netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: fix tx queue selection for bridged devices implementing select_queue
@ 2010-09-03 12:39 Helmut Schaa
  2010-09-07  0:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Helmut Schaa @ 2010-09-03 12:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Johannes Berg, Krishna Kumar, Helmut Schaa

When a net device is implementing the select_queue callback and is part of
a bridge, frames coming from the bridge already have a tx queue associated
to the socket (introduced in commit a4ee3ce3293dc931fab19beb472a8bde1295aebe,
"net: Use sk_tx_queue_mapping for connected sockets"). The call to
sk_tx_queue_get will then return the tx queue used by the bridge instead
of calling the select_queue callback.

In case of mac80211 this broke QoS which is implemented by using the
select_queue callback. Furthermore it introduced problems with rt2x00
because frames with the same TID and RA sometimes appeared on different
tx queues which the hw cannot handle correctly.

Fix this by always calling select_queue first if it is available and only
afterwards use the socket tx queue mapping.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---

JFI this patch is based on wireless-testing.

 net/core/dev.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 3721fbb..b9b22a3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2058,16 +2058,16 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,
 					struct sk_buff *skb)
 {
 	int queue_index;
-	struct sock *sk = skb->sk;
+	const struct net_device_ops *ops = dev->netdev_ops;
 
-	queue_index = sk_tx_queue_get(sk);
-	if (queue_index < 0) {
-		const struct net_device_ops *ops = dev->netdev_ops;
+	if (ops->ndo_select_queue) {
+		queue_index = ops->ndo_select_queue(dev, skb);
+		queue_index = dev_cap_txqueue(dev, queue_index);
+	} else {
+		struct sock *sk = skb->sk;
+		queue_index = sk_tx_queue_get(sk);
+		if (queue_index < 0) {
 
-		if (ops->ndo_select_queue) {
-			queue_index = ops->ndo_select_queue(dev, skb);
-			queue_index = dev_cap_txqueue(dev, queue_index);
-		} else {
 			queue_index = 0;
 			if (dev->real_num_tx_queues > 1)
 				queue_index = skb_tx_hash(dev, skb);
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: fix tx queue selection for bridged devices implementing select_queue
  2010-09-03 12:39 [PATCH] net: fix tx queue selection for bridged devices implementing select_queue Helmut Schaa
@ 2010-09-07  0:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-09-07  0:48 UTC (permalink / raw)
  To: helmut.schaa; +Cc: netdev, johannes, krkumar2

From: Helmut Schaa <helmut.schaa@googlemail.com>
Date: Fri,  3 Sep 2010 14:39:56 +0200

> When a net device is implementing the select_queue callback and is part of
> a bridge, frames coming from the bridge already have a tx queue associated
> to the socket (introduced in commit a4ee3ce3293dc931fab19beb472a8bde1295aebe,
> "net: Use sk_tx_queue_mapping for connected sockets"). The call to
> sk_tx_queue_get will then return the tx queue used by the bridge instead
> of calling the select_queue callback.
> 
> In case of mac80211 this broke QoS which is implemented by using the
> select_queue callback. Furthermore it introduced problems with rt2x00
> because frames with the same TID and RA sometimes appeared on different
> tx queues which the hw cannot handle correctly.
> 
> Fix this by always calling select_queue first if it is available and only
> afterwards use the socket tx queue mapping.
> 
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Applied to net-2.6, thanks Helmut.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-07  0:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 12:39 [PATCH] net: fix tx queue selection for bridged devices implementing select_queue Helmut Schaa
2010-09-07  0:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).