From: Jesper Dangaard Brouer <hawk@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
Jon Kohler <jon@nutanix.com>
Cc: Jason Wang <jasowang@redhat.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next] tun: use xdp_get_frame_len()
Date: Thu, 8 May 2025 16:16:41 +0200 [thread overview]
Message-ID: <962b227f-9673-4050-90b2-334850087487@kernel.org> (raw)
In-Reply-To: <681cb1d4cb20_2574d529466@willemb.c.googlers.com.notmuch>
On 08/05/2025 15.29, Willem de Bruijn wrote:
> Jon Kohler wrote:
>>
>>
>>> On May 7, 2025, at 4:56 PM, Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
>>>
>>>
>>> Jon Kohler wrote:
>>>> Use xdp_get_frame_len helper to ensure xdp frame size is calculated
>>>> correctly in both single buffer and multi buffer configurations.
>>>
>>> Not necessarily opposed, but multi buffer is not actually possible
>>> in this code path, right?
>>>
>>> tun_put_user_xdp only copies xdp_frame->data, for one.
>>>
>>> Else this would also be fix, not net-next material.
>>
>> Correct, this is a prep patch for future multi buffer support,
>> I’m not aware of any path that can currently do that thru
>> this code.
>>
This is a good example of a performance paper-cut, from my rant.
Adding xdp_get_frame_len() where it is not needed, adds extra code,
in-form of an if-statement and a potential touching of a colder
cache-line in skb_shared_info area.
>> The reason for pursuing multi-buffer is to allow vhost/net
>> batching to work again for large payloads.
>
> I was not aware of that context. I'd add a comment to that in the
> commit message, and send it as part of that series.
It need to part of that series, as that batching change should bring a
larger performance benefit that outweighs the paper-cut.
AFAICR there is also some dual packet handling code path for XDP in
vhost_net/tun. I'm also willing to take the paper-cut, for cleaning
that up.
--Jesper
next prev parent reply other threads:[~2025-05-08 14:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-07 16:19 Jon Kohler
2025-05-07 20:56 ` Willem de Bruijn
2025-05-08 2:56 ` Jon Kohler
2025-05-08 13:29 ` Willem de Bruijn
2025-05-08 14:16 ` Jesper Dangaard Brouer [this message]
2025-05-08 14:24 ` Jon Kohler
2025-05-08 15:04 ` Jesper Dangaard Brouer
2025-05-08 15:26 ` Jon Kohler
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=962b227f-9673-4050-90b2-334850087487@kernel.org \
--to=hawk@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=john.fastabend@gmail.com \
--cc=jon@nutanix.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemdebruijn.kernel@gmail.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
all inboxes | Powered by JetHome®