aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-08-21 13:47:58 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-22 19:19:50 -0400
commitb4c1c1d03842e6b24e87e48c07769e105df99985 (patch)
tree6035762943affb2540a951189f0e2fdacb1a3aea
parentbaf3b3f227e6d2c143a03f03dcbd50b55089eda4 (diff)
net: tcp_probe: also include rcv_wnd next to snd_wnd
It is helpful to sometimes know the TCP window sizes of an established socket e.g. to confirm that window scaling is working or to tweak the window size to improve high-latency connections, etc etc. Currently the TCP snooper only exports the send window size, but not the receive window size. Therefore, also add the receive window size to the end of the output line. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/tcp_probe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index d4943f67aff2..fae788b5b03e 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -60,6 +60,7 @@ struct tcp_log {
60 u32 snd_nxt; 60 u32 snd_nxt;
61 u32 snd_una; 61 u32 snd_una;
62 u32 snd_wnd; 62 u32 snd_wnd;
63 u32 rcv_wnd;
63 u32 snd_cwnd; 64 u32 snd_cwnd;
64 u32 ssthresh; 65 u32 ssthresh;
65 u32 srtt; 66 u32 srtt;
@@ -116,6 +117,7 @@ static int jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
116 p->snd_una = tp->snd_una; 117 p->snd_una = tp->snd_una;
117 p->snd_cwnd = tp->snd_cwnd; 118 p->snd_cwnd = tp->snd_cwnd;
118 p->snd_wnd = tp->snd_wnd; 119 p->snd_wnd = tp->snd_wnd;
120 p->rcv_wnd = tp->rcv_wnd;
119 p->ssthresh = tcp_current_ssthresh(sk); 121 p->ssthresh = tcp_current_ssthresh(sk);
120 p->srtt = tp->srtt >> 3; 122 p->srtt = tp->srtt >> 3;
121 123
@@ -157,13 +159,13 @@ static int tcpprobe_sprint(char *tbuf, int n)
157 = ktime_to_timespec(ktime_sub(p->tstamp, tcp_probe.start)); 159 = ktime_to_timespec(ktime_sub(p->tstamp, tcp_probe.start));
158 160
159 return scnprintf(tbuf, n, 161 return scnprintf(tbuf, n,
160 "%lu.%09lu %pI4:%u %pI4:%u %d %#x %#x %u %u %u %u\n", 162 "%lu.%09lu %pI4:%u %pI4:%u %d %#x %#x %u %u %u %u %u\n",
161 (unsigned long) tv.tv_sec, 163 (unsigned long) tv.tv_sec,
162 (unsigned long) tv.tv_nsec, 164 (unsigned long) tv.tv_nsec,
163 &p->saddr, ntohs(p->sport), 165 &p->saddr, ntohs(p->sport),
164 &p->daddr, ntohs(p->dport), 166 &p->daddr, ntohs(p->dport),
165 p->length, p->snd_nxt, p->snd_una, 167 p->length, p->snd_nxt, p->snd_una,
166 p->snd_cwnd, p->ssthresh, p->snd_wnd, p->srtt); 168 p->snd_cwnd, p->ssthresh, p->snd_wnd, p->srtt, p->rcv_wnd);
167} 169}
168 170
169static ssize_t tcpprobe_read(struct file *file, char __user *buf, 171static ssize_t tcpprobe_read(struct file *file, char __user *buf,