]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc56a0752c291bcbc6eebfb50d45e1d0eac8659e4
treebcb9fc9dc0a218d018f863c545ce7d1e814de7a9
parentb0b89bf10cb6c477eee41b3845f5f49f63cd1428
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