From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: "Kal Cutter Conley" <kal.conley@dectris.com>,
"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
"Björn Töpel" <bjorn@kernel.org>,
"Magnus Karlsson" <magnus.karlsson@intel.com>,
"Jonathan Lemon" <jonathan.lemon@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf-next v3 1/3] xsk: Support UMEM chunk_size > PAGE_SIZE
Date: Thu, 13 Apr 2023 00:49:15 +0200 [thread overview]
Message-ID: <87ttxk1ztg.fsf@toke.dk> (raw)
In-Reply-To: <CAJ8uoz0arggpZdf9KPe5+pJbq_nVJUmvVryPHuwAsqswGs1LZw@mail.gmail.com>
Magnus Karlsson <magnus.karlsson@gmail.com> writes:
> On Wed, 12 Apr 2023 at 15:40, Toke Høiland-Jørgensen <toke@redhat.com> wrote:
>>
>> Kal Cutter Conley <kal.conley@dectris.com> writes:
>>
>> >> > > Add core AF_XDP support for chunk sizes larger than PAGE_SIZE. This
>> >> > > enables sending/receiving jumbo ethernet frames up to the theoretical
>> >> > > maxiumum of 64 KiB. For chunk sizes > PAGE_SIZE, the UMEM is required
>> >> > > to consist of HugeTLB VMAs (and be hugepage aligned). Initially, only
>> >> > > SKB mode is usable pending future driver work.
>> >> >
>> >> > Hmm, interesting. So how does this interact with XDP multibuf?
>> >>
>> >> To me it currently does not interact with mbuf in any way as it is enabled
>> >> only for skb mode which linearizes the skb from what i see.
>> >>
>> >> I'd like to hear more about Kal's use case - Kal do you use AF_XDP in SKB
>> >> mode on your side?
>> >
>> > Our use-case is to receive jumbo Ethernet frames up to 9000 bytes with
>> > AF_XDP in zero-copy mode. This patchset is a step in this direction.
>> > At the very least, it lets you test out the feature in SKB mode
>> > pending future driver support. Currently, XDP multi-buffer does not
>> > support AF_XDP at all. It could support it in theory, but I think it
>> > would need some UAPI design work and a bit of implementation work.
>> >
>> > Also, I think that the approach taken in this patchset has some
>> > advantages over XDP multi-buffer:
>> > (1) It should be possible to achieve higher performance
>> > (a) because the packet data is kept together
>> > (b) because you need to acquire and validate less descriptors
>> > and touch the queue pointers less often.
>> > (2) It is a nicer user-space API.
>> > (a) Since the packet data is all available in one linear
>> > buffer. This may even be a requirement to avoid an extra copy if the
>> > data must be handed off contiguously to other code.
>> >
>> > The disadvantage of this patchset is requiring the user to allocate
>> > HugeTLB pages which is an extra complication.
>> >
>> > I am not sure if this patchset would need to interact with XDP
>> > multi-buffer at all directly. Does anyone have anything to add here?
>>
>> Well, I'm mostly concerned with having two different operation and
>> configuration modes for the same thing. We'll probably need to support
>> multibuf for AF_XDP anyway for the non-ZC path, which means we'll need
>> to create a UAPI for that in any case. And having two APIs is just going
>> to be more complexity to handle at both the documentation and
>> maintenance level.
>
> One does not replace the other. We need them both, unfortunately.
> Multi-buff is great for e.g., stitching together different headers
> with the same data. Point to different buffers for the header in each
> packet but the same piece of data in all of them. This will never be
> solved with Kal's approach. We just need multi-buffer support for
> this. BTW, we are close to posting multi-buff support for AF_XDP. Just
> hang in there a little while longer while the last glitches are fixed.
> We have to stage it in two patch sets as it will be too long
> otherwise. First one will only contain improvements to the xsk
> selftests framework so that multi-buffer tests can be supported. The
> second one will be the core code and the actual multi-buffer tests.
Alright, sounds good!
> As for what Kal's patches are good for, please see below.
>
>> It *might* be worth it to do this if the performance benefit is really
>> compelling, but, well, you'd need to implement both and compare directly
>> to know that for sure :)
>
> The performance benefit is compelling. As I wrote in a mail to a post
> by Kal, there are users out there that state that this feature (for
> zero-copy mode nota bene) is a must for them to be able to use AF_XDP
> instead of DPDK style user-mode drivers. They have really tough
> latency requirements.
Hmm, okay, looking forward to seeing the benchmark results, then! :)
-Toke
next prev parent reply other threads:[~2023-04-12 22:50 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 13:02 [PATCH bpf-next v3 0/3] xsk: Support UMEM chunk_size > PAGE_SIZE Kal Conley
2023-04-06 13:02 ` [PATCH bpf-next v3 1/3] " Kal Conley
2023-04-06 18:38 ` Toke Høiland-Jørgensen
2023-04-07 16:28 ` Maciej Fijalkowski
2023-04-08 17:38 ` Kal Cutter Conley
2023-04-12 13:34 ` Toke Høiland-Jørgensen
2023-04-12 13:55 ` Magnus Karlsson
2023-04-12 22:49 ` Toke Høiland-Jørgensen [this message]
2023-04-13 10:56 ` Kal Cutter Conley
2023-04-13 11:08 ` Toke Høiland-Jørgensen
2023-04-13 12:43 ` Kal Cutter Conley
2023-04-13 20:49 ` Toke Høiland-Jørgensen
2023-04-13 22:06 ` Kal Cutter Conley
2023-04-13 22:28 ` Toke Høiland-Jørgensen
2023-04-14 9:08 ` Kal Cutter Conley
2023-04-17 12:13 ` Magnus Karlsson
2023-04-17 12:40 ` Toke Høiland-Jørgensen
2023-04-17 13:46 ` Kal Cutter Conley
2023-04-14 16:36 ` Kal Cutter Conley
2023-04-18 10:16 ` Toke Høiland-Jørgensen
2023-04-18 11:12 ` Kal Cutter Conley
2023-04-21 9:37 ` Maciej Fijalkowski
2023-04-21 9:54 ` Toke Høiland-Jørgensen
2023-04-21 12:27 ` Magnus Karlsson
2023-04-21 12:17 ` Magnus Karlsson
2023-04-21 15:27 ` Kal Cutter Conley
2023-04-06 13:02 ` [PATCH bpf-next v3 2/3] selftests: xsk: Use hugepages when umem->frame_size " Kal Conley
2023-04-06 13:02 ` [PATCH bpf-next v3 3/3] selftests: xsk: Add tests for 8K and 9K frame sizes Kal Conley
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=87ttxk1ztg.fsf@toke.dk \
--to=toke@redhat.com \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kal.conley@dectris.com \
--cc=kuba@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.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).