Commit db0e7cba authored by Aviad Yehezkel's avatar Aviad Yehezkel Committed by David S. Miller

net/mlx4_en: Fix traffic loss under promiscuous mode

When port is stopped and flow steering mode is not device managed: promisc QP
rule wasn't removed from MCG table.
Added code to remove it in all flow steering modes.
In addition, promsic rule removal should be in stop port and not in start
port - moved it accordingly.
Signed-off-by: default avatarAviad Yehezkel <aviadye@mellanox.com>
Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: default avatarHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d51837f
...@@ -1167,15 +1167,6 @@ int mlx4_en_start_port(struct net_device *dev) ...@@ -1167,15 +1167,6 @@ int mlx4_en_start_port(struct net_device *dev)
/* Must redo promiscuous mode setup. */ /* Must redo promiscuous mode setup. */
priv->flags &= ~(MLX4_EN_FLAG_PROMISC | MLX4_EN_FLAG_MC_PROMISC); priv->flags &= ~(MLX4_EN_FLAG_PROMISC | MLX4_EN_FLAG_MC_PROMISC);
if (mdev->dev->caps.steering_mode ==
MLX4_STEERING_MODE_DEVICE_MANAGED) {
mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port,
MLX4_FS_PROMISC_UPLINK);
mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port,
MLX4_FS_PROMISC_ALL_MULTI);
}
/* Schedule multicast task to populate multicast list */ /* Schedule multicast task to populate multicast list */
queue_work(mdev->workqueue, &priv->mcast_task); queue_work(mdev->workqueue, &priv->mcast_task);
...@@ -1227,6 +1218,32 @@ void mlx4_en_stop_port(struct net_device *dev) ...@@ -1227,6 +1218,32 @@ void mlx4_en_stop_port(struct net_device *dev)
/* Set port as not active */ /* Set port as not active */
priv->port_up = false; priv->port_up = false;
/* Promsicuous mode */
if (mdev->dev->caps.steering_mode ==
MLX4_STEERING_MODE_DEVICE_MANAGED) {
priv->flags &= ~(MLX4_EN_FLAG_PROMISC |
MLX4_EN_FLAG_MC_PROMISC);
mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port,
MLX4_FS_PROMISC_UPLINK);
mlx4_flow_steer_promisc_remove(mdev->dev,
priv->port,
MLX4_FS_PROMISC_ALL_MULTI);
} else if (priv->flags & MLX4_EN_FLAG_PROMISC) {
priv->flags &= ~MLX4_EN_FLAG_PROMISC;
/* Disable promiscouos mode */
mlx4_unicast_promisc_remove(mdev->dev, priv->base_qpn,
priv->port);
/* Disable Multicast promisc */
if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) {
mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
priv->port);
priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
}
}
/* Detach All multicasts */ /* Detach All multicasts */
memset(&mc_list[10], 0xff, ETH_ALEN); memset(&mc_list[10], 0xff, ETH_ALEN);
mc_list[5] = priv->port; /* needed for B0 steering support */ mc_list[5] = priv->port; /* needed for B0 steering support */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment