[PATCH bpf-next 0/6] use network helpers, part 4

2024-05-05 Thread Geliang Tang
From: Geliang Tang This patchset adds post_socket_cb pointer together with 'struct post_socket_opts cb_opts' into struct network_helper_opts to make start_server_addr() helper more flexible. With these modifications, many duplicate codes can be dropped. Patches 1-3 address Martin's comments in t

[PATCH bpf-next 2/6] selftests/bpf: Use start_server_addr in sockopt_inherit

2024-05-05 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in prog_tests/sockopt_inherit.c, use public helper start_server_addr() instead of the local defined function start_server(). This can avoid duplicate code. Add a helper custom_cb() to set SOL_CUSTOM sockopt looply, set it to post_socket_cb pointer of

[PATCH bpf-next 1/6] selftests/bpf: Add post_socket_cb for network_helper_opts

2024-05-05 Thread Geliang Tang
From: Geliang Tang __start_server() sets SO_REUSPORT through setsockopt() when the parameter 'reuseport' is set. This patch makes it more flexible by adding a function pointer post_socket_cb, together with 'struct post_socket_opts cb_opts' for future extension into struct network_helper_opts. The

[PATCH bpf-next 3/6] selftests/bpf: Use start_server_addr in test_tcp_check_syncookie

2024-05-05 Thread Geliang Tang
From: Geliang Tang Include network_helpers.h in test_tcp_check_syncookie_user.c, use public helper start_server_addr() in it instead of the local defined function start_server(). This can avoid duplicate code. Add two helpers v6only_true() and v6only_false() to set IPV6_V6ONLY sockopt to true or

[PATCH bpf-next 4/6] selftests/bpf: Use connect_to_fd in sockopt_inherit

2024-05-05 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_to_fd() exported in network_helpers.h instead of the local defined function connect_to_server() in prog_tests/sockopt_inherit.c. This can avoid duplicate code. Signed-off-by: Geliang Tang --- .../bpf/prog_tests/sockopt_inherit.c

[PATCH bpf-next 5/6] selftests/bpf: Use connect_to_fd in test_tcp_check_syncookie

2024-05-05 Thread Geliang Tang
From: Geliang Tang This patch uses public helper connect_to_fd() exported in network_helpers.h instead of the local defined function connect_to_server() in test_tcp_check_syncookie_user.c. This can avoid duplicate code. Then the arguments "addr" and "len" of run_test() become useless, drop them

[PATCH bpf-next 6/6] selftests/bpf: Drop get_port in test_tcp_check_syncookie

2024-05-05 Thread Geliang Tang
From: Geliang Tang The arguments "addr" and "len" of run_test() have dropped. This makes function get_port() useless. Drop it from test_tcp_check_syncookie_user.c. Signed-off-by: Geliang Tang --- .../bpf/test_tcp_check_syncookie_user.c | 21 +++ 1 file changed, 3 insertio

RE: [PATCH v3] selftests/vDSO: Explicit unsigned char conversion for elf_hash

2024-05-05 Thread David Laight
From: Justin Stitt > Sent: 01 May 2024 20:55 ... > > static unsigned long elf_hash(const unsigned char *name) ... > Is it possible to just change the types of the parameters of vdso_sym() > or does that trigger even more warnings on the callsites of vdso_sym()? Isn't the problem the definition of

[PATCH] selftests: introduce additional eventfd test coverage

2024-05-05 Thread Wen Yang
Add several new test cases which assert corner cases on the eventfd mechanism, for example, the supplied buffer is less than 8 bytes, attempting to write a value that is too large, etc. ./eventfd_test # Starting 9 tests from 1 test cases. # RUN global.eventfd01 .

Re: [PATCH] selftests/alsa: fix a build warning: return a value in all cases

2024-05-05 Thread Mark Brown
On Fri, May 03, 2024 at 07:13:30PM -0700, John Hubbard wrote: > dump_config_tree() is declared to return an int, but the compiler cannot > prove that it always returns any value at all. This leads to a clang > warning, when building via: > > make LLVM=1 -C tools/testing/selftests > > Fix this

