Patch "selftests: mlxsw: resource_scale: Fix return value" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    selftests: mlxsw: resource_scale: Fix return value

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     selftests-mlxsw-resource_scale-fix-return-value.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5457c795f1823dbffe1a4a9321a33d6761b4b4b7
Author: Amit Cohen <amcohen@xxxxxxxxxx>
Date:   Wed Mar 2 18:14:47 2022 +0200

    selftests: mlxsw: resource_scale: Fix return value
    
    [ Upstream commit 196f9bc050cbc5085b4cbb61cce2efe380bc66d0 ]
    
    The test runs several test cases and is supposed to return an error in
    case at least one of them failed.
    
    Currently, the check of the return value of each test case is in the
    wrong place, which can result in the wrong return value. For example:
    
     # TESTS='tc_police' ./resource_scale.sh
     TEST: 'tc_police' [default] 968                                     [FAIL]
             tc police offload count failed
     Error: mlxsw_spectrum: Failed to allocate policer index.
     We have an error talking to the kernel
     Command failed /tmp/tmp.i7Oc5HwmXY:969
     TEST: 'tc_police' [default] overflow 969                            [ OK ]
     ...
     TEST: 'tc_police' [ipv4_max] overflow 969                           [ OK ]
    
     $ echo $?
     0
    
    Fix this by moving the check to be done after each test case.
    
    Fixes: 059b18e21c63 ("selftests: mlxsw: Return correct error code in resource scale test")
    Signed-off-by: Amit Cohen <amcohen@xxxxxxxxxx>
    Reviewed-by: Petr Machata <petrm@xxxxxxxxxx>
    Signed-off-by: Ido Schimmel <idosch@xxxxxxxxxx>
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
index bcb110e830ce..dea33dc93790 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
@@ -50,8 +50,8 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
 			else
 				log_test "'$current_test' [$profile] overflow $target"
 			fi
+			RET_FIN=$(( RET_FIN || RET ))
 		done
-		RET_FIN=$(( RET_FIN || RET ))
 	done
 done
 current_test=""



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux