[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <847dcd1e-81ba-4364-7242-d280a17f9244@intel.com>
Date: Fri, 13 Sep 2019 11:21:16 +0100
From: "Laatz, Kevin" <kevin.laatz@...el.com>
To: Björn Töpel <bjorn.topel@...il.com>
Cc: Netdev <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Björn Töpel <bjorn.topel@...el.com>,
"Karlsson, Magnus" <magnus.karlsson@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>,
Bruce Richardson <bruce.richardson@...el.com>,
ciara.loftus@...el.com, bpf <bpf@...r.kernel.org>
Subject: Re: [PATCH bpf-next] libbpf: add xsk_umem__adjust_offset
On 13/09/2019 05:59, Björn Töpel wrote:
> On Thu, 12 Sep 2019 at 17:47, Kevin Laatz <kevin.laatz@...el.com> wrote:
>> Currently, xsk_umem_adjust_offset exists as a kernel internal function.
>> This patch adds xsk_umem__adjust_offset to libbpf so that it can be used
>> from userspace. This will take the responsibility of properly storing the
>> offset away from the application, making it less error prone.
>>
>> Since xsk_umem__adjust_offset is called on a per-packet basis, we need to
>> inline the function to avoid any performance regressions. In order to
>> inline xsk_umem__adjust_offset, we need to add it to xsk.h. Unfortunately
>> this means that we can't dereference the xsk_umem_config struct directly
>> since it is defined only in xsk.c. We therefore add an extra API to return
>> the flags field to the user from the structure, and have the inline
>> function use this flags field directly.
>>
> Can you expand this to a series, with an additional patch where these
> functions are used in XDP socket sample application, so it's more
> clear for users?
These functions are currently not required in the xdpsock application and I think forcing them in would be messy :-). However, an example of the use of these functions could be seen in the DPDK AF_XDP PMD. There is a patch herehttp://patches.dpdk.org/patch/58624/ where we currently do the offset adjustment to the handle manually, but with this patch we could replace it with xsk_umem__adjust_offset and have a real use example of the functions being used.
Would this be enough for an example?
Thanks,
Kevin
Powered by blists - more mailing lists