mbox series

[bpf-next,v3,0/4] Fixes for sock_fields selftests

Message ID 20220317113920.1068535-1-jakub@cloudflare.com (mailing list archive)
Headers show
Series Fixes for sock_fields selftests | expand

Message

Jakub Sitnicki March 17, 2022, 11:39 a.m. UTC
I think we have reached a consensus [1] on how the test for the 4-byte load from
bpf_sock->dst_port and bpf_sk_lookup->remote_port should look, so here goes v3.

I will submit a separate set of patches for bpf_sk_lookup->remote_port tests.


This series has been tested on x86_64 and s390 on top of recent bpf-next -
ad13baf45691 ("selftests/bpf: Test subprog jit when toggle bpf_jit_harden
repeatedly").

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

v2 -> v3:
- Split what was previously patch 2 which was doing two things
- Use BPF_TCP_* constants (Martin)
- Treat the result of 4-byte load from dst_port as a 16-bit value (Martin)
- Typo fixup and some rewording in patch 4 description

v1 -> v2:
- Limit read_sk_dst_port only to client traffic (patch 2)
- Make read_sk_dst_port pass on litte- and big-endian (patch 3)

v1: https://lore.kernel.org/bpf/20220225184130.483208-1-jakub@cloudflare.com/
v2: https://lore.kernel.org/bpf/20220227202757.519015-1-jakub@cloudflare.com/

Jakub Sitnicki (4):
  selftests/bpf: Fix error reporting from sock_fields programs
  selftests/bpf: Check dst_port only on the client socket
  selftests/bpf: Use constants for socket states in sock_fields test
  selftests/bpf: Fix test for 4-byte load from dst_port on big-endian

 .../selftests/bpf/progs/test_sock_fields.c    | 24 +++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)

Comments

Martin KaFai Lau March 18, 2022, 1:01 a.m. UTC | #1
On Thu, Mar 17, 2022 at 12:39:16PM +0100, Jakub Sitnicki wrote:
> I think we have reached a consensus [1] on how the test for the 4-byte load from
> bpf_sock->dst_port and bpf_sk_lookup->remote_port should look, so here goes v3.
> 
> I will submit a separate set of patches for bpf_sk_lookup->remote_port tests.
> 
> 
> This series has been tested on x86_64 and s390 on top of recent bpf-next -
> ad13baf45691 ("selftests/bpf: Test subprog jit when toggle bpf_jit_harden
> repeatedly").
> 
> [1] https://lore.kernel.org/bpf/87k0cwxkzs.fsf@cloudflare.com/
> 
> v2 -> v3:
> - Split what was previously patch 2 which was doing two things
> - Use BPF_TCP_* constants (Martin)
> - Treat the result of 4-byte load from dst_port as a 16-bit value (Martin)
> - Typo fixup and some rewording in patch 4 description
Thanks for your work on this and reached a resolution with the remote_port !

Acked-by: Martin KaFai Lau <kafai@fb.com>
patchwork-bot+netdevbpf@kernel.org March 18, 2022, 2:50 p.m. UTC | #2
Hello:

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

On Thu, 17 Mar 2022 12:39:16 +0100 you wrote:
> I think we have reached a consensus [1] on how the test for the 4-byte load from
> bpf_sock->dst_port and bpf_sk_lookup->remote_port should look, so here goes v3.
> 
> I will submit a separate set of patches for bpf_sk_lookup->remote_port tests.
> 
> 
> This series has been tested on x86_64 and s390 on top of recent bpf-next -
> ad13baf45691 ("selftests/bpf: Test subprog jit when toggle bpf_jit_harden
> repeatedly").
> 
> [...]

Here is the summary with links:
  - [bpf-next,v3,1/4] selftests/bpf: Fix error reporting from sock_fields programs
    https://git.kernel.org/bpf/bpf-next/c/a4c9fe0ed4a1
  - [bpf-next,v3,2/4] selftests/bpf: Check dst_port only on the client socket
    https://git.kernel.org/bpf/bpf-next/c/2d2202ba858c
  - [bpf-next,v3,3/4] selftests/bpf: Use constants for socket states in sock_fields test
    https://git.kernel.org/bpf/bpf-next/c/e06b5bbcf3f1
  - [bpf-next,v3,4/4] selftests/bpf: Fix test for 4-byte load from dst_port on big-endian
    https://git.kernel.org/bpf/bpf-next/c/deb594004644

You are awesome, thank you!