linux/net/core
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
..
datagram.c [PATCH] POLLRDHUP/EPOLLRDHUP handling for half-closed devices notifications 2006-03-25 08:22:56 -08:00
dev_mcast.c [NET]: Add netif_tx_lock 2006-06-17 21:30:14 -07:00
dev.c [NET]: Prevent transmission after dev_deactivate 2006-06-23 02:07:26 -07:00
dst.c [PATCH] timer initialization cleanup: DEFINE_TIMER 2005-09-09 14:03:48 -07:00
dv.c [NET]: More kzalloc conversions. 2006-04-09 22:25:48 -07:00
ethtool.c [ETHTOOL]: Fix UFO typo 2006-06-17 23:00:20 -07:00
filter.c unaligned access in sk_run_filter() 2006-04-18 15:57:54 -07:00
flow.c [PATCH] for_each_possible_cpu: network codes 2006-04-11 06:18:31 -07:00
gen_estimator.c [NET]: More kzalloc conversions. 2006-04-09 22:25:48 -07:00
gen_stats.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iovec.c [PATCH] misc verify_area cleanups 2005-05-01 08:59:08 -07:00
link_watch.c [NET] linkwatch: Handle jiffies wrap-around 2006-05-09 15:27:54 -07:00
Makefile [I/OAT]: Utility functions for offloading sk_buff to iovec copies 2006-06-17 21:25:46 -07:00
neighbour.c [NEIGH]: Fix IP-over-ATM and ARP interaction. 2006-05-12 14:56:08 -07:00
net-sysfs.c [NET]: Create netdev attribute_groups with class_device_add 2006-05-06 17:56:03 -07:00
netpoll.c [NET]: Add netif_tx_lock 2006-06-17 21:30:14 -07:00
pktgen.c [NET]: Add netif_tx_lock 2006-06-17 21:30:14 -07:00
request_sock.c [NET]: More kzalloc conversions. 2006-04-09 22:25:48 -07:00
rtnetlink.c [PATCH] WE-20 for kernel 2.6.16 2006-03-23 07:12:57 -05:00
scm.c [PATCH] capable/capability.h (net/) 2006-01-11 18:42:14 -08:00
skbuff.c [NET]: Avoid allocating skb in skb_pad 2006-06-23 02:06:41 -07:00
sock.c [I/OAT]: Structure changes for TCP recv offload to I/OAT 2006-06-17 21:25:48 -07:00
stream.c [NET]: Add skb->truesize assertion checking. 2006-04-20 00:10:50 -07:00
sysctl_net_core.c [IPSEC]: Sync series - core changes 2006-03-20 19:15:11 -08:00
user_dma.c [I/OAT]: Add a sysctl for tuning the I/OAT offloaded I/O threshold 2006-06-17 21:25:54 -07:00
utils.c [PATCH] for_each_possible_cpu: network codes 2006-04-11 06:18:31 -07:00
wireless.c [PATCH] wext: Fix RtNetlink ENCODE security permissions 2006-04-19 17:25:41 -04:00