linux-stable-rt/net
Herbert Xu d4828d85d1 [NET]: Prevent transmission after dev_deactivate
The dev_deactivate function has bit-rotted since the introduction of
lockless drivers.  In particular, the spin_unlock_wait call at the end
has no effect on the xmit routine of lockless drivers.

With a little bit of work, we can make it much more useful by providing
the guarantee that when it returns, no more calls to the xmit routine
of the underlying driver will be made.

The idea is simple.  There are two entry points in to the xmit routine.
The first comes from dev_queue_xmit.  That one is easily stopped by
using synchronize_rcu.  This works because we set the qdisc to noop_qdisc
before the synchronize_rcu call.  That in turn causes all subsequent
packets sent to dev_queue_xmit to be dropped.  The synchronize_rcu call
also ensures all outstanding calls leave their critical section.

The other entry point is from qdisc_run.  Since we now have a bit that
indicates whether it's running, all we have to do is to wait until the
bit is off.

I've removed the loop to wait for __LINK_STATE_SCHED to clear.  This is
useless because netif_wake_queue can cause it to be set again.  It is
also harmless because we've disarmed qdisc_run.

I've also removed the spin_unlock_wait on xmit_lock because its only
purpose of making sure that all outstanding xmit_lock holders have
exited is also given by dev_watchdog_down.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-06-23 02:07:26 -07:00
..
802
8021q
appletalk
atm [ATM]: fix broken uses of NIPQUAD in net/atm 2006-06-20 03:27:27 -07:00
ax25
bluetooth
bridge [BRIDGE]: Add support for NETIF_F_HW_CSUM devices 2006-06-17 22:06:45 -07:00
core [NET]: Prevent transmission after dev_deactivate 2006-06-23 02:07:26 -07:00
dccp [I/OAT]: Make sk_eat_skb I/OAT aware. 2006-06-17 21:25:52 -07:00
decnet [NET]: Clean up skb_linearize 2006-06-17 21:30:16 -07:00
econet
ethernet [NET]: Eliminate unused /proc/sys/net/ethernet 2006-06-05 15:34:11 -07:00
ieee80211 [PATCH] wireless: correct dump of WPA IE 2006-06-15 15:48:14 -04:00
ipv4 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2006-06-19 19:01:59 -07:00
ipv6 [IPV6] ADDRCONF: Fix default source address selection without CONFIG_IPV6_PRIVACY 2006-06-23 02:07:24 -07:00
ipx [IPX]: Endian bug in ipxrtr_route_packet() 2006-06-17 21:30:24 -07:00
irda [IRDA]: Use put_unaligned() in irlmp_do_discovery(). 2006-06-17 22:16:13 -07:00
key [LSM-IPsec]: SELinux Authorize 2006-06-17 21:29:45 -07:00
lapb
llc [LLC]: Fix double receive of SKB. 2006-06-17 21:29:19 -07:00
netfilter [NETFILTER]: xt_sctp: fix endless loop caused by 0 chunk length 2006-06-19 23:39:45 -07:00
netlink
netrom
packet
rose
rxrpc
sched [NET]: Prevent transmission after dev_deactivate 2006-06-23 02:07:26 -07:00
sctp [SCTP]: sctp_unpack_cookie() fix 2006-06-20 03:26:14 -07:00
sunrpc
tipc
unix
wanrouter
x25
xfrm [NET]: Fix warnings after LSM-IPSEC changes. 2006-06-17 21:29:49 -07:00
Kconfig [SECMARK]: Add secmark support to core networking. 2006-06-17 21:29:57 -07:00
Makefile
TUNABLE
compat.c
nonet.c
socket.c
sysctl_net.c [NET]: Eliminate unused /proc/sys/net/ethernet 2006-06-05 15:34:11 -07:00