netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb()
@ 2013-10-16 16:36 Neal Cardwell
  2013-10-16 16:44 ` Eric Dumazet
  2013-10-18 20:22 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Neal Cardwell @ 2013-10-16 16:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Neal Cardwell, Eric Dumazet, Yuchung Cheng

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).

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
---
 net/ipv4/tcp_output.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e5ce0e1..ce7c4d9 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -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.
 	 */
-- 
1.8.4

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

* Re: [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb()
  2013-10-16 16:36 [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb() Neal Cardwell
@ 2013-10-16 16:44 ` Eric Dumazet
  2013-10-16 17:34   ` Yuchung Cheng
  2013-10-18 20:22 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2013-10-16 16:44 UTC (permalink / raw)
  To: Neal Cardwell; +Cc: David Miller, netdev, Eric Dumazet, Yuchung Cheng

On Wed, 2013-10-16 at 12:36 -0400, Neal Cardwell wrote:
> 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).
> 
> Signed-off-by: Neal Cardwell <ncardwell@google.com>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Yuchung Cheng <ycheng@google.com>
> ---
>  net/ipv4/tcp_output.c | 15 ---------------
>  1 file changed, 15 deletions(-)

Acked-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb()
  2013-10-16 16:44 ` Eric Dumazet
@ 2013-10-16 17:34   ` Yuchung Cheng
  0 siblings, 0 replies; 4+ messages in thread
From: Yuchung Cheng @ 2013-10-16 17:34 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Neal Cardwell, David Miller, netdev, Eric Dumazet

On Wed, Oct 16, 2013 at 12:44 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> On Wed, 2013-10-16 at 12:36 -0400, Neal Cardwell wrote:
>> 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).
>>
>> Signed-off-by: Neal Cardwell <ncardwell@google.com>
>> Cc: Eric Dumazet <edumazet@google.com>
>> Cc: Yuchung Cheng <ycheng@google.com>
>> ---
>>  net/ipv4/tcp_output.c | 15 ---------------
>>  1 file changed, 15 deletions(-)
>
> Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
>
>

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

* Re: [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb()
  2013-10-16 16:36 [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb() Neal Cardwell
  2013-10-16 16:44 ` Eric Dumazet
@ 2013-10-18 20:22 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2013-10-18 20:22 UTC (permalink / raw)
  To: ncardwell; +Cc: netdev, edumazet, ycheng

From: Neal Cardwell <ncardwell@google.com>
Date: Wed, 16 Oct 2013 12:36:51 -0400

> 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).
> 
> Signed-off-by: Neal Cardwell <ncardwell@google.com>

Applied, thanks Neal.

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

end of thread, other threads:[~2013-10-18 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 16:36 [PATCH net-next] tcp: remove redundant code in __tcp_retransmit_skb() Neal Cardwell
2013-10-16 16:44 ` Eric Dumazet
2013-10-16 17:34   ` Yuchung Cheng
2013-10-18 20:22 ` 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).