aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 014f18e2f7b3..f93150d15199 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2642,6 +2642,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
2642 const struct inet_connection_sock *icsk = inet_csk(sk); 2642 const struct inet_connection_sock *icsk = inet_csk(sk);
2643 u32 now = tcp_time_stamp; 2643 u32 now = tcp_time_stamp;
2644 unsigned int start; 2644 unsigned int start;
2645 int notsent_bytes;
2645 u64 rate64; 2646 u64 rate64;
2646 u32 rate; 2647 u32 rate;
2647 2648
@@ -2722,6 +2723,11 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
2722 } while (u64_stats_fetch_retry_irq(&tp->syncp, start)); 2723 } while (u64_stats_fetch_retry_irq(&tp->syncp, start));
2723 info->tcpi_segs_out = tp->segs_out; 2724 info->tcpi_segs_out = tp->segs_out;
2724 info->tcpi_segs_in = tp->segs_in; 2725 info->tcpi_segs_in = tp->segs_in;
2726
2727 notsent_bytes = READ_ONCE(tp->write_seq) - READ_ONCE(tp->snd_nxt);
2728 info->tcpi_notsent_bytes = max(0, notsent_bytes);
2729
2730 info->tcpi_min_rtt = tcp_min_rtt(tp);
2725} 2731}
2726EXPORT_SYMBOL_GPL(tcp_get_info); 2732EXPORT_SYMBOL_GPL(tcp_get_info);
2727 2733