All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames
@ 2023-03-13 21:55 Alexander Lobakin
  2023-03-13 21:55 ` [PATCH bpf-next v3 1/4] selftests/bpf: robustify test_xdp_do_redirect with more payload magics Alexander Lobakin
                   ` (5 more replies)
  0 siblings, 6 replies; 26+ messages in thread
From: Alexander Lobakin @ 2023-03-13 21:55 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau
  Cc: Alexander Lobakin, Maciej Fijalkowski, Larysa Zaremba,
	Toke Høiland-Jørgensen, Song Liu,
	Jesper Dangaard Brouer, John Fastabend, Menglong Dong,
	Mykola Lysenko, David S. Miller, Jakub Kicinski, Eric Dumazet,
	Paolo Abeni, bpf, netdev, linux-kernel

Yeah, I still remember that "Who needs cpumap nowadays" (c), but anyway.

__xdp_build_skb_from_frame() missed the moment when the networking stack
became able to recycle skb pages backed by a page_pool. This was making
e.g. cpumap redirect even less effective than simple %XDP_PASS. veth was
also affected in some scenarios.
A lot of drivers use skb_mark_for_recycle() already, it's been almost
two years and seems like there are no issues in using it in the generic
code too. {__,}xdp_release_frame() can be then removed as it losts its
last user.
Page Pool becomes then zero-alloc (or almost) in the abovementioned
cases, too. Other memory type models (who needs them at this point)
have no changes.

Some numbers on 1 Xeon Platinum core bombed with 27 Mpps of 64-byte
IPv6 UDP, iavf w/XDP[0] (CONFIG_PAGE_POOL_STATS is enabled):

Plain %XDP_PASS on baseline, Page Pool driver:

src cpu Rx     drops  dst cpu Rx
  2.1 Mpps       N/A    2.1 Mpps

cpumap redirect (cross-core, w/o leaving its NUMA node) on baseline:

  6.8 Mpps  5.0 Mpps    1.8 Mpps

cpumap redirect with skb PP recycling:

  7.9 Mpps  5.7 Mpps    2.2 Mpps
                       +22% (from cpumap redir on baseline)

[0] https://github.com/alobakin/linux/commits/iavf-xdp

Alexander Lobakin (4):
  selftests/bpf: robustify test_xdp_do_redirect with more payload magics
  net: page_pool, skbuff: make skb_mark_for_recycle() always available
  xdp: recycle Page Pool backed skbs built from XDP frames
  xdp: remove unused {__,}xdp_release_frame()

 include/linux/skbuff.h                        |  4 +--
 include/net/xdp.h                             | 29 ---------------
 net/core/xdp.c                                | 19 ++--------
 .../bpf/progs/test_xdp_do_redirect.c          | 36 +++++++++++++------
 4 files changed, 30 insertions(+), 58 deletions(-)

---
From v2[1]:
* fix the test_xdp_do_redirect selftest failing after the series: it was
  relying on that %XDP_PASS frames can't be recycled on veth
  (BPF CI, Alexei);
* explain "w/o leaving its node" in the cover letter (Jesper).

From v1[2]:
* make skb_mark_for_recycle() always available, otherwise there are build
  failures on non-PP systems (kbuild bot);
* 'Page Pool' -> 'page_pool' when it's about a page_pool instance, not
  API (Jesper);
* expanded test system info a bit in the cover letter (Jesper).

[1] https://lore.kernel.org/bpf/20230303133232.2546004-1-aleksander.lobakin@intel.com
[2] https://lore.kernel.org/bpf/20230301160315.1022488-1-aleksander.lobakin@intel.com
-- 
2.39.2


