Skip to contentSkip to conversation

tcp: expose both send and receive intervals for rate sample

PATCH Applied Deepti Raghavan 4 participants 4 messages Jul 9, 2018 – Jul 12, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: expose both send and receive intervals for rate sample

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.

---
 include/net/tcp.h   | 2 ++
 net/ipv4/tcp_rate.c | 4 ++++
 2 files changed, 6 insertions(+)
include/net/tcp.h +2 -0
index cce3769..f6cb20e 100644
@@ -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 */
net/ipv4/tcp_rate.c +4 -0
index c61240e..4dff40d 100644
@@ -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"
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Deepti Raghavan

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.

Quoted 5 lines
---
 include/net/tcp.h   | 2 ++
 net/ipv4/tcp_rate.c | 4 ++++
 2 files changed, 6 insertions(+)

Thanks for re-sending. It does seem to be showing up in patchwork now:
https://patchwork.ozlabs.org/patch/941532/
And I can confirm I'm able to apply it to net-next.

thanks,
neal

#2 lore raw
In reply to Deepti Raghavan
Quoted 7 lines · Deepti Raghavan

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.

(Assuming another CC is coming soon, using this...)

Thanks

maintainer Applied
#3 lore raw
In reply to Deepti Raghavan

From: Deepti Raghavan <[email protected]>
Date: Mon, 9 Jul 2018 17:53:39 +0000

Quoted 7 lines

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.

Applied.