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

Commit 71aa60f6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull networking fixes from David Miller:

 1) Fix NAPI poll list corruption in enic driver, from Christian
    Lamparter.

 2) Fix route use after free, from Eric Dumazet.

 3) Fix regression in reuseaddr handling, from Josef Bacik.

 4) Assert the size of control messages in compat handling since we copy
    it in from userspace twice. From Meng Xu.

 5) SMC layer bug fixes (missing RCU locking, bad refcounting, etc.)
    from Ursula Braun.

 6) Fix races in AF_PACKET fanout handling, from Willem de Bruijn.

 7) Don't use ARRAY_SIZE on spinlock array which might have zero
    entries, from Geert Uytterhoeven.

 8) Fix miscomputation of checksum in ipv6 udp code, from Subash Abhinov
    Kasiviswanathan.

 9) Push the ipv6 header properly in ipv6 GRE tunnel driver, from Xin
    Long.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (75 commits)
  inet: fix improper empty comparison
  net: use inet6_rcv_saddr to compare sockets
  net: set tb->fast_sk_family
  net: orphan frags on stand-alone ptype in dev_queue_xmit_nit
  MAINTAINERS: update git tree locations for ieee802154 subsystem
  net: prevent dst uses after free
  net: phy: Fix truncation of large IRQ numbers in phy_attached_print()
  net/smc: no close wait in case of process shut down
  net/smc: introduce a delay
  net/smc: terminate link group if out-of-sync is received
  net/smc: longer delay for client link group removal
  net/smc: adapt send request completion notification
  net/smc: adjust net_device refcount
  net/smc: take RCU read lock for routing cache lookup
  net/smc: add receive timeout check
  net/smc: add missing dev_put
  net: stmmac: Cocci spatch "of_table"
  lan78xx: Use default values loaded from EEPROM/OTP after reset
  lan78xx: Allow EEPROM write for less than MAX_EEPROM_SIZE
  lan78xx: Fix for eeprom read/write when device auto suspend
  ...
parents 79444df4 4e683f49
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -1680,6 +1680,9 @@ accept_dad - INTEGER
	2: Enable DAD, and disable IPv6 operation if MAC-based duplicate
	   link-local address has been found.

	DAD operation and mode on a given interface will be selected according
	to the maximum value of conf/{all,interface}/accept_dad.

force_tllao - BOOLEAN
	Enable sending the target link-layer address option even when
	responding to a unicast neighbor solicitation.
@@ -1730,6 +1733,10 @@ optimistic_dad - BOOLEAN
	0: disabled (default)
	1: enabled

	Optimistic Duplicate Address Detection for the interface will be enabled
	if at least one of conf/{all,interface}/optimistic_dad is set to 1,
	it will be disabled otherwise.

use_optimistic - BOOLEAN
	If enabled, do not classify optimistic addresses as deprecated during
	source address selection.  Preferred addresses will still be chosen
@@ -1738,6 +1745,9 @@ use_optimistic - BOOLEAN
	0: disabled (default)
	1: enabled

	This will be enabled if at least one of
	conf/{all,interface}/use_optimistic is set to 1, disabled otherwise.

stable_secret - IPv6 address
	This IPv6 address will be used as a secret to generate IPv6
	addresses for link-local addresses and autoconfigured
