netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcp: xps: fix reordering issues
@ 2013-05-23 17:44 Eric Dumazet
  2013-05-24  1:29 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2013-05-23 17:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Tom Herbert, Yuchung Cheng, Neal Cardwell

From: Eric Dumazet <edumazet@google.com>

commit 3853b5841c01a ("xps: Improvements in TX queue selection")
introduced ooo_okay flag, but the condition to set it is slightly wrong.

In our traces, we have seen ACK packets being received out of order,
and RST packets sent in response.

We should test if we have any packets still in host queue.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/tcp_output.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 536d409..ec335fa 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -874,11 +874,13 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
 							   &md5);
 	tcp_header_size = tcp_options_size + sizeof(struct tcphdr);
 
-	if (tcp_packets_in_flight(tp) == 0) {
+	if (tcp_packets_in_flight(tp) == 0)
 		tcp_ca_event(sk, CA_EVENT_TX_START);
-		skb->ooo_okay = 1;
-	} else
-		skb->ooo_okay = 0;
+
+	/* if no packet is in qdisc/device queue, then allow XPS to select
+	 * another queue.
+	 */
+	skb->ooo_okay = sk_wmem_alloc_get(sk) == 0;
 
 	skb_push(skb, tcp_header_size);
 	skb_reset_transport_header(skb);

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

* Re: [PATCH] tcp: xps: fix reordering issues
  2013-05-23 17:44 [PATCH] tcp: xps: fix reordering issues Eric Dumazet
@ 2013-05-24  1:29 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-05-24  1:29 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev, therbert, ycheng, ncardwell

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 23 May 2013 10:44:20 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> commit 3853b5841c01a ("xps: Improvements in TX queue selection")
> introduced ooo_okay flag, but the condition to set it is slightly wrong.
> 
> In our traces, we have seen ACK packets being received out of order,
> and RST packets sent in response.
> 
> We should test if we have any packets still in host queue.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

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

end of thread, other threads:[~2013-05-24  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-23 17:44 [PATCH] tcp: xps: fix reordering issues Eric Dumazet
2013-05-24  1:29 ` 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).