riscv: add BPF JIT for RV64G")
Signed-off-by: Björn Töpel
---
arch/riscv/net/bpf_jit_comp.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/riscv/net/bpf_jit_comp.c b/arch/riscv/net/bpf_jit_comp.c
index 80b12aa5e10d..e5c8d675bd6e 100644
--- a/arch/riscv/net/bpf_jit
On Tue, 21 May 2019 at 16:02, Daniel Borkmann wrote:
>
> On 05/21/2019 03:46 PM, Björn Töpel wrote:
> > When using 32-bit subregisters (ALU32), the RISC-V JIT would not clear
> > the high 32-bits of the target register and therefore generate
> > incorrect code.
> >
&
Add three tests to test_verifier/basic_instr that make sure that the
high 32-bits of the destination register is cleared after an ALU32
and/or/xor.
Signed-off-by: Björn Töpel
---
.../selftests/bpf/verifier/basic_instr.c | 39 +++
1 file changed, 39 insertions(+)
diff --git
r+sk2dxxfyo8qpr-wjx0...@mail.gmail.com/
Björn Töpel (2):
net: xdp: refactor XDP_QUERY_PROG{,_HW} to netdev
net: xdp: remove XDP_QUERY_PROG{,_HW}
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4 -
.../net/ethernet/cavium/thunder/nicvf_main.c | 3 -
.../net/ethernet/freescale/dpaa2/dpa
From: Björn Töpel
Remove all use of XDP_QUERY_PROG{,_HW}, since it was moved to the
generic code path.
Signed-off-by: Björn Töpel
---
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4
.../net/ethernet/cavium/thunder/nicvf_main.c | 3 ---
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c
From: Björn Töpel
All XDP capable drivers need to implement the XDP_QUERY_PROG{,_HW}
command of ndo_bpf. The query code is fairly generic. This commit
refactors the query code up from the drivers to the netdev level.
The struct net_device has gained four new members tracking the XDP
program
socket tracks which maps it resides in, and remove itself from
those maps at relase.
2. The XSKMAP did not honor the BPF_EXIST/BPF_NOEXIST flag on insert,
which this patch addresses.
Thanks,
Björn
v1->v2: Fixed deadlock and broken cleanup. (Daniel)
Björn Töpel (2):
xsk: remove AF_XD
From: Björn Töpel
The XSKMAP did not honor the BPF_EXIST/BPF_NOEXIST flags when updating
an entry. This patch addressed that.
Signed-off-by: Björn Töpel
---
kernel/bpf/xskmap.c | 18 +++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/xskmap.c b/kernel
From: Björn Töpel
When an AF_XDP socket is released/closed the XSKMAP still holds a
reference to the socket in a "released" state. The socket will still
use the netdev queue resource, and block newly created sockets from
attaching to that queue, but no user application can acces
On Wed, 22 May 2019 at 20:13, Y Song wrote:
>
> On Wed, May 22, 2019 at 2:25 AM Björn Töpel wrote:
> >
> > Add three tests to test_verifier/basic_instr that make sure that the
> > high 32-bits of the destination register is cleared after an ALU32
> > and/or/xor
On Wed, 22 May 2019 at 19:41, Jakub Kicinski
wrote:
>
> On Wed, 22 May 2019 14:53:50 +0200, Björn Töpel wrote:
> > Shout out to all XDP driver hackers to check that the second patch
> > doesn't break anything (especially Jakub). I've only been able to test
> >
On Wed, 22 May 2019 at 20:32, Jakub Kicinski
wrote:
>
> On Wed, 22 May 2019 14:53:51 +0200, Björn Töpel wrote:
> > From: Björn Töpel
> >
> > All XDP capable drivers need to implement the XDP_QUERY_PROG{,_HW}
> > command of ndo_bpf. The query code is fairly generic.
On Wed, 22 May 2019 at 23:04, Jakub Kicinski
wrote:
>
> On Wed, 22 May 2019 22:54:44 +0200, Björn Töpel wrote:
> > > > Now, the same commands give:
> > > >
> > > > # ip link set dev eth0 xdp obj foo.o sec main
> > > > # ip link set dev e
On Thu, 23 May 2019 at 07:47, Saeed Mahameed wrote:
>
> On Wed, 2019-05-22 at 14:53 +0200, Björn Töpel wrote:
> > From: Björn Töpel
> >
> > All XDP capable drivers need to implement the XDP_QUERY_PROG{,_HW}
> > command of ndo_bpf. The query code is fairly generic.
On Thu, 23 May 2019 at 08:39, Y Song wrote:
>
> On Wed, May 22, 2019 at 1:46 PM Björn Töpel wrote:
> >
> > On Wed, 22 May 2019 at 20:13, Y Song wrote:
> > >
> > > On Wed, May 22, 2019 at 2:25 AM Björn Töpel wrote:
> > > >
> > > > Add
On Thu, 23 May 2019 at 16:31, Jiong Wang wrote:
>
>
> > On 23 May 2019, at 15:02, Daniel Borkmann wrote:
> >
> > On 05/23/2019 08:38 AM, Y Song wrote:
> >> On Wed, May 22, 2019 at 1:46 PM Björn Töpel wrote:
> >>> On Wed, 22 May 2019 at 20:13, Y Son
On 2019-05-24 11:35, Maxim Mikityanskiy wrote:
This series contains improvements to the AF_XDP kernel infrastructure
and AF_XDP support in mlx5e. The infrastructure improvements are
required for mlx5e, but also some of them benefit to all drivers, and
some can be useful for other drivers that wan
On Fri, 24 May 2019 at 13:36, Jiong Wang wrote:
>
> Cc: Björn Töpel
> Acked-by: Björn Töpel
> Tested-by: Björn Töpel
> Signed-off-by: Jiong Wang
> ---
> arch/riscv/net/bpf_jit_comp.c | 43
> ++-
> 1 file changed, 30
On Fri, 24 May 2019 at 18:36, Jiong Wang wrote:
>
[...]
> > Hmm, missing is64 check here (fall-through for 64-bit movs)?
>
> (re-send because of bouncing back)
>
> FOR BPF_X form, when imm == 1, it is a special mov32 constructed by
> verifier, it can only be BPF_ALU, not BPF_ALU64. And it is used
On Wed, 22 May 2019 at 20:32, Jakub Kicinski
wrote:
>
[...]
>
> You should be able to just call install with the original flags, and
> install handler should do the right maths again to direct it either to
> drv or generic, no?
>
On a related note: I ran the test_offload.py test (thanks for point
From: Björn Töpel
Remove all use of XDP_QUERY_PROG{,_HW}, since it was moved to the
generic code path.
Signed-off-by: Björn Töpel
---
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4
.../net/ethernet/cavium/thunder/nicvf_main.c | 3 ---
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c
From: Björn Töpel
All XDP capable drivers need to implement the XDP_QUERY_PROG{,_HW}
command of ndo_bpf. The query code is fairly generic. This commit
refactors the query code up from the drivers to the netdev level.
The struct net_device has gained two new members: xdp_prog_hw and
xdp_flags
more details.
The patch passes test_offload.py from selftests. Thanks to Jakub for
pointing this out.
I, hopefully, addressed all comments from Jakub and Saeed, except one;
I did not move the XDP struct net_device into a struct of its own.
Thanks,
Björn
Björn Töpel (2):
net: xdp: ref
On Fri, 31 May 2019 at 11:42, Björn Töpel wrote:
>
[...]
>
> I, hopefully, addressed all comments from Jakub and Saeed, except one;
> I did not move the XDP struct net_device into a struct of its own.
>
Uhm, the last sentence was weird.
What I meant was: I did not move the newly
32 *)key);
+
+ return xs ? &xs->queue_id : NULL;
I like this! I haven't taken it for a spin, but still:
Acked-by: Björn Töpel
}
static int xsk_map_update_elem(struct bpf_map *map, void *key, void *value,
diff --git a/tools/testing/selftests/bpf/verifier/prevent_map_lookup.c
b/tools/t
On 2019-05-30 20:57, Jonathan Lemon wrote:
Use the recent change to XSKMAP bpf_map_lookup_elem() to test if
there is a xsk present in the map instead of duplicating the work
with qidconf.
Fix things so callers using XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD
bypass any internal bpf maps, so xsk_socket_
On Fri, 31 May 2019 at 18:27, Jonathan Lemon wrote:
>
> On 31 May 2019, at 4:49, Björn Töpel wrote:
>
> > On 2019-05-30 20:57, Jonathan Lemon wrote:
> >> Currently, the AF_XDP code uses a separate map in order to
> >> determine if an xsk is bound to a queue.
On Sat, 1 Jun 2019 at 20:12, Jonathan Lemon wrote:
>
> On 31 May 2019, at 2:42, Björn Töpel wrote:
>
> > From: Björn Töpel
> >
> > All XDP capable drivers need to implement the XDP_QUERY_PROG{,_HW}
> > command of ndo_bpf. The query code is fairly generic. This co
On Sat, 1 Jun 2019 at 21:42, Jakub Kicinski
wrote:
>
> On Fri, 31 May 2019 19:18:17 +, Saeed Mahameed wrote:
> > On Fri, 2019-05-31 at 11:42 +0200, Björn Töpel wrote:
> > > From: Björn Töpel
> > >
> > > All XDP capable drivers need to implement th
On Sat, 1 Jun 2019 at 21:57, Jakub Kicinski
wrote:
>
> On Fri, 31 May 2019 19:18:17 +, Saeed Mahameed wrote:
> > > + if (!bpf_op || flags & XDP_FLAGS_SKB_MODE)
> > > + mode = XDP_FLAGS_SKB_MODE;
> > > +
> > > + curr_mode = dev_xdp_current_mode(dev);
> > > +
> > > + if (!offload
On Sat, 1 Jun 2019 at 22:02, Jakub Kicinski
wrote:
>
> On Fri, 31 May 2019 11:42:14 +0200, Björn Töpel wrote:
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 44b47e9df94a..f3a875a52c6c 100644
> > --- a/include/linux/netdevice.h
> > +
On Sun, 2 Jun 2019 at 00:32, Song Liu wrote:
>
> On Wed, May 22, 2019 at 6:38 AM Björn Töpel wrote:
> >
> > From: Björn Töpel
> >
> > When an AF_XDP socket is released/closed the XSKMAP still holds a
> > reference to the socket in a "released" s
t;> {
> >> -int qid = true, fd = xsk->fd, err;
> >> -
> >> -err = bpf_map_update_elem(xsk->qidconf_map_fd, &xsk->queue_id,
> >> &qid, 0);
> >> -if (err)
> >> -goto out;
> >> -
> >>
On Mon, 3 Jun 2019 at 19:03, Jakub Kicinski
wrote:
>
> On Mon, 3 Jun 2019 11:04:36 +0200, Björn Töpel wrote:
> > On Sat, 1 Jun 2019 at 21:57, Jakub Kicinski
> > wrote:
> > >
> > > On Fri, 31 May 2019 19:18:17 +, Saeed Mahameed wrote:
> > > >
On Mon, 3 Jun 2019 at 23:20, Saeed Mahameed wrote:
>
> On Mon, 2019-06-03 at 11:04 +0200, Björn Töpel wrote:
> > On Sat, 1 Jun 2019 at 21:42, Jakub Kicinski
> > wrote:
> > > On Fri, 31 May 2019 19:18:17 +, Saeed Mahameed wrote:
> > > > On Fri, 2019-
On Tue, 4 Jun 2019 at 01:11, Daniel Borkmann wrote:
>
> On 06/03/2019 10:39 AM, Björn Töpel wrote:
> > On Sat, 1 Jun 2019 at 20:12, Jonathan Lemon wrote:
> >> On 31 May 2019, at 2:42, Björn Töpel wrote:
> >>> From: Björn Töpel
> >>>
> &
nal bpf programs.
>
Nice work!
For the series,
Acked-by: Björn Töpel
> include/net/xdp_sock.h| 6 +-
> kernel/bpf/verifier.c | 6 +-
> kernel/bpf/xskmap.c | 4 +-
> tools/lib/bpf/xsk.c
On 2019-06-03 15:19, Maciej Fijalkowski wrote:
Let's get into the driver via ndo_bpf with command set to XDP_SETUP_UMEM
with fill queue that already contains some available entries that can be
used by Rx driver rings. Things worked in such way on old version of
xdpsock (that lacked libbpf support
On 2019-06-03 15:19, Maciej Fijalkowski wrote:
When it comes down to ethtool's get channels API, various drivers are
reporting the queue count in two ways - they are setting max_combined or
max_tx/max_rx fields. When creating the eBPF maps for xsk socket, this
API is used so that we have an entri
On 2019-06-03 15:19, Maciej Fijalkowski wrote:
Since xsk support in libbpf loads the xdp program interface, make it
also responsible for its removal. Store the prog id in xsk_socket_config
so when removing the program we are still able to compare the current
program id with the id from the atta
On 2019-06-03 15:19, Maciej Fijalkowski wrote:
In case where multiple xsk sockets are attached to a single interface
and one of them gets detached, the eBPF maps and program are removed.
This should not happen as the rest of xsksocks are still using these
resources.
In order to fix that, let's h
On 2019-06-04 19:25, Jonathan Lemon wrote:
On 4 Jun 2019, at 9:43, Jesper Dangaard Brouer wrote:
On Mon, 3 Jun 2019 09:38:51 -0700
Jonathan Lemon wrote:
Currently, the AF_XDP code uses a separate map in order to
determine if an xsk is bound to a queue. Instead of doing this,
have bpf_map_lo
On Tue, 4 Jun 2019 at 20:13, Martin Lau wrote:
>
> On Tue, Jun 04, 2019 at 10:25:23AM -0700, Jonathan Lemon wrote:
> > On 4 Jun 2019, at 9:43, Jesper Dangaard Brouer wrote:
> >
> > > On Mon, 3 Jun 2019 09:38:51 -0700
> > > Jonathan Lemon wrote:
> > >
> > >> Currently, the AF_XDP code uses a separ
On Tue, 4 Jun 2019 at 17:06, Maciej Fijalkowski
wrote:
>
> On Tue, 4 Jun 2019 10:06:36 +0200
> Björn Töpel wrote:
>
> > On 2019-06-03 15:19, Maciej Fijalkowski wrote:
> > > Let's get into the driver via ndo_bpf with command set to XDP_SETUP_UMEM
> > > w
On Tue, 4 Jun 2019 at 17:07, Maciej Fijalkowski
wrote:
>
> On Tue, 4 Jun 2019 10:07:25 +0200
> Björn Töpel wrote:
>
> >
> > On 2019-06-03 15:19, Maciej Fijalkowski wrote:
> > > Since xsk support in libbpf loads the xdp program interface, make it
> > > a
On Tue, 4 Jun 2019 at 17:07, Maciej Fijalkowski
wrote:
>
> On Tue, 4 Jun 2019 10:08:03 +0200
> Björn Töpel wrote:
>
> > On 2019-06-03 15:19, Maciej Fijalkowski wrote:
> > > In case where multiple xsk sockets are attached to a single interface
> > > and one
On Wed, 5 Jun 2019 at 17:58, Jonathan Lemon wrote:
>
> Currently, the AF_XDP code uses a separate map in order to
> determine if an xsk is bound to a queue. Instead of doing this,
> have bpf_map_lookup_elem() return a xdp_sock.
>
> Rearrange some xdp_sock members to eliminate structure holes.
>
>
On 2019-06-05 19:56, Junsong Zhao (junszhao) wrote:
Hi Magnus and Bjorn,
I saw your articles and presentation about AF_PACKET V4. It is exciting
to know that the kernel socket can have 40G throughput.
But it seems the code is not in the 4.19 or 5.1 kernel. Instead there is
a new feature AF_X
On Mon, 3 Jun 2019 at 11:25, Björn Töpel wrote:
>
> On Sun, 2 Jun 2019 at 00:32, Song Liu wrote:
> >
> > On Wed, May 22, 2019 at 6:38 AM Björn Töpel wrote:
> > >
> > > From: Björn Töpel
> > >
> > > When an AF_XDP socket is released/closed
s.
>
Very nice! Thanks for doing this, Jonathan.
Again, for the series:
Acked-by: Björn Töpel
> Patches:
> 1 - adds XSK_SOCK type
> 2 - sync bpf.h with tools
> 3 - add tools selftest
> 4 - update lib/bpf, removing qidconf
>
> v4->v5:
> - xskmap lookup now return
test_offload.py from selftests. Thanks to Jakub for
pointing this out.
Thanks,
Björn
Björn Töpel (5):
net: xdp: refactor XDP_QUERY_PROG{,_HW} to netdev
nfp, netdevsim: use dev_xdp_support_offload() function
net: xdp: remove XDP_QUERY_PROG{,_HW}
net: xdp: refactor XDP fla
From: Björn Töpel
Remove all use of XDP_QUERY_PROG{,_HW}, since it was moved to the
generic code path.
Signed-off-by: Björn Töpel
---
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 4
.../net/ethernet/cavium/thunder/nicvf_main.c | 3 ---
.../net/ethernet/freescale/dpaa2/dpaa2-eth.c
From: Björn Töpel
All XDP capable drivers need to implement the XDP_QUERY_PROG{,_HW}
command of ndo_bpf. This commit refactors the query code up from the
drivers to the netdev level.
The xdp_prog member of the struct net_device has evolved into a struct
netdev_xdp. The new structure contains an
From: Björn Töpel
Make all drivers with XDP offloading support use
dev_xdp_support_offload().
Signed-off-by: Björn Töpel
---
drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 7 +++
drivers/net/netdevsim/netdev.c| 4
2 files changed, 11 insertions(+)
diff --git
From: Björn Töpel
The attachment flags check is done in the generic netdev code, so
there is no need for this function anymore. Remove it and all uses of
it.
Further; Passing flags from struct netdev_bpf when attaching an XDP
program is no longer necessary, so let us remove that member.
Signed
From: Björn Töpel
Similar to query a driver for a loaded XDP program, each driver need
to check the attachment flags when a program is loaded.
E.g., if an XDP program was loaded without explicit flags (fallback
mode), it must be reloaded/removed without explicit flags.
This commit moves that
On Tue, 30 Jul 2019 at 19:43, Kevin Laatz wrote:
>
> This patch adds a 'flags' field to the umem_config and umem_reg structs.
> This will allow for more options to be added for configuring umems.
>
> The first use for the flags field is to add a flag for unaligned chunks
> mode. These flags can ei
On Tue, 30 Jul 2019 at 19:43, Kevin Laatz wrote:
>
> This patch adds a 'flags' field to the umem_config and umem_reg structs.
> This will allow for more options to be added for configuring umems.
>
> The first use for the flags field is to add a flag for unaligned chunks
> mode. These flags can ei
On Thu, 1 Aug 2019 at 08:59, Andrii Nakryiko wrote:
>
> On Wed, Jul 31, 2019 at 8:21 AM Björn Töpel wrote:
> >
> > On Tue, 30 Jul 2019 at 19:43, Kevin Laatz wrote:
> > >
> > > This patch adds a 'flags' field to the umem_config and umem_reg structs
On Fri, 2 Aug 2019 at 09:19, Andrii Nakryiko wrote:
>
> On Thu, Aug 1, 2019 at 12:34 AM Björn Töpel wrote:
> >
[...]
> >
> > Old application, dynamically linked to new libbpf.so will crash,
> > right? Old application passes old version of xsk_umem_config, and
From: Björn Töpel
When an AF_XDP socket is released/closed the XSKMAP still holds a
reference to the socket in a "released" state. The socket will still
use the netdev queue resource, and block newly created sockets from
attaching to that queue, but no user application can acces
v3->v4: {READ, WRITE}_ONCE consistency. (Daniel)
Socket release/map update race. (Daniel)
Björn Töpel (2):
xsk: remove AF_XDP socket from map when the socket is released
xsk: support BPF_EXIST and BPF_NOEXIST flags in XSKMAP
include/net/xdp_sock.h | 18 ++
From: Björn Töpel
The XSKMAP did not honor the BPF_EXIST/BPF_NOEXIST flags when updating
an entry. This patch addresses that.
Signed-off-by: Björn Töpel
---
kernel/bpf/xskmap.c | 19 ---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/xskmap.c b
On Mon, 12 Aug 2019 at 14:28, Daniel Borkmann wrote:
>
[...]
> > diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
> > index 59b57d708697..c3447bad608a 100644
> > --- a/net/xdp/xsk.c
> > +++ b/net/xdp/xsk.c
> > @@ -362,6 +362,50 @@ static void xsk_unbind_dev(struct xdp_sock *xs)
> > dev_put(dev);
>
From: Björn Töpel
My Intel email will stop working in a not too distant future. Move my
MAINTAINERS entries to my kernel.org address.
Signed-off-by: Björn Töpel
---
.mailmap| 2 ++
MAINTAINERS | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.mailmap b/.mailmap
#syz fix: xsk: Validate socket state in xsk_recvmsg, prior touching
socket members
From: Björn Töpel
Brendan Jackman added extend atomic operations to the BPF instruction
set in commit 7064a7341a0d ("Merge branch 'Atomics for eBPF'"), which
introduces the BPF_ATOMIC_OP macro. However, that macro was missing
for the BPF samples. Fix that by adding it into
that one sample broke w/o the BPF_ATOMIC_OP.
On Mon, 18 Jan 2021 at 10:18, Björn Töpel wrote:
From: Björn Töpel
Brendan Jackman added extend atomic operations to the BPF instruction
set in commit 7064a7341a0d ("Merge branch 'Atomics for eBPF'"), which
introduces the BPF
Baseline
Two cores: 21.3 Mpps
One core:24.5 Mpps
Patched
Two cores, bpf_redirect_map: 21.7 Mpps + 2%
One core, bpf_redirect_map: 24.9 Mpps + 2%
Two cores, bpf_redirect_xsk: 24.0 Mpps +13%
One core, bpf_redirect_xsk: 25.5 Mpps + 4%
Thanks!
Björn
Björn Töpel (8)
From: Björn Töpel
The XDP_REDIRECT implementations for maps and non-maps are fairly
similar, but obviously need to take different code paths depending on
if the target is using a map or not. Today, the redirect targets for
XDP either uses a map, or is based on ifindex.
Future commits will
From: Björn Töpel
Instead of passing void * all over the place, let us pass the actual
type (ifobject) and remove the void-ptr-to-type-ptr casting.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 87
1 file changed, 42 insertions(+), 45
From: Björn Töpel
Select bpf_redirect_xsk() as the default AF_XDP BPF program, if
supported.
The bpf_redirect_xsk() helper does not require an XSKMAP, so make sure
that no map is created/updated when using it.
Reviewed-by: Maciej Fijalkowski
Signed-off-by: Björn Töpel
---
tools/lib/bpf
From: Björn Töpel
Add support for externally loaded XDP programs to
xdpxceiver/test_xsk.sh, so that bpf_redirect_xsk() and
bpf_redirect_map() can be exercised.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/test_xsk.sh | 48 +++
tools/testing/selftests/bpf
From: Björn Töpel
Extend bind() for XDP sockets, so that the bound socket is added to
the netdev_rx_queue _rx array in the netdevice. We call this to
register an XDP socket. To redirect packets to a registered socket, a
new BPF helper is used: bpf_redirect_xsk().
For shared XDP sockets, only
From: Björn Töpel
Fold xp_assign_dev and __xp_assign_dev. The former directly calls the
latter.
Reviewed-by: Maciej Fijalkowski
Signed-off-by: Björn Töpel
---
net/xdp/xsk_buff_pool.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/net/xdp/xsk_buff_pool.c b
From: Björn Töpel
The explicit_free parameter of the __xsk_rcv() function was used to
mark whether the call was via the generic XDP or the native XDP
path. Instead of clutter the code with if-statements and "true/false"
parameters which are hard to understand, simply move the explic
From: Björn Töpel
Add detection for kernel version, and adapt the BPF program based on
kernel support. This way, users will get the best possible performance
from the BPF program.
Reviewed-by: Maciej Fijalkowski
Acked-by: Maciej Fijalkowski
Signed-off-by: Björn Töpel
Signed-off-by: Marek
On Tue, 19 Jan 2021 at 16:37, Björn Töpel wrote:
>
> From: Björn Töpel
>
> Add support for externally loaded XDP programs to
> xdpxceiver/test_xsk.sh, so that bpf_redirect_xsk() and
> bpf_redirect_map() can be exercised.
>
Ah, crap. Forgot two files. Will resend.
Björn
From: Björn Töpel
Instead of passing void * all over the place, let us pass the actual
type (ifobject) and remove the void-ptr-to-type-ptr casting.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 87
1 file changed, 42 insertions(+), 45
From: Björn Töpel
Add detection for kernel version, and adapt the BPF program based on
kernel support. This way, users will get the best possible performance
from the BPF program.
Reviewed-by: Maciej Fijalkowski
Acked-by: Maciej Fijalkowski
Signed-off-by: Björn Töpel
Signed-off-by: Marek
From: Björn Töpel
Add support for externally loaded XDP programs to
xdpxceiver/test_xsk.sh, so that bpf_redirect_xsk() and
bpf_redirect_map() can be exercised.
Signed-off-by: Björn Töpel
---
.../selftests/bpf/progs/xdpxceiver_ext1.c | 15
.../selftests/bpf/progs/xdpxceiver_ext2.c
From: Björn Töpel
Select bpf_redirect_xsk() as the default AF_XDP BPF program, if
supported.
The bpf_redirect_xsk() helper does not require an XSKMAP, so make sure
that no map is created/updated when using it.
Reviewed-by: Maciej Fijalkowski
Signed-off-by: Björn Töpel
---
tools/lib/bpf
From: Björn Töpel
Fold xp_assign_dev and __xp_assign_dev. The former directly calls the
latter.
Reviewed-by: Maciej Fijalkowski
Signed-off-by: Björn Töpel
---
net/xdp/xsk_buff_pool.c | 12 +++-
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/net/xdp/xsk_buff_pool.c b
From: Björn Töpel
Extend bind() for XDP sockets, so that the bound socket is added to
the netdev_rx_queue _rx array in the netdevice. We call this to
register an XDP socket. To redirect packets to a registered socket, a
new BPF helper is used: bpf_redirect_xsk().
For shared XDP sockets, only
From: Björn Töpel
The XDP_REDIRECT implementations for maps and non-maps are fairly
similar, but obviously need to take different code paths depending on
if the target is using a map or not. Today, the redirect targets for
XDP either uses a map, or is based on ifindex.
Future commits will
From: Björn Töpel
The explicit_free parameter of the __xsk_rcv() function was used to
mark whether the call was via the generic XDP or the native XDP
path. Instead of clutter the code with if-statements and "true/false"
parameters which are hard to understand, simply move the explic
ed missing XDP programs to selftests.
* Fixed checkpatch warning in selftests.
Björn Töpel (8):
xdp: restructure redirect actions
xsk: remove explicit_free parameter from __xsk_rcv()
xsk: fold xp_assign_dev and __xp_assign_dev
xsk: register XDP sockets at bind(), and add new AF_XDP B
umem_at_qid implementation")
Signed-off-by: Maxim Mikityanskiy
Thanks, Maxim!
Acked-by: Björn Töpel
---
net/xdp/xsk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index 8037b04a9edd..4a83117507f5 100644
--- a/net/xdp/xsk.c
+++ b
On 2021-01-20 09:25, kernel test robot wrote:
Hi "Björn,
I love your patch! Yet something to improve:
[auto build test ERROR on 95204c9bfa48d2f4d3bab7df55c1cc823957ff81]
url:
https://github.com/0day-ci/linux/commits/Bj-rn-T-pel/Introduce-bpf_redirect_xsk-helper/20210120-150357
base:952
On 2021-01-20 13:50, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcbc..bbc7d9a57262 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -3836,6 +3836,12 @@ union bpf_attr {
*Return
On 2021-01-20 14:15, Maxim Mikityanskiy wrote:
On 2021-01-19 17:50, Björn Töpel wrote:
This series extends bind() for XDP sockets, so that the bound socket
is added to the netdev_rx_queue _rx array in the netdevice. We call
this to register the socket. To redirect packets to the registered
On 2021-01-20 15:54, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
On 2021-01-20 13:50, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcbc..bbc7d9a57262 100644
--- a/include/uapi/linux/bpf.h
+++ b
On 2021-01-20 16:11, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
On 2021-01-20 14:25, Björn Töpel wrote:
On 2021-01-20 13:52, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Add detection for kernel version, and adapt the BPF program based on
kernel support
On 2021-01-20 14:25, Björn Töpel wrote:
On 2021-01-20 13:52, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Add detection for kernel version, and adapt the BPF program based on
kernel support. This way, users will get the best possible performance
from the BPF program
On 2021-01-20 15:52, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
On 2021-01-20 13:44, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
The XDP_REDIRECT implementations for maps and non-maps are fairly
similar, but obviously need to take different code paths
On 2021-01-20 13:44, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
The XDP_REDIRECT implementations for maps and non-maps are fairly
similar, but obviously need to take different code paths depending on
if the target is using a map or not. Today, the redirect
On 2021-01-20 17:30, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
[...]
It can't be free'd but, ri->map can be cleared via
bpf_clear_redirect_map(). So, between the helper (setting) and the
tracepoint in xdp_do_redirect() it can be cleared (say if the XDP
program is swapp
On 2021-01-20 18:29, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
On 2021-01-20 15:54, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
On 2021-01-20 13:50, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index
On 2021-01-20 19:25, Alexei Starovoitov wrote:
On Wed, Jan 20, 2021 at 7:27 AM Björn Töpel wrote:
Would it make sense with some kind of BPF-specific "supported
features" mechanism? Something else with a bigger scope (whole
kernel)?
Heh, in my opinion, yeah. Seems like we'll
On 2021-01-20 13:52, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Add detection for kernel version, and adapt the BPF program based on
kernel support. This way, users will get the best possible performance
from the BPF program.
Please do explicit feature detection
1 - 100 of 1059 matches
Mail list logo