All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf] libbpf: add libbpf_util.h to header install.
@ 2019-05-02 18:33 William Tu
  2019-05-02 20:18 ` Y Song
  0 siblings, 1 reply; 5+ messages in thread
From: William Tu @ 2019-05-02 18:33 UTC (permalink / raw)
  To: ast, daniel, netdev, bpf, magnus.karlsson, blp

The libbpf_util.h is used by xsk.h, so add it to
the install headers.

Reported-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: William Tu <u9012063@gmail.com>
---
 tools/lib/bpf/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index c6c06bc6683c..f91639bf5650 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -230,6 +230,7 @@ install_headers:
 		$(call do_install,bpf.h,$(prefix)/include/bpf,644); \
 		$(call do_install,libbpf.h,$(prefix)/include/bpf,644); \
 		$(call do_install,btf.h,$(prefix)/include/bpf,644); \
+		$(call do_install,libbpf_util.h,$(prefix)/include/bpf,644); \
 		$(call do_install,xsk.h,$(prefix)/include/bpf,644);
 
 install_pkgconfig: $(PC_FILE)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.
  2019-05-02 18:33 [PATCH bpf] libbpf: add libbpf_util.h to header install William Tu
@ 2019-05-02 20:18 ` Y Song
  2019-05-03 19:53   ` William Tu
  0 siblings, 1 reply; 5+ messages in thread
From: Y Song @ 2019-05-02 20:18 UTC (permalink / raw)
  To: William Tu
  Cc: Alexei Starovoitov, Daniel Borkmann, netdev, bpf, Magnus Karlsson, blp

On Thu, May 2, 2019 at 11:34 AM William Tu <u9012063@gmail.com> wrote:
>
> The libbpf_util.h is used by xsk.h, so add it to
> the install headers.

Can we try to change code a little bit to avoid exposing libbpf_util.h?
Originally libbpf_util.h is considered as libbpf internal.
I am not strongly against this patch. But would really like to see
whether we have an alternative not exposing libbpf_util.h.

>
> Reported-by: Ben Pfaff <blp@ovn.org>
> Signed-off-by: William Tu <u9012063@gmail.com>
> ---
>  tools/lib/bpf/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index c6c06bc6683c..f91639bf5650 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -230,6 +230,7 @@ install_headers:
>                 $(call do_install,bpf.h,$(prefix)/include/bpf,644); \
>                 $(call do_install,libbpf.h,$(prefix)/include/bpf,644); \
>                 $(call do_install,btf.h,$(prefix)/include/bpf,644); \
> +               $(call do_install,libbpf_util.h,$(prefix)/include/bpf,644); \
>                 $(call do_install,xsk.h,$(prefix)/include/bpf,644);
>
>  install_pkgconfig: $(PC_FILE)
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.
  2019-05-02 20:18 ` Y Song
@ 2019-05-03 19:53   ` William Tu
  2019-05-03 21:09     ` Y Song
  0 siblings, 1 reply; 5+ messages in thread
From: William Tu @ 2019-05-03 19:53 UTC (permalink / raw)
  To: Y Song
  Cc: Alexei Starovoitov, Daniel Borkmann, netdev, bpf,
	Magnus Karlsson, Ben Pfaff

On Thu, May 2, 2019 at 1:18 PM Y Song <ys114321@gmail.com> wrote:
>
> On Thu, May 2, 2019 at 11:34 AM William Tu <u9012063@gmail.com> wrote:
> >
> > The libbpf_util.h is used by xsk.h, so add it to
> > the install headers.
>
> Can we try to change code a little bit to avoid exposing libbpf_util.h?
> Originally libbpf_util.h is considered as libbpf internal.
> I am not strongly against this patch. But would really like to see
> whether we have an alternative not exposing libbpf_util.h.
>

The commit b7e3a28019c92ff ("libbpf: remove dependency on barrier.h in xsk.h")
adds the dependency of libbpf_util.h to xsk.h.
How about we move the libbpf_smp_* into the xsk.h, since they are
used only by xsk.h.

Regards,
William

