Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aca04ce5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking bugfixes from David Miller:
 "Several bug fixes rolling in, some for changes introduced in this
  merge window, and some for problems that have existed for some time:

  1) Fix prepare_to_wait() handling in AF_VSOCK, from Claudio Imbrenda.

  2) The new DST_CACHE should be a silent config option, from Dave
     Jones.

  3) inet_current_timestamp() unintentionally truncates timestamps to
     16-bit, from Deepa Dinamani.

  4) Missing reference to netns in ppp, from Guillaume Nault.

  5) Free memory reference in hv_netvsc driver, from Haiyang Zhang.

  6) Missing kernel doc documentation for function arguments in various
     spots around the networking, from Luis de Bethencourt.

  7) UDP stopped receiving broadcast packets properly, due to
     overzealous multicast checks, fix from Paolo Abeni"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (59 commits)
  net: ping: make ping_v6_sendmsg static
  hv_netvsc: Fix the order of num_sc_offered decrement
  net: Fix typos and whitespace.
  hv_netvsc: Fix the array sizes to be max supported channels
  hv_netvsc: Fix accessing freed memory in netvsc_change_mtu()
  ppp: take reference on channels netns
  net: Reset encap_level to avoid resetting features on inner IP headers
  net: mediatek: fix checking for NULL instead of IS_ERR() in .probe
  net: phy: at803x: Request 'reset' GPIO only for AT8030 PHY
  at803x: fix reset handling
  AF_VSOCK: Shrink the area influenced by prepare_to_wait
  Revert "vsock: Fix blocking ops call in prepare_to_wait"
  macb: fix PHY reset
  ipv4: initialize flowi4_flags before calling fib_lookup()
  fsl/fman: Workaround for Errata A-007273
  ipv4: fix broadcast packets reception
  net: hns: bug fix about the overflow of mss
  net: hns: adds limitation for debug port mtu
  net: hns: fix the bug about mtu setting
  net: hns: fixes a bug of RSS
  ...
parents 5a010c73 6579a023
Loading
Loading
Loading
Loading
+12 −7
Original line number Original line Diff line number Diff line
@@ -946,16 +946,21 @@ igmp_max_memberships - INTEGER
	The value 5459 assumes no IP header options, so in practice
	The value 5459 assumes no IP header options, so in practice
	this number may be lower.
	this number may be lower.


	conf/interface/*  changes special settings per interface (where
igmp_max_msf - INTEGER
	"interface" is the name of your network interface)
	Maximum number of addresses allowed in the source filter list for a

	multicast group.
	conf/all/*	  is special, changes the settings for all interfaces
	Default: 10


igmp_qrv - INTEGER
igmp_qrv - INTEGER
	Controls the IGMP query robustness variable (see RFC2236 8.1).
	Controls the IGMP query robustness variable (see RFC2236 8.1).
	Default: 2 (as specified by RFC2236 8.1)
	Default: 2 (as specified by RFC2236 8.1)
	Minimum: 1 (as specified by RFC6636 4.5)
	Minimum: 1 (as specified by RFC6636 4.5)


conf/interface/*  changes special settings per interface (where
"interface" is the name of your network interface)

conf/all/*	  is special, changes the settings for all interfaces

log_martians - BOOLEAN
log_martians - BOOLEAN
	Log packets with impossible addresses to kernel log.
	Log packets with impossible addresses to kernel log.
	log_martians for the interface will be enabled if at least one of
	log_martians for the interface will be enabled if at least one of
+29 −40
Original line number Original line Diff line number Diff line
@@ -37,6 +37,7 @@
#include <linux/types.h>
#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/stddef.h>
#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/ktime.h>
#include <linux/mISDNif.h>
#include <linux/mISDNif.h>
#include <linux/export.h>
#include <linux/export.h>
#include "core.h"
#include "core.h"
@@ -45,15 +46,15 @@ static u_int *debug;
static LIST_HEAD(iclock_list);
static LIST_HEAD(iclock_list);
static DEFINE_RWLOCK(iclock_lock);
static DEFINE_RWLOCK(iclock_lock);
static u16 iclock_count;		/* counter of last clock */
static u16 iclock_count;		/* counter of last clock */
static struct timeval iclock_tv;	/* time stamp of last clock */
static ktime_t iclock_timestamp;	/* time stamp of last clock */
static int iclock_tv_valid;		/* already received one timestamp */
static int iclock_timestamp_valid;	/* already received one timestamp */
static struct mISDNclock *iclock_current;
static struct mISDNclock *iclock_current;


