OSDN Git Service

mlxsw: spectrum_matchall: Perform protocol check earlier
authorIdo Schimmel <idosch@nvidia.com>
Mon, 29 Mar 2021 10:09:43 +0000 (13:09 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Mar 2021 20:37:25 +0000 (13:37 -0700)
commit4947e7309a31fdab1078b477b98b4cb1a28f80d8
treebcb9fc9dc0a218d018f863c545ce7d1e814de7a9
parent32e67c0aea904225fc77bf6edb27d033bec564fb
mlxsw: spectrum_matchall: Perform protocol check earlier

Perform the protocol check earlier in the function instead of repeating
it for every action. Example:

 # tc filter add dev swp1 ingress proto ip matchall skip_sw action sample group 1 rate 100
 Error: matchall rules only supported with 'all' protocol.
 We have an error talking to the kernel

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_matchall.c