John Fastabend f0796d5c73 net: decreasing real_num_tx_queues needs to flush qdisc
Reducing real_num_queues needs to flush the qdisc otherwise
skbs with queue_mappings greater then real_num_tx_queues can
be sent to the underlying driver.

The flow for this is,

dev_queue_xmit()
	dev_pick_tx()
		skb_tx_hash()  => hash using real_num_tx_queues
		skb_set_queue_mapping()
	...
	qdisc_enqueue_root() => enqueue skb on txq from hash
...
dev->real_num_tx_queues -= n
...
sch_direct_xmit()
	dev_hard_start_xmit()
		ndo_start_xmit(skb,dev) => skb queue set with old hash

skbs are enqueued on the qdisc with skb->queue_mapping set
0 < queue_mappings < real_num_tx_queues.  When the driver
decreases real_num_tx_queues skb's may be dequeued from the
qdisc with a queue_mapping greater then real_num_tx_queues.

This fixes a case in ixgbe where this was occurring with DCB
and FCoE. Because the driver is using queue_mapping to map
skbs to tx descriptor rings we can potentially map skbs to
rings that no longer exist.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-02 21:59:07 -07:00
..
2010-05-21 16:44:34 -05:00
2010-01-07 00:24:55 -08:00
2010-05-12 23:02:23 -07:00
2009-11-04 05:06:25 -08:00
2009-09-01 17:40:57 -07:00
2009-11-04 05:06:25 -08:00
2009-03-21 19:06:54 -07:00
2009-09-01 17:40:31 -07:00
2009-11-04 05:06:25 -08:00
2009-11-04 05:06:25 -08:00
2009-11-13 20:46:58 -08:00
2010-04-13 01:41:33 -07:00
2009-11-04 05:06:25 -08:00
2009-12-26 20:46:28 -08:00
2010-03-12 15:52:40 -08:00
2009-01-06 11:38:15 -07:00
2009-11-20 15:35:04 -08:00
2010-04-01 18:38:48 -07:00
2009-03-21 19:06:50 -07:00
2010-04-13 14:49:34 -07:00
2009-11-04 05:06:25 -08:00
2009-07-26 19:11:14 -07:00
2010-05-17 17:18:51 -07:00
2009-11-04 05:06:25 -08:00
2010-06-23 11:48:19 -07:00
2009-11-10 20:54:38 -08:00
2009-10-07 16:39:43 -04:00