shares the fd with the umem.
>
> v3->v4:
> * Reduced nesting in xsk_put_ctx as suggested by Alexei.
> * Use bools instead of a u8 and flags to represent the
> ring setup status as suggested by Björn.
>
Thanks, Ciara! LGTM!
Acked-by: Björn Töpel
> v2->v3:
> * Ins
On Tue, 30 Mar 2021 at 14:05, Ciara Loftus wrote:
>
> Prior to this commit xsk_socket__create(_shared) always attempted to create
> the rx and tx rings for the socket. However this causes an issue when the
> socket being setup is that which shares the fd with the UMEM. If a
> previous call to this
On Tue, 30 Mar 2021 at 17:08, Alexei Starovoitov
wrote:
>
> On Tue, Mar 30, 2021 at 5:06 AM Ciara Loftus wrote:
> >
[...]
> > if (--ctx->refcount == 0) {
> > - err = xsk_get_mmap_offsets(umem->fd, &off);
> > - if (!err) {
> > - munmap(ct
On Thu, 18 Mar 2021 at 04:52, Hangbin Liu wrote:
>
> On Wed, Mar 17, 2021 at 01:03:02PM +0100, Toke Høiland-Jørgensen wrote:
> > FYI, this no longer applies to bpf-next due to Björn's refactor in
> > commit: ee75aef23afe ("bpf, xdp: Restructure redirect actions")
>
> Thanks Toke, I need to see how
On 2021-03-11 01:06, Jonathan Lemon wrote:
On Wed, Mar 10, 2021 at 09:09:29AM +0100, Björn Töpel wrote:
From: Björn Töpel
The only user of libbpf_util.h is xsk.h. Move the barriers to xsk.h,
and remove libbpf_util.h. The barriers are used as an implementation
detail, and should not be
On 2021-03-11 01:47, Stephen Rothwell wrote:
Hi all,
After merging the bpf-next tree, today's linux-next build (perf) failed
like this:
make[3]: *** No rule to make target 'libbpf_util.h', needed by
'/home/sfr/next/perf/staticobjs/xsk.o'. Stop.
Hi Stephen,
It's an incremental build issue,
From: Björn Töpel
The only user of libbpf_util.h is xsk.h. Move the barriers to xsk.h,
and remove libbpf_util.h. The barriers are used as an implementation
detail, and should not be considered part of the stable API.
Signed-off-by: Björn Töpel
---
tools/lib/bpf/Makefile | 1 -
tools/lib
From: Björn Töpel
In commit 291471dd1559 ("libbpf, xsk: Add libbpf_smp_store_release
libbpf_smp_load_acquire") linux/compiler.h was added as a dependency
to xsk.h, which is the user-facing API. This makes it harder for
userspace application to consume the library. Here the header
in
This series removes a header dependency from xsk.h, and moves
libbpf_util.h into xsk.h.
More details in each commit!
Thank you,
Björn
Björn Töpel (2):
libbpf: xsk: remove linux/compiler.h header
libbpf: xsk: move barriers from libbpf_util.h to xsk.h
tools/lib/bpf/Makefile | 1
ropagate napi_id to XDP socket Rx path")
> Signed-off-by: Alexander Duyck
Thanks Alex!
Acked-by: Björn Töpel
I'll look into if this applies to the other Intel drivers as well.
Björn
[...]
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.
Here, the map type and id
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds bpf_redirect_map() as a map
operation. Each map provides its bpf_redirect_map() version, and
correct function is
/bpf/20210226112322.144927-1-bjorn.to...@gmail.com/
v5: https://lore.kernel.org/bpf/20210227122139.183284-1-bjorn.to...@gmail.com/
Björn Töpel (2):
bpf, xdp: make bpf_redirect_map() a map operation
bpf, xdp: restructure redirect actions
include/linux/bpf.h| 26 ++---
include/linux/filter
On 2021-03-05 16:44, Daniel Borkmann wrote:
On 2/27/21 1:21 PM, Björn Töpel wrote:
[...]
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 008691fd3b58..a7752badc2ec 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -646,11 +646,20 @@ struct bpf_redirect_info
On 2021-03-05 16:55, Daniel Borkmann wrote:
On 2/27/21 1:21 PM, Björn Töpel wrote:
[...]
Look good. Small nits inline I had originally fixed up locally before
glancing at 2/2:
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 4c730863fa77..3d3e89a37e62 100644
--- a/include/linux
From: Björn Töpel
Now that the AF_XDP rings have load-acquire/store-release semantics,
move libbpf to that as well.
The library-internal libbpf_smp_{load_acquire,store_release} are only
valid for 32-bit words on ARM64.
Also, remove the barriers that are no longer in use.
Signed-off-by: Björn
From: Björn Töpel
Currently, the AF_XDP rings uses general smp_{r,w,}mb() barriers on
the kernel-side. On most modern architectures
load-acquire/store-release barriers perform better, and results in
simpler code for circular ring buffers.
This change updates the XDP socket rings to use
load
https://lore.kernel.org/bpf/20210301104318.263262-1-bjorn.to...@gmail.com/
Thanks,
Björn
Björn Töpel (2):
xsk: update rings for load-acquire/store-release barriers
libbpf, xsk: add libbpf_smp_store_release libbpf_smp_load_acquire
net/xdp/xsk_queue.h | 30 +++-
tool
On 2021-03-03 16:39, Will Deacon wrote:
On Tue, Mar 02, 2021 at 10:13:21AM +0100, Daniel Borkmann wrote:
[...]
Would also be great to get Will's ACK on that when you have a v2. :)
Please stick me on CC for that and I'll take a look as I've forgotten pretty
much everything about this since
On Wed, 3 Mar 2021 at 08:14, Björn Töpel wrote:
>
> On 2021-03-03 05:38, Andrii Nakryiko wrote:
> > On Mon, Mar 1, 2021 at 2:43 AM Björn Töpel wrote:
> >>
> >> From: Björn Töpel
> >>
> >> Now that the AF_XDP rings have load-acquire/store-rel
On Tue, 2 Mar 2021 at 10:25, Daniel Borkmann wrote:
>
[...]
> > I wonder if it's possible to cook a LKMM litmus test for this...?
>
> That would be amazing! :-)
>
With the help of Paul and Alan [1] (Thanks!) I've cooked 8 litmus
tests for this [2].
The litmus tests is based on a one entry ring
On 2021-03-03 05:38, Andrii Nakryiko wrote:
On Mon, Mar 1, 2021 at 2:43 AM Björn Töpel wrote:
From: Björn Töpel
Now that the AF_XDP rings have load-acquire/store-release semantics,
move libbpf to that as well.
The library-internal libbpf_smp_{load_acquire,store_release} are only
valid for
On Tue, 2 Mar 2021 at 11:23, Toke Høiland-Jørgensen wrote:
>
> Björn Töpel writes:
>
> > On 2021-03-01 17:08, Toke Høiland-Jørgensen wrote:
> >> Björn Töpel writes:
> >>
> >>> From: Björn Töpel
> >>>
> >>> Currently, the
nguish between exiting due to initialisation failure vs test failure
>
> This series applies on commit d310ec03a34e92a77302edb804f7d68ee4f01ba0
>
Ciara, this slipped on my side! Apologies! This is much better, thanks
for working on it!
For the series:
Acked-by: Björn Töpel
>
> Cia
On 2021-03-02 10:13, Daniel Borkmann wrote:
On 3/2/21 9:05 AM, Björn Töpel wrote:
On 2021-03-01 17:10, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Now that the AF_XDP rings have load-acquire/store-release semantics,
move libbpf to that as well.
The library-internal
On 2021-03-01 17:10, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Now that the AF_XDP rings have load-acquire/store-release semantics,
move libbpf to that as well.
The library-internal libbpf_smp_{load_acquire,store_release} are only
valid for 32-bit words on ARM64
On 2021-03-01 17:08, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Currently, the AF_XDP rings uses smp_{r,w,}mb() fences on the
kernel-side. By updating the rings for load-acquire/store-release
semantics, the full barrier on the consumer side can be replaced with
From: Björn Töpel
Now that the AF_XDP rings have load-acquire/store-release semantics,
move libbpf to that as well.
The library-internal libbpf_smp_{load_acquire,store_release} are only
valid for 32-bit words on ARM64.
Also, remove the barriers that are no longer in use.
Signed-off-by: Björn
From: Björn Töpel
Currently, the AF_XDP rings uses smp_{r,w,}mb() fences on the
kernel-side. By updating the rings for load-acquire/store-release
semantics, the full barrier on the consumer side can be replaced with
improved performance as a nice side-effect.
Note that this change does *not
.
This is effectively the change done in commit 6c43c091bdc5
("documentation: Update circular buffer for
load-acquire/store-release"), but for the AF_XDP rings.
Both libbpf and the kernel-side are updated.
More details in each commit.
Thanks,
Björn
Björn Töpel (2):
xsk: update ring
4125-3-bjorn.to...@gmail.com/
v4: https://lore.kernel.org/bpf/20210226112322.144927-1-bjorn.to...@gmail.com/
Cheers,
Björn
Björn Töpel (2):
bpf, xdp: make bpf_redirect_map() a map operation
bpf, xdp: restructure redirect actions
include/linux/bpf.h| 26 ++
include/linux/fil
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.
Here, an explicit
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds bpf_redirect_map() as a map
operation. Each map provides its bpf_redirect_map() version, and
correct function is
On 2021-02-26 22:48, Daniel Borkmann wrote:
On 2/26/21 12:23 PM, Björn Töpel wrote:
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds bpf_redirect_map() as a map
On 2021-02-26 12:40, Björn Töpel wrote:
On 2021-02-26 12:37, Toke Høiland-Jørgensen wrote:
[...]
(That last paragraph above is why I asked if you updated the performance
numbers in the cover letter; removing an additional function call should
affect those, right?)
Yeah, it should. Let
On 2021-02-26 12:37, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds bpf_redirect_map() as a map
operation
On 2021-02-26 12:35, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
Hi XDP-folks,
This two patch series contain two optimizations for the
bpf_redirect_map() helper and the xdp_do_redirect() function.
The bpf_redirect_map() optimization is about avoiding the map lookup
dispatching
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.
Here, an explicit
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds bpf_redirect_map() as a map
operation. Each map provides its bpf_redirect_map() version, and
correct function is
8-1-bjorn.to...@gmail.com/
v3: https://lore.kernel.org/bpf/20210221200954.164125-3-bjorn.to...@gmail.com/
Cheers,
Björn
Björn Töpel (2):
bpf, xdp: make bpf_redirect_map() a map operation
bpf, xdp: restructure redirect actions
include/linux/bpf.h| 26 ++
include/linux/filter
On 2021-02-25 00:38, Daniel Borkmann wrote:
On 2/21/21 9:09 PM, Björn Töpel wrote:
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds one bpf_redirect_map
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.
Here, an explicit
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds one bpf_redirect_map() implementation per
map. Correct function is automatically selected by the BPF verifier.
v2
-drop), and 4% (sample:xdp_redirect_map) on my
machine.
More details in each commit. Changes since the RFC is outlined in each
commit.
Cheers,
Björn
Björn Töpel (2):
bpf, xdp: per-map bpf_redirect_map functions for XDP
bpf, xdp: restructure redirect actions
include/linux/bpf.h| 21
On 2021-02-20 18:00, kernel test robot wrote:
Hi "Björn,
I love your patch! Yet something to improve:
[auto build test ERROR on 7b1e385c9a488de9291eaaa412146d3972e9dec5]
url:
https://github.com/0day-ci/linux/commits/Bj-rn-T-pel/Optimize-bpf_redirect_map-xdp_do_redirect/20210220-233623
base
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.
Here, an explicit
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds one bpf_redirect_map() implementation per
map. Correct function is automatically selected by the BPF verifier.
v1
-drop), and 4% (sample:xdp_redirect_map) on my
machine.
More details in each commit. Changes since the RFC is outlined in each
commit.
Cheers,
Björn
Björn Töpel (2):
bpf, xdp: per-map bpf_redirect_map functions for XDP
bpf, xdp: restructure redirect actions
include/linux/bpf.h| 21
On 2021-02-19 18:10, Toke Høiland-Jørgensen wrote:
+ case XDP_REDIR_DEV_MAP: {
struct bpf_dtab_netdev *dst = fwd;
I thought the braces around the case body looked a bit odd. I guess
that's to get a local scope for the dst var (and xs var below), right?
This is basically a c
On 2021-02-19 18:05, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
[...]
@@ -4110,22 +4094,17 @@ static const struct bpf_func_proto
bpf_xdp_redirect_proto = {
.arg2_type = ARG_ANYTHING,
};
-BPF_CALL_3(bpf_xdp_redirect_map, struct bpf_map *, map, u32, ifindex
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds one bpf_redirect_map() implementation per
map. Correct function is automatically selected by the BPF verifier.
rfc
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.
Here, an explicit
-drop), and 4% (sample:xdp_redirect_map) on my
machine.
More details in each commit. Changes since the RFC is outlined in each
commit.
Cheers,
Björn
Björn Töpel (2):
bpf, xdp: per-map bpf_redirect_map functions for XDP
bpf, xdp: restructure redirect actions
include/linux/bpf.h| 20
On Wed, 17 Feb 2021 at 17:33, Ciara Loftus wrote:
>
> Prior to this commit individual xsk tests were launched from the
> shell script 'test_xsk.sh'. When adding a new test type, two new test
> configurations had to be added to this file - one for each of the
> supported XDP 'modes' (skb or drv). S
On 2021-02-16 03:23, Maciej Fijalkowski wrote:
On Mon, Feb 15, 2021 at 04:18:28PM -0800, John Fastabend wrote:
[...]
Once again, is libxdp going to land in th kernel? Still not clear to me.
No, libxdp does not live in the kernel tree.
Björn
[...]
On 2021-02-15 21:24, John Fastabend wrote:
Maciej Fijalkowski wrote:
With the introduction of bpf_link in xsk's libbpf part, there's no
further need for explicit unload of prog on xdpsock's termination. When
process dies, the bpf_link's refcount will be decremented and resources
will be unloaded
On 2021-02-15 21:49, John Fastabend wrote:
Maciej Fijalkowski wrote:
Currently, if there are multiple xdpsock instances running on a single
interface and in case one of the instances is terminated, the rest of
them are left in an inoperable state due to the fact of unloaded XDP
prog from interfa
On 2021-02-16 03:01, Maciej Fijalkowski wrote:
On Mon, Feb 15, 2021 at 08:35:29PM +0100, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
[...]
I'd say it's depending on the libbpf 1.0/libxdp merge timeframe. If
we're months ahead, then I'd really like to see this
On 2021-02-15 18:07, Toke Høiland-Jørgensen wrote:
Maciej Fijalkowski writes:
Currently, if there are multiple xdpsock instances running on a single
interface and in case one of the instances is terminated, the rest of
them are left in an inoperable state due to the fact of unloaded XDP
prog f
/netdev/20190603131907.13395-5-maciej.fijalkow...@intel.com/
In the meantime bpf_link was introduced and it seems that it can address
the issue of refcounting the XDP prog on interface. More info on commit
messages.
For the series:
Reviewed-by: Björn Töpel
Acked-by: Björn Töpel
Finally, bpf_link
-by: Stanislav Fomichev
Stanislav, apologies for the delay!
Tested-by: Björn Töpel
Acked-by: Björn Töpel
Björn
> ---
> tools/lib/bpf/xsk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/lib/bpf/xsk.c b/tools/lib/bpf/xsk.c
> index 20500fb1f17e..
From: Björn Töpel
The test_xdp_redirect.sh script uses a bash feature, '&>'. On systems,
e.g. Debian, where '/bin/sh' is dash, this will not work as
expected. Use bash in the shebang to get the expected behavior.
Further, using 'set -e' means that the
On 2021-02-10 21:13, Andrii Nakryiko wrote:
On Mon, Feb 8, 2021 at 11:45 PM Björn Töpel wrote:
From: Björn Töpel
The test_xdp_redirect.sh script uses a bash feature, '&>'. On systems,
e.g. Debian, where '/bin/sh' is dash, this will not work as
expected. Use bas
From: Björn Töpel
The test_xdp_redirect.sh script uses a bash feature, '&>'. On systems,
e.g. Debian, where '/bin/sh' is dash, this will not work as
expected. Use bash in the shebang to get the expected behavior.
Further, using 'set -e' means that the
On 2021-02-09 06:52, Andrii Nakryiko wrote:
On Sat, Feb 6, 2021 at 1:29 AM Björn Töpel wrote:
From: Björn Töpel
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' instead.
We have plenty of explicit b
From: Björn Töpel
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' instead.
Also remove the 'set -e' since the script actually relies on that the
return value can be used to determine pass
On Fri, 5 Feb 2021 at 18:39, Randy Dunlap wrote:
>
> On 2/5/21 9:30 AM, William Tu wrote:
> > On Fri, Feb 5, 2021 at 9:09 AM Björn Töpel wrote:
> >>
> >> From: Björn Töpel
> >>
> >> The test_xdp_redirect.sh script uses some bash-features, such
From: Björn Töpel
The test_xdp_redirect.sh script uses some bash-features, such as
'&>'. On systems that use dash as the sh implementation this will not
work as intended. Change the shebang to use bash instead.
Also remove the 'set -e' since the script actually reli
On 2021-02-01 10:31, Jesper Dangaard Brouer wrote:
On Mon, 1 Feb 2021 07:27:57 +0100
Björn Töpel wrote:
On 2021-01-29 17:45, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup
On 2021-01-29 17:45, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
From: Björn Töpel
Currently the bpf_redirect_map() implementation dispatches to the
correct map-lookup function via a switch-statement. To avoid the
dispatching, this change adds one bpf_redirect_map() implementation per
From: Björn Töpel
There is no need to cast to void * when the argument is void *. Avoid
cluttering of code.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf
From: Björn Töpel
Instead of casting from void *, let us use the actual type in
gen_udp_hdr().
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c
b/tools
From: Björn Töpel
The data variable is only used locally. Instead of using the heap,
stick to using the stack.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf
From: Björn Töpel
Use C89 rules for variable definition.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 12 +++-
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c
b/tools/testing/selftests/bpf
From: Björn Töpel
Use calloc instead of malloc where it makes sense, and avoid C++-style
void *-cast.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/bpf
From: Björn Töpel
Instead of casting from void *, let us use the actual type in
init_iface_config().
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 28
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/tools/testing/selftests
From: Björn Töpel
The allocated entry is immediately overwritten by an assignment. Fix
that.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c
b/tools/testing/selftests/bpf
From: Björn Töpel
Introduce a local variable to get rid of lot of casting. Move common
code outside the if/else-clause.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 29 ++--
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/tools
From: Björn Töpel
Let us use a local variable in nsswitchthread(), so we can remove a
lot of casting for better readability.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 24 +++-
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a
From: Björn Töpel
Silence three checkpatch style warnings.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.c | 14 +++---
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c
b/tools/testing/selftests/bpf
From: Björn Töpel
The enums undef and bidi are not used. Remove them.
Signed-off-by: Björn Töpel
---
tools/testing/selftests/bpf/xdpxceiver.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/xdpxceiver.h
b/tools/testing/selftests/bpf/xdpxceiver.h
index
This series is a number of fixes/cleanups, mainly to improve the
readability of the xdpxceiver selftest application.
Details in each commit!
Cheers,
Björn
Björn Töpel (12):
selftests/bpf: remove a lot of ifobject casting
selftests/bpf: remove unused enums
selftests/bpf: fix style
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 | 88
1 file changed, 43 insertions(+), 45
On 2021-01-22 14:19, Toke Høiland-Jørgensen wrote:
Björn Töpel writes:
This series has some clean up/performance improvements for XDP
sockets.
The first two patches are cleanups for the AF_XDP core, and the
restructure actually give a little performance boost.
The last patch adds support
tps://lore.kernel.org/bpf/20210119155013.154808-1-bjorn.to...@gmail.com/
Björn Töpel (3):
xsk: remove explicit_free parameter from __xsk_rcv()
xsk: fold xp_assign_dev and __xp_assign_dev
libbpf, xsk: select AF_XDP BPF program based on kernel version
net/xdp/xsk.c | 47 +++
net
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 Thu, 21 Jan 2021 at 08:39, Andrii Nakryiko wrote:
>
> On Tue, Jan 19, 2021 at 7:55 AM 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
>
On 2021-01-20 22:15, Alexei Starovoitov wrote:
On Wed, Jan 20, 2021 at 12:26 PM Toke Høiland-Jørgensen wrote:
This argument, however, I buy: bpf_redirect() is the single-purpose
helper for redirecting to an ifindex, bpf_redirect_xsk() is the
single-purpose helper for redirecting to an XSK, and
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
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 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 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 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 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 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 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 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 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
1 - 100 of 1059 matches
Mail list logo