void
void
mISDN_init_clock(u_int *dp)
mISDN_init_clock(u_int *dp)
{
{
	debug = dp;
	debug = dp;
	do_gettimeofday(&iclock_tv);
	iclock_timestamp = ktime_get();
}
}


static void
static void
@@ -86,7 +87,7 @@ select_iclock(void)
	}
	}
	if (bestclock != iclock_current) {
	if (bestclock != iclock_current) {
		/* no clock received yet */
		/* no clock received yet */
		iclock_tv_valid = 0;
		iclock_timestamp_valid = 0;
	}
	}
	iclock_current = bestclock;
	iclock_current = bestclock;
}
}
@@ -139,12 +140,11 @@ mISDN_unregister_clock(struct mISDNclock *iclock)
EXPORT_SYMBOL(mISDN_unregister_clock);
EXPORT_SYMBOL(mISDN_unregister_clock);


void
void
mISDN_clock_update(struct mISDNclock *iclock, int samples, struct timeval *tv)
mISDN_clock_update(struct mISDNclock *iclock, int samples, ktime_t *timestamp)
{
{
	u_long		flags;
	u_long		flags;
	struct timeval	tv_now;
	ktime_t		timestamp_now;
	time_t		elapsed_sec;
	u16		delta;
	int		elapsed_8000th;


	write_lock_irqsave(&iclock_lock, flags);
	write_lock_irqsave(&iclock_lock, flags);
	if (iclock_current != iclock) {
	if (iclock_current != iclock) {
@@ -156,33 +156,27 @@ mISDN_clock_update(struct mISDNclock *iclock, int samples, struct timeval *tv)
		write_unlock_irqrestore(&iclock_lock, flags);
		write_unlock_irqrestore(&iclock_lock, flags);
		return;
		return;
	}
	}
	if (iclock_tv_valid) {
	if (iclock_timestamp_valid) {
		/* increment sample counter by given samples */
		/* increment sample counter by given samples */
		iclock_count += samples;
		iclock_count += samples;
		if (tv) { /* tv must be set, if function call is delayed */
		if (timestamp) { /* timestamp must be set, if function call is delayed */
			iclock_tv.tv_sec = tv->tv_sec;
			iclock_timestamp = *timestamp;
			iclock_tv.tv_usec = tv->tv_usec;
		} else	{
		} else
			iclock_timestamp = ktime_get();
			do_gettimeofday(&iclock_tv);
		}
	} else {
	} else {
		/* calc elapsed time by system clock */
		/* calc elapsed time by system clock */
		if (tv) { /* tv must be set, if function call is delayed */
		if (timestamp) { /* timestamp must be set, if function call is delayed */
			tv_now.tv_sec = tv->tv_sec;
			timestamp_now = *timestamp;
			tv_now.tv_usec = tv->tv_usec;
		} else {
		} else
			timestamp_now = ktime_get();
			do_gettimeofday(&tv_now);
		elapsed_sec = tv_now.tv_sec - iclock_tv.tv_sec;
		elapsed_8000th = (tv_now.tv_usec / 125)
			- (iclock_tv.tv_usec / 125);
		if (elapsed_8000th < 0) {
			elapsed_sec -= 1;
			elapsed_8000th += 8000;
		}
		}
		delta = ktime_divns(ktime_sub(timestamp_now, iclock_timestamp),
				(NSEC_PER_SEC / 8000));
		/* add elapsed time to counter and set new timestamp */
		/* add elapsed time to counter and set new timestamp */
		iclock_count += elapsed_sec * 8000 + elapsed_8000th;
		iclock_count += delta;
		iclock_tv.tv_sec = tv_now.tv_sec;
		iclock_timestamp = timestamp_now;
		iclock_tv.tv_usec = tv_now.tv_usec;
		iclock_timestamp_valid = 1;
		iclock_tv_valid = 1;
		if (*debug & DEBUG_CLOCK)
		if (*debug & DEBUG_CLOCK)
			printk("Received first clock from source '%s'.\n",
			printk("Received first clock from source '%s'.\n",
			       iclock_current ? iclock_current->name : "nothing");
			       iclock_current ? iclock_current->name : "nothing");
@@ -195,22 +189,17 @@ unsigned short
mISDN_clock_get(void)
mISDN_clock_get(void)
{
{
	u_long		flags;
	u_long		flags;
	struct timeval	tv_now;
	ktime_t		timestamp_now;
	time_t		elapsed_sec;
	u16		delta;
	int		elapsed_8000th;
	u16		count;
	u16		count;


	read_lock_irqsave(&iclock_lock, flags);
	read_lock_irqsave(&iclock_lock, flags);
	/* calc elapsed time by system clock */
	/* calc elapsed time by system clock */
	do_gettimeofday(&tv_now);
	timestamp_now = ktime_get();
	elapsed_sec = tv_now.tv_sec - iclock_tv.tv_sec;
	delta = ktime_divns(ktime_sub(timestamp_now, iclock_timestamp),
	elapsed_8000th = (tv_now.tv_usec / 125) - (iclock_tv.tv_usec / 125);
			(NSEC_PER_SEC / 8000));
	if (elapsed_8000th < 0) {
		elapsed_sec -= 1;
		elapsed_8000th += 8000;
	}
	/* add elapsed time to counter */
	/* add elapsed time to counter */
	count =	iclock_count + elapsed_sec * 8000 + elapsed_8000th;
	count =	iclock_count + delta;
	read_unlock_irqrestore(&iclock_lock, flags);
	read_unlock_irqrestore(&iclock_lock, flags);
	return count;
	return count;
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -2959,7 +2959,7 @@ static int macb_probe(struct platform_device *pdev)
		int gpio = of_get_named_gpio(phy_node, "reset-gpios", 0);
		int gpio = of_get_named_gpio(phy_node, "reset-gpios", 0);
		if (gpio_is_valid(gpio))
		if (gpio_is_valid(gpio))
			bp->reset_gpio = gpio_to_desc(gpio);
			bp->reset_gpio = gpio_to_desc(gpio);
		gpiod_set_value(bp->reset_gpio, GPIOD_OUT_HIGH);
		gpiod_direction_output(bp->reset_gpio, 1);
	}
	}
	of_node_put(phy_node);
	of_node_put(phy_node);


@@ -3029,7 +3029,7 @@ static int macb_remove(struct platform_device *pdev)
		mdiobus_free(bp->mii_bus);
		mdiobus_free(bp->mii_bus);


		/* Shutdown the PHY if there is a GPIO reset */
		/* Shutdown the PHY if there is a GPIO reset */
		gpiod_set_value(bp->reset_gpio, GPIOD_OUT_LOW);
		gpiod_set_value(bp->reset_gpio, 0);


		unregister_netdev(dev);
		unregister_netdev(dev);
		clk_disable_unprepare(bp->tx_clk);
		clk_disable_unprepare(bp->tx_clk);
+88 −16
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@
#include "fman.h"
#include "fman.h"
#include "fman_muram.h"
#include "fman_muram.h"


#include <linux/fsl/guts.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/module.h>
@@ -1871,6 +1872,90 @@ static int fman_config(struct fman *fman)
	return -EINVAL;
	return -EINVAL;
}
}


static int fman_reset(struct fman *fman)
{
	u32 count;
	int err = 0;

	if (fman->state->rev_info.major < 6) {
		iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
		/* Wait for reset completion */
		count = 100;
		do {
			udelay(1);
		} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
			 FPM_RSTC_FM_RESET) && --count);
		if (count == 0)
			err = -EBUSY;

		goto _return;
	} else {
		struct device_node *guts_node;
		struct ccsr_guts __iomem *guts_regs;
		u32 devdisr2, reg;

		/* Errata A007273 */
		guts_node =
			of_find_compatible_node(NULL, NULL,
						"fsl,qoriq-device-config-2.0");
		if (!guts_node) {
			dev_err(fman->dev, "%s: Couldn't find guts node\n",
				__func__);
			goto guts_node;
		}

		guts_regs = of_iomap(guts_node, 0);
		if (!guts_regs) {
			dev_err(fman->dev, "%s: Couldn't map %s regs\n",
				__func__, guts_node->full_name);
			goto guts_regs;
		}
#define FMAN1_ALL_MACS_MASK	0xFCC00000
#define FMAN2_ALL_MACS_MASK	0x000FCC00
		/* Read current state */
		devdisr2 = ioread32be(&guts_regs->devdisr2);
		if (fman->dts_params.id == 0)
			reg = devdisr2 & ~FMAN1_ALL_MACS_MASK;
		else
			reg = devdisr2 & ~FMAN2_ALL_MACS_MASK;

		/* Enable all MACs */
		iowrite32be(reg, &guts_regs->devdisr2);

		/* Perform FMan reset */
		iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);

		/* Wait for reset completion */
		count = 100;
		do {
			udelay(1);
		} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
			 FPM_RSTC_FM_RESET) && --count);
		if (count == 0) {
			iounmap(guts_regs);
			of_node_put(guts_node);
			err = -EBUSY;
			goto _return;
		}

		/* Restore devdisr2 value */
		iowrite32be(devdisr2, &guts_regs->devdisr2);

		iounmap(guts_regs);
		of_node_put(guts_node);

		goto _return;

