Skip to contentSkip to conversation

tcp: remove redundant code in __tcp_retransmit_skb()

PATCH Applied Neal Cardwell 4 participants 4 messages Oct 16, 2013 – Oct 18, 2013

Subsystems (3)
lore
Share & tools
lore

Neal Cardwell

author maintainer
#0 lore raw

PATCH 1/1 tcp: remove redundant code in __tcp_retransmit_skb()

Remove the specialized code in __tcp_retransmit_skb() that tries to trim any ACKed payload preceding a FIN before we retransmit (this was added in 1999 in v2.2.3pre3). This trimming code was made unreachable by the more general code added above it that uses tcp_trim_head() to trim any ACKed payload, with or without a FIN (this was added in "[NET]: Add segmentation offload support to TCP." in 2002 circa v2.5.33).

Cc Eric Dumazet <[email protected]>
Cc Yuchung Cheng <[email protected]>
---
 net/ipv4/tcp_output.c | 15 ---------------
 1 file changed, 15 deletions(-)
net/ipv4/tcp_output.c +0 -15
index e5ce0e1..ce7c4d9 100644
@@ -2351,21 +2351,6 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
 
 	tcp_retrans_try_collapse(sk, skb, cur_mss);
 
-	/* Some Solaris stacks overoptimize and ignore the FIN on a
-	 * retransmit when old data is attached.  So strip it off
-	 * since it is cheap to do so and saves bytes on the network.
-	 */
-	if (skb->len > 0 &&
-	    (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) &&
-	    tp->snd_una == (TCP_SKB_CB(skb)->end_seq - 1)) {
-		if (!pskb_trim(skb, 0)) {
-			/* Reuse, even though it does some unnecessary work */
-			tcp_init_nondata_skb(skb, TCP_SKB_CB(skb)->end_seq - 1,
-					     TCP_SKB_CB(skb)->tcp_flags);
-			skb->ip_summed = CHECKSUM_NONE;
-		}
-	}
-
 	/* Make a copy, if the first transmission SKB clone we made
 	 * is still in somebody's hands, else make a clone.
 	 */
Signature · 1 line
1.8.4
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Neal Cardwell

Remove the specialized code in __tcp_retransmit_skb() that tries to trim any ACKed payload preceding a FIN before we retransmit (this was added in 1999 in v2.2.3pre3). This trimming code was made unreachable by the more general code added above it that uses tcp_trim_head() to trim any ACKed payload, with or without a FIN (this was added in "[NET]: Add segmentation offload support to TCP." in 2002 circa v2.5.33).

Quoted 6 lines
Cc Eric Dumazet <[email protected]>
Cc Yuchung Cheng <[email protected]>
---
 net/ipv4/tcp_output.c | 15 ---------------
 1 file changed, 15 deletions(-)
Acked-by
#2 lore raw
Quoted 8 lines · Eric Dumazet
Quoted 7 lines · Neal Cardwell

Remove the specialized code in __tcp_retransmit_skb() that tries to trim any ACKed payload preceding a FIN before we retransmit (this was added in 1999 in v2.2.3pre3). This trimming code was made unreachable by the more general code added above it that uses tcp_trim_head() to trim any ACKed payload, with or without a FIN (this was added in "[NET]: Add segmentation offload support to TCP." in 2002 circa v2.5.33).

Quoted 8 lines
Quoted 6 lines
Cc Eric Dumazet <[email protected]>
Cc Yuchung Cheng <[email protected]>
---
 net/ipv4/tcp_output.c | 15 ---------------
 1 file changed, 15 deletions(-)
Quoted 2 lines
maintainer Applied
#3 lore raw
In reply to Neal Cardwell

From: Neal Cardwell <[email protected]>
Date: Wed, 16 Oct 2013 12:36:51 -0400

Quoted 8 lines

Remove the specialized code in __tcp_retransmit_skb() that tries to trim any ACKed payload preceding a FIN before we retransmit (this was added in 1999 in v2.2.3pre3). This trimming code was made unreachable by the more general code added above it that uses tcp_trim_head() to trim any ACKed payload, with or without a FIN (this was added in "[NET]: Add segmentation offload support to TCP." in 2002 circa v2.5.33).

Applied, thanks Neal.