netdev
[Top] [All Lists]

[PATCH] add receive DRS info

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH] add receive DRS info
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Mon, 7 Jun 2004 10:07:44 -0700
Cc: netdev@xxxxxxxxxxx
In-reply-to: <20040604205749.11725598.davem@xxxxxxxxxx>
Organization: Open Source Development Lab
References: <20040604153749.5d8a13b9@xxxxxxxxxxxxxxxxxxxxx> <20040604205749.11725598.davem@xxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
Add receiver feedback information to the tcp_info structure to allow
looking at receive dynamic right sizing with 'ss' command.

This increases the size of the structure, but since both getsockopt() and 
netlink
interface pass length in request; it retains compatibility with older versions.

diff -Nru a/include/linux/tcp.h b/include/linux/tcp.h
--- a/include/linux/tcp.h       2004-06-07 10:07:25 -07:00
+++ b/include/linux/tcp.h       2004-06-07 10:07:25 -07:00
@@ -183,6 +183,9 @@
        __u32   tcpi_snd_cwnd;
        __u32   tcpi_advmss;
        __u32   tcpi_reordering;
+
+       __u32   tcpi_rcv_rtt;
+       __u32   tcpi_rcv_space;
 };
 
 #ifdef __KERNEL__
diff -Nru a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
--- a/net/ipv4/tcp_diag.c       2004-06-07 10:07:25 -07:00
+++ b/net/ipv4/tcp_diag.c       2004-06-07 10:07:25 -07:00
@@ -91,6 +91,9 @@
        info->tcpi_snd_cwnd = tp->snd_cwnd;
        info->tcpi_advmss = tp->advmss;
        info->tcpi_reordering = tp->reordering;
+
+       info->tcpi_rcv_rtt = ((1000000*tp->rcv_rtt_est.rtt)/HZ)>>3;
+       info->tcpi_rcv_space = tp->rcvq_space.space;
 }
 
 static int tcpdiag_fill(struct sk_buff *skb, struct sock *sk,

<Prev in Thread] Current Thread [Next in Thread>