+34 −34
Original line number Diff line number Diff line
@@ -13,42 +13,42 @@ an example setup using a data-center-class switch ASIC chip. Other setups
with SR-IOV or soft switches, such as OVS, are possible.


                             User-space tools

       user space                   |
      +-------------------------------------------------------------------+
       kernel                       | Netlink
                                    |
                     +--------------+-------------------------------+
                     |         Network stack                        |
                     |           (Linux)                            |
                     |                                              |
                     +----------------------------------------------+
                             User-space tools

       user space                   |
      +-------------------------------------------------------------------+
       kernel                       | Netlink
                                    |
                     +--------------+-------------------------------+
                     |         Network stack                        |
                     |           (Linux)                            |
                     |                                              |
                     +----------------------------------------------+

                           sw1p2     sw1p4     sw1p6
                      sw1p1  +  sw1p3  +  sw1p5  +          eth1
                        +    |    +    |    +    |            +
                        |    |    |    |    |    |            |
                     +--+----+----+----+-+--+----+---+  +-----+-----+
                     |         Switch driver         |  |    mgmt   |
                     |        (this document)        |  |   driver  |
                     |                               |  |           |
                     +--------------+----------------+  +-----------+
                                    |
       kernel                       | HW bus (eg PCI)
      +-------------------------------------------------------------------+
       hardware                     |
                     +--------------+---+------------+
                     |         Switch device (sw1)   |
                     |  +----+                       +--------+
                     |  |    v offloaded data path   | mgmt port
                     |  |    |                       |
                     +--|----|----+----+----+----+---+
                        |    |    |    |    |    |
                        +    +    +    +    +    +
                       p1   p2   p3   p4   p5   p6

                             front-panel ports
                      sw1p1  +  sw1p3  +  sw1p5  +          eth1
                        +    |    +    |    +    |            +
                        |    |    |    |    |    |            |
                     +--+----+----+----+----+----+---+  +-----+-----+
                     |         Switch driver         |  |    mgmt   |
                     |        (this document)        |  |   driver  |
                     |                               |  |           |
                     +--------------+----------------+  +-----------+
                                    |
       kernel                       | HW bus (eg PCI)
      +-------------------------------------------------------------------+
       hardware                     |
                     +--------------+----------------+
                     |         Switch device (sw1)   |
                     |  +----+                       +--------+
                     |  |    v offloaded data path   | mgmt port
                     |  |    |                       |
                     +--|----|----+----+----+----+---+
                        |    |    |    |    |    |
                        +    +    +    +    +    +
                       p1   p2   p3   p4   p5   p6

                             front-panel ports


                                    Fig 1.
+2 −4
Original line number Diff line number Diff line
@@ -2865,7 +2865,6 @@ S: Supported
F:	drivers/scsi/bnx2i/

BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
M:	Yuval Mintz <Yuval.Mintz@cavium.com>
M:	Ariel Elior <ariel.elior@cavium.com>
M:	everest-linux-l2@cavium.com
L:	netdev@vger.kernel.org
@@ -6655,8 +6654,8 @@ M: Alexander Aring <alex.aring@gmail.com>
M:	Stefan Schmidt <stefan@osg.samsung.com>
L:	linux-wpan@vger.kernel.org
W:	http://wpan.cakelab.org/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan-next.git
S:	Maintained
F:	net/ieee802154/
F:	net/mac802154/
@@ -11059,7 +11058,6 @@ S: Supported
F:	drivers/scsi/qedi/

QLOGIC QL4xxx ETHERNET DRIVER
M:	Yuval Mintz <Yuval.Mintz@cavium.com>
M:	Ariel Elior <Ariel.Elior@cavium.com>
M:	everest-linux-l2@cavium.com
L:	netdev@vger.kernel.org
+25 −12
Original line number Diff line number Diff line
@@ -825,7 +825,6 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
	isdn_net_local *lp;
	struct ippp_struct *is;
	int proto;
	unsigned char protobuf[4];

	is = file->private_data;

