Skip to content

Commit 8f7baad

Browse files
thomashigdondavem330
authored andcommitted
tcp: Add snd_wnd to TCP_INFO
Neal Cardwell mentioned that snd_wnd would be useful for diagnosing TCP performance problems -- > (1) Usually when we're diagnosing TCP performance problems, we do so > from the sender, since the sender makes most of the > performance-critical decisions (cwnd, pacing, TSO size, TSQ, etc). > From the sender-side the thing that would be most useful is to see > tp->snd_wnd, the receive window that the receiver has advertised to > the sender. This serves the purpose of adding an additional __u32 to avoid the would-be hole caused by the addition of the tcpi_rcvi_ooopack field. Signed-off-by: Thomas Higdon <[email protected]> Acked-by: Yuchung Cheng <[email protected]> Acked-by: Neal Cardwell <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f9af2db commit 8f7baad

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/uapi/linux/tcp.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ struct tcp_info {
272272
__u32 tcpi_reord_seen; /* reordering events seen */
273273

274274
__u32 tcpi_rcv_ooopack; /* Out-of-order packets received */
275+
276+
__u32 tcpi_snd_wnd; /* peer's advertised receive window after
277+
* scaling (bytes)
278+
*/
275279
};
276280

277281
/* netlink attributes types for SCM_TIMESTAMPING_OPT_STATS */

net/ipv4/tcp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3297,6 +3297,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
32973297
info->tcpi_dsack_dups = tp->dsack_dups;
32983298
info->tcpi_reord_seen = tp->reord_seen;
32993299
info->tcpi_rcv_ooopack = tp->rcv_ooopack;
3300+
info->tcpi_snd_wnd = tp->snd_wnd;
33003301
unlock_sock_fast(sk, slow);
33013302
}
33023303
EXPORT_SYMBOL_GPL(tcp_get_info);

0 commit comments

Comments
 (0)