[PATCH bpf-next v8 4/5] libbpf: add missing SPDX-License-Identifier

2018-01-30 Thread Eric Leblond
Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 9c88f6e4156d

[PATCH bpf-next v8 2/5] libbpf: add function to setup XDP

2018-01-30 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 122 + tools/lib/bpf/libbpf.c | 2 + tools/lib

[PATCH bpf-next v8 3/5] libbpf: add error reporting in XDP

2018-01-30 Thread Eric Leblond
inclusion. Using a direct define could have been an issue as NLMSGERR_ATTR_MAX can change in the future. We also define SOL_NETLINK if not defined to avoid to have to copy socket.h for a fixed value. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- samples/bpf/Makefile | 2 +- tools/lib

[PATCH bpf-next v8 5/5] samples/bpf: use bpf_set_link_xdp_fd

2018-01-30 Thread Eric Leblond
Use bpf_set_link_xdp_fd instead of set_link_xdp_fd to remove some code duplication and benefit of netlink ext ack errors message. Signed-off-by: Eric Leblond --- samples/bpf/bpf_load.c | 102 samples/bpf/bpf_load.h | 2 +- samples

[PATCH bpf-next v8 1/5] tools: add netlink.h and if_link.h in tools uapi

2018-01-30 Thread Eric Leblond
The headers are necessary for libbpf compilation on system with older version of the headers. Signed-off-by: Eric Leblond --- tools/include/uapi/linux/if_link.h | 943 + tools/include/uapi/linux/netlink.h | 251 ++ tools/lib/bpf/Makefile

[PATCH bpf-next v8 0/5] libbpf: add XDP binding support

2018-01-30 Thread Eric Leblond
Hello Daniel, No problem with the delay in the answer. I'm doing far worse. Here is an updated version: - add if_link.h in uapi and remove the definition - fix a commit message - remove uapi from a include Best Regards, -- Eric

Re: [PATCH bpf-next v7 3/5] libbpf: add error reporting in XDP

2018-01-27 Thread Eric Leblond
Hi, On Sat, 2018-01-27 at 02:28 +0100, Daniel Borkmann wrote: > On 01/25/2018 01:05 AM, Eric Leblond wrote: > > Parse netlink ext attribute to get the error message returned by > > the card. Code is partially take from libnl. > > > > We add netlink.h to the uapi inclu

Re: [PATCH bpf-next v7 2/5] libbpf: add function to setup XDP

2018-01-27 Thread Eric Leblond
Hi, On Sat, 2018-01-27 at 02:23 +0100, Daniel Borkmann wrote: > On 01/25/2018 01:05 AM, Eric Leblond wrote: > > Most of the code is taken from set_link_xdp_fd() in bpf_load.c and > > slightly modified to be library compliant. > > > > Signed-off-by: Eric Leblond >

[PATCH bpf-next v7 4/5] libbpf: add missing SPDX-License-Identifier

2018-01-24 Thread Eric Leblond
Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 765fd95b0657

[PATCH bpf-next v7 3/5] libbpf: add error reporting in XDP

2018-01-24 Thread Eric Leblond
inclusion. Using a direct define could have been an issue as NLMSGERR_ATTR_MAX can change in the future. We also define SOL_NETLINK if not defined to avoid to have to copy socket.h for a fixed value. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov remote rtne Signed-off-by: Eric Leblond

[PATCH bpf-next v7 1/5] tools: import netlink header in tools uapi

2018-01-24 Thread Eric Leblond
The header is necessary for libbpf compilation on system with older version of the headers. Signed-off-by: Eric Leblond --- tools/include/uapi/linux/netlink.h | 251 + tools/lib/bpf/Makefile | 3 + 2 files changed, 254 insertions(+) create mode

[PATCH bpf-next v7 0/5] libbpf: add XDP setup support

2018-01-24 Thread Eric Leblond
Hello, This patchset fixes the problem found by Alexei when building libbpf on a system with old headers. It has been tested on an old Ubuntu and seems to behave fine. Best regards, -- Eric

[PATCH bpf-next v7 2/5] libbpf: add function to setup XDP

2018-01-24 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 127 + tools/lib/bpf/libbpf.c | 2 + tools/lib

[PATCH bpf-next v7 5/5] samples/bpf: use bpf_set_link_xdp_fd

