Re: [PATCH bpf-next 02/14] libbpf: add bpf() syscall wrapper into public API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 1, 2021 at 9:01 AM Hengqi Chen <hengqi.chen@xxxxxxxxx> wrote:
>
>
>
> On 2021/10/30 12:59 PM, Andrii Nakryiko wrote:
> > Move internal sys_bpf() helper into bpf.h and expose as public API.
> > __NR_bpf definition logic is also moved. Renamed sys_bpf() into bpf() to
> > follow libbpf naming conventions. Adapt internal uses accordingly.
> >
> > Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
> > ---
> >  tools/lib/bpf/bpf.c | 76 ++++++++++++++-------------------------------
> >  tools/lib/bpf/bpf.h | 30 ++++++++++++++++++
> >  2 files changed, 54 insertions(+), 52 deletions(-)
> >
>
> A little confuse about this public API. Shouldn't it be annotated with
> LIBBPF_API attribute and go into libbpf.map ?

It's a `static inline` helper, so it's not in any exported libbpf
symbols, so no LIBBPF_API for that. But as I just replied to Alexei,
I'll just drop this change for now.

>
> BTW, these headers can now be removed from bpf.c:
>
>   #include <stdlib.h>
>   #include <string.h>
>   #include <memory.h>
>   #include <unistd.h>
>   #include <asm/unistd.h>
>   #include <errno.h>
>   #include <linux/bpf.h>
>   #include "libbpf.h"
>
>

[...]

Please trim irrelevant parts of quoted email in your replies.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux