Skip to content

support flow dissector in BPF_PROG_TEST_RUN

Stanislav Fomichev netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net/flow_dissector: move bpf case into __skb_flow_bpf_dissectinclude/linux/skbuff.h net/core/flow_dissector.c+59 -380 replies
2/3bpf: add BPF_PROG_TEST_RUN support for flow dissectorinclude/linux/bpf.h net/bpf/test_run.c net/core/filter.c+78 -12 replies
3/3selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow dissectortools/testing/selftests/bpf/Makefile tools/testing/selftests/bpf/flow_dissector_load.c tools/testing/selftests/bpf/flow_dissector_load.h +1 more+139 -400 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] support flow dissector in BPF_PROG_TEST_RUN

This patch series adds support for testing flow dissector BPF programs by extending already existing BPF_PROG_TEST_RUN. The goal is to have a packet as an input and `struct bpf_flow_key' as an output. That way we can easily test flow dissector programs' behavior.
I've also modified existing test_progs.c test to do a simple flow dissector run as well.

* first patch introduces new __skb_flow_bpf_dissect to simplify sharing between __skb_flow_bpf_dissect and BPF_PROG_TEST_RUN
* second patch adds actual BPF_PROG_TEST_RUN support
* third patch adds example usage to the selftests

Stanislav Fomichev (3):
net/flow_dissector: move bpf case into __skb_flow_bpf_dissect
bpf: add BPF_PROG_TEST_RUN support for flow dissector selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow
dissector

 include/linux/bpf.h                           |  3 +
 include/linux/skbuff.h                        |  5 +
 net/bpf/test_run.c                            | 75 ++++++++++++++-
 net/core/filter.c                             |  1 +
 net/core/flow_dissector.c                     | 92 +++++++++++--------
 tools/testing/selftests/bpf/Makefile          |  3 +
 .../selftests/bpf/flow_dissector_load.c       | 43 +--------
 .../selftests/bpf/flow_dissector_load.h       | 55 +++++++++++
 tools/testing/selftests/bpf/test_progs.c      | 78 +++++++++++++++-
 9 files changed, 276 insertions(+), 79 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/flow_dissector_load.h
Signature · 1 line
2.20.1.321.g9e740568ce-goog