[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fda8ef3-0169-007f-147c-af8cb460758c@intel.com>
Date: Fri, 13 Sep 2019 13:17:30 +0200
From: Björn Töpel <bjorn.topel@...el.com>
To: "Laatz, Kevin" <kevin.laatz@...el.com>,
Björn Töpel <bjorn.topel@...il.com>
Cc: Netdev <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
"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 2019-09-13 12:21, Laatz, Kevin wrote:
> 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?
>
Fair enough! :-)
Acked-by: Björn Töpel <bjorn.topel@...el.com>
> Thanks,
> Kevin
>
Powered by blists - more mailing lists