Re: [PATCH bpf-next v5 1/3] libbpf: add support for using AF_XDP sockets

2019-02-20 Thread Magnus Karlsson
On Thu, Feb 21, 2019 at 7:06 AM Ye Xiaolong wrote: > > Hi Magnus > > On 02/19, Magnus Karlsson wrote: > [snip] > >+static int xsk_setup_xdp_prog(struct xsk_socket *xsk) > >+{ > >+ bool prog_attached = false; > >+ __u32 prog_id = 0; > >+ int err; > >+ > >+ err = bpf_get_link_xdp

Re: [PATCH bpf-next v5 1/3] libbpf: add support for using AF_XDP sockets

2019-02-20 Thread Ye Xiaolong
Hi Magnus On 02/19, Magnus Karlsson wrote: [snip] >+static int xsk_setup_xdp_prog(struct xsk_socket *xsk) >+{ >+ bool prog_attached = false; >+ __u32 prog_id = 0; >+ int err; >+ >+ err = bpf_get_link_xdp_id(xsk->ifindex, &prog_id, >+xsk->config.x

[PATCH bpf-next v5 1/3] libbpf: add support for using AF_XDP sockets

2019-02-19 Thread Magnus Karlsson
This commit adds AF_XDP support to libbpf. The main reason for this is to facilitate writing applications that use AF_XDP by offering higher-level APIs that hide many of the details of the AF_XDP uapi. This is in the same vein as libbpf facilitates XDP adoption by offering easy-to-use higher level