mbox series

[v2,bpf-next,0/4] flow_dissector: Allow bpf flow-dissector progs to request fallback to normal dissection

Message ID 20220821113519.116765-1-shmulik.ladkani@gmail.com (mailing list archive)
Headers show
Series flow_dissector: Allow bpf flow-dissector progs to request fallback to normal dissection | expand

Message

Shmulik Ladkani Aug. 21, 2022, 11:35 a.m. UTC
Currently, attaching BPF_PROG_TYPE_FLOW_DISSECTOR programs completely
replaces the flow-dissector logic with custom dissection logic.
This forces implementors to write programs that handle dissection for
any flows expected in the namespace.

It makes sense for flow-dissector bpf programs to just augment the
dissector with custom logic (e.g. dissecting certain flows or custom
protocols), while enjoying the broad capabilities of the standard
dissector for any other traffic.

v2:
- Extend selftests/bpf/progs/bpf_flow.c to exercise new ret code

Shmulik Ladkani (4):
  flow_dissector: Make 'bpf_flow_dissect' return the bpf program retcode
  bpf/flow_dissector: Introduce BPF_FLOW_DISSECTOR_CONTINUE retcode for
    flow-dissector bpf progs
  bpf: test_run: Propagate bpf_flow_dissect's retval to user's
    bpf_attr.test.retval
  selftests/bpf: test BPF_FLOW_DISSECTOR_CONTINUE

 include/linux/skbuff.h                        |  4 +-
 include/uapi/linux/bpf.h                      |  5 +++
 net/core/flow_dissector.c                     | 16 ++++---
 tools/include/uapi/linux/bpf.h                |  5 +++
 .../selftests/bpf/prog_tests/flow_dissector.c | 44 ++++++++++++++++++-
 .../prog_tests/flow_dissector_load_bytes.c    |  2 +-
 tools/testing/selftests/bpf/progs/bpf_flow.c  | 15 +++++++
 .../selftests/bpf/test_flow_dissector.sh      |  8 ++++
 8 files changed, 89 insertions(+), 10 deletions(-)

Comments

Stanislav Fomichev Aug. 22, 2022, 6:06 p.m. UTC | #1
On Sun, Aug 21, 2022 at 4:35 AM Shmulik Ladkani
<shmulik@metanetworks.com> wrote:
>
> Currently, attaching BPF_PROG_TYPE_FLOW_DISSECTOR programs completely
> replaces the flow-dissector logic with custom dissection logic.
> This forces implementors to write programs that handle dissection for
> any flows expected in the namespace.
>
> It makes sense for flow-dissector bpf programs to just augment the
> dissector with custom logic (e.g. dissecting certain flows or custom
> protocols), while enjoying the broad capabilities of the standard
> dissector for any other traffic.
>
> v2:
> - Extend selftests/bpf/progs/bpf_flow.c to exercise new ret code

The series looks good to me, thank you!

Reviewed-by: Stanislav Fomichev <sdf@google.com>
John Fastabend Aug. 23, 2022, 7:38 a.m. UTC | #2
Shmulik Ladkani wrote:
> Currently, attaching BPF_PROG_TYPE_FLOW_DISSECTOR programs completely
> replaces the flow-dissector logic with custom dissection logic.
> This forces implementors to write programs that handle dissection for
> any flows expected in the namespace.
> 
> It makes sense for flow-dissector bpf programs to just augment the
> dissector with custom logic (e.g. dissecting certain flows or custom
> protocols), while enjoying the broad capabilities of the standard
> dissector for any other traffic.
> 
> v2:
> - Extend selftests/bpf/progs/bpf_flow.c to exercise new ret code
> 
> Shmulik Ladkani (4):
>   flow_dissector: Make 'bpf_flow_dissect' return the bpf program retcode
>   bpf/flow_dissector: Introduce BPF_FLOW_DISSECTOR_CONTINUE retcode for
>     flow-dissector bpf progs
>   bpf: test_run: Propagate bpf_flow_dissect's retval to user's
>     bpf_attr.test.retval
>   selftests/bpf: test BPF_FLOW_DISSECTOR_CONTINUE
> 
>  include/linux/skbuff.h                        |  4 +-
>  include/uapi/linux/bpf.h                      |  5 +++
>  net/core/flow_dissector.c                     | 16 ++++---
>  tools/include/uapi/linux/bpf.h                |  5 +++
>  .../selftests/bpf/prog_tests/flow_dissector.c | 44 ++++++++++++++++++-
>  .../prog_tests/flow_dissector_load_bytes.c    |  2 +-
>  tools/testing/selftests/bpf/progs/bpf_flow.c  | 15 +++++++
>  .../selftests/bpf/test_flow_dissector.sh      |  8 ++++
>  8 files changed, 89 insertions(+), 10 deletions(-)
> 
> -- 
> 2.37.2
> 

LGTM.

Acked-by: John Fastabend <john.fastabend@gmail.com>
patchwork-bot+netdevbpf@kernel.org Aug. 23, 2022, 8:50 p.m. UTC | #3
Hello:

This series was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Sun, 21 Aug 2022 14:35:15 +0300 you wrote:
> Currently, attaching BPF_PROG_TYPE_FLOW_DISSECTOR programs completely
> replaces the flow-dissector logic with custom dissection logic.
> This forces implementors to write programs that handle dissection for
> any flows expected in the namespace.
> 
> It makes sense for flow-dissector bpf programs to just augment the
> dissector with custom logic (e.g. dissecting certain flows or custom
> protocols), while enjoying the broad capabilities of the standard
> dissector for any other traffic.
> 
> [...]

Here is the summary with links:
  - [v2,bpf-next,1/4] flow_dissector: Make 'bpf_flow_dissect' return the bpf program retcode
    https://git.kernel.org/bpf/bpf-next/c/0ba985024ae7
  - [v2,bpf-next,2/4] bpf/flow_dissector: Introduce BPF_FLOW_DISSECTOR_CONTINUE retcode for flow-dissector bpf progs
    https://git.kernel.org/bpf/bpf-next/c/91350fe15293
  - [v2,bpf-next,3/4] bpf: test_run: Propagate bpf_flow_dissect's retval to user's bpf_attr.test.retval
    https://git.kernel.org/bpf/bpf-next/c/5deedfbee842
  - [v2,bpf-next,4/4] selftests/bpf: test BPF_FLOW_DISSECTOR_CONTINUE
    https://git.kernel.org/bpf/bpf-next/c/d6513727c2af

You are awesome, thank you!