2018-01-24 Thread Eric Leblond
Use bpf_set_link_xdp_fd instead of set_link_xdp_fd to remove some code duplication and benefit of netlink ext ack errors message. Signed-off-by: Eric Leblond --- samples/bpf/bpf_load.c | 102 samples/bpf/bpf_load.h | 2 +- samples

[PATCH bpf-next v6 2/4] libbpf: add error reporting in XDP

2018-01-18 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Code is partially take from libnl. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- samples/bpf/Makefile | 2 +- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 8 +++ tools/lib/bpf/nlattr.c

[PATCH bpf-next v6 1/4] libbpf: add function to setup XDP

2018-01-18 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 126 + tools/lib/bpf/libbpf.c | 2 + tools/lib

[PATCH bpf-next 0/4] libbpf: add XDP binding support

2018-01-18 Thread Eric Leblond
Hello, This patchset rebases the libbpf code on latest bpf-next code and addresses remarks by Daniel. Best regards, -- Eric Leblond

[PATCH bpf-next v6 4/4] samples/bpf: use bpf_set_link_xdp_fd

2018-01-18 Thread Eric Leblond
Use bpf_set_link_xdp_fd instead of set_link_xdp_fd to remove some code duplication and benefit of netlink ext ack errors message. Signed-off-by: Eric Leblond --- samples/bpf/bpf_load.c | 102 samples/bpf/bpf_load.h | 2 +- samples

[PATCH bpf-next v6 3/4] libbpf: add missing SPDX-License-Identifier

2018-01-18 Thread Eric Leblond
Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 4517dce6849d

Re: [PATCH bpf-next v5 2/4] libbpf: add error reporting in XDP

2018-01-18 Thread Eric Leblond
Hi, Sorry for the delay, missed the mail. On Sat, 2018-01-06 at 22:16 +0100, Daniel Borkmann wrote: > On 01/04/2018 09:21 AM, Eric Leblond wrote: > > Parse netlink ext attribute to get the error message returned by > > the card. Code is partially take from libnl. > > &g

[PATCH bpf-next v5 4/4] samples/bpf: use bpf_set_link_xdp_fd

2018-01-04 Thread Eric Leblond
Use bpf_set_link_xdp_fd instead of set_link_xdp_fd to remove some code duplication and benefit of netlink ext ack errors message. Signed-off-by: Eric Leblond --- samples/bpf/bpf_load.c | 102 samples/bpf/bpf_load.h | 2 +- samples

[PATCH bpf-next v5 3/4] libbpf: add missing SPDX-License-Identifier

2018-01-04 Thread Eric Leblond
Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 10d71b9fdbd0

[PATCH bpf-next v5 2/4] libbpf: add error reporting in XDP

2018-01-04 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Code is partially take from libnl. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- samples/bpf/Makefile | 2 +- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 10 ++- tools/lib/bpf/nlattr.c

[PATCH bpf-next v5 1/4] libbpf: add function to setup XDP

2018-01-04 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 126 + tools/lib/bpf/libbpf.c | 2 + tools/lib

Re: [PATCH bpf-next v4 1/3] libbpf: add function to setup XDP

2018-01-03 Thread Eric Leblond
Hello, On Sat, 2017-12-30 at 21:41 +0100, Eric Leblond wrote: > Most of the code is taken from set_link_xdp_fd() in bpf_load.c and > slightly modified to be library compliant. I've just discovered this patch is breaking the build of samples/bpf/ (nlattr not included at least and so

[PATCH bpf-next v4 3/3] libbpf: add missing SPDX-License-Identifier

2017-12-30 Thread Eric Leblond
Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index ceb20c5cae3b

[PATCH bpf-next v4 2/3] libbpf: add error reporting in XDP

2017-12-30 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Code is partially take from libnl. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 10 ++- tools/lib/bpf/nlattr.c | 187

[PATCH bpf-next v4 1/3] libbpf: add function to setup XDP

2017-12-30 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 126 - tools/lib/bpf/libbpf.c | 2 + tools/lib

[PATCH bpf-next v4 0/3] libbpf: add function to setup XDP

2017-12-30 Thread Eric Leblond
Hello, This updated patchset address the remarks by Toshiaki Makita and Philippe Ombredanne: - fixes on errno handling - correct usage of SPDX header Best regards, -- Eric Leblond

[PATCH bpf-next v3 3/3] libbpf: add missing SPDX-License-Identifier

2017-12-28 Thread Eric Leblond
Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index cdfabbe118cc

[PATCH bpf-next v3 0/3] libbpf: add XDP setup support

