From: Deepti Raghavan <deeptir@mit.edu>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Deepti Raghavan <deeptir@mit.edu>
Subject: [PATCH net-next] tcp: expose both send and receive intervals for rate sample
Date: Mon, 9 Jul 2018 17:53:39 +0000 [thread overview]
Message-ID: <1531158819-7901-1-git-send-email-deeptir@mit.edu> (raw)
Congestion control algorithms, which access the rate sample
through the tcp_cong_control function, only have access to the maximum
of the send and receive interval, for cases where the acknowledgment
rate may be inaccurate due to ACK compression or decimation. Algorithms
may want to use send rates and receive rates as separate signals.
Signed-off-by: Deepti Raghavan <deeptir@mit.edu>
---
include/net/tcp.h | 2 ++
net/ipv4/tcp_rate.c | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cce3769..f6cb20e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -954,6 +954,8 @@ struct rate_sample {
u32 prior_delivered; /* tp->delivered at "prior_mstamp" */
s32 delivered; /* number of packets delivered over interval */
long interval_us; /* time for tp->delivered to incr "delivered" */
+ u32 snd_interval_us; /* snd interval for delivered packets */
+ u32 rcv_interval_us; /* rcv interval for delivered packets */
long rtt_us; /* RTT of last (S)ACKed packet (or -1) */
int losses; /* number of packets marked lost upon ACK */
u32 acked_sacked; /* number of packets newly (S)ACKed upon ACK */
diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c
index c61240e..4dff40d 100644
--- a/net/ipv4/tcp_rate.c
+++ b/net/ipv4/tcp_rate.c
@@ -146,6 +146,10 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost,
rs->prior_mstamp); /* ack phase */
rs->interval_us = max(snd_us, ack_us);
+ /* Record both segment send and ack receive intervals */
+ rs->snd_interval_us = snd_us;
+ rs->rcv_interval_us = ack_us;
+
/* Normally we expect interval_us >= min-rtt.
* Note that rate may still be over-estimated when a spuriously
* retransmistted skb was first (s)acked because "interval_us"
--
2.7.4
next reply other threads:[~2018-07-09 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 17:53 Deepti Raghavan [this message]
2018-07-09 18:09 ` [PATCH net-next] tcp: expose both send and receive intervals for rate sample Neal Cardwell
2018-07-09 18:11 ` Eric Dumazet
2018-07-12 6:02 ` David Miller
[not found] <CAKOGndb391n16rVhudpf4C5TWPikE7Oj9LywZ4f-v_YCr=Be=g@mail.gmail.com>
2018-07-09 16:23 ` Yuchung Cheng
2018-07-09 17:02 ` Eric Dumazet
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=1531158819-7901-1-git-send-email-deeptir@mit.edu \
--to=deeptir@mit.edu \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/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).