]> err.no Git - linux-2.6/commitdiff
[TCP]: Add highest_sack seqno, points to globally highest SACK
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sun, 25 Mar 2007 04:03:23 +0000 (21:03 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:47:50 +0000 (16:47 -0700)
It is guaranteed to be valid only when !tp->sacked_out. In most
cases this seqno is available in the last ACK but there is no
guarantee for that. The new fast recovery loss marking algorithm
needs this as entry point.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
net/ipv4/tcp_input.c

index c6b9f92e8289949bde61f0ea384f48349d5a083f..c072f88afb979ef61f107999dde18956e26727d8 100644 (file)
@@ -333,6 +333,8 @@ struct tcp_sock {
 
        struct tcp_sack_block_wire recv_sack_cache[4];
 
+       u32     highest_sack;   /* Start seq of globally highest revd SACK (valid only in slowpath) */
+
        /* from STCP, retrans queue hinting */
        struct sk_buff* lost_skb_hint;
 
index f893e90061ebfebe87ad359bd94c700db70b02d6..813f2049b85d911f33d8885aa42f9f671179c32c 100644 (file)
@@ -979,8 +979,10 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
        int i;
        int first_sack_index;
 
-       if (!tp->sacked_out)
+       if (!tp->sacked_out) {
                tp->fackets_out = 0;
+               tp->highest_sack = tp->snd_una;
+       }
        prior_fackets = tp->fackets_out;
 
        /* Check for D-SACK. */
@@ -1217,6 +1219,10 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
 
                                if (fack_count > tp->fackets_out)
                                        tp->fackets_out = fack_count;
+
+                               if (after(TCP_SKB_CB(skb)->seq,
+                                   tp->highest_sack))
+                                       tp->highest_sack = TCP_SKB_CB(skb)->seq;
                        } else {
                                if (dup_sack && (sacked&TCPCB_RETRANS))
                                        reord = min(fack_count, reord);