diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-10-07 17:43:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-07 17:43:06 -0400 |
commit | 33f5f57eeb0c6386fdd85f9c690dc8d700ba7928 (patch) | |
tree | 4bd3421bfa3088018f8e355e6f47e43599748802 /net/ipv4/tcp_input.c | |
parent | 654bed16cf86a9ef94495d9e6131b7ff7840a3dd (diff) |
tcp: kill pointless urg_mode
It all started from me noticing that this urgent check in
tcp_clean_rtx_queue is unnecessarily inside the loop. Then
I took a longer look to it and found out that the users of
urg_mode can trivially do without, well almost, there was
one gotcha.
Bonus: those funny people who use urg with >= 2^31 write_seq -
snd_una could now rejoice too (that's the only purpose for the
between being there, otherwise a simple compare would have done
the thing). Not that I assume that the rest of the tcp code
happily lives with such mind-boggling numbers :-). Alas, it
turned out to be impossible to set wmem to such numbers anyway,
yes I really tried a big sendfile after setting some wmem but
nothing happened :-). ...Tcp_wmem is int and so is sk_sndbuf...
So I hacked a bit variable to long and found out that it seems
to work... :-)
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 | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3b76bce769dd..c19f429dc443 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2836,7 +2836,8 @@ static u32 tcp_tso_acked(struct sock *sk, struct sk_buff *skb) | |||
2836 | * is before the ack sequence we can discard it as it's confirmed to have | 2836 | * is before the ack sequence we can discard it as it's confirmed to have |
2837 | * arrived at the other end. | 2837 | * arrived at the other end. |
2838 | */ | 2838 | */ |
2839 | static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) | 2839 | static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets, |
2840 | u32 prior_snd_una) | ||
2840 | { | 2841 | { |
2841 | struct tcp_sock *tp = tcp_sk(sk); | 2842 | struct tcp_sock *tp = tcp_sk(sk); |
2842 | const struct inet_connection_sock *icsk = inet_csk(sk); | 2843 | const struct inet_connection_sock *icsk = inet_csk(sk); |
@@ -2903,9 +2904,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) | |||
2903 | if (sacked & TCPCB_LOST) | 2904 | if (sacked & TCPCB_LOST) |
2904 | tp->lost_out -= acked_pcount; | 2905 | tp->lost_out -= acked_pcount; |
2905 | 2906 | ||
2906 | if (unlikely(tp->urg_mode && !before(end_seq, tp->snd_up))) | ||
2907 | tp->urg_mode = 0; | ||
2908 | |||
2909 | tp->packets_out -= acked_pcount; | 2907 | tp->packets_out -= acked_pcount; |
2910 | pkts_acked += acked_pcount; | 2908 | pkts_acked += acked_pcount; |
2911 | 2909 | ||
@@ -2935,6 +2933,9 @@ static int tcp_clean_rtx_queue(struct sock *sk, int prior_fackets) | |||
2935 | tp->lost_skb_hint = NULL; | 2933 | tp->lost_skb_hint = NULL; |
2936 | } | 2934 | } |
2937 | 2935 | ||
2936 | if (likely(between(tp->snd_up, prior_snd_una, tp->snd_una))) | ||
2937 | tp->snd_up = tp->snd_una; | ||
2938 | |||
2938 | if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) | 2939 | if (skb && (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) |
2939 | flag |= FLAG_SACK_RENEGING; | 2940 | flag |= FLAG_SACK_RENEGING; |
2940 | 2941 | ||
@@ -3311,7 +3312,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag) | |||
3311 | goto no_queue; | 3312 | goto no_queue; |
3312 | 3313 | ||
3313 | /* See if we can take anything off of the retransmit queue. */ | 3314 | /* See if we can take anything off of the retransmit queue. */ |
3314 | flag |= tcp_clean_rtx_queue(sk, prior_fackets); | 3315 | flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); |
3315 | 3316 | ||
3316 | if (tp->frto_counter) | 3317 | if (tp->frto_counter) |
3317 | frto_cwnd = tcp_process_frto(sk, flag); | 3318 | frto_cwnd = tcp_process_frto(sk, flag); |