Skip to contentSkip to conversation

tcp: use tcp_skb_sent_after() instead in RACK

PATCH Applied Pengcheng Yang 4 participants 4 messages Apr 29, 2022 – Apr 30, 2022

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

PATCH 1/1 tcp: use tcp_skb_sent_after() instead in RACK

This patch doesn't change any functionality.

---
 net/ipv4/tcp_recovery.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
net/ipv4/tcp_recovery.c +5 -10
index fd113f6..48f30e7 100644
@@ -2,11 +2,6 @@
 #include <linux/tcp.h>
 #include <net/tcp.h>
 
-static bool tcp_rack_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2)
-{
-	return t1 > t2 || (t1 == t2 && after(seq1, seq2));
-}
-
 static u32 tcp_rack_reo_wnd(const struct sock *sk)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
@@ -77,9 +72,9 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout)
 		    !(scb->sacked & TCPCB_SACKED_RETRANS))
 			continue;
 
-		if (!tcp_rack_sent_after(tp->rack.mstamp,
-					 tcp_skb_timestamp_us(skb),
-					 tp->rack.end_seq, scb->end_seq))
+		if (!tcp_skb_sent_after(tp->rack.mstamp,
+					tcp_skb_timestamp_us(skb),
+					tp->rack.end_seq, scb->end_seq))
 			break;
 
 		/* A packet is lost if it has not been s/acked beyond
@@ -140,8 +135,8 @@ void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
 	}
 	tp->rack.advanced = 1;
 	tp->rack.rtt_us = rtt_us;
-	if (tcp_rack_sent_after(xmit_time, tp->rack.mstamp,
-				end_seq, tp->rack.end_seq)) {
+	if (tcp_skb_sent_after(xmit_time, tp->rack.mstamp,
+			       end_seq, tp->rack.end_seq)) {
 		tp->rack.mstamp = xmit_time;
 		tp->rack.end_seq = end_seq;
 	}
Signature · 1 line
1.8.3.1
maintainer Acked-by Tested-by on v1 1/1
#1 lore raw
Quoted 40 lines · Pengcheng Yang

This patch doesn't change any functionality.

---
 net/ipv4/tcp_recovery.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
net/ipv4/tcp_recovery.c +3 -8
index fd113f6..48f30e7 100644
@@ -2,11 +2,6 @@
 #include <linux/tcp.h>
 #include <net/tcp.h>
 
-static bool tcp_rack_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2)
-{
-       return t1 > t2 || (t1 == t2 && after(seq1, seq2));
-}
-
 static u32 tcp_rack_reo_wnd(const struct sock *sk)
 {
        struct tcp_sock *tp = tcp_sk(sk);
@@ -77,9 +72,9 @@ static void tcp_rack_detect_loss(struct sock *sk, u32 *reo_timeout)
                    !(scb->sacked & TCPCB_SACKED_RETRANS))
                        continue;
 
-               if (!tcp_rack_sent_after(tp->rack.mstamp,
-                                        tcp_skb_timestamp_us(skb),
-                                        tp->rack.end_seq, scb->end_seq))
+               if (!tcp_skb_sent_after(tp->rack.mstamp,
+                                       tcp_skb_timestamp_us(skb),
+                                       tp->rack.end_seq, scb->end_seq))
                        break;
 
                /* A packet is lost if it has not been s/acked beyond
@@ -140,8 +135,8 @@ void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,
        }

net/ipv4/tcp_recovery.c void tcp_rack_advance(struct tcp_sock *tp, u8 sacked, u32 end_seq,

Quoted 10 lines
net/ipv4/tcp_recovery.c +2 -3
        tp->rack.advanced = 1;
        tp->rack.rtt_us = rtt_us;
-       if (tcp_rack_sent_after(xmit_time, tp->rack.mstamp,
-                               end_seq, tp->rack.end_seq)) {
+       if (tcp_skb_sent_after(xmit_time, tp->rack.mstamp,
+                              end_seq, tp->rack.end_seq)) {
                tp->rack.mstamp = xmit_time;
                tp->rack.end_seq = end_seq;
        }
--

Thanks! The patch looks good to me, and passes all our team's packetdrill tests.

thanks,
neal

#3 lore raw
In reply to Pengcheng Yang
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 7 lines · On Fri, 29 Apr 2022 18:32:56 +0800 you wrote:

This patch doesn't change any functionality.

---
 net/ipv4/tcp_recovery.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Here is the summary with links:
- [net-next] tcp: use tcp_skb_sent_after() instead in RACK

    https://git.kernel.org/netdev/net-next/c/5a8ad1ce2c60

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html