netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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] Check in_sack firstly in tcp_match_skb_to_sack()
Date: Tue, 12 Aug 2025 23:23:22 +0800	[thread overview]
Message-ID: <20250812152322.19336-1-guoxin0309@gmail.com> (raw)

This is because only when in_sack is equal to false
the pkt_len can be greater than or equal to skb->len,
so checking the in_sack firstly will make the logic
more clear.

Signed-off-by: Xin Guo <guoxin0309@gmail.com>
---
 net/ipv4/tcp_input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 71b76e98371a..293fb2cc8969 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1375,7 +1375,7 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
 			pkt_len = new_len;
 		}
 
-		if (pkt_len >= skb->len && !in_sack)
+		if (!in_sack && pkt_len >= skb->len)
 			return 0;
 
 		err = tcp_fragment(sk, TCP_FRAG_IN_RTX_QUEUE, skb,
-- 
2.43.0


             reply	other threads:[~2025-08-12 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 15:23 Xin Guo [this message]
2025-08-15 18:45 ` [PATCH net-next] Check in_sack firstly in tcp_match_skb_to_sack() Jakub Kicinski

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=20250812152322.19336-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 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).