diff mbox

[net-next,internal,0/2] mlxsw: Reject unsupported FIB configurations

Message ID 20180425091200.GA29940@splinter.mtl.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Ido Schimmel April 25, 2018, 9:12 a.m. UTC
On Tue, Apr 24, 2018 at 05:17:42PM +0300, Ido Schimmel wrote:
> Recently it became possible for listeners of the FIB notification chain
> to veto operations such as addition of routes and rules.
> 
> Adjust the mlxsw driver to take advantage of it and return an error for
> unsupported FIB rules and for routes configured after the abort
> mechanism was triggered (due to exceeded resources for example).

I'll apply this set for now. I had to patch router_scale.sh to prevent
it from failing:

Comments

Yuval Mintz April 25, 2018, 9:31 a.m. UTC | #1
> > Recently it became possible for listeners of the FIB notification chain
> > to veto operations such as addition of routes and rules.
> >
> > Adjust the mlxsw driver to take advantage of it and return an error for
> > unsupported FIB rules and for routes configured after the abort
> > mechanism was triggered (due to exceeded resources for example).
> 
> I'll apply this set for now. I had to patch router_scale.sh to prevent
> it from failing:
> 
> diff --git a/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
> b/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
> index 12722835129e..2fe0c155f4cc 100755
> --- a/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
> +++ b/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
> @@ -95,8 +95,7 @@ router_routes_create()
>                 done
>         done
> 
> -       ip -b $ROUTE_FILE
> -       check_err $? "Route insertion failed"
> +       ip -b $ROUTE_FILE &> /dev/null
>  }
> 
>  router_routes_destroy()
> @@ -115,10 +114,6 @@ router_test()
>         RET=0
> 
>         router_routes_create $route_count
> -       check_err $? "Route insertaion failed"
> -       if [[ $RET -ne 0 ]]; then
> -               return
> -       fi
> 
>         router_offload_validate $route_count
>         check_err_fail $should_fail $? "Offload of $route_count routes"

Reviewed-by: Yuval Mintz <yuvalm@mellanox.com>

Although it might make sense to add a comment in router_routes_create()
stating we're deliberately not checking for errors since when used for negative
testing it might return an error [and rightfully so].
diff mbox

Patch

diff --git a/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
index 12722835129e..2fe0c155f4cc 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/router_scale.sh
@@ -95,8 +95,7 @@  router_routes_create()
                done
        done
 
-       ip -b $ROUTE_FILE
-       check_err $? "Route insertion failed"
+       ip -b $ROUTE_FILE &> /dev/null
 }
 
 router_routes_destroy()
@@ -115,10 +114,6 @@  router_test()
        RET=0
 
        router_routes_create $route_count
-       check_err $? "Route insertaion failed"
-       if [[ $RET -ne 0 ]]; then
-               return
-       fi
 
        router_offload_validate $route_count
        check_err_fail $should_fail $? "Offload of $route_count routes"