diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-09-21 00:19:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-21 00:19:22 -0400 |
commit | 41ea36e35a0daa75377b3e70680e5c3a3f83fe27 (patch) | |
tree | d329b2def429374aeb7f6a46bbe8fb6d40156288 /net/ipv4/tcp_input.c | |
parent | c8c213f20ce97c66fe2ff86f33814d1ca0f9d7ea (diff) |
tcp: add helper for lost bit toggling
This useful because we'd need to verifying soon in many places
which makes things slightly more complex than it used to be.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 9e95ad637db9..12512336dbd8 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -992,6 +992,16 @@ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb) | |||
992 | tp->retransmit_skb_hint = NULL; | 992 | tp->retransmit_skb_hint = NULL; |
993 | } | 993 | } |
994 | 994 | ||
995 | static void tcp_skb_mark_lost(struct tcp_sock *tp, struct sk_buff *skb) | ||
996 | { | ||
997 | if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_LOST|TCPCB_SACKED_ACKED))) { | ||
998 | tcp_verify_retransmit_hint(tp, skb); | ||
999 | |||
1000 | tp->lost_out += tcp_skb_pcount(skb); | ||
1001 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; | ||
1002 | } | ||
1003 | } | ||
1004 | |||
995 | /* This procedure tags the retransmission queue when SACKs arrive. | 1005 | /* This procedure tags the retransmission queue when SACKs arrive. |
996 | * | 1006 | * |
997 | * We have three tag bits: SACKED(S), RETRANS(R) and LOST(L). | 1007 | * We have three tag bits: SACKED(S), RETRANS(R) and LOST(L). |
@@ -2216,11 +2226,7 @@ static void tcp_mark_head_lost(struct sock *sk, int packets) | |||
2216 | cnt = packets; | 2226 | cnt = packets; |
2217 | } | 2227 | } |
2218 | 2228 | ||
2219 | if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST))) { | 2229 | tcp_skb_mark_lost(tp, skb); |
2220 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; | ||
2221 | tp->lost_out += tcp_skb_pcount(skb); | ||
2222 | tcp_verify_retransmit_hint(tp, skb); | ||
2223 | } | ||
2224 | } | 2230 | } |
2225 | tcp_verify_left_out(tp); | 2231 | tcp_verify_left_out(tp); |
2226 | } | 2232 | } |
@@ -2262,11 +2268,7 @@ static void tcp_update_scoreboard(struct sock *sk, int fast_rexmit) | |||
2262 | if (!tcp_skb_timedout(sk, skb)) | 2268 | if (!tcp_skb_timedout(sk, skb)) |
2263 | break; | 2269 | break; |
2264 | 2270 | ||
2265 | if (!(TCP_SKB_CB(skb)->sacked & (TCPCB_SACKED_ACKED|TCPCB_LOST))) { | 2271 | tcp_skb_mark_lost(tp, skb); |
2266 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; | ||
2267 | tp->lost_out += tcp_skb_pcount(skb); | ||
2268 | tcp_verify_retransmit_hint(tp, skb); | ||
2269 | } | ||
2270 | } | 2272 | } |
2271 | 2273 | ||
2272 | tp->scoreboard_skb_hint = skb; | 2274 | tp->scoreboard_skb_hint = skb; |