linux/drivers/net
Jay Vosburgh 266b495f11 bonding: don't use stale speed and duplex information
There is presently a race condition between the bonding periodic
link monitor and the updating of a slave's speed and duplex.  The former
occurs on a periodic basis, and the latter in response to a driver's
calling of netif_carrier_on.

	It is possible for the periodic monitor to run between the
driver call of netif_carrier_on and the receipt of the NETDEV_CHANGE
event that causes bonding to update the slave's speed and duplex.  This
manifests most notably as a report that a slave is up and "0 Mbps full
duplex" after enslavement, but in principle could report an incorrect
speed and duplex after any link up event if the device comes up with a
different speed or duplex.  This affects the 802.3ad aggregator
selection, as the speed and duplex are selection criteria.

	This is fixed by updating the speed and duplex in the periodic
monitor, prior to using that information.

	This was done historically in bonding, but the call to
bond_update_speed_duplex was removed in commit 876254ae27 ("bonding:
don't call update_speed_duplex() under spinlocks"), as it might sleep
under lock.  Later, the locking was changed to only hold RTNL, and so
after commit 876254ae27 ("bonding: don't call update_speed_duplex()
under spinlocks") this call is again safe.

Tested-by: "Tantilov, Emil S" <emil.s.tantilov@intel.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: dingtianhong <dingtianhong@huawei.com>
Fixes: 876254ae27 ("bonding: don't call update_speed_duplex() under spinlocks")
Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Acked-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-02-16 15:14:01 -05:00
..
appletalk
arcnet arcnet/com20020: add LEDS_CLASS dependency 2015-11-03 11:29:56 -05:00
bonding bonding: don't use stale speed and duplex information 2016-02-16 15:14:01 -05:00
caif net: caif: check return value of alloc_netdev 2015-11-09 11:31:13 -05:00
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-03 21:09:12 -05:00
cris
dsa net: dsa: mv88e6xxx: do not leave reserved VLANs 2016-02-13 06:07:48 -05:00
ethernet net: am79c961a: avoid %? in inline assembly 2016-02-16 15:06:54 -05:00
fddi defxx: fix build warning 2016-01-25 10:51:52 -08:00
fjes fjes: fix inconsistent indenting 2015-11-15 17:09:23 -05:00
hamradio mkiss: fix scribble on freed memory 2016-01-06 15:06:27 -05:00
hippi
hyperv hv_netvsc: Restore needed_headroom request 2016-02-13 06:04:44 -05:00
ieee802154 ieee802154: cc2520: Check CRC & add promiscuous 2016-01-03 09:17:42 +01:00
ipvlan net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
irda net/irda: bfin_sir: remove duplicate defines 2016-01-21 10:45:45 -08:00
phy net: phy: bcm7xxx: Remove wildcard entries 2016-02-16 14:55:36 -05:00
plip net: plip: use new parport device model 2016-01-09 21:02:05 -05:00
ppp pptp: fix illegal memory access caused by multiple bind()s 2016-01-24 22:18:26 -08:00
slip ppp, slip: Validate VJ compression slot parameters completely 2015-11-02 16:25:00 -05:00
team team: Replace rcu_read_lock with a mutex in team_vlan_rx_kill_vid 2016-01-18 11:52:38 -05:00
usb lan78xx: throttle TX path at slower than SuperSpeed USB 2016-01-28 22:51:43 -08:00
vmxnet3 Driver: Vmxnet3: Fix regression caused by 5738a09 2016-01-06 16:20:13 -05:00
wan dscc4: Undefined signed int shift 2016-02-13 06:10:21 -05:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-02-01 15:56:08 -08:00
xen-netback xen-netback: free queues after freeing the net device 2016-01-15 15:13:19 -05:00
dummy.c
eql.c
geneve.c vxlan, gre, geneve: Set a large MTU on ovs-created tunnel devices 2016-02-10 05:50:03 -05:00
ifb.c
Kconfig
LICENSE.SRC
loopback.c sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC 2015-12-15 16:49:58 -05:00
macvlan.c macvlan: make operstate and carrier more accurate 2016-01-29 12:15:45 -08:00
macvtap.c net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
Makefile
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c tun: honor IFF_UP in tun_get_user() 2015-12-17 15:25:57 -05:00
veth.c veth: don’t modify ip_summed; doing so treats packets with bad checksums as good. 2015-12-22 15:15:34 -05:00
virtio_net.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-12-17 22:08:28 -05:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-01-06 22:54:18 -05:00
vxlan.c vxlan, gre, geneve: Set a large MTU on ovs-created tunnel devices 2016-02-10 05:50:03 -05:00
xen-netfront.c xen-netfront: request Tx response events more often 2016-01-28 16:08:55 -08:00