linux/drivers/net
dingtianhong be79bd048a bonding: add RCU for bond_3ad_state_machine_handler()
The bond_3ad_state_machine_handler() use the bond lock to protect
the bond slave list and slave port together, but it is not enough,
the bond slave list was link and unlink in RTNL, not bond lock,
so I add RCU to protect the slave list from leaving.

The bond lock is still used here, because when the slave has been
removed from the list by the time the state machine runs, it appears
to be possible for both function to manupulate the same aggregator->lag_ports
by finding the aggregator via two different ports that are both members of
that aggregator (i.e., port A of the agg is being unbound, and port B
of the agg is runing its state machine).

If I remove the bond lock, there are nothing to mutex changes
to aggregator->lag_ports between bond_3ad_state_machine_handler and
bond_3ad_unbind_slave, So the bond lock is the simplest way to protect
aggregator->lag_ports.

There was a lot of function need RCU protect, I have two choice
to make the function in RCU-safe, (1) create new similar functions
and make the bond slave list in RCU. (2) modify the existed functions
and make them in read-side critical section, because the RCU
read-side critical sections may be nested.

I choose (2) because it is no need to create more similar functions.

The nots in the function is still too old, clean up the nots.

Suggested-by: Nikolay Aleksandrov <nikolay@redhat.com>
Suggested-by: Jay Vosburgh <fubar@us.ibm.com>
Suggested-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-14 01:58:02 -05:00
..
appletalk
arcnet
bonding bonding: add RCU for bond_3ad_state_machine_handler() 2013-12-14 01:58:02 -05:00
caif virtio: use size-based config accessors. 2013-10-17 10:55:37 +10:30
can can: flexcan: use correct clock as base for bit rate calculation 2013-11-26 15:39:47 +01:00
cris
dsa
ethernet Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next 2013-12-14 01:11:22 -05:00
fddi net: fddi: remove unnecessary pci_set_drvdata() 2013-12-10 22:31:32 -05:00
hamradio drivers/net/*: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
hippi net: hippi: remove unnecessary pci_set_drvdata() 2013-12-10 22:31:32 -05:00
hyperv drivers/net/*: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
ieee802154 net: ieee802154: remove unnecessary spi_set_drvdata() 2013-12-10 22:31:32 -05:00
irda irda: vlsi_ir: remove unnecessary pci_set_drvdata() 2013-12-09 18:09:28 -05:00
phy net: phy: spi_ks8995: remove unnecessary spi_set_drvdata() 2013-12-10 22:31:32 -05:00
plip net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
ppp drivers/net/*: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
slip
team team: fix master carrier set when user linkup is enabled 2013-11-29 16:34:33 -05:00
usb usb: Fix FSF address in file headers 2013-12-06 12:37:55 -05:00
vmxnet3 net: vmxnet3: remove unnecessary pci_set_drvdata() 2013-12-10 22:31:32 -05:00
wan wan: wanxl: remove unnecessary pci_set_drvdata() 2013-12-09 18:09:29 -05:00
wimax
wireless Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2013-12-06 09:50:45 -05:00
xen-netback xen-netback: improve guest-receive-side flow control 2013-12-09 20:33:12 -05:00
dummy.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
eql.c
ifb.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
Kconfig
LICENSE.SRC
loopback.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
macvlan.c macvlan: Remove custom recieve and forward handlers 2013-12-12 13:38:39 -05:00
macvtap.c macvlan: Remove custom recieve and forward handlers 2013-12-12 13:38:39 -05:00
Makefile
mdio.c
mii.c
netconsole.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-11-04 13:48:30 -05:00
nlmon.c net: Explicitly initialize u64_stats_sync structures for lockdep 2013-11-06 12:40:25 +01:00
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c Revert "tun: remove useless codes in tun_chr_aio_read() and tun_recvmsg()" 2013-12-10 22:05:45 -05:00
veth.c Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-14 16:30:30 +09:00
virtio_net.c virtio_net: spelling fixes 2013-12-10 22:28:06 -05:00
vxlan.c vxlan: leave multicast group when vxlan device down 2013-12-11 14:21:26 -05:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-11-19 15:50:47 -08:00