linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Pengtao He <hept.hept.hept@gmail.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 Simon Horman <horms@kernel.org>,
	 Willem de Bruijn <willemb@google.com>,
	 Mina Almasry <almasrymina@google.com>,
	 Jason Xing <kerneljasonxing@gmail.com>,
	 Michal Luczaj <mhal@rbox.co>,
	 Eric Biggers <ebiggers@google.com>,
	 Alexander Lobakin <aleksander.lobakin@intel.com>
Cc: netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 Pengtao He <hept.hept.hept@gmail.com>
Subject: Re: [PATCH] net/core: fix wrong return value in __splice_segment
Date: Wed, 23 Jul 2025 09:28:05 -0400	[thread overview]
Message-ID: <6880e365b84d2_334c6729452@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20250723063119.24059-1-hept.hept.hept@gmail.com>

Pengtao He wrote:
> Return true immediately when the last segment is processed,
> without waiting for the next segment.

This can use a bit more explanation. Which unnecessary wait is
avoided.

The boolean return from __skb_splice_bits has a bit odd semantics. But
is ignored by its only caller anyway.

The relevant __splice_segment that can cause an early return is in the
frags loop. But I see no waiting operation in here.

Aside from that, the commit also should target [PATCH net-next],
assuuming that this is an optimization, not a fix.

> 
> Signed-off-by: Pengtao He <hept.hept.hept@gmail.com>
> ---
>  net/core/skbuff.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index ee0274417948..cc3339ab829a 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -3114,6 +3114,9 @@ static bool __splice_segment(struct page *page, unsigned int poff,
>  		*len -= flen;
>  	} while (*len && plen);
>  
> +	if (!*len)
> +		return true;
> +
>  	return false;
>  }
>  
> -- 
> 2.49.0
> 



  reply	other threads:[~2025-07-23 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-23  6:31 [PATCH] net/core: fix wrong return value in __splice_segment Pengtao He
2025-07-23 13:28 ` Willem de Bruijn [this message]
2025-07-24 10:06   ` Pengtao He

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=6880e365b84d2_334c6729452@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=almasrymina@google.com \
    --cc=davem@davemloft.net \
    --cc=ebiggers@google.com \
    --cc=edumazet@google.com \
    --cc=hept.hept.hept@gmail.com \
    --cc=horms@kernel.org \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhal@rbox.co \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.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).