aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Blakey <paulb@mellanox.com>2017-07-06 16:40:34 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-11 08:33:59 -0700
commit9d641966047bd45a71f78a365324c4b6b9730695 (patch)
tree665c8615b34ed16e043dc452d4e75c2ec97f08d6
parentb3829b15e644205df7bb643ba3dcc4d37005bcef (diff)
downloadlinux-yocto-4.12-9d641966047bd45a71f78a365324c4b6b9730695.tar.gz
linux-yocto-4.12-9d641966047bd45a71f78a365324c4b6b9730695.tar.bz2
linux-yocto-4.12-9d641966047bd45a71f78a365324c4b6b9730695.zip
net/mlx5: Fix mlx5_add_flow_rules call with correct num of dests
[ Upstream commit bcec601f30fb41e9233674942fa4040a6e63657a ] When adding ethtool steering rule with action DISCARD we wrongly pass a NULL dest with dest_num 1 to mlx5_add_flow_rules(). What this error seems to have caused is sending VPORT 0 (MLX5_FLOW_DESTINATION_TYPE_VPORT) as the fte dest instead of no dests. We have fte action correctly set to DROP so it might been ignored anyways. To reproduce use: # sudo ethtool --config-nfc <dev> flow-type ether \ dst aa:bb:cc:dd:ee:ff action -1 Fixes: 74491de93712 ("net/mlx5: Add multi dest support") Signed-off-by: Paul Blakey <paulb@mellanox.com> Reviewed-by: Mark Bloch <markb@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
index 969ddb3aaf6e..986387de13ee 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.c
@@ -320,7 +320,7 @@ add_ethtool_flow_rule(struct mlx5e_priv *priv,
spec->match_criteria_enable = (!outer_header_zero(spec->match_criteria));
flow_act.flow_tag = MLX5_FS_DEFAULT_FLOW_TAG;
- rule = mlx5_add_flow_rules(ft, spec, &flow_act, dst, 1);
+ rule = mlx5_add_flow_rules(ft, spec, &flow_act, dst, dst ? 1 : 0);
if (IS_ERR(rule)) {
err = PTR_ERR(rule);
netdev_err(priv->netdev, "%s: failed to add ethtool steering rule: %d\n",