^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames
@ 2023-03-13 21:42 Alexander Lobakin
  2023-03-16 11:57 ` Alexander Lobakin
  0 siblings, 1 reply; 26+ messages in thread
From: Alexander Lobakin @ 2023-03-13 21:42 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau
  Cc: Alexander Lobakin, Maciej Fijalkowski, Larysa Zaremba,
	Toke Høiland-Jørgensen, Song Liu,
	Jesper Dangaard Brouer, John Fastabend, Menglong Dong,
	Mykola Lysenko, David S. Miller, Jakub Kicinski, Eric Dumazet,
	Paolo Abeni, bpf, netdev, linux-kernel

Yeah, I still remember that "Who needs cpumap nowadays" (c), but anyway.

__xdp_build_skb_from_frame() missed the moment when the networking stack
became able to recycle skb pages backed by a page_pool. This was making
e.g. cpumap redirect even less effective than simple %XDP_PASS. veth was
also affected in some scenarios.
A lot of drivers use skb_mark_for_recycle() already, it's been almost
two years and seems like there are no issues in using it in the generic
code too. {__,}xdp_release_frame() can be then removed as it losts its
last user.
Page Pool becomes then zero-alloc (or almost) in the abovementioned
cases, too. Other memory type models (who needs them at this point)
have no changes.

Some numbers on 1 Xeon Platinum core bombed with 27 Mpps of 64-byte
IPv6 UDP, iavf w/XDP[0] (CONFIG_PAGE_POOL_STATS is enabled):

Plain %XDP_PASS on baseline, Page Pool driver:

src cpu Rx     drops  dst cpu Rx
  2.1 Mpps       N/A    2.1 Mpps

cpumap redirect (cross-core, w/o leaving its NUMA node) on baseline:

  6.8 Mpps  5.0 Mpps    1.8 Mpps

cpumap redirect with skb PP recycling:

  7.9 Mpps  5.7 Mpps    2.2 Mpps
                       +22% (from cpumap redir on baseline)

[0] https://github.com/alobakin/linux/commits/iavf-xdp

Alexander Lobakin (4):
  selftests/bpf: robustify test_xdp_do_redirect with more payload magics
  net: page_pool, skbuff: make skb_mark_for_recycle() always available
  xdp: recycle Page Pool backed skbs built from XDP frames
  xdp: remove unused {__,}xdp_release_frame()

 include/linux/skbuff.h                        |  4 +--
 include/net/xdp.h                             | 29 ---------------
 net/core/xdp.c                                | 19 ++--------
 .../bpf/progs/test_xdp_do_redirect.c          | 36 +++++++++++++------
 4 files changed, 30 insertions(+), 58 deletions(-)

---
From v2[1]:
* fix the test_xdp_do_redirect selftest failing after the series: it was
  relying on that %XDP_PASS frames can't be recycled on veth
  (BPF CI, Alexei);
* explain "w/o leaving its node" in the cover letter (Jesper).

From v1[2]:
* make skb_mark_for_recycle() always available, otherwise there are build
  failures on non-PP systems (kbuild bot);
* 'Page Pool' -> 'page_pool' when it's about a page_pool instance, not
  API (Jesper);
* expanded test system info a bit in the cover letter (Jesper).

[1] https://lore.kernel.org/bpf/20230303133232.2546004-1-aleksander.lobakin@intel.com
[2] https://lore.kernel.org/bpf/20230301160315.1022488-1-aleksander.lobakin@intel.com
-- 
2.39.2


^ permalink raw reply	[flat|nested] 26+ messages in thread
* [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames
@ 2023-03-13 19:08 Alexander Lobakin
  0 siblings, 0 replies; 26+ messages in thread
From: Alexander Lobakin @ 2023-03-13 19:08 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau
  Cc: Alexander Lobakin, Maciej Fijalkowski, Larysa Zaremba,
	Toke Høiland-Jørgensen, Song Liu,
	Jesper Dangaard Brouer, John Fastabend, Menglong Dong,
	Mykola Lysenko, David S. Miller, Jakub Kicinski, Eric Dumazet,
	Paolo Abeni, bpf, netdev, linux-kernel

Yeah, I still remember that "Who needs cpumap nowadays" (c), but anyway.

__xdp_build_skb_from_frame() missed the moment when the networking stack
became able to recycle skb pages backed by a page_pool. This was making
e.g. cpumap redirect even less effective than simple %XDP_PASS. veth was
also affected in some scenarios.
A lot of drivers use skb_mark_for_recycle() already, it's been almost
two years and seems like there are no issues in using it in the generic
code too. {__,}xdp_release_frame() can be then removed as it losts its
last user.
Page Pool becomes then zero-alloc (or almost) in the abovementioned
cases, too. Other memory type models (who needs them at this point)
have no changes.

Some numbers on 1 Xeon Platinum core bombed with 27 Mpps of 64-byte
IPv6 UDP, iavf w/XDP[0] (CONFIG_PAGE_POOL_STATS is enabled):

Plain %XDP_PASS on baseline, Page Pool driver:

src cpu Rx     drops  dst cpu Rx
  2.1 Mpps       N/A    2.1 Mpps

cpumap redirect (cross-core, w/o leaving its NUMA node) on baseline:

  6.8 Mpps  5.0 Mpps    1.8 Mpps

cpumap redirect with skb PP recycling:

  7.9 Mpps  5.7 Mpps    2.2 Mpps
                       +22% (from cpumap redir on baseline)

[0] https://github.com/alobakin/linux/commits/iavf-xdp

Alexander Lobakin (4):
  selftests/bpf: robustify test_xdp_do_redirect with more payload magics
  net: page_pool, skbuff: make skb_mark_for_recycle() always available
  xdp: recycle Page Pool backed skbs built from XDP frames
  xdp: remove unused {__,}xdp_release_frame()

 include/linux/skbuff.h                        |  4 +--
 include/net/xdp.h                             | 29 ---------------
 net/core/xdp.c                                | 19 ++--------
 .../bpf/progs/test_xdp_do_redirect.c          | 36 +++++++++++++------
 4 files changed, 30 insertions(+), 58 deletions(-)

---
From v2[1]:
* fix the test_xdp_do_redirect selftest failing after the series: it was
  relying on that %XDP_PASS frames can't be recycled on veth
  (BPF CI, Alexei);
* explain "w/o leaving its node" in the cover letter (Jesper).

From v1[2]:
* make skb_mark_for_recycle() always available, otherwise there are build
  failures on non-PP systems (kbuild bot);
* 'Page Pool' -> 'page_pool' when it's about a page_pool instance, not
  API (Jesper);
* expanded test system info a bit in the cover letter (Jesper).

[1] https://lore.kernel.org/bpf/20230303133232.2546004-1-aleksander.lobakin@intel.com
[2] https://lore.kernel.org/bpf/20230301160315.1022488-1-aleksander.lobakin@intel.com
-- 
2.39.2


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-03-17 13:38 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-13 21:55 [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 1/4] selftests/bpf: robustify test_xdp_do_redirect with more payload magics Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 2/4] net: page_pool, skbuff: make skb_mark_for_recycle() always available Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 3/4] xdp: recycle Page Pool backed skbs built from XDP frames Alexander Lobakin
2023-03-15 14:55   ` Jesper Dangaard Brouer
2023-03-15 14:58     ` Alexander Lobakin
2023-03-16 17:10       ` Jesper Dangaard Brouer
2023-03-17 13:36         ` Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 4/4] xdp: remove unused {__,}xdp_release_frame() Alexander Lobakin
2023-03-14 11:37   ` Yunsheng Lin
2023-03-14 12:27     ` Alexander Lobakin
2023-03-14 11:57 ` [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames Alexander Lobakin
2023-03-14 18:52   ` Alexei Starovoitov
2023-03-14 23:54     ` Alexei Starovoitov
2023-03-15  9:56       ` Alexander Lobakin
2023-03-15 10:54         ` Alexander Lobakin
2023-03-15 14:54           ` Ilya Leoshkevich
2023-03-15 18:00             ` Ilya Leoshkevich
2023-03-15 18:12               ` Alexander Lobakin
2023-03-15 18:26                 ` Ilya Leoshkevich
2023-03-16 13:22                   ` Alexander Lobakin
2023-03-15 16:55           ` Alexei Starovoitov
2023-03-14 22:30 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2023-03-13 21:42 Alexander Lobakin
2023-03-16 11:57 ` Alexander Lobakin
2023-03-13 19:08 Alexander Lobakin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.