Skip to content

bpf_redirect_peer fixes

Daniel Borkmann bpf netdev 3 versions – Applied

Status from this message: This series was applied to bpf/bpf.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 2 repliesApplied 8/8
  2. v28 patches 13 repliesSuperseded
  3. v16 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- Add kdoc for pcpu_stat_type (Simon)
- Reject invalid type value in netdev_do_alloc_pcpu_stats (Simon)
- Add Reviewed-by tags from list

Patches in v3 All 8 applied

#Subject and filesSizeRepliesApplied
1/8net, vrf: Move dstats structure to coredrivers/net/vrf.c include/linux/netdevice.h+17 -170 repliesApplied
2/8net: Move {l,t,d}stats allocation to core and convert veth & vrfdrivers/net/veth.c drivers/net/vrf.c include/linux/netdevice.h +1 more+69 -300 repliesApplied
3/8netkit: Add tstats per-CPU traffic countersdrivers/net/netkit.c+18 -10 repliesApplied
4/8veth: Use tstats per-CPU traffic countersdrivers/net/veth.c+11 -190 repliesApplied
5/8bpf: Fix dev's rx stats for bpf_redirect_peer trafficnet/core/dev.c net/core/filter.c+9 -00 repliesApplied
6/8bpf, netkit: Add indirect call wrapper for fetching peer devdrivers/net/netkit.c include/net/netkit.h net/core/filter.c+21 -60 repliesApplied
7/8selftests/bpf: De-veth-ize the tc_redirect test casetools/testing/selftests/bpf/prog_tests/tc_redirect.c+137 -1260 repliesApplied
8/8selftests/bpf: Add netkit to tc_redirect selftesttools/testing/selftests/bpf/prog_tests/tc_redirect.c+52 -00 repliesApplied

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNikolay AleksandrovStanislav FomichevMartin KaFai Lau
SeriesA-b
1/8R-b
2/8R-b
3/8A-b
4/8R-b
5/8R-b
6/8A-b
7/8R-b A-b
8/8R-b A-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 v3 thread

Cover letter [PATCH bpf v3 0/8] bpf_redirect_peer fixes

This fixes bpf_redirect_peer stats accounting for veth and netkit, and adds tstats in the first place for the latter. Utilise indirect call wrapper for bpf_redirect_peer, and improve test coverage of the latter also for netkit devices. Details in the patches, thanks!

The series was targeted at bpf originally, and is done here as well, so it can trigger BPF CI. Jakub, if you think directly going via net is better since the majority of the diff touches net anyway, that is fine, too.

Thanks!

v2 -> v3:
- Add kdoc for pcpu_stat_type (Simon)
- Reject invalid type value in netdev_do_alloc_pcpu_stats (Simon)
- Add Reviewed-by tags from list
v1 -> v2:
- Move stats allocation/freeing into net core (Jakub)
- As prepwork for the above, move vrf's dstats over into the core
- Add a check into stats alloc to enforce tstats upon implementing ndo_get_peer_dev
- Add Acked-by tags from list

Daniel Borkmann (6):
net, vrf: Move dstats structure to core
net: Move {l,t,d}stats allocation to core and convert veth & vrf
netkit: Add tstats per-CPU traffic counters
bpf, netkit: Add indirect call wrapper for fetching peer dev selftests/bpf: De-veth-ize the tc_redirect test case selftests/bpf: Add netkit to tc_redirect selftest

Peilin Ye (2):
veth: Use tstats per-CPU traffic counters
bpf: Fix dev's rx stats for bpf_redirect_peer traffic

 drivers/net/netkit.c                          |  22 +-
 drivers/net/veth.c                            |  44 +--
 drivers/net/vrf.c                             |  38 +--
 include/linux/netdevice.h                     |  30 +-
 include/net/netkit.h                          |   6 +
 net/core/dev.c                                |  57 +++-
 net/core/filter.c                             |  19 +-
 .../selftests/bpf/prog_tests/tc_redirect.c    | 317 +++++++++++-------
 8 files changed, 334 insertions(+), 199 deletions(-)
Signature · 1 line
2.34.1