summaryrefslogtreecommitdiff
path: root/net/ipv4/tcp_timer.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.davemloft.net>2004-09-06 19:20:50 -0700
committerPatrick McHardy <kaber@trash.net>2004-09-06 19:20:50 -0700
commit14a1f44569619b2dfda526dc0f73b9bf0df74171 (patch)
treef1200dfaf23a0013babab9fd458051b14d723ad1 /net/ipv4/tcp_timer.c
parent10bc956350e6821a1a9757065962f1924649b12d (diff)
[TCP]: Make TSO play nice with congestion window.
Previously TSO would not abide by the congestion window properly. Essentially, each TSO packet would be trated just like 1 normal packet, even though a TSO packet generates more than 1 normal packet. This violates congestion window rules entirely. So now we record the TSO factor, a count of how many real packets a TSO packet will generate, and include this in all the packet counting routines. This initial version has a bug in that skb_entail() is not the correct time to figure out the TSO factor for the SKB, and tp->mss_tso_factor is not necessarily the right value for a given SKB. Will fix this up next. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r--net/ipv4/tcp_timer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 72a5a50b50ab..c060bb333471 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -121,7 +121,7 @@ static int tcp_out_of_resources(struct sock *sk, int do_reset)
* 1. Last segment was sent recently. */
if ((s32)(tcp_time_stamp - tp->lsndtime) <= TCP_TIMEWAIT_LEN ||
/* 2. Window is closed. */
- (!tp->snd_wnd && !tp->packets_out))
+ (!tp->snd_wnd && !tcp_get_pcount(&tp->packets_out)))
do_reset = 1;
if (do_reset)
tcp_send_active_reset(sk, GFP_ATOMIC);
@@ -269,7 +269,7 @@ static void tcp_probe_timer(struct sock *sk)
struct tcp_opt *tp = tcp_sk(sk);
int max_probes;
- if (tp->packets_out || !sk->sk_send_head) {
+ if (tcp_get_pcount(&tp->packets_out) || !sk->sk_send_head) {
tp->probes_out = 0;
return;
}
@@ -316,7 +316,7 @@ static void tcp_retransmit_timer(struct sock *sk)
{
struct tcp_opt *tp = tcp_sk(sk);
- if (tp->packets_out == 0)
+ if (!tcp_get_pcount(&tp->packets_out))
goto out;
BUG_TRAP(!skb_queue_empty(&sk->sk_write_queue));
@@ -606,7 +606,7 @@ static void tcp_keepalive_timer (unsigned long data)
elapsed = keepalive_time_when(tp);
/* It is alive without keepalive 8) */
- if (tp->packets_out || sk->sk_send_head)
+ if (tcp_get_pcount(&tp->packets_out) || sk->sk_send_head)
goto resched;
elapsed = tcp_time_stamp - tp->rcv_tstamp;