mbox series

[bpf-next,v2,0/2] Split bpf_sock dst_port field

Message ID 20220130115518.213259-1-jakub@cloudflare.com (mailing list archive)
Headers show
Series Split bpf_sock dst_port field | expand

Message

Jakub Sitnicki Jan. 30, 2022, 11:55 a.m. UTC
This is a follow-up to discussion around the idea of making dst_port in struct
bpf_sock a 16-bit field that happened in [1].

v2:
- use an anonymous field for zero padding (Alexei)

v1:
- keep dst_field offset unchanged to prevent existing BPF program breakage
  (Martin)
- allow 8-bit loads from dst_port[0] and [1]
- add test coverage for the verifier and the context access converter

[1] https://lore.kernel.org/bpf/87sftbobys.fsf@cloudflare.com/

Jakub Sitnicki (2):
  bpf: Make dst_port field in struct bpf_sock 16-bit wide
  selftests/bpf: Extend verifier and bpf_sock tests for dst_port loads

 include/uapi/linux/bpf.h                      |  3 +-
 net/core/filter.c                             | 10 ++-
 tools/include/uapi/linux/bpf.h                |  3 +-
 .../selftests/bpf/prog_tests/sock_fields.c    | 58 +++++++++----
 .../selftests/bpf/progs/test_sock_fields.c    | 41 ++++++++++
 tools/testing/selftests/bpf/verifier/sock.c   | 81 ++++++++++++++++++-
 6 files changed, 173 insertions(+), 23 deletions(-)

Comments

Martin KaFai Lau Jan. 31, 2022, 8:14 p.m. UTC | #1
On Sun, Jan 30, 2022 at 12:55:16PM +0100, Jakub Sitnicki wrote:
> This is a follow-up to discussion around the idea of making dst_port in struct
> bpf_sock a 16-bit field that happened in [1].
> 
> v2:
> - use an anonymous field for zero padding (Alexei)
Acked-by: Martin KaFai Lau <kafai@fb.com>
patchwork-bot+netdevbpf@kernel.org Jan. 31, 2022, 8:53 p.m. UTC | #2
Hello:

This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

On Sun, 30 Jan 2022 12:55:16 +0100 you wrote:
> This is a follow-up to discussion around the idea of making dst_port in struct
> bpf_sock a 16-bit field that happened in [1].
> 
> v2:
> - use an anonymous field for zero padding (Alexei)
> 
> v1:
> - keep dst_field offset unchanged to prevent existing BPF program breakage
>   (Martin)
> - allow 8-bit loads from dst_port[0] and [1]
> - add test coverage for the verifier and the context access converter
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2,1/2] bpf: Make dst_port field in struct bpf_sock 16-bit wide
    https://git.kernel.org/bpf/bpf-next/c/4421a582718a
  - [bpf-next,v2,2/2] selftests/bpf: Extend verifier and bpf_sock tests for dst_port loads
    https://git.kernel.org/bpf/bpf-next/c/8f50f16ff39d

You are awesome, thank you!