@@ -839,24 +838,28 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
	if (!lp)
		printk(KERN_DEBUG "isdn_ppp_write: lp == NULL\n");
	else {
		if (lp->isdn_device < 0 || lp->isdn_channel < 0) {
			unsigned char protobuf[4];
			/*
			 * Don't reset huptimer for
			 * LCP packets. (Echo requests).
			 */
			if (copy_from_user(protobuf, buf, 4))
				return -EFAULT;

			proto = PPP_PROTOCOL(protobuf);
			if (proto != PPP_LCP)
				lp->huptimer = 0;

		if (lp->isdn_device < 0 || lp->isdn_channel < 0)
			return 0;
		}

		if ((dev->drv[lp->isdn_device]->flags & DRV_FLAG_RUNNING) &&
		    lp->dialstate == 0 &&
		    (lp->flags & ISDN_NET_CONNECTED)) {
			unsigned short hl;
			struct sk_buff *skb;
			unsigned char *cpy_buf;
			/*
			 * we need to reserve enough space in front of
			 * sk_buff. old call to dev_alloc_skb only reserved
@@ -869,11 +872,21 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)
				return count;
			}
			skb_reserve(skb, hl);
			if (copy_from_user(skb_put(skb, count), buf, count))
			cpy_buf = skb_put(skb, count);
			if (copy_from_user(cpy_buf, buf, count))
			{
				kfree_skb(skb);
				return -EFAULT;
			}

			/*
			 * Don't reset huptimer for
			 * LCP packets. (Echo requests).
			 */
			proto = PPP_PROTOCOL(cpy_buf);
			if (proto != PPP_LCP)
				lp->huptimer = 0;

			if (is->debug & 0x40) {
				printk(KERN_DEBUG "ppp xmit: len %d\n", (int) skb->len);
				isdn_ppp_frame_log("xmit", skb->data, skb->len, 32, is->unit, lp->ppp_slot);
+32 −20
Original line number Diff line number Diff line
@@ -432,6 +432,27 @@ static void bcm_sysport_update_mib_counters(struct bcm_sysport_priv *priv)
	netif_dbg(priv, hw, priv->netdev, "updated MIB counters\n");
}

static void bcm_sysport_update_tx_stats(struct bcm_sysport_priv *priv,
					u64 *tx_bytes, u64 *tx_packets)
{
	struct bcm_sysport_tx_ring *ring;
	u64 bytes = 0, packets = 0;
	unsigned int start;
	unsigned int q;

	for (q = 0; q < priv->netdev->num_tx_queues; q++) {
		ring = &priv->tx_rings[q];
		do {
			start = u64_stats_fetch_begin_irq(&priv->syncp);
			bytes = ring->bytes;
			packets = ring->packets;
		} while (u64_stats_fetch_retry_irq(&priv->syncp, start));

		*tx_bytes += bytes;
		*tx_packets += packets;
	}
}

static void bcm_sysport_get_stats(struct net_device *dev,
				  struct ethtool_stats *stats, u64 *data)
{
@@ -439,11 +460,16 @@ static void bcm_sysport_get_stats(struct net_device *dev,
	struct bcm_sysport_stats64 *stats64 = &priv->stats64;
	struct u64_stats_sync *syncp = &priv->syncp;
	struct bcm_sysport_tx_ring *ring;
	u64 tx_bytes = 0, tx_packets = 0;
	unsigned int start;
	int i, j;

	if (netif_running(dev))
	if (netif_running(dev)) {
		bcm_sysport_update_mib_counters(priv);
		bcm_sysport_update_tx_stats(priv, &tx_bytes, &tx_packets);
		stats64->tx_bytes = tx_bytes;
		stats64->tx_packets = tx_packets;
	}

	for (i =  0, j = 0; i < BCM_SYSPORT_STATS_LEN; i++) {
		const struct bcm_sysport_stats *s;
@@ -461,12 +487,13 @@ static void bcm_sysport_get_stats(struct net_device *dev,
			continue;
		p += s->stat_offset;

		if (s->stat_sizeof == sizeof(u64))
		if (s->stat_sizeof == sizeof(u64) &&
		    s->type == BCM_SYSPORT_STAT_NETDEV64) {
			do {
				start = u64_stats_fetch_begin_irq(syncp);
				data[i] = *(u64 *)p;
			} while (u64_stats_fetch_retry_irq(syncp, start));
		else
		} else
			data[i] = *(u32 *)p;
		j++;
	}
@@ -1716,27 +1743,12 @@ static void bcm_sysport_get_stats64(struct net_device *dev,
{
	struct bcm_sysport_priv *priv = netdev_priv(dev);
	struct bcm_sysport_stats64 *stats64 = &priv->stats64;
	struct bcm_sysport_tx_ring *ring;
	u64 tx_packets = 0, tx_bytes = 0;
	unsigned int start;
	unsigned int q;

	netdev_stats_to_stats64(stats, &dev->stats);

	for (q = 0; q < dev->num_tx_queues; q++) {
		ring = &priv->tx_rings[q];
		do {
			start = u64_stats_fetch_begin_irq(&priv->syncp);
			tx_bytes = ring->bytes;
			tx_packets = ring->packets;
		} while (u64_stats_fetch_retry_irq(&priv->syncp, start));

		stats->tx_bytes += tx_bytes;
		stats->tx_packets += tx_packets;
	}

	stats64->tx_bytes = stats->tx_bytes;
	stats64->tx_packets = stats->tx_packets;
	bcm_sysport_update_tx_stats(priv, &stats->tx_bytes,
				    &stats->tx_packets);

	do {
		start = u64_stats_fetch_begin_irq(&priv->syncp);
Loading