All of lore.kernel.org
 help / color / mirror / Atom feed
* libbpf missing set_link_xdp_fd ?
@ 2017-09-24 18:07 Eric Leblond
  2017-09-25  9:25 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Leblond @ 2017-09-24 18:07 UTC (permalink / raw)
  To: xdp-newbies

Hello,

bpf_load is implementing the set_link_xdp_fd() function and it seems
this function is not available in libbpf.

Should it be the case or should it be part of another library ?

BR,
-- 
Eric Leblond <eric@regit.org>
Blog: https://home.regit.org/

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

* Re: libbpf missing set_link_xdp_fd ?
  2017-09-24 18:07 libbpf missing set_link_xdp_fd ? Eric Leblond
@ 2017-09-25  9:25 ` Jesper Dangaard Brouer
  2017-09-25  9:41   ` Daniel Borkmann
  2017-09-25 10:03   ` Wangnan (F)
  0 siblings, 2 replies; 7+ messages in thread
From: Jesper Dangaard Brouer @ 2017-09-25  9:25 UTC (permalink / raw)
  To: Eric Leblond
  Cc: xdp-newbies, brouer, wangnan0, Daniel Borkmann, Alexei Starovoitov

On Sun, 24 Sep 2017 20:07:11 +0200
Eric Leblond <eric@regit.org> wrote:

> Hello,
> 
> bpf_load is implementing the set_link_xdp_fd() function and it seems
> this function is not available in libbpf.

I also ran into this problem, when I wanted to switch my XDP programs
into using tools/lib/bpf/.

E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763

> Should it be the case or should it be part of another library ?

I'm not sure... maybe Alexei, Daniel or Wang have an opinion?

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer

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

* Re: libbpf missing set_link_xdp_fd ?
  2017-09-25  9:25 ` Jesper Dangaard Brouer
@ 2017-09-25  9:41   ` Daniel Borkmann
  2017-09-25 11:02     ` Daniel Borkmann
  2017-09-25 10:03   ` Wangnan (F)
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Borkmann @ 2017-09-25  9:41 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Eric Leblond
  Cc: xdp-newbies, wangnan0, Daniel Borkmann, Alexei Starovoitov

On 09/25/2017 11:25 AM, Jesper Dangaard Brouer wrote:
> On Sun, 24 Sep 2017 20:07:11 +0200
> Eric Leblond <eric@regit.org> wrote:
>
>> Hello,
>>
>> bpf_load is implementing the set_link_xdp_fd() function and it seems
>> this function is not available in libbpf.
>
> I also ran into this problem, when I wanted to switch my XDP programs
> into using tools/lib/bpf/.

Right.

> E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763
>
>> Should it be the case or should it be part of another library ?
>
> I'm not sure... maybe Alexei, Daniel or Wang have an opinion?

It seems that none of the actual attach infra is handled in
tools/lib/bpf/, meaning neither attaching the fd to kprobes/
uprobes/tracepoints nor tc or xdp, so adding a special case
only for xdp into the lib feels that we probably might be better
off putting this either into its own mini lib on top of that,
or as a small helper included in the samples / selftests and
the like where its needed.

Best,
Daniel

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

* Re: libbpf missing set_link_xdp_fd ?
  2017-09-25  9:25 ` Jesper Dangaard Brouer
  2017-09-25  9:41   ` Daniel Borkmann
@ 2017-09-25 10:03   ` Wangnan (F)
  1 sibling, 0 replies; 7+ messages in thread
From: Wangnan (F) @ 2017-09-25 10:03 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Eric Leblond
  Cc: xdp-newbies, Daniel Borkmann, Alexei Starovoitov



On 2017/9/25 17:25, Jesper Dangaard Brouer wrote:
> On Sun, 24 Sep 2017 20:07:11 +0200
> Eric Leblond <eric@regit.org> wrote:
>
>> Hello,
>>
>> bpf_load is implementing the set_link_xdp_fd() function and it seems
>> this function is not available in libbpf.
> I also ran into this problem, when I wanted to switch my XDP programs
> into using tools/lib/bpf/.
>
> E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763
>
>> Should it be the case or should it be part of another library ?
> I'm not sure... maybe Alexei, Daniel or Wang have an opinion?
>

tools/lib/bpf is aiming at provide a better way to parse bpf object file,
load bpf program and maps. It doesn't operate link layer. set_link_xdp_fd()
and other socket and link related functions are better to be implement
separately. Two choices: 1. Move them into a library in samples/bpf.
2. make libbpf support XDP. The second choice looks good, but I'm
not familiar with XDP API and don't know how to give a good abstraction.

In my opinion it should be part of another library.

Thank you.

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

* Re: libbpf missing set_link_xdp_fd ?
  2017-09-25  9:41   ` Daniel Borkmann
@ 2017-09-25 11:02     ` Daniel Borkmann
  2017-09-25 16:01       ` Alexei Starovoitov
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Borkmann @ 2017-09-25 11:02 UTC (permalink / raw)
  To: Jesper Dangaard Brouer, Eric Leblond
  Cc: xdp-newbies, wangnan0, Daniel Borkmann, Alexei Starovoitov

On 09/25/2017 11:41 AM, Daniel Borkmann wrote:
> On 09/25/2017 11:25 AM, Jesper Dangaard Brouer wrote:
>> On Sun, 24 Sep 2017 20:07:11 +0200
>> Eric Leblond <eric@regit.org> wrote:
>>
>>> Hello,
>>>
>>> bpf_load is implementing the set_link_xdp_fd() function and it seems
>>> this function is not available in libbpf.
>>
>> I also ran into this problem, when I wanted to switch my XDP programs
>> into using tools/lib/bpf/.
>
> Right.
>
>> E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763
>>
>>> Should it be the case or should it be part of another library ?
>>
>> I'm not sure... maybe Alexei, Daniel or Wang have an opinion?
>
> It seems that none of the actual attach infra is handled in
> tools/lib/bpf/, meaning neither attaching the fd to kprobes/
> uprobes/tracepoints nor tc or xdp, so adding a special case
> only for xdp into the lib feels that we probably might be better
> off putting this either into its own mini lib on top of that,

That could potentially go to tools/lib/xdp/, probably would be
the best option.

> or as a small helper included in the samples / selftests and
> the like where its needed.
>
> Best,
> Daniel

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

* Re: libbpf missing set_link_xdp_fd ?
  2017-09-25 11:02     ` Daniel Borkmann