guts_regs:
		of_node_put(guts_node);
guts_node:
		dev_dbg(fman->dev, "%s: Didn't perform FManV3 reset due to Errata A007273!\n",
			__func__);
	}
_return:
	return err;
}

static int fman_init(struct fman *fman)
static int fman_init(struct fman *fman)
{
{
	struct fman_cfg *cfg = NULL;
	struct fman_cfg *cfg = NULL;
@@ -1914,22 +1999,9 @@ static int fman_init(struct fman *fman)
		fman->liodn_base[i] = liodn_base;
		fman->liodn_base[i] = liodn_base;
	}
	}


	/* FMan Reset (supported only for FMan V2) */
	err = fman_reset(fman);
	if (fman->state->rev_info.major >= 6) {
	if (err)
		/* Errata A007273 */
		return err;
		dev_dbg(fman->dev, "%s: FManV3 reset is not supported!\n",
			__func__);
	} else {
		iowrite32be(FPM_RSTC_FM_RESET, &fman->fpm_regs->fm_rstc);
		/* Wait for reset completion */
		count = 100;
		do {
			udelay(1);
		} while (((ioread32be(&fman->fpm_regs->fm_rstc)) &
			 FPM_RSTC_FM_RESET) && --count);
		if (count == 0)
			return -EBUSY;
	}


	if (ioread32be(&fman->qmi_regs->fmqm_gs) & QMI_GS_HALT_NOT_BUSY) {
	if (ioread32be(&fman->qmi_regs->fmqm_gs) & QMI_GS_HALT_NOT_BUSY) {
		resume(fman->fpm_regs);
		resume(fman->fpm_regs);
+3 −0
Original line number Original line Diff line number Diff line
@@ -147,6 +147,8 @@ enum hnae_led_state {


#define HNSV2_TXD_BUFNUM_S 0
#define HNSV2_TXD_BUFNUM_S 0
#define HNSV2_TXD_BUFNUM_M (0x7 << HNSV2_TXD_BUFNUM_S)
#define HNSV2_TXD_BUFNUM_M (0x7 << HNSV2_TXD_BUFNUM_S)
#define HNSV2_TXD_PORTID_S	4
#define HNSV2_TXD_PORTID_M	(0X7 << HNSV2_TXD_PORTID_S)
#define HNSV2_TXD_RI_B   1
#define HNSV2_TXD_RI_B   1
#define HNSV2_TXD_L4CS_B   2
#define HNSV2_TXD_L4CS_B   2
#define HNSV2_TXD_L3CS_B   3
#define HNSV2_TXD_L3CS_B   3
@@ -516,6 +518,7 @@ struct hnae_handle {
	int q_num;
	int q_num;
	int vf_id;
	int vf_id;
	u32 eport_id;
	u32 eport_id;
	u32 dport_id;	/* v2 tx bd should fill the dport_id */
	enum hnae_port_type port_type;
	enum hnae_port_type port_type;
	struct list_head node;    /* list to hnae_ae_dev->handle_list */
	struct list_head node;    /* list to hnae_ae_dev->handle_list */
	struct hnae_buf_ops *bops; /* operation for the buffer */
	struct hnae_buf_ops *bops; /* operation for the buffer */
Loading