]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/tcp.h
[TCP]: Rewrite SACK block processing & sack_recv_cache use
[linux-2.6-omap-h63xx.git] / include / linux / tcp.h
index 29d3089038ab6dab1393abc5c00509d1010f366d..08027f1d7f31d81836de46fd58f89d1fd5edbcae 100644 (file)
@@ -178,6 +178,21 @@ struct tcp_md5sig {
 #include <net/inet_connection_sock.h>
 #include <net/inet_timewait_sock.h>
 
+static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
+{
+       return (struct tcphdr *)skb_transport_header(skb);
+}
+
+static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
+{
+       return tcp_hdr(skb)->doff * 4;
+}
+
+static inline unsigned int tcp_optlen(const struct sk_buff *skb)
+{
+       return (tcp_hdr(skb)->doff - 5) * 4;
+}
+
 /* This defines a selective acknowledgement block. */
 struct tcp_sack_block_wire {
        __be32  start_seq;
@@ -242,6 +257,8 @@ struct tcp_sock {
  *     See RFC793 and RFC1122. The RFC writes these in capitals.
  */
        u32     rcv_nxt;        /* What we want to receive next         */
+       u32     copied_seq;     /* Head of yet unread data              */
+       u32     rcv_wup;        /* rcv_nxt on last window update sent   */
        u32     snd_nxt;        /* Next sequence we send                */
 
        u32     snd_una;        /* First byte we want an ack for        */
@@ -287,7 +304,6 @@ struct tcp_sock {
        u32     rtt_seq;        /* sequence number to update rttvar     */
 
        u32     packets_out;    /* Packets which are "in flight"        */
-       u32     left_out;       /* Packets which leaved network */
        u32     retrans_out;    /* Retransmitted packets out            */
 /*
  *      Options received (usually on last packet, some only on SYN packets).
@@ -299,24 +315,27 @@ struct tcp_sock {
  */
        u32     snd_ssthresh;   /* Slow start size threshold            */
        u32     snd_cwnd;       /* Sending congestion window            */
-       u16     snd_cwnd_cnt;   /* Linear increase counter              */
-       u16     snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
+       u32     snd_cwnd_cnt;   /* Linear increase counter              */
+       u32     snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
        u32     snd_cwnd_used;
        u32     snd_cwnd_stamp;
 
        struct sk_buff_head     out_of_order_queue; /* Out of order segments go here */
 
        u32     rcv_wnd;        /* Current receiver window              */
-       u32     rcv_wup;        /* rcv_nxt on last window update sent   */
        u32     write_seq;      /* Tail(+1) of data held in tcp send buffer */
        u32     pushed_seq;     /* Last pushed seq, required to talk to windows */
-       u32     copied_seq;     /* Head of yet unread data              */
 
 /*     SACKs data      */
        struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
        struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
 
-       struct tcp_sack_block_wire recv_sack_cache[4];
+       struct tcp_sack_block recv_sack_cache[4];
+
+       struct sk_buff *highest_sack;   /* highest skb with SACK received
+                                        * (validity guaranteed only if
+                                        * sacked_out > 0)
+                                        */
 
        /* from STCP, retrans queue hinting */
        struct sk_buff* lost_skb_hint;
@@ -324,12 +343,11 @@ struct tcp_sock {
        struct sk_buff *scoreboard_skb_hint;
        struct sk_buff *retransmit_skb_hint;
        struct sk_buff *forward_skb_hint;
-       struct sk_buff *fastpath_skb_hint;
 
-       int     fastpath_cnt_hint;
        int     lost_cnt_hint;
        int     retransmit_cnt_hint;
-       int     forward_cnt_hint;
+
+       u32     lost_retrans_low;       /* Sent seq after any rxmit (lowest) */
 
        u16     advmss;         /* Advertised MSS                       */
        u16     prior_ssthresh; /* ssthresh saved at recovery start     */