2017-12-28 Thread Eric Leblond
Hello, This patchset adds support for loading eBPF code as XDP filter. Best regards, -- Eric Leblond

[PATCH bpf-next v3 1/3] libbpf: add function to setup XDP

2017-12-28 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/bpf.c| 126 - tools/lib/bpf/libbpf.c | 2 + tools/lib

[PATCH bpf-next v3 2/3] libbpf: add error reporting in XDP

2017-12-28 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Code is partially take from libnl. Signed-off-by: Eric Leblond Acked-by: Alexei Starovoitov --- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 9 +++ tools/lib/bpf/nlattr.c | 187

Re: [PATCH 3/4] libbpf: break loop earlier

2017-12-27 Thread Eric Leblond
Hello, On Wed, 2017-12-27 at 11:00 -0800, Alexei Starovoitov wrote: > On Wed, Dec 27, 2017 at 07:02:28PM +0100, Eric Leblond wrote: > > Get out of the loop when we have a match. > > > > Signed-off-by: Eric Leblond > > --- > > tools/lib/bpf/libbpf.c | 1 +

[PATCH 3/4] libbpf: break loop earlier

2017-12-27 Thread Eric Leblond
Get out of the loop when we have a match. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 5fe8aaa2123e..d263748aa341 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c

[PATCH 4/4] libbpf: add missing SPDX-License-Identifier

2017-12-27 Thread Eric Leblond
Signed-off-by: Eric Leblond --- tools/lib/bpf/bpf.c| 2 ++ tools/lib/bpf/bpf.h| 2 ++ tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index cdfabbe118cc..9e53dbbca2bd 100644 --- a/tools

[PATCH 2/4] libbpf: add error reporting in XDP

2017-12-27 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Code is partially take from libnl. Signed-off-by: Eric Leblond --- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 9 +++ tools/lib/bpf/nlattr.c | 187 + tools

[PATCH 1/4] libbpf: add function to setup XDP

2017-12-27 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond --- tools/lib/bpf/bpf.c| 126 - tools/lib/bpf/libbpf.c | 2 + tools/lib/bpf/libbpf.h | 4 ++ 3 files

[PATCH bpf-next v2 0/4] libbpf: add function to setup XDP

2017-12-27 Thread Eric Leblond
Hello, This patchset address the remark about license. It now uses libnl code as a base for the netlink parsing. The library seems to report error correctly when used over a netdevsim interface. I did not manage to test it on a real hardware. Best regards, -- Eric Leblond

[PATCH bpf-next 0/3] add XDP loading support to libbpf

2017-12-25 Thread Eric Leblond
Hello, This patchset adds a function to load XDP eBPF file in the libbpf library. It gets the netlink extended ack from the driver in case of failure and print the error to stderr. Best regards, -- Eric Leblond

[PATCH bpf-next 3/3] libbpf: break loop earlier

2017-12-25 Thread Eric Leblond
Get out of the loop when we have a match. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 5fe8aaa2123e..d263748aa341 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c

[PATCH bpf-next 2/3] libbpf: add error reporting in XDP

2017-12-25 Thread Eric Leblond
Parse netlink ext attribute to get the error message returned by the card. Signed-off-by: Eric Leblond --- tools/lib/bpf/Build| 2 +- tools/lib/bpf/bpf.c| 9 +++ tools/lib/bpf/nlattr.c | 188 + tools/lib/bpf/nlattr.h | 164

[PATCH bpf-next 1/3] libbpf: add function to setup XDP

2017-12-25 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond --- tools/lib/bpf/bpf.c| 126 - tools/lib/bpf/libbpf.c | 2 + tools/lib/bpf/libbpf.h | 4 ++ 3 files

Re: [PATCH net-next] libbpf: add function to setup XDP

