lkml.org 
[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][TCP]: simplify tcp_mark_lost_retrans()
Hi,

I noticed that in tcp_mark_lost_retrans the for-loop is only entered
if tcp_is_fack(tp) evaluates to true:

if (!tcp_is_fack(tp) || !tp->retrans_out ||
!after(received_upto, tp->lost_retrans_low) ||
icsk->icsk_ca_state != TCP_CA_Recovery)
return;

Therefore the following check in the for-loop seems to be redundant,
because it always evaluates to true:

(tcp_is_fack(tp) ||
!before(received_upto,
ack_seq + tp->reordering * tp->mss_cache))

Did I miss something?

Best regards,
Arnd Hannemann

From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>

Because the for loop is only executed for FACK-enabled flows remove
redundant checks within the loop.

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
---
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 99b7ecb..cd8b4bd 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1178,10 +1178,7 @@ static void tcp_mark_lost_retrans(struct sock *sk)
if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS))
continue;

- if (after(received_upto, ack_seq) &&
- (tcp_is_fack(tp) ||
- !before(received_upto,
- ack_seq + tp->reordering * tp->mss_cache))) {
+ if (after(received_upto, ack_seq)) {
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
tp->retrans_out -= tcp_skb_pcount(skb);


\
 
 \ /
  Last update: 2009-01-07 10:57    [W:0.056 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site