Skip to content

Generic XDP improvements

Kumar Kartikeya Dwivedi bpf netdev 6 versions – Applied

Status from this message: Applied. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest5 patches 4 repliesApplied
  2. v55 patches 2 repliesSuperseded
  3. v45 patches 1 replySuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v35 patches7 repliesSuperseded
v25 patches1 replySuperseded
v14 patches2 repliesSuperseded

Changes in v6 from the cover letter

v5: https://lore.kernel.org/bpf/[email protected]
* Put rcpu->prog check before RCU-bh section to avoid do_softirq (Jesper)

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/5net: core: split out code to run generic XDP proginclude/linux/netdevice.h net/core/dev.c+55 -310 replies
2/5bitops: add non-atomic bitops for pointersinclude/linux/bitops.h include/linux/typecheck.h+59 -02 replies
3/5bpf: cpumap: implement generic cpumapinclude/linux/bpf.h include/linux/skbuff.h kernel/bpf/cpumap.c +2 more+114 -301 reply
4/5bpf: devmap: implement devmap prog execution for generic XDPinclude/linux/bpf.h kernel/bpf/devmap.c net/core/dev.c+39 -290 replies
5/5bpf: tidy xdp attach selfteststools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c+32 -500 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchToke Høiland-JørgensenJesper Dangaard Brouer
1/5R-b
2/5R-b
3/5R-b A-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH net-next v6 0/5] Generic XDP improvements

This small series makes some improvements to generic XDP mode and brings it closer to native XDP. Patch 1 splits out generic XDP processing into reusable parts, patch 2 adds pointer friendly wrappers for bitops (not have to cast back and forth the address of local pointer to unsigned long *), patch 3 implements generic cpumap support (details in commit) and patch 4 allows devmap bpf prog execution before generic_xdp_tx is called.

Patch 5 just updates a couple of selftests to adapt to changes in behavior (in that specifying devmap/cpumap prog fd in generic mode is now allowed).

Changelog:
----------
v5 -> v6
v5: https://lore.kernel.org/bpf/[email protected]
* Put rcpu->prog check before RCU-bh section to avoid do_softirq (Jesper)

v4 -> v5
v4: https://lore.kernel.org/bpf/[email protected]
* Add comments and examples for new bitops macros (Alexei)

v3 -> v4
v3: https://lore.kernel.org/bpf/[email protected]
* Add detach now that attach of XDP program succeeds (Toke)
* Clean up the test to use new ASSERT macros

v2 -> v3
v2: https://lore.kernel.org/bpf/[email protected]
* list_for_each_entry -> list_for_each_entry_safe (due to deletion of skb)

v1 -> v2
v1: https://lore.kernel.org/bpf/[email protected]
* Move __ptr_{set,clear,test}_bit to bitops.h (Toke)
Also changed argument order to match the bit op they wrap.
* Remove map value size checking functions for cpumap/devmap (Toke)
* Rework prog run for skb in cpu_map_kthread_run (Toke)
* Set skb->dev to dst->dev after devmap prog has run
* Don't set xdp rxq that will be overwritten in cpumap prog run

Kumar Kartikeya Dwivedi (5):
net: core: split out code to run generic XDP prog
bitops: add non-atomic bitops for pointers
bpf: cpumap: implement generic cpumap
bpf: devmap: implement devmap prog execution for generic XDP
bpf: tidy xdp attach selftests

 include/linux/bitops.h                        |  50 ++++++++
 include/linux/bpf.h                           |  10 +-
 include/linux/netdevice.h                     |   2 +
 include/linux/skbuff.h                        |  10 +-
 include/linux/typecheck.h                     |   9 ++
 kernel/bpf/cpumap.c                           | 116 +++++++++++++++---
 kernel/bpf/devmap.c                           |  49 ++++++--
 net/core/dev.c                                | 103 ++++++++--------
 net/core/filter.c                             |   6 +-
 .../bpf/prog_tests/xdp_cpumap_attach.c        |  43 +++----
 .../bpf/prog_tests/xdp_devmap_attach.c        |  39 +++---
 11 files changed, 298 insertions(+), 139 deletions(-)
Signature · 1 line
2.31.1