From: Xin Guo <guoxin0309@gmail.com>
To: ncardwell@google.com, edumazet@google.com, davem@davemloft.net,
dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com
Cc: netdev@vger.kernel.org, Xin Guo <guoxin0309@gmail.com>
Subject: [PATCH net-next] tcp: correct the skip logic in tcp_sacktag_skip()
Date: Sun, 13 Jul 2025 23:22:53 +0800 [thread overview]
Message-ID: <20250713152253.110107-1-guoxin0309@gmail.com> (raw)
tcp_sacktag_skip() directly return the input skb only
if TCP_SKB_CB(skb)->seq>skip_to_seq,
this is not right, and the logic should be
TCP_SKB_CB(skb)->seq>=skip_to_seq, for example
if start_seq is equal to tcp_highest_sack_seq() ,
the start_seq is equal to seq of skb which is from
tcp_highest_sack().
and on the other side ,when
tcp_highest_sack_seq() < start_seq in
tcp_sacktag_write_queue(),
the skb is from tcp_highest_sack() will be ignored
in tcp_sacktag_skip(), so clean the logic also.
Fixes: 75c119afe14f ("tcp: implement rb-tree based retransmit queue")
Signed-off-by: Xin Guo <guoxin0309@gmail.com>
---
net/ipv4/tcp_input.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 79e3bfb0108f..bbefb866c649 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1809,7 +1809,7 @@ static struct sk_buff *tcp_sacktag_bsearch(struct sock *sk, u32 seq)
static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
u32 skip_to_seq)
{
- if (skb && after(TCP_SKB_CB(skb)->seq, skip_to_seq))
+ if (skb && !before(TCP_SKB_CB(skb)->seq, skip_to_seq))
return skb;
return tcp_sacktag_bsearch(sk, skip_to_seq);
@@ -1997,7 +1997,7 @@ tcp_sacktag_write_queue(struct sock *sk, const struct sk_buff *ack_skb,
continue;
}
- if (!before(start_seq, tcp_highest_sack_seq(tp))) {
+ if (tcp_highest_sack_seq(tp) == start_seq) {
skb = tcp_highest_sack(sk);
if (!skb)
break;
--
2.43.0
next reply other threads:[~2025-07-13 15:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-13 15:22 Xin Guo [this message]
2025-07-17 8:24 ` [PATCH net-next] tcp: correct the skip logic in tcp_sacktag_skip() Paolo Abeni
2025-07-17 13:36 ` Xin Guo
2025-07-17 14:14 ` Neal Cardwell
2025-07-17 14:30 ` Xin Guo
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=20250713152253.110107-1-guoxin0309@gmail.com \
--to=guoxin0309@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.