Thread (95 messages) 95 messages, 7 authors, 2004-10-01

Re: bad TSO performance in 2.6.9-rc2-BK

From: "David S. Miller" <davem@davemloft.net>
Date: 2004-09-28 05:58:19

On Tue, 28 Sep 2004 15:15:39 +1000
Herbert Xu [off-list ref] wrote:
quoted
+	if (skb->len != (data_end_seq - data_seq)) {
Please make that > so that I can sleep at night :)
quoted
+		if (__tcp_trim_head(sk, skb, data_end_seq - data_seq))
The argument to __tcp_trim_head should be

skb->len - (data_end_seq - data_seq)
Good catch, fixed as follows:

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/09/27 22:37:27-07:00 davem@nuts.davemloft.net 
#   [TCP]: Fix third arg to __tcp_trim_head().
#   
#   Noted by Herbert Xu [off-list ref]
#   
#   Signed-off-by: David S. Miller [off-list ref]
# 
# net/ipv4/tcp_output.c
#   2004/09/27 22:36:41-07:00 davem@nuts.davemloft.net +4 -2
#   [TCP]: Fix third arg to __tcp_trim_head().
# 
diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
--- a/net/ipv4/tcp_output.c	2004-09-27 22:37:55 -07:00
+++ b/net/ipv4/tcp_output.c	2004-09-27 22:37:55 -07:00
@@ -980,8 +980,10 @@
 	if (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)
 		data_end_seq--;
 
-	if (skb->len != (data_end_seq - data_seq)) {
-		if (__tcp_trim_head(sk, skb, data_end_seq - data_seq))
+	if (skb->len > (data_end_seq - data_seq)) {
+		u32 to_trim = skb->len - (data_end_seq - data_seq);
+
+		if (__tcp_trim_head(sk, skb, to_trim))
 			return -ENOMEM;
 	}		
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help