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 and
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 problem to get
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
4.6.0 kernel and a 4.5.x kernel.
What did I miss here ?
BR,
--
Eric Leblond <e...@regit.org>
Blog: https://home.regit.org/
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(-)
BR,
--
Eric
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 <e...@regit.org>
---
tools/lib/bpf/libbpf.c | 15 ++-
tools/l
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 <e...@regit.org>
---
tools/lib/bpf/libbpf.c | 1 +
tools/lib/bpf/libbpf.h | 1 -
2 files chan
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 <e...@regit.org>
Blog: https://home.regit.org/
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.
>
&
ch 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,
--
.
Signed-off-by: Eric Leblond <e...@regit.org>
---
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
Signed-off-by: Eric Leblond <e...@regit.org>
---
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
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 &l
Signed-off-by: Eric Leblond <e...@regit.org>
---
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/includ
It will be used to detect userspace trying to set invalid value.
Signed-off-by: Eric Leblond <e...@regit.org>
---
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/includ
| 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 <e...@regit.org>
---
tools/lib/bpf/Makefile | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/l
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 <e...@regit.org>
---
tools/lib/bpf/libbpf.c | 19 +--
too
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 <e...@regit.org>
---
tools/lib/bpf/bpf.c
Signed-off-by: Eric Leblond <e...@regit.org>
---
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
@@
? Is there a known workaround for this
issue ?
BR,
--
Eric Leblond <e...@regit.org>
his a wanted behavior to have libbpf that needs to be in sync with
kernel ? or should it be fixed ?
BR,
--
Eric Leblond <e...@regit.org>
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 <e...@regit.org>
---
tools/lib/bpf/bpf.c| 108 -
tools/lib/bpf/libbpf.c | 2 +
tools/lib/bpf/li
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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/bpf.c| 126
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
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/b
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
Parse netlink ext attribute to get the error message returned by
the card. Code is partially take from libnl.
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/Build| 2 +-
tools/lib/bpf/bpf.c| 10 ++-
tools/lib/
Get out of the loop when we have a match.
Signed-off-by: Eric Leblond <e...@regit.org>
---
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
Parse netlink ext attribute to get the error message returned by
the card. Code is partially take from libnl.
Signed-off-by: Eric Leblond <e...@regit.org>
---
tools/lib/bpf/Build| 2 +-
tools/lib/bpf/bpf.c| 9 +++
tools/lib/bpf/nlattr.c
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
Signed-off-by: Eric Leblond <e...@regit.org>
---
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..9e53db
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 <e...@regit.org>
---
tools/lib/bpf/bpf.c| 126 -
tools/lib/bpf/libbpf.c | 2 +
tools/lib/bpf/li
Parse netlink ext attribute to get the error message returned by
the card. Code is partially take from libnl.
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
samples/bpf/Makefile | 2 +-
tools/lib/bpf/Build| 2 +-
tools/l
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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/bpf.c| 126
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 <e...@regit.org>
---
samples/bpf/bpf_load.c | 102
samples/bpf/bpf_
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
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/b
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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/bpf.c| 126
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
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/b
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 <e...@regit.org>
---
samples/bpf/bpf_load.c | 102
samples/bpf/bpf_
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
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
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/b
The header is necessary for libbpf compilation on system with older
version of the headers.
Signed-off-by: Eric Leblond <e...@regit.org>
---
tools/include/uapi/linux/netlink.h | 251 +
tools/lib/bpf/Makefile | 3 +
2 files changed, 254 inse
the 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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/bpf.c| 127
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 <e...@regit.org>
---
samples/bpf/bpf_load.c | 102
samples/bpf/bpf_
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
The headers are necessary for libbpf compilation on system with older
version of the headers.
Signed-off-by: Eric Leblond <e...@regit.org>
---
tools/include/uapi/linux/if_link.h | 943 +
tools/include/uapi/linux/netlink.h | 251 ++
tools/l
the 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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
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/b
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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/bpf.c| 122
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
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 in
he 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 <e...@regit.org>
Blog: https://home.regit.org/
CLANG} -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 <e...@regit.org>
d I will do a Pull Request
on github.
Thanks a lot for that, that's a really valuable help!
BR,
--
Eric Leblond <e...@regit.org>
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 <e...@regit.org>
---
tools/lib/bpf/bpf.c| 126 -
tools/lib/bpf/libbpf.c | 2 +
tools/lib/bpf/li
Parse netlink ext attribute to get the error message returned by
the card.
Signed-off-by: Eric Leblond <e...@regit.org>
---
tools/lib/bpf/Build| 2 +-
tools/lib/bpf/bpf.c| 9 +++
tools/lib/bpf/nlattr.c | 188 +
tools/lib/bpf/nl
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
Get out of the loop when we have a match.
Signed-off-by: Eric Leblond <e...@regit.org>
---
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
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 <e...@regit.org>
> > ---
> > tools/lib/bp
Parse netlink ext attribute to get the error message returned by
the card. Code is partially take from libnl.
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/Build| 2 +-
tools/lib/bpf/bpf.c| 9 +++
tools/lib/
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
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/b
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 <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
tools/lib/bpf/bpf.c| 126
Hello,
This patchset adds support for loading eBPF code as XDP filter.
Best regards,
--
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 some in
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
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 <e...@regit.org>
---
samples/bpf/bpf_load.c | 102
samples/bpf/bpf_
Parse netlink ext attribute to get the error message returned by
the card. Code is partially take from libnl.
Signed-off-by: Eric Leblond <e...@regit.org>
Acked-by: Alexei Starovoitov <a...@kernel.org>
---
samples/bpf/Makefile | 2 +-
tools/lib/bpf/Build| 2 +-
tools/l
Hello,
This patchset rebases the libbpf code on latest bpf-next code and addresses
remarks by Daniel.
Best regards,
--
Eric Leblond
ver does not have support for XDP, 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
70 matches
Mail list logo