netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH] add receive DRS info
Date: Mon, 7 Jun 2004 10:07:44 -0700	[thread overview]
Message-ID: <20040607100744.1b67baa2@dell_ss3.pdx.osdl.net> (raw)
In-Reply-To: <20040604205749.11725598.davem@redhat.com>

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,

  reply	other threads:[~2004-06-07 17:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-04 22:37 [PATCH] common code for generating tcp_info Stephen Hemminger
2004-06-05  3:57 ` David S. Miller
2004-06-07 17:07   ` Stephen Hemminger [this message]
2004-06-07 22:27     ` [PATCH] add receive DRS info David S. Miller
2004-06-07 14:48 ` [PATCH] common code for generating tcp_info Joe Perches
2004-06-07 16:16   ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040607100744.1b67baa2@dell_ss3.pdx.osdl.net \
    --to=shemminger@osdl.org \
    --cc=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).