Fix documentation that mention xdpsock_kern.c which has been
replaced by code embedded in libbpf.
Signed-off-by: Eric Leblond
---
Documentation/networking/af_xdp.rst | 16 +++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/Documentation/networking/af_xdp.rst
b
DP, or XDP_SKB is explicitly chosen
...
Thanks a lot for this work, I'm gonna try to implement this in
Suricata.
Best regards,
--
Eric Leblond
LANG} -Wall $(BPF_CFLAGS) -O2 \
+ -I/usr/include/$(host_cpu)-$(host_os)/ \
-D__KERNEL__ -D__ASM_SYSREG_H \
-target bpf -S -emit-llvm $< -o ${@:.bpf=.ll}
# From LLVM-IR to BPF-bytecode in ELF-obj file
Let me know if it is ok for you.
Best regards,
--
Eric Leblond
ting it and I will do a Pull Request
on github.
Thanks a lot for that, that's a really valuable help!
BR,
--
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
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
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
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
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
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
er have info available on).
>
> Thus, my solution is simply to match on the name of the relocation
> section, to skip that too.
I confirm this fixes the issue I have seen when loading XDP filter with
libbpf in Suricata.
BR,
--
Eric Leblond
Blog: https://home.regit.org/
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
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
>
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
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
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
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
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
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
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
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
Hello,
This patchset rebases the libbpf code on latest bpf-next code and addresses
remarks by Daniel.
Best regards,
--
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
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
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
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
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
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
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
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
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
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
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
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
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
Hello,
This patchset adds support for loading eBPF code as XDP filter.
Best regards,
--
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
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
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 +
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
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
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
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
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
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
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
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
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
? Is there a known workaround for this
issue ?
BR,
--
Eric Leblond
that needs to be in sync with
kernel ? or should it be fixed ?
BR,
--
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
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
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 1cc3ea0ffdc3..35f6dfcdc565 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -879,7 +879,8
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/
ols/lib/bpf/libbpf.h | 12 +++-
7 files changed, 166 insertions(+), 34 deletions(-)
Best regards,
--
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
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
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
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
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
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
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
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
Hello,
On Sun, 2016-09-18 at 14:02 +0200, Eric Leblond wrote:
> Hello,
>
> I'm currently testing a code implementing AF_PACKET bypass for
> Suricata. The idea is that Suricata is updating a hash table
> containing
> a list of flows it does not want to see anymore.
&g
s timeout.
This is currently working well when there is only a few flows but on a
real system with log of insertion in the table, the loop is never
returning because we dequeue slower than we enqueue.
Is there a better algorithm or an other way to do it ?
BR,
--
Eric Leblond
Blog: https://home.regit.org/
The include of err.h is not explicitely needed in exported
functions and it was causing include conflict with some existing
code due to redefining some macros.
Signed-off-by: Eric Leblond
---
tools/lib/bpf/libbpf.c | 1 +
tools/lib/bpf/libbpf.h | 1 -
2 files changed, 1 insertion(+), 1 deletion
Hello,
Here's a small patchset on libbpf fixing two issues I've encountered
when adding some eBPF related features to Suricata.
Patchset statistics:
tools/lib/bpf/libbpf.c | 16 +++-
tools/lib/bpf/libbpf.h | 4 +++-
2 files changed, 10 insertions(+), 10 deletions(-)
B
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 | 15 ++-
tools/lib/bpf/libbpf.h | 3
Hello,
On Sun, 2016-06-12 at 20:35 +0200, Daniel Borkmann wrote:
> On 06/12/2016 07:37 PM, Eric Leblond wrote:
> > On Thu, 2016-06-09 at 17:34 -0700, Alexei Starovoitov wrote:
> > > On Thu, Jun 09, 2016 at 11:10:05PM +0200, Eric Leblond wrote:
> > > > Hello,
&
Hello,
On Thu, 2016-06-09 at 17:34 -0700, Alexei Starovoitov wrote:
> On Thu, Jun 09, 2016 at 11:10:05PM +0200, Eric Leblond wrote:
> > Hello,
> >
> > I'm working on integrating ebpf cluster load balancing for
> > AF_PACKET
> > and I've got some prob
;
This has been tested with a 4.6.0 kernel and a 4.5.x kernel.
What did I miss here ?
BR,
--
Eric Leblond
Blog: https://home.regit.org/
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
72 matches
Mail list logo