aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-11-10 19:53:30 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-10 19:53:30 -0500
commitf4805eded7d38c4e42bf473dc5eb2f34853beb06 (patch)
tree1f7e0e90642e775b4e8c2c47d84e2df8ce2de3c3 /include/net/tcp.h
parent6e6ece5dc6022e8086c565498d23511bbceda811 (diff)
[TCP]: fix congestion window update when using TSO deferal
TCP peformance with TSO over networks with delay is awful. On a 100Mbit link with 150ms delay, we get 4Mbits/sec with TSO and 50Mbits/sec without TSO. The problem is with TSO, we intentionally do not keep the maximum number of packets in flight to fill the window, we hold out to until we can send a MSS chunk. But, we also don't update the congestion window unless we have filled, as per RFC2861. This patch replaces the check for the congestion window being full with something smarter that accounts for TSO. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 96cc3b434e40..15bdbc6bd571 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -810,6 +810,27 @@ static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp)
810 return 3; 810 return 3;
811} 811}
812 812
813/* RFC2861 Check whether we are limited by application or congestion window
814 * This is the inverse of cwnd check in tcp_tso_should_defer
815 */
816static inline int tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight)
817{
818 const struct tcp_sock *tp = tcp_sk(sk);
819 u32 left;
820
821 if (in_flight >= tp->snd_cwnd)
822 return 1;
823
824 if (!(sk->sk_route_caps & NETIF_F_TSO))
825 return 0;
826
827 left = tp->snd_cwnd - in_flight;
828 if (sysctl_tcp_tso_win_divisor)
829 return left * sysctl_tcp_tso_win_divisor < tp->snd_cwnd;
830 else
831 return left <= tcp_max_burst(tp);
832}
833
813static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss, 834static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss,
814 const struct sk_buff *skb) 835 const struct sk_buff *skb)
815{ 836{