🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Jingjing Xu Sun, 22 Nov 2026 15:49
[PATCH net-next 2/2] selftests: net: cover zero receive mark and priority
#20454
Author: Jingjing Xu
Date: Sun, 22 Nov 2026 15:49
50 lines
10462 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.

Use the lowercase ksft_fail and ksft_pass constants defined by lib.sh.
The uppercase names are undefined, so the failure path otherwise exits
with the status of echo and incorrectly reports success to the runner.

With the new tests and the original listener, four of eight cases fail
and the 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.

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 | 6 ++++--
 1 file changed, 4 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..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() {
@@ -66,8 +68,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: 2208ab00f4f213ade91ab775e7f8c4dacdcc856e
-- 
2.53.0
Re: [PATCH net-next 2/2] selftests: net: cover zero receive mark and priority
#20671
Author: Hangbin Liu
Date: Mon, 23 Nov 2026 02:44
58 lines
10379 bytes
Hi Jingjing,
On Sun, Nov 22, 2026 at 03:49:12PM +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.
> 
> Use the lowercase ksft_fail and ksft_pass constants defined by lib.sh.
> The uppercase names are undefined, so the failure path otherwise exits
> with the status of echo and incorrectly reports success to the runner.
> 
> With the new tests and the original listener, four of eight cases fail
> and the 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.
> 
> 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 | 6 ++++--
>  1 file changed, 4 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..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"
>  )
>  

These are 2 new test cases.

>  check_result() {
> @@ -66,8 +68,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}

And this is a stand along fix.

I think you can split this into another patch.

Thanks
Hangbin
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