2017-12-10 Thread Eric Leblond
Hello, On Sat, 2017-12-09 at 15:57 -0800, Jakub Kicinski wrote: > On Sat, 9 Dec 2017 15:43:15 +0100, Eric Leblond wrote: > > + for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); > > +nh = NLMSG_NEXT(nh, len)) { > > + if (nh

[PATCH net-next] libbpf: add function to setup XDP

2017-12-09 Thread Eric Leblond
Most of the code is taken from set_link_xdp_fd() in bpf_load.c and slightly modified to be library compliant. Signed-off-by: Eric Leblond --- tools/lib/bpf/bpf.c| 108 - tools/lib/bpf/libbpf.c | 2 + tools/lib/bpf/libbpf.h | 4 ++ 3 files

[tip:perf/core] tools lib bpf: Fix maps resolution

2016-11-25 Thread tip-bot for Eric Leblond
Commit-ID: 4708bbda5cb2f6cdc331744597527143f46394d5 Gitweb: http://git.kernel.org/tip/4708bbda5cb2f6cdc331744597527143f46394d5 Author: Eric Leblond AuthorDate: Tue, 15 Nov 2016 04:05:47 + Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 25 Nov 2016 11:27:33 -0300 tools lib bpf

Re: [PATCH 7/8] tools lib bpf: fix maps resolution

2016-11-07 Thread Eric Leblond
s patch 7/8 into my local code base and send to Arnaldo > with my other patches. If ok with you, I propose that you collect patch 7/8 it you have no news from me on Friday. If an issue for you, just collect it now and I will synchronize with updated code when resending my patchset. BR, -- Eric Leblond Blog: https://home.regit.org/

[PATCH 6/8] tools lib bpf: improve warning

2016-10-16 Thread Eric Leblond
Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 7cd341e..1fe4532 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -802,7 +802,8

[PATCH 4/8] tools lib bpf: export function to set type

2016-10-16 Thread Eric Leblond
Current API was not allowing the user to set a type like socket filter. To avoid a setter function for each type, the patch simply exports a set function that takes the type in parameter. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 19 +-- tools/lib/bpf/libbpf.h

[PATCH 0/8] tools lib bpf: fixes and functional upgrade

2016-10-16 Thread Eric Leblond
ols/lib/bpf/libbpf.h | 12 +++- 7 files changed, 166 insertions(+), 34 deletions(-) Best regards, -- Eric Leblond

[PATCH 1/8] tools lib bpf: add error functions

2016-10-16 Thread Eric Leblond
s API. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 11 +++ tools/lib/bpf/libbpf.h | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index b699aea..90932f1 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/li

[PATCH 3/8] tools: Sync tools/include/uapi/linux/bpf.h with the kernel

2016-10-16 Thread Eric Leblond
Signed-off-by: Eric Leblond --- tools/include/uapi/linux/bpf.h | 52 ++ 1 file changed, 52 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 9e5fc16..570287f 100644 --- a/tools/include/uapi/linux/bpf.h +++ b

[PATCH 7/8] tools lib bpf: fix maps resolution

2016-10-16 Thread Eric Leblond
It is not correct to assimilate the elf data of the maps section to an array of map definition. In fact the sizes differ. The offset provided in the symbol section has to be used instead. This patch fixes a bug causing a elf with two maps not to load correctly. Signed-off-by: Eric Leblond

[PATCH 8/8] tools lib bpf: install header file

2016-10-16 Thread Eric Leblond
Makefile was not installing the header file of the library and a manual copy was needed to have a usable library on the system. Signed-off-by: Eric Leblond --- tools/lib/bpf/Makefile | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/lib/bpf/Makefile b/tools

[PATCH 5/8] tools lib bpf: add missing functions

2016-10-16 Thread Eric Leblond
Some functions were missing in the library to be able to use it in the case where the userspace is handling the maps in kernel. The patch also renames functions to have a homogeneous naming convention. Signed-off-by: Eric Leblond --- tools/lib/bpf/bpf.c| 35

[PATCH 2/8] uapi linux bpf: add max value to enum

2016-10-16 Thread Eric Leblond
It will be used to detect userspace trying to set invalid value. Signed-off-by: Eric Leblond --- include/uapi/linux/bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index f09c70b..570287f 100644 --- a/include/uapi/linux/bpf.h +++ b

[Patch] Add support for PCMCIA card Sierra WIreless AC850

2007-09-05 Thread Eric Leblond
Hi, This patch adds support for Sierra Wireless AC850 which has the same Ids as the AC710/750 but has a different firmware. PS: Please CC answer as I've not subscribed to the list. BR, -- Eric Leblond <[EMAIL PROTECTED]> INL SARL Signed-off-by: Eric Leblond <[EMAIL PROTECTED]

Re: Netlink connector

2005-07-25 Thread Eric Leblond
Le lundi 25 juillet 2005 à 16:32 +0200, Patrick McHardy a écrit : > Evgeniy Polyakov wrote: > > On Mon, Jul 25, 2005 at 02:02:10AM -0400, James Morris ([EMAIL PROTECTED]) > > wrote: > If I understand correctly it tries to workaround some netlink > limitations (limited number of netlink families an