bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@intel.com>
To: "Laatz, Kevin" <kevin.laatz@intel.com>,
	"Björn Töpel" <bjorn.topel@gmail.com>
Cc: Netdev <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	ciara.loftus@intel.com, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next] libbpf: add xsk_umem__adjust_offset
Date: Fri, 13 Sep 2019 13:17:30 +0200	[thread overview]
Message-ID: <1fda8ef3-0169-007f-147c-af8cb460758c@intel.com> (raw)
In-Reply-To: <847dcd1e-81ba-4364-7242-d280a17f9244@intel.com>

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@intel.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@intel.com>

> Thanks,
> Kevin

  reply	other threads:[~2019-09-13 11:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  7:28 [PATCH bpf-next] libbpf: add xsk_umem__adjust_offset Kevin Laatz
2019-09-13  4:59 ` Björn Töpel
2019-09-13 10:21   ` Laatz, Kevin
2019-09-13 11:17     ` Björn Töpel [this message]
2019-09-13 22:49 ` Yonghong Song

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1fda8ef3-0169-007f-147c-af8cb460758c@intel.com \
    --to=bjorn.topel@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=bruce.richardson@intel.com \
    --cc=ciara.loftus@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=kevin.laatz@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \


* 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).