aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-11-15 22:33:31 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:01 -0500
commitb9d86585dc6c9265aa373c7036458fe8aa7627c6 (patch)
tree12783783956ec16230d8a89a012125b4b6ecb156
parentc0ef877b2c9f543e9fb7953bfe1a0cd3a4eae362 (diff)
[TCP]: Move !in_sack test earlier in sacktag & reorganize if()s
All intermediate conditions include it already, make them simpler as well. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/tcp_input.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index b39f0d86e44c..901240f40688 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1406,28 +1406,25 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
1406 if (unlikely(in_sack < 0)) 1406 if (unlikely(in_sack < 0))
1407 break; 1407 break;
1408 1408
1409 if (!in_sack) {
1410 fack_count += tcp_skb_pcount(skb);
1411 continue;
1412 }
1413
1409 sacked = TCP_SKB_CB(skb)->sacked; 1414 sacked = TCP_SKB_CB(skb)->sacked;
1410 1415
1411 /* Account D-SACK for retransmitted packet. */ 1416 /* Account D-SACK for retransmitted packet. */
1412 if ((dup_sack && in_sack) && 1417 if (dup_sack && (sacked & TCPCB_RETRANS)) {
1413 (sacked & TCPCB_RETRANS) && 1418 if (after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))
1414 after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker)) 1419 tp->undo_retrans--;
1415 tp->undo_retrans--; 1420 if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una) &&
1416 1421 (sacked & TCPCB_SACKED_ACKED))
1417 /* The frame is ACKed. */ 1422 reord = min(fack_count, reord);
1418 if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) {
1419 if (sacked&TCPCB_RETRANS) {
1420 if ((dup_sack && in_sack) &&
1421 (sacked&TCPCB_SACKED_ACKED))
1422 reord = min(fack_count, reord);
1423 }
1424
1425 /* Nothing to do; acked frame is about to be dropped. */
1426 fack_count += tcp_skb_pcount(skb);
1427 continue;
1428 } 1423 }
1429 1424
1430 if (!in_sack) { 1425
1426 /* Nothing to do; acked frame is about to be dropped (was ACKed). */
1427 if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una)) {
1431 fack_count += tcp_skb_pcount(skb); 1428 fack_count += tcp_skb_pcount(skb);
1432 continue; 1429 continue;
1433 } 1430 }