On Sat, Jul 26, 2008 at 02:18:46AM -0700, David Miller wrote: ... > I think there might be an easier way, but we may have > to modify the state bits a little. > > Every call into ->hard_start_xmit() is made like this: > > 1. lock TX queue > 2. check TX queue stopped > 3. call ->hard_start_xmit() if not stopped > > This means that we can in fact do something like: > > unsigned int i; > > for (i = 0; i < dev->num_tx_queues; i++) { > struct netdev_queue *txq; > > txq = netdev_get_tx_queue(dev, i); > spin_lock_bh(&txq->_xmit_lock); > netif_tx_freeze_queue(txq); > spin_unlock_bh(&txq->_xmit_lock); > } > > netif_tx_freeze_queue() just sets a new bit we add. > > Then we go to the ->hard_start_xmit() call sites and check this new > "frozen" bit as well as the existing "stopped" bit. > > When we unfreeze each queue later, we see if it is stopped, and if not > we schedule it's qdisc for packet processing. I guess some additional synchronization will be added yet to prevent parallel freeze and especially unfreeze. Jarek P. -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html