> >
> > Reported-by: Ben Pfaff <blp@ovn.org>
> > Signed-off-by: William Tu <u9012063@gmail.com>
> > ---
> >  tools/lib/bpf/Makefile | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> > index c6c06bc6683c..f91639bf5650 100644
> > --- a/tools/lib/bpf/Makefile
> > +++ b/tools/lib/bpf/Makefile
> > @@ -230,6 +230,7 @@ install_headers:
> >                 $(call do_install,bpf.h,$(prefix)/include/bpf,644); \
> >                 $(call do_install,libbpf.h,$(prefix)/include/bpf,644); \
> >                 $(call do_install,btf.h,$(prefix)/include/bpf,644); \
> > +               $(call do_install,libbpf_util.h,$(prefix)/include/bpf,644); \
> >                 $(call do_install,xsk.h,$(prefix)/include/bpf,644);
> >
> >  install_pkgconfig: $(PC_FILE)
> > --
> > 2.7.4
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.
  2019-05-03 19:53   ` William Tu
@ 2019-05-03 21:09     ` Y Song
  2019-05-05  7:08       ` Alexei Starovoitov
  0 siblings, 1 reply; 5+ messages in thread
From: Y Song @ 2019-05-03 21:09 UTC (permalink / raw)
  To: William Tu
  Cc: Alexei Starovoitov, Daniel Borkmann, netdev, bpf,
	Magnus Karlsson, Ben Pfaff

On Fri, May 3, 2019 at 12:54 PM William Tu <u9012063@gmail.com> wrote:
>
> On Thu, May 2, 2019 at 1:18 PM Y Song <ys114321@gmail.com> wrote:
> >
> > On Thu, May 2, 2019 at 11:34 AM William Tu <u9012063@gmail.com> wrote:
> > >
> > > The libbpf_util.h is used by xsk.h, so add it to
> > > the install headers.
> >
> > Can we try to change code a little bit to avoid exposing libbpf_util.h?
> > Originally libbpf_util.h is considered as libbpf internal.
> > I am not strongly against this patch. But would really like to see
> > whether we have an alternative not exposing libbpf_util.h.
> >
>
> The commit b7e3a28019c92ff ("libbpf: remove dependency on barrier.h in xsk.h")
> adds the dependency of libbpf_util.h to xsk.h.
> How about we move the libbpf_smp_* into the xsk.h, since they are
> used only by xsk.h.

Okay. Looks like the libbpf_smp_* is used in some static inline functions
which are also API functions.

Probably having libbpf_smp_* in libbpf_util.h is a better choice as these
primitives can be used by other .c files in tools/lib/bpf.

On the other hand, exposing macros pr_warning(), pr_info() and
pr_debug() may not
be a bad thing as user can use them with the same debug level used by
libbpf itself.

Ack your original patch:
Acked-by: Yonghong Song <yhs@fb.com>

>
> Regards,
> William
>
> > >
> > > Reported-by: Ben Pfaff <blp@ovn.org>
> > > Signed-off-by: William Tu <u9012063@gmail.com>
> > > ---
> > >  tools/lib/bpf/Makefile | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> > > index c6c06bc6683c..f91639bf5650 100644
> > > --- a/tools/lib/bpf/Makefile
> > > +++ b/tools/lib/bpf/Makefile
> > > @@ -230,6 +230,7 @@ install_headers:
> > >                 $(call do_install,bpf.h,$(prefix)/include/bpf,644); \
> > >                 $(call do_install,libbpf.h,$(prefix)/include/bpf,644); \
> > >                 $(call do_install,btf.h,$(prefix)/include/bpf,644); \
> > > +               $(call do_install,libbpf_util.h,$(prefix)/include/bpf,644); \
> > >                 $(call do_install,xsk.h,$(prefix)/include/bpf,644);
> > >
> > >  install_pkgconfig: $(PC_FILE)
> > > --
> > > 2.7.4
> > >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf] libbpf: add libbpf_util.h to header install.
  2019-05-03 21:09     ` Y Song
@ 2019-05-05  7:08       ` Alexei Starovoitov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexei Starovoitov @ 2019-05-05  7:08 UTC (permalink / raw)
  To: Y Song
  Cc: William Tu, Alexei Starovoitov, Daniel Borkmann, netdev, bpf,
	Magnus Karlsson, Ben Pfaff

On Fri, May 3, 2019 at 2:09 PM Y Song <ys114321@gmail.com> wrote:
>
> On Fri, May 3, 2019 at 12:54 PM William Tu <u9012063@gmail.com> wrote:
> >
> > On Thu, May 2, 2019 at 1:18 PM Y Song <ys114321@gmail.com> wrote:
> > >
> > > On Thu, May 2, 2019 at 11:34 AM William Tu <u9012063@gmail.com> wrote:
> > > >
> > > > The libbpf_util.h is used by xsk.h, so add it to
> > > > the install headers.
> > >
> > > Can we try to change code a little bit to avoid exposing libbpf_util.h?
> > > Originally libbpf_util.h is considered as libbpf internal.
> > > I am not strongly against this patch. But would really like to see
> > > whether we have an alternative not exposing libbpf_util.h.
> > >
> >
> > The commit b7e3a28019c92ff ("libbpf: remove dependency on barrier.h in xsk.h")
> > adds the dependency of libbpf_util.h to xsk.h.
> > How about we move the libbpf_smp_* into the xsk.h, since they are
> > used only by xsk.h.
>
> Okay. Looks like the libbpf_smp_* is used in some static inline functions
> which are also API functions.
>
> Probably having libbpf_smp_* in libbpf_util.h is a better choice as these
> primitives can be used by other .c files in tools/lib/bpf.
>
> On the other hand, exposing macros pr_warning(), pr_info() and
> pr_debug() may not
> be a bad thing as user can use them with the same debug level used by
> libbpf itself.
>
> Ack your original patch:
> Acked-by: Yonghong Song <yhs@fb.com>

Applied. Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-05  7:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02 18:33 [PATCH bpf] libbpf: add libbpf_util.h to header install William Tu
2019-05-02 20:18 ` Y Song
2019-05-03 19:53   ` William Tu
2019-05-03 21:09     ` Y Song
2019-05-05  7:08       ` Alexei Starovoitov

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.