]> www.infradead.org Git - users/hch/configfs.git/commitdiff
net/mlx5e: Correctly report errors for ethtool rx flows
authorCosmin Ratiu <cratiu@nvidia.com>
Thu, 8 Aug 2024 14:41:05 +0000 (17:41 +0300)
committerJakub Kicinski <kuba@kernel.org>
Sat, 10 Aug 2024 05:16:46 +0000 (22:16 -0700)
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: b29c61dac3a2 ("net/mlx5e: Ethtool steering flow validation refactoring")
Signed-off-by: Cosmin Ratiu <cratiu@nvidia.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20240808144107.2095424-5-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c

index 3eccdadc0357810e18d93ba4d1104b99b1ba965d..773624bb2c5d549f30157ff158be7e909384585c 100644 (file)
@@ -734,7 +734,7 @@ mlx5e_ethtool_flow_replace(struct mlx5e_priv *priv,
        if (num_tuples <= 0) {
                netdev_warn(priv->netdev, "%s: flow is not valid %d\n",
                            __func__, num_tuples);
-               return num_tuples;
+               return num_tuples < 0 ? num_tuples : -EINVAL;
        }
 
        eth_ft = get_flow_table(priv, fs, num_tuples);