linux/drivers/net/bonding
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
..
bond_3ad.c bonding: add 802.3ad support for 100G speeds 2015-12-03 11:49:24 -05:00
bond_alb.c
bond_debugfs.c
bond_main.c bonding: don't use stale speed and duplex information 2016-02-16 15:14:01 -05:00
bond_netlink.c bonding: add tlb_dynamic_lb netlink support 2015-07-31 15:35:55 -07:00
bond_options.c Changes for 4.3 2015-09-09 08:33:31 -07:00
bond_procfs.c
bond_sysfs_slave.c
bond_sysfs.c bonding: make mii_status sysfs node consistent 2016-01-11 17:14:42 -05:00
bonding_priv.h
Makefile