Skip to content

Commit 7c237bb

Browse files
Cosmin RatiuNipaLocal
Cosmin Ratiu
authored and
NipaLocal
committed
net/mlx5e: Correctly report errors for ethtool rx flows
Previously, an ethtool rx flow with no attrs would not be added to the NIC as it has no rules to configure the hw with, but it would be reported as successful to the caller (return code 0). This is confusing for the user as ethtool then reports "Added rule $num", but no rule was actually added. This change corrects that by instead reporting these wrong rules as -EINVAL. Fixes: b29c61d ("net/mlx5e: Ethtool steering flow validation refactoring") Signed-off-by: Cosmin Ratiu <[email protected]> Reviewed-by: Saeed Mahameed <[email protected]> Reviewed-by: Dragos Tatulea <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent 1e5f1b6 commit 7c237bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
734734
if (num_tuples <= 0) {
735735
netdev_warn(priv->netdev, "%s: flow is not valid %d\n",
736736
__func__, num_tuples);
737-
return num_tuples;
737+
return num_tuples < 0 ? num_tuples : -EINVAL;
738738
}
739739

740740
eth_ft = get_flow_table(priv, fs, num_tuples);

0 commit comments

Comments
 (0)