All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, "Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Martin KaFai Lau" <kafai@fb.com>,
	"Song Liu" <songliubraving@fb.com>, "Yonghong Song" <yhs@fb.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"KP Singh" <kpsingh@kernel.org>, "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>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH] libbpf: export inline helpers as symbols for xsk
Date: Mon, 26 Apr 2021 16:20:04 -0700	[thread overview]
Message-ID: <CAEf4BzaDbVpLvbOnkTKtzHVGq74TfBprLuZ6fJtYqJ+jFZN+Gw@mail.gmail.com> (raw)
In-Reply-To: <20210426202240.518961-1-memxor@gmail.com>

On Mon, Apr 26, 2021 at 1:22 PM Kumar Kartikeya Dwivedi
<memxor@gmail.com> wrote:
>
> This helps people writing language bindings to not have to rewrite C
> wrappers for inline functions in the headers. We force inline the
> definition from the header for C and C++ consumers, but also export a
> symbol in the library for others. This keeps the performance
> advantages similar to using static inline, while also allowing tools
> like Rust's bindgen to generate wrappers for the functions.
>
> Also see
> https://lore.kernel.org/bpf/CAJ8uoz0QqR97qEYYK=VVCE9A=V=k2tKnH6wNM48jeak2RAmL0A@mail.gmail.com/
> for some context.
>
> Also see https://github.com/xdp-project/xdp-tools/pull/97 for more
> discussion on the same.
>
> extern inline is used as it's slightly better since it warns when an
> inline definition is missing.
>
> The fvisibility attribute goes on the inline definition, as essentially
> it acts as a declaration for the function, while the extern inline
> declaration ends up acting as a definition.
>
> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
> ---

xsk is moving into libxdp, why not do this there, instead of exporting
a lot of symbols that we'll be deprecating very soon. It will also
incentivise customers to make a move more promptly.

Bjorn, Magnus, what's the status of libxsk in libxdp?

>  tools/lib/bpf/libbpf.map | 16 ++++++++++++++
>  tools/lib/bpf/xsk.c      | 24 +++++++++++++++++++++
>  tools/lib/bpf/xsk.h      | 45 +++++++++++++++++++++++-----------------
>  3 files changed, 66 insertions(+), 19 deletions(-)
>

[...]

  reply	other threads:[~2021-04-26 23:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 20:22 [PATCH] libbpf: export inline helpers as symbols for xsk Kumar Kartikeya Dwivedi
2021-04-26 23:20 ` Andrii Nakryiko [this message]
2021-04-27  6:49   ` Magnus Karlsson
2021-04-27 18:05     ` Andrii Nakryiko

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=CAEf4BzaDbVpLvbOnkTKtzHVGq74TfBprLuZ6fJtYqJ+jFZN+Gw@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=john.fastabend@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=toke@redhat.com \
    --cc=yhs@fb.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.