linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3] net/core: fix wrong return value in __splice_segment
@ 2025-07-24 12:19 Pengtao He
  2025-07-25 23:54 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Pengtao He @ 2025-07-24 12:19 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, Willem de Bruijn, Mina Almasry, Jason Xing,
	Michal Luczaj, Eric Biggers, Alexander Lobakin
  Cc: netdev, linux-kernel, Pengtao He

Return true immediately when the last segment is processed,
avoid to walking once more in the frags loop.

Signed-off-by: Pengtao He <hept.hept.hept@gmail.com>
---
v3->v2:
Reduce once condition evaluation.
v2->v1:
Correct the commit message and target tree.
v1:
https://lore.kernel.org/netdev/20250723063119.24059-1-hept.hept.hept@gmail.com/
---
 net/core/skbuff.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ee0274417948..23b776cd9879 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3112,7 +3112,9 @@ static bool __splice_segment(struct page *page, unsigned int poff,
 		poff += flen;
 		plen -= flen;
 		*len -= flen;
-	} while (*len && plen);
+		if (!*len)
+			return true;
+	} while (plen);
 
 	return false;
 }
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v3] net/core: fix wrong return value in __splice_segment
  2025-07-24 12:19 [PATCH net-next v3] net/core: fix wrong return value in __splice_segment Pengtao He
@ 2025-07-25 23:54 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2025-07-25 23:54 UTC (permalink / raw)
  To: Pengtao He
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Simon Horman,
	Willem de Bruijn, Mina Almasry, Jason Xing, Michal Luczaj,
	Eric Biggers, Alexander Lobakin, netdev, linux-kernel

On Thu, 24 Jul 2025 20:19:21 +0800 Pengtao He wrote:
> Return true immediately when the last segment is processed,
> avoid to walking once more in the frags loop.

The merge window is about to begin so we're switching to "fixes only"
mode of operation. Please repost this patch in ~2 weeks (you can use
this page to check status: https://netdev.bots.linux.dev/net-next.html
-- 
pw-bot: defer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-25 23:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24 12:19 [PATCH net-next v3] net/core: fix wrong return value in __splice_segment Pengtao He
2025-07-25 23:54 ` Jakub Kicinski

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