Skip to content

xdp: a fistful of generic changes pt. III

Alexander Lobakin bpf lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 4 repliesIn review 4 of 7 applied

Patches in v1 4 of 7 applied

#Subject and filesSizeRepliesApplied
1/7page_pool: add page_pool_dev_alloc_netmem()include/net/page_pool/helpers.h+9 -00 repliesApplied
2/7xdp: add generic xdp_buff_add_frag()include/linux/skbuff.h include/net/xdp.h net/core/xdp.c+118 -50 repliesApplied
3/7xdp: add generic xdp_build_skb_from_buff()include/net/xdp.h net/core/xdp.c+56 -00 repliesApplied
4/7xsk: make xsk_buff_add_frag() really add the frag via __xdp_buff_add_frag()drivers/net/ethernet/intel/i40e/i40e_xsk.c drivers/net/ethernet/intel/ice/ice_xsk.c include/net/xdp_sock_drv.h+20 -600 replies
5/7xsk: add generic XSk &xdp_buff -> skb conversioninclude/net/xdp.h net/core/xdp.c+113 -00 repliesApplied
6/7xsk: add helper to get &xdp_desc's DMA and meta pointer in one goinclude/net/xdp_sock_drv.h include/net/xsk_buff_pool.h net/xdp/xsk_buff_pool.c+71 -04 replies
7/7unroll: add generic loop unroll helpersinclude/linux/unroll.h+44 -00 replies

Reviews trailers per patch

5 of 7 patches have a Reviewed-by or Acked-by.

PatchMaciej FijalkowskiToke Høiland-JørgensenPrzemek Kitszel
1/7
2/7R-b
3/7R-b
4/7A-b
5/7R-b
6/7
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH net-next 0/7] xdp: a fistful of generic changes pt. III

XDP for idpf is currently 5.(6) chapters:
* convert Rx to libeth;
* convert Tx and stats to libeth;
* generic XDP and XSk code changes;
* generic XDP and XSk code additions pt. 1;
* generic XDP and XSk code additions pt. 2 (you are here);
* actual XDP for idpf via new libeth_xdp;
* XSk for idpf (via ^).

Part III.3 does the following:
* adds generic functions to build skbs from xdp_buffs (regular and XSk) and attach frags to xdp_buffs (regular and XSk);
* adds helper to optimize XSk xmit in drivers;
* add generic loop unroll hint macros.

Everything is prereq for libeth_xdp, but will be useful standalone as well: less code in drivers, faster XSk XDP_PASS, smaller object code.

Alexander Lobakin (7):
page_pool: add page_pool_dev_alloc_netmem()
xdp: add generic xdp_buff_add_frag()
xdp: add generic xdp_build_skb_from_buff()
xsk: make xsk_buff_add_frag() really add the frag via

    __xdp_buff_add_frag()

xsk: add generic XSk &xdp_buff -> skb conversion
xsk: add helper to get &xdp_desc's DMA and meta pointer in one go
unroll: add generic loop unroll helpers

 include/linux/skbuff.h                     |  16 +-
 include/linux/unroll.h                     |  44 +++++
 include/net/page_pool/helpers.h            |   9 ++
 include/net/xdp.h                          |  98 +++++++++++-
 include/net/xdp_sock_drv.h                 |  41 ++++-
 include/net/xsk_buff_pool.h                |   8 +
 drivers/net/ethernet/intel/i40e/i40e_xsk.c |  30 +---
 drivers/net/ethernet/intel/ice/ice_xsk.c   |  32 +---
 net/core/xdp.c                             | 178 +++++++++++++++++++++
 net/xdp/xsk_buff_pool.c                    |  40 +++++
 10 files changed, 431 insertions(+), 65 deletions(-)

---
Each patch except trivial 0001 was on the lists already.

Since the not applied part of Chapter III.2:
* rebase on top of Mina's netmem fixes;
* 0003: remove redundant double CONFIG_PAGE_POOL check (one inside and another one outside of skb_mark_for_recycle()) (Jakub);
* 0005: remove !CONFIG_PAGE_POOL code as unreachable (eBPF always selects it) (also Jakub);
* 0005: actually check the pfmemalloc flag of newly allocated frags;
* drop exporting static_key_{inc,dec}_cpuslocked() -- were used on slowpath in very unlikely case where saving a few cycles looked worse and less convienient than the "regular" way.

Signature · 1 line
2.47.1