@ 2017-09-25 16:01       ` Alexei Starovoitov
  2017-09-25 19:39         ` Daniel Borkmann
  0 siblings, 1 reply; 7+ messages in thread
From: Alexei Starovoitov @ 2017-09-25 16:01 UTC (permalink / raw)
  To: Daniel Borkmann
  Cc: Jesper Dangaard Brouer, Eric Leblond, xdp-newbies, wangnan0,
	Daniel Borkmann

On Mon, Sep 25, 2017 at 01:02:04PM +0200, Daniel Borkmann wrote:
> On 09/25/2017 11:41 AM, Daniel Borkmann wrote:
> > On 09/25/2017 11:25 AM, Jesper Dangaard Brouer wrote:
> > > On Sun, 24 Sep 2017 20:07:11 +0200
> > > Eric Leblond <eric@regit.org> wrote:
> > > 
> > > > Hello,
> > > > 
> > > > bpf_load is implementing the set_link_xdp_fd() function and it seems
> > > > this function is not available in libbpf.
> > > 
> > > I also ran into this problem, when I wanted to switch my XDP programs
> > > into using tools/lib/bpf/.
> > 
> > Right.
> > 
> > > E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763
> > > 
> > > > Should it be the case or should it be part of another library ?
> > > 
> > > I'm not sure... maybe Alexei, Daniel or Wang have an opinion?
> > 
> > It seems that none of the actual attach infra is handled in
> > tools/lib/bpf/, meaning neither attaching the fd to kprobes/
> > uprobes/tracepoints nor tc or xdp, so adding a special case
> > only for xdp into the lib feels that we probably might be better
> > off putting this either into its own mini lib on top of that,
> 
> That could potentially go to tools/lib/xdp/, probably would be
> the best option.

I'm afraid it may spiral out of control.
If we create such dirs, we'd need one for xdp, tc, cgroup, tracepoint, kprobe.
Differentiating the libraries by type of attach point is imo too fine grained.

Why not to put everything into toos/lib/bpf ?
New file for netlink stuff is easy enough and we can gatekeep it with
some knob in the Makefile, so perf build won't need to include it.

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

* Re: libbpf missing set_link_xdp_fd ?
  2017-09-25 16:01       ` Alexei Starovoitov
@ 2017-09-25 19:39         ` Daniel Borkmann
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Borkmann @ 2017-09-25 19:39 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Jesper Dangaard Brouer, Eric Leblond, xdp-newbies, wangnan0,
	Daniel Borkmann

On 09/25/2017 06:01 PM, Alexei Starovoitov wrote:
> On Mon, Sep 25, 2017 at 01:02:04PM +0200, Daniel Borkmann wrote:
>> On 09/25/2017 11:41 AM, Daniel Borkmann wrote:
>>> On 09/25/2017 11:25 AM, Jesper Dangaard Brouer wrote:
>>>> On Sun, 24 Sep 2017 20:07:11 +0200
>>>> Eric Leblond <eric@regit.org> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> bpf_load is implementing the set_link_xdp_fd() function and it seems
>>>>> this function is not available in libbpf.
>>>>
>>>> I also ran into this problem, when I wanted to switch my XDP programs
>>>> into using tools/lib/bpf/.
>>>
>>> Right.
>>>
>>>> E.g.: https://github.com/netoptimizer/prototype-kernel/commit/5397e596c30416763
>>>>
>>>>> Should it be the case or should it be part of another library ?
>>>>
>>>> I'm not sure... maybe Alexei, Daniel or Wang have an opinion?
>>>
>>> It seems that none of the actual attach infra is handled in
>>> tools/lib/bpf/, meaning neither attaching the fd to kprobes/
>>> uprobes/tracepoints nor tc or xdp, so adding a special case
>>> only for xdp into the lib feels that we probably might be better
>>> off putting this either into its own mini lib on top of that,
>>
>> That could potentially go to tools/lib/xdp/, probably would be
>> the best option.
>
> I'm afraid it may spiral out of control.
> If we create such dirs, we'd need one for xdp, tc, cgroup, tracepoint, kprobe.
> Differentiating the libraries by type of attach point is imo too fine grained.
>
> Why not to put everything into toos/lib/bpf ?
> New file for netlink stuff is easy enough and we can gatekeep it with
> some knob in the Makefile, so perf build won't need to include it.

Personally, I don't really have a strong opinion on that. This could
probably be made a bit modular for each attach handler with the option
to compile some of them out if not desired, so could work as well.

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

end of thread, other threads:[~2017-09-25 19:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-24 18:07 libbpf missing set_link_xdp_fd ? Eric Leblond
2017-09-25  9:25 ` Jesper Dangaard Brouer
2017-09-25  9:41   ` Daniel Borkmann
2017-09-25 11:02     ` Daniel Borkmann
2017-09-25 16:01       ` Alexei Starovoitov
2017-09-25 19:39         ` Daniel Borkmann
2017-09-25 10:03   ` Wangnan (F)

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.