Thread View: linux.kernel.netdev
6 messages
6 total messages
Started by Jingjing Xu
Wed, 25 Nov 2026 06:41
[PATCH net-next v2 0/3] selftests: net: fix receive metadata and failure reporting
Author: Jingjing Xu
Date: Wed, 25 Nov 2026 06:41
Date: Wed, 25 Nov 2026 06:41
41 lines
10218 bytes
10218 bytes
Separate the failure-status correction from the zero-value tests, as requested by Hangbin Liu. The first patch repairs script failure reporting, the second enables reception independently of the expected metadata, and the third adds the zero mark/priority cases to the existing test. Changes in v2: - Split the exit-constant correction into a standalone fix (Hangbin Liu). - Put both fixes before the added regression cases. - Retain Hangbin Liu's Reviewed-by only on the receive-enable fix. - Wrap that setsockopt() call to stay within 80 columns; behavior unchanged. - Rebase onto net-next 57f165ff2f30. v1: https://lore.kernel.org/netdev/20261122154912.1272447-1-xujingjing@cmss.chinamobile.com/ Split request: https://patchwork.kernel.org/comment/27396929/ Core-fix review: https://patchwork.kernel.org/comment/27396955/ Validation used the existing host kernel and real IPv4/IPv6 UDP sockets in private mount/network namespaces. The original four cases pass before and after the fixes. A user-space mismatched-metadata sender makes those four cases fail: the original script exits 0; patch 1 exits 1. Extended zero cases with the original listener fail 4/8 and exit 1. The complete series passes 8/8 and exits 0. All helpers build with gcc -Wall -Werror -O2. No kernel instrumentation or kernel fault injection was used. The negative sender fixture deliberately changes only user-space metadata arguments. No hardware test suite was run. Jingjing Xu (3): selftests: net: report SO_RCV test failures to the runner selftests: net: enable receive metadata independently of its value selftests: net: cover zero receive mark and priority tools/testing/selftests/net/so_rcv_listener.c | 4 +++- tools/testing/selftests/net/test_so_rcv.sh | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) -- 2.53.0
[PATCH net-next v2 1/3] selftests: net: report SO_RCV test failures to the runner
Author: Jingjing Xu
Date: Wed, 25 Nov 2026 06:41
Date: Wed, 25 Nov 2026 06:41
49 lines
10500 bytes
10500 bytes
test_so_rcv.sh uses KSFT_FAIL and KSFT_PASS, but lib.sh defines the
lowercase ksft_fail and ksft_pass constants. With the uppercase variables
unset, exit has no argument and returns the successful echo status, even
when the script has reported failed tests.
Use the constants actually provided by lib.sh so failures produce a
nonzero exit status.
Run as root from tools/testing/selftests/net after building the helpers.
For the original four-case script, this changes only sender metadata to 1
while the listeners still expect 2 or 3:
sed '/\.\/cmsg_sender/s/\$arg/${arg% *} 1/' test_so_rcv.sh | bash
echo $?
Both versions report four failures. The original prints 0 as the exit
status; with this fix it prints 1.
AI-assisted inspection found this while extending the receive tests.
With deliberately mismatched sender metadata, all four original cases
fail on both versions: the original script exits 0 and
the corrected script exits 1. The unmodified sender passes all four cases
with exit 0. No kernel instrumentation or fault injection was used.
Fixes: c935af429ec2 ("selftests: net: add support for testing SO_RCVMARK and SO_RCVPRIORITY")
Signed-off-by: Jingjing Xu <xujingjing@cmss.chinamobile.com>
---
tools/testing/selftests/net/test_so_rcv.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/net/test_so_rcv.sh b/tools/testing/selftests/net/test_so_rcv.sh
index d8aa4362879d..ae01fa3c5329 100755
--- a/tools/testing/selftests/net/test_so_rcv.sh
+++ b/tools/testing/selftests/net/test_so_rcv.sh
@@ -66,8 +66,8 @@ done
if [ "$FAILED_TESTS" -ne 0 ]; then
echo "FAIL - $FAILED_TESTS/$TOTAL_TESTS tests failed"
- exit ${KSFT_FAIL}
+ exit ${ksft_fail}
else
echo "OK - All $TOTAL_TESTS tests passed"
- exit ${KSFT_PASS}
+ exit ${ksft_pass}
fi
base-commit: 57f165ff2f30491bc3511d24a52ca516751a268b
--
2.53.0
[PATCH net-next v2 3/3] selftests: net: cover zero receive mark and priority
Author: Jingjing Xu
Date: Wed, 25 Nov 2026 06:41
Date: Wed, 25 Nov 2026 06:41
33 lines
9856 bytes
9856 bytes
Exercise SO_RCVMARK and SO_RCVPRIORITY with zero values as well as the
existing nonzero values, for both IPv4 and IPv6. These cases catch using
the expected metadata value as the ancillary-message enable flag.
With the new tests and the original listener, four of eight cases fail
and the corrected script exits with status 1. With the fixed listener,
all eight pass and the script exits with status 0. The original four
cases also pass with the original listener. Verification used real UDP
sockets in isolated network namespaces; discovery and testing were
AI-assisted. No kernel instrumentation or fault injection was used.
Signed-off-by: Jingjing Xu <xujingjing@cmss.chinamobile.com>
---
tools/testing/selftests/net/test_so_rcv.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/net/test_so_rcv.sh b/tools/testing/selftests/net/test_so_rcv.sh
index ae01fa3c5329..3263ba2d1a67 100755
--- a/tools/testing/selftests/net/test_so_rcv.sh
+++ b/tools/testing/selftests/net/test_so_rcv.sh
@@ -11,6 +11,8 @@ FAILED_TESTS=0
declare -A TESTS=(
["SO_RCVPRIORITY"]="-P 2"
["SO_RCVMARK"]="-M 3"
+ ["SO_RCVPRIORITY_ZERO"]="-P 0"
+ ["SO_RCVMARK_ZERO"]="-M 0"
)
check_result() {
base-commit: 57f165ff2f30491bc3511d24a52ca516751a268b
--
2.53.0
Re: [PATCH net-next v2 1/3] selftests: net: report SO_RCV test failures to the runner
Author: Hangbin Liu
Date: Wed, 25 Nov 2026 07:18
Date: Wed, 25 Nov 2026 07:18
55 lines
10396 bytes
10396 bytes
On Wed, Nov 25, 2026 at 06:41:08AM +0000, Jingjing Xu wrote:
> test_so_rcv.sh uses KSFT_FAIL and KSFT_PASS, but lib.sh defines the
> lowercase ksft_fail and ksft_pass constants. With the uppercase variables
> unset, exit has no argument and returns the successful echo status, even
> when the script has reported failed tests.
>
> Use the constants actually provided by lib.sh so failures produce a
> nonzero exit status.
>
> Run as root from tools/testing/selftests/net after building the helpers.
> For the original four-case script, this changes only sender metadata to 1
> while the listeners still expect 2 or 3:
>
> sed '/\.\/cmsg_sender/s/\$arg/${arg% *} 1/' test_so_rcv.sh | bash
> echo $?
>
> Both versions report four failures. The original prints 0 as the exit
> status; with this fix it prints 1.
>
> AI-assisted inspection found this while extending the receive tests.
> With deliberately mismatched sender metadata, all four original cases
> fail on both versions: the original script exits 0 and
> the corrected script exits 1. The unmodified sender passes all four cases
> with exit 0. No kernel instrumentation or fault injection was used.
>
> Fixes: c935af429ec2 ("selftests: net: add support for testing SO_RCVMARK and SO_RCVPRIORITY")
> Signed-off-by: Jingjing Xu <xujingjing@cmss.chinamobile.com>
> ---
> tools/testing/selftests/net/test_so_rcv.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/test_so_rcv.sh b/tools/testing/selftests/net/test_so_rcv.sh
> index d8aa4362879d..ae01fa3c5329 100755
> --- a/tools/testing/selftests/net/test_so_rcv.sh
> +++ b/tools/testing/selftests/net/test_so_rcv.sh
> @@ -66,8 +66,8 @@ done
>
> if [ "$FAILED_TESTS" -ne 0 ]; then
> echo "FAIL - $FAILED_TESTS/$TOTAL_TESTS tests failed"
> - exit ${KSFT_FAIL}
> + exit ${ksft_fail}
> else
> echo "OK - All $TOTAL_TESTS tests passed"
> - exit ${KSFT_PASS}
> + exit ${ksft_pass}
> fi
> base-commit: 57f165ff2f30491bc3511d24a52ca516751a268b
> --
> 2.53.0
>
>
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Re: [PATCH net-next v2 3/3] selftests: net: cover zero receive mark and priority
Author: Hangbin Liu
Date: Wed, 25 Nov 2026 08:36
Date: Wed, 25 Nov 2026 08:36
39 lines
9732 bytes
9732 bytes
On Wed, Nov 25, 2026 at 06:41:10AM +0000, Jingjing Xu wrote:
> Exercise SO_RCVMARK and SO_RCVPRIORITY with zero values as well as the
> existing nonzero values, for both IPv4 and IPv6. These cases catch using
> the expected metadata value as the ancillary-message enable flag.
>
> With the new tests and the original listener, four of eight cases fail
> and the corrected script exits with status 1. With the fixed listener,
> all eight pass and the script exits with status 0. The original four
> cases also pass with the original listener. Verification used real UDP
> sockets in isolated network namespaces; discovery and testing were
> AI-assisted. No kernel instrumentation or fault injection was used.
>
> Signed-off-by: Jingjing Xu <xujingjing@cmss.chinamobile.com>
> ---
> tools/testing/selftests/net/test_so_rcv.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/net/test_so_rcv.sh b/tools/testing/selftests/net/test_so_rcv.sh
> index ae01fa3c5329..3263ba2d1a67 100755
> --- a/tools/testing/selftests/net/test_so_rcv.sh
> +++ b/tools/testing/selftests/net/test_so_rcv.sh
> @@ -11,6 +11,8 @@ FAILED_TESTS=0
> declare -A TESTS=(
> ["SO_RCVPRIORITY"]="-P 2"
> ["SO_RCVMARK"]="-M 3"
> + ["SO_RCVPRIORITY_ZERO"]="-P 0"
> + ["SO_RCVMARK_ZERO"]="-M 0"
> )
>
> check_result() {
> base-commit: 57f165ff2f30491bc3511d24a52ca516751a268b
> --
> 2.53.0
>
>
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Re: [PATCH net-next v2 0/3] selftests: net: fix receive metadata and failure reporting
Author: Jingjing Xu
Date: Mon, 30 Nov 2026 00:59
Date: Mon, 30 Nov 2026 00:59
19 lines
9223 bytes
9223 bytes
Hi, The contest check reports that this series conflicts with pending/net patches in net-next-2026-11-25--09-00 at test_so_rcv.sh:66. I checked that all three v2 patches apply in order to the net-next main at 5eb53a1fbf80 (checked on 2026-11-30). Applying v1 first and then v2 reproduces the same exit-constant hunk failure locally. Could v1 still be present in the pending queue? I have not inspected the actual CI queue, so this is only a possible explanation. V2 replaces the original two-patch series: https://lore.kernel.org/netdev/20261122154912.1272447-1-xujingjing@cmss.chinamobile.com/ Please use the three-patch v2 for the receive selftest fixes and coverage. Thanks, Jingjing
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads