net/mlx5: DR, Don't allow match on IP w/o matching on full ethertype/ip_version
authorYevgeny Kliteynik <kliteyn@nvidia.com>
Thu, 13 Jan 2022 12:52:48 +0000 (14:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:48:00 +0000 (11:48 +0100)
commit837b0d2e69e81bd0b61b2cd5bdccd07ce221fb88
treecaa3ad74a48ea6e6efecdbb883beb96d2a66554f
parent954997aeb8f294215b94c2d8e6839649f10e40ee
net/mlx5: DR, Don't allow match on IP w/o matching on full ethertype/ip_version

commit ffb0753b954763d94f52c901adfe58ed0d4005e6 upstream.

Currently SMFS allows adding rule with matching on src/dst IP w/o matching
on full ethertype or ip_version, which is not supported by HW.
This patch fixes this issue and adds the check as it is done in DMFS.

Fixes: 26d688e33f88 ("net/mlx5: DR, Add Steering entry (STE) utilities")
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_matcher.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h