aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_output.c
diff options
context:
space:
mode:
authorFrancis Yan <francisyyan@gmail.com>2016-11-28 02:07:15 -0500
committerDavid S. Miller <davem@davemloft.net>2016-11-30 10:04:24 -0500
commit5615f88614a47d2b802e1d14d31b623696109276 (patch)
tree3e323a3aeb157cddf60f22d3581763c816d16897 /net/ipv4/tcp_output.c
parent0f87230d1a6c253681550c6064715d06a32be73d (diff)
tcp: instrument how long TCP is limited by receive window
This patch measures the total time when the TCP stops sending because the receiver's advertised window is not large enough. Note that once the limit is lifted we are likely in the busy status if we have data pending. Signed-off-by: Francis Yan <francisyyan@gmail.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r--net/ipv4/tcp_output.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e8ea584106e0..b74444cee24d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2144,7 +2144,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
2144 unsigned int tso_segs, sent_pkts; 2144 unsigned int tso_segs, sent_pkts;
2145 int cwnd_quota; 2145 int cwnd_quota;
2146 int result; 2146 int result;
2147 bool is_cwnd_limited = false; 2147 bool is_cwnd_limited = false, is_rwnd_limited = false;
2148 u32 max_segs; 2148 u32 max_segs;
2149 2149
2150 sent_pkts = 0; 2150 sent_pkts = 0;
@@ -2181,8 +2181,10 @@ static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
2181 break; 2181 break;
2182 } 2182 }
2183 2183
2184 if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) 2184 if (unlikely(!tcp_snd_wnd_test(tp, skb, mss_now))) {
2185 is_rwnd_limited = true;
2185 break; 2186 break;
2187 }
2186 2188
2187 if (tso_segs == 1) { 2189 if (tso_segs == 1) {
2188 if (unlikely(!tcp_nagle_test(tp, skb, mss_now, 2190 if (unlikely(!tcp_nagle_test(tp, skb, mss_now,
@@ -2227,6 +2229,11 @@ repair:
2227 break; 2229 break;
2228 } 2230 }
2229 2231
2232 if (is_rwnd_limited)
2233 tcp_chrono_start(sk, TCP_CHRONO_RWND_LIMITED);
2234 else
2235 tcp_chrono_stop(sk, TCP_CHRONO_RWND_LIMITED);
2236
2230 if (likely(sent_pkts)) { 2237 if (likely(sent_pkts)) {
2231 if (tcp_in_cwnd_reduction(sk)) 2238 if (tcp_in_cwnd_reduction(sk))
2232 tp->prr_out += sent_pkts; 2239 tp->prr_out += sent_pkts;