Skip to content

selftests/bpf: Restore test_offload.py to working order

Toke Høiland-Jørgensen bpf linux-omap netdev 4 versions – Applied

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

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 2 repliesApplied 7/7
  2. v37 patches 1 replySuperseded
  3. v27 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v17 patches6 repliesSuperseded

Changes in v4 from the cover letter

- Accidentally truncated the Fixes: hashes in patches 3/4 to 11 chars

Patches in v4 All 7 applied

#Subject and filesSizeRepliesApplied
1/7xdp: remove the xdp_attachment_flags_ok() callbackdrivers/net/ethernet/netronome/nfp/nfp_net_common.c drivers/net/ethernet/ti/cpsw_priv.c drivers/net/netdevsim/bpf.c +3 more+20 -280 repliesApplied
2/7selftests/bpf/test_offload.py: Remove check for program load flags matchtools/testing/selftests/bpf/test_offload.py+5 -170 repliesApplied
3/7netdevsim: Add debugfs toggle to reject BPF programs in verifierdrivers/net/netdevsim/bpf.c drivers/net/netdevsim/netdevsim.h+11 -20 repliesApplied
4/7selftests/bpf/test_offload.py: only check verifier log on verification failstools/testing/selftests/bpf/test_offload.py+17 -20 repliesApplied
5/7selftests/bpf/test_offload.py: fix expected case of extack messagestools/testing/selftests/bpf/test_offload.py+2 -20 repliesApplied
6/7selftests/bpf/test_offload.py: reset ethtool features after failed settingtools/testing/selftests/bpf/test_offload.py+1 -00 repliesApplied
7/7selftests/bpf/test_offload.py: filter bpftool internal map when counting mapstools/testing/selftests/bpf/test_offload.py+4 -30 repliesApplied

Reviews trailers per patch

1 of 7 patches has a Reviewed-by or Acked-by.

PatchJakub Kicinski
1/7
2/7
3/7A-b
4/7
5/7
6/7
7/7

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

Read the v4 thread

Cover letter [PATCH bpf v4 0/7] selftests/bpf: Restore test_offload.py to working order

This series restores the test_offload.py selftest to working order. It seems a number of subtle behavioural changes have crept into various subsystems which broke test_offload.py in a number of ways. Most of these are fairly benign changes where small adjustments to the test script seems to be the best fix, but one is an actual kernel bug that I've observed in the wild caused by a bad interaction between xdp_attachment_flags_ok() and the rework of XDP program handling in the core netdev code.

Patch 1 fixes the bug by removing xdp_attachment_flags_ok(), and the reminder of the patches are adjustments to test_offload.py, including a new feature for netdevsim to force a BPF verification fail. Please see the individual patches for details.

Changelog:

v4:
- Accidentally truncated the Fixes: hashes in patches 3/4 to 11 chars

v3:
- Add Fixes: tags

v2:
- Replace xdp_attachment_flags_ok() with a check in dev_xdp_attach()
- Better packing of struct nsim_dev

---

Toke Høiland-Jørgensen (7):
xdp: remove the xdp_attachment_flags_ok() callback selftests/bpf/test_offload.py: Remove check for program load flags match
netdevsim: Add debugfs toggle to reject BPF programs in verifier selftests/bpf/test_offload.py: only check verifier log on verification fails selftests/bpf/test_offload.py: fix expected case of extack messages selftests/bpf/test_offload.py: reset ethtool features after failed setting selftests/bpf/test_offload.py: filter bpftool internal map when counting maps

 drivers/net/netdevsim/bpf.c                 | 12 ++++-
 drivers/net/netdevsim/netdevsim.h           |  1 +
 tools/testing/selftests/bpf/test_offload.py | 53 +++++++++++----------
 3 files changed, 40 insertions(+), 26 deletions(-)