Skip to contentSkip to conversation

net: fix multiqueue selection

PATCH In review Eric Dumazet 3 participants 3 messages Sep 7, 2013 – Sep 11, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: fix multiqueue selection

From: Eric Dumazet <[email protected]>

commit 416186fbf8c5b4e4465 ("net: Split core bits of netdev_pick_tx into __netdev_pick_tx") added a bug that disables caching of queue index in the socket.

This is the source of packet reorders for TCP flows, and again this is happening more often when using FQ pacing.

Old code was doing

if (queue_index != old_index)

	sk_tx_queue_set(sk, queue_index);

Alexander renamed the variables but forgot to change sk_tx_queue_set() 2nd parameter.

if (queue_index != new_index)

	sk_tx_queue_set(sk, queue_index);

This means we store -1 over and over in sk->sk_tx_queue_mapping

Cc Alexander Duyck <[email protected]>
---
 net/core/flow_dissector.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/flow_dissector.c +1 -1
index 0ff42f0..1929af8 100644
@@ -352,7 +352,7 @@ u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)
 
 		if (queue_index != new_index && sk &&
 		    rcu_access_pointer(sk->sk_dst_cache))
-			sk_tx_queue_set(sk, queue_index);
+			sk_tx_queue_set(sk, new_index);
 
 		queue_index = new_index;
 	}
Acked-by on v1 1/1
#1 lore raw
Quoted 34 lines · Eric Dumazet

From: Eric Dumazet <[email protected]>

commit 416186fbf8c5b4e4465 ("net: Split core bits of netdev_pick_tx into __netdev_pick_tx") added a bug that disables caching of queue index in the socket.

This is the source of packet reorders for TCP flows, and again this is happening more often when using FQ pacing.

Old code was doing

if (queue_index != old_index)

	sk_tx_queue_set(sk, queue_index);

Alexander renamed the variables but forgot to change sk_tx_queue_set() 2nd parameter.

if (queue_index != new_index)

	sk_tx_queue_set(sk, queue_index);

This means we store -1 over and over in sk->sk_tx_queue_mapping

Cc Alexander Duyck <[email protected]>
---
 net/core/flow_dissector.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/flow_dissector.c +0 -0
index 0ff42f0..1929af8 100644
@@ -352,7 +352,7 @@ u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)
 

net/core/flow_dissector.c u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb)

Quoted 10 lines
net/core/flow_dissector.c +1 -2
 		if (queue_index != new_index && sk &&
 		    rcu_access_pointer(sk->sk_dst_cache))
-			sk_tx_queue_set(sk, queue_index);
+			sk_tx_queue_set(sk, new_index);
 
 		queue_index = new_index;
 	}
 
 
--

Ugh, my bad. This is a nasty one too since the behaviour appeared to be correct for most cases.

It looks like this needs to go into stable for 3.9 - 3.11.

maintainer
#2 lore raw

From: Alexander Duyck <[email protected]>
Date: Sat, 07 Sep 2013 21:08:59 -0700

Quoted 24 lines · Eric Dumazet
Quoted 23 lines

From: Eric Dumazet <[email protected]>

commit 416186fbf8c5b4e4465 ("net: Split core bits of netdev_pick_tx into __netdev_pick_tx") added a bug that disables caching of queue index in the socket.

This is the source of packet reorders for TCP flows, and again this is happening more often when using FQ pacing.

Old code was doing

if (queue_index != old_index)

	sk_tx_queue_set(sk, queue_index);

Alexander renamed the variables but forgot to change sk_tx_queue_set() 2nd parameter.

if (queue_index != new_index)

	sk_tx_queue_set(sk, queue_index);

This means we store -1 over and over in sk->sk_tx_queue_mapping

...

Quoted 7 lines

Ugh, my bad. This is a nasty one too since the behaviour appeared to be correct for most cases.

It looks like this needs to go into stable for 3.9 - 3.11.

Applied and queued up for -stable, thanks.