Re: [PATCH] selftests/alsa: fix a build warning: return a value in all cases

2024-05-05 Thread Mark Brown
On Fri, May 03, 2024 at 07:13:30PM -0700, John Hubbard wrote: > dump_config_tree() is declared to return an int, but the compiler cannot > prove that it always returns any value at all. This leads to a clang > warning, when building via: Though given that the function isn't referenced we could als

[PATCH net-next v2 0/2] Fix icmp error source address over xfrm tunnel

2024-05-05 Thread Antony Antony
Hi, This fix, originally intended for XFRM/IPsec, has been recommended by Steffen Klassert to submit to the net tree. The patch addresses a minor issue related to the IPv4 source address of ICMP error messages, which originated from an old 2011 commit: 415b3334a21a ("icmp: Fix regression in nexth

[PATCH net-next v2 1/2] xfrm: fix source address in icmp error generation from IPsec gateway

2024-05-05 Thread Antony Antony
When enabling support for XFRM lookup using reverse ICMP payload, we have identified an issue where the source address of the IPv4, e.g., "Destination Host Unreachable" message, is incorrect. The error message received by the sender appears to originate from a non-existing/unreachable host. IPv6 s

[PATCH net-next v2 2/2] selftests/net: add ICMP unreachable over IPsec tunnel

2024-05-05 Thread Antony Antony
Add IPsec tunnel, aka xfrm state, tests with ICMP flags enabled. IPv4 and IPv6, unreachable tests over xfrm/IPsec tunnels, xfrm SA with "flag icmp" set. Signed-off-by: Antony Antony --- tools/testing/selftests/net/Makefile | 1 + tools/testing/selftests/net/xfrm_state.sh | 624 +++

Re: [PATCH] selftests/alsa: fix a build warning: return a value in all cases

2024-05-05 Thread John Hubbard
On 5/5/24 7:53 AM, Mark Brown wrote: On Fri, May 03, 2024 at 07:13:30PM -0700, John Hubbard wrote: dump_config_tree() is declared to return an int, but the compiler cannot prove that it always returns any value at all. This leads to a clang warning, when building via: Though given that the fun

[PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()

2024-05-05 Thread John Hubbard
dump_config_tree() is declared to return an int, but the compiler cannot prove that it always returns any value at all. This leads to a clang warning, when building via: make LLVM=1 -C tools/testing/selftests Furthermore, Mark Brown noticed that dump_config_tree() isn't even used anymore, so

[PATCH] selftests/timers: remove unused irqcount variable

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about an unused irqcount variable. clang is correct: the variable is incremented and then ignored. Fix this by deleting the irqcount variable. Signed-off-by: John Hubbard --- tools/testing/selftests/timers

[PATCH] selftests/user_events: silence a clang warning: address of packed member

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about "taking address of packed member 'write_index' ". This is not particularly helpful, because the test code really wants to write to exactly this location, and if it ends up being unaligned, then the test

[PATCH 1/2] selftests/netfilter: use socklen_t, not a signed int, for len

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about using "int *" interchangeably with "socklen_t *". clang is correct, so fix this by declaring len as a socklen_t, instead of as an int. Signed-off-by: John Hubbard --- tools/testing/selftests/netfilte

[PATCH 2/2] selftests/netfilter: return a value for several "int" functions

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftests ...clang warns, correctly, that several functions declared with an "int" return type are not always returning values in all cases (or at least, clang cannot prove that they always return a value). Fix this by returning 0 f

[PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings

2024-05-05 Thread John Hubbard
When building either tools/bpf/bpftool, or tools/testing/selftests/hid, (the same Makefile is used for these), clang generates many instances of a warning that is useless here: "clang: warning: -lLLVM-17: 'linker' input unused" Silence this in both locations, by disabling that warning when bu

[PATCH] selftests/mqueue: fix 5 warnings about signed/unsigned mismatches

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about several cases of using a signed integer for the priority argument to mq_receive(3), which expects an unsigned int. Fix this by declaring the type as unsigned int in all cases. Signed-off-by: John Hubba

[PATCH 1/2] selftests/net: suppress clang's "variable-sized type not at the end" warning

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns that "a variable sized type not at the end of a struct or class is a GNU extension". These cases are not easily changed, because they involve structs that are part of the API. Fortunately, however, the tests

[PATCH 2/2] selftests/net: fix uninitialized variables

2024-05-05 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about three variables that are not initialized in all cases: 1) The opt_ipproto_off variable is used uninitialized if "testname" is not "ip". This seems like an actual bug. 2) The addr_len is used uninitiali

Re: [PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings

2024-05-05 Thread Quentin Monnet
On 05/05/2024 22:56, John Hubbard wrote: > When building either tools/bpf/bpftool, or tools/testing/selftests/hid, > (the same Makefile is used for these), clang generates many instances of > a warning that is useless here: > > "clang: warning: -lLLVM-17: 'linker' input unused" > > Silence th

Re: [PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings

2024-05-05 Thread John Hubbard
On 5/5/24 3:36 PM, Quentin Monnet wrote: On 05/05/2024 22:56, John Hubbard wrote: ... Thanks! If possible, I'd rather keep the warning enabled, and fix the command line instead. Looking at the error and the Makefile, we may not need the -lLLVM in the CFLAGS at all, but only in $(LIBS). On my se

Re: [PATCH] bpftool, selftests/hid/bpf: fix 29 clang warnings

2024-05-05 Thread Quentin Monnet
On 05/05/2024 23:48, John Hubbard wrote: > On 5/5/24 3:36 PM, Quentin Monnet wrote: >> On 05/05/2024 22:56, John Hubbard wrote: > ... >> Thanks! If possible, I'd rather keep the warning enabled, and fix the >> command line instead. Looking at the error and the Makefile, we may not >> need the -lLLV

[PATCH v2] bpftool, selftests/hid/bpf: fix 29 clang warnings

2024-05-05 Thread John Hubbard
When building either tools/bpf/bpftool, or tools/testing/selftests/hid, (the same Makefile is used for these), clang generates many instances of the following: "clang: warning: -lLLVM-17: 'linker' input unused" Quentin points out that the LLVM version is only required in $(LIBS), not in $(CFL

Re: [PATCH v2] bpftool, selftests/hid/bpf: fix 29 clang warnings

2024-05-05 Thread Quentin Monnet
On 06/05/2024 00:00, John Hubbard wrote: > When building either tools/bpf/bpftool, or tools/testing/selftests/hid, > (the same Makefile is used for these), clang generates many instances of > the following: > > "clang: warning: -lLLVM-17: 'linker' input unused" > > Quentin points out that the

Re: [RFC PATCH net-next v8 07/14] page_pool: devmem support

2024-05-05 Thread David Wei
On 2024-05-01 00:55, Christoph Hellwig wrote: > On Fri, Apr 26, 2024 at 05:17:52PM -0700, David Wei wrote: >> On 2024-04-02 5:20 pm, Mina Almasry wrote: >>> @@ -69,20 +106,26 @@ net_iov_binding(const struct net_iov *niov) >>> */ >>> typedef unsigned long __bitwise netmem_ref; >>> >>> +static i

Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()

2024-05-05 Thread Mark Brown
On Sun, May 05, 2024 at 02:08:24PM -0700, John Hubbard wrote: > dump_config_tree() is declared to return an int, but the compiler cannot > prove that it always returns any value at all. This leads to a clang > warning, when building via: Reviewed-by: Mark Brown signature.asc Description: PGP si

Re: [PATCH] selftests/capabilities: fix warn_unused_result build warnings

2024-05-05 Thread Muhammad Usama Anjum
Thanks for the patch! On 5/4/24 10:09 PM, Amer Al Shanawany wrote: > Fix the following warnings by adding return check and error handling. > > test_execve.c: In function ‘do_tests’: > test_execve.c:100:17: warning: ignoring return value of > ‘capng_get_caps_process’ > declared with attribute ‘w