BPF Archive on lore.kernel.org
 help / color / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
	Networking <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>
Subject: Re: [PATCH bpf-next] libbpf: make bpf_endian co-exist with vmlinux.h
Date: Mon, 29 Jun 2020 20:35:28 -0700
Message-ID: <CAEf4BzZdxvFwv11NKJGX4YzCtSHMs0i8nMMhOgxdU_mm0iHnow@mail.gmail.com> (raw)
In-Reply-To: <20200630030910.p7xnbnywofvzcr7r@ast-mbp.dhcp.thefacebook.com>

On Mon, Jun 29, 2020 at 8:09 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Mon, Jun 29, 2020 at 07:05:38PM -0700, Andrii Nakryiko wrote:
> > Copy over few #defines from UAPI swab.h header to make all the rest of
> > bpf_endian.h work and not rely on any extra headers. This way it can be used
> > both with linux header includes, as well with a vmlinux.h. This has been
> > a frequent complaint from users, that need this header.
> >
> > Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> > ---
> >  tools/lib/bpf/bpf_endian.h | 22 ++++++++++++++++++++--
> >  1 file changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/lib/bpf/bpf_endian.h b/tools/lib/bpf/bpf_endian.h
> > index fbe28008450f..a4be8a70845c 100644
> > --- a/tools/lib/bpf/bpf_endian.h
> > +++ b/tools/lib/bpf/bpf_endian.h
> > @@ -2,8 +2,26 @@
> >  #ifndef __BPF_ENDIAN__
> >  #define __BPF_ENDIAN__
> >
> > -#include <linux/stddef.h>
> > -#include <linux/swab.h>
> > +/* copied from include/uapi/linux/swab.h */
>
> You cannot just copy due to different licenses.

Ah, I see. I was thinking that because it's from UAPI header it might
be ok. Alright, I'll try to re-implement it instead.

      reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30  2:05 Andrii Nakryiko
2020-06-30  3:09 ` Alexei Starovoitov
2020-06-30  3:35   ` Andrii Nakryiko [this message]

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=CAEf4BzZdxvFwv11NKJGX4YzCtSHMs0i8nMMhOgxdU_mm0iHnow@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@fb.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    /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

BPF Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/bpf/0 bpf/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 bpf bpf/ https://lore.kernel.org/bpf \
		bpf@vger.kernel.org
	public-inbox-index bpf

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.bpf


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git