Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: router_scale: Do not count failed routes

To check how many routes are installed in hardware, the test runs "ip
route" and greps for "offload", which includes routes with state
"offload_failed".

Till now, this wrong check was not found because after one failure in
route insertion, the driver moved to "abort" mode, which means that user
cannot try to add more routes.

The previous patch removed the abort mechanism and now failed routes are
counted as offloaded.

Fix this by not considering routes with "offload_failed" flag as
offloaded.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Amit Cohen and committed by
David S. Miller
00190c2b a08a6193

+1 -1
+1 -1
tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
··· 68 68 local t0=$1; shift 69 69 local route_count=$1; shift 70 70 71 - local t1=$(ip route | grep -o 'offload' | wc -l) 71 + local t1=$(ip route | grep 'offload' | grep -v 'offload_failed' | wc -l) 72 72 local delta=$((t1 - t0)) 73 73 echo $delta 74 74 [[ $delta -ge $route_count ]]