aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
diff options
context:
space:
mode:
authorAviad Yehezkel <aviadye@mellanox.com>2013-01-23 20:54:15 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-28 00:13:56 -0500
commitdb0e7cba6dafa269f33f379997794a9d3bd4d535 (patch)
treec0db0e45b8c75ff6adba1a5ad8ab1b7de09c6001 /drivers/net/ethernet/mellanox/mlx4/en_netdev.c
parent2d51837fa1ee7ff5c42f34b07dc460daff6afda1 (diff)
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: Aviad Yehezkel <aviadye@mellanox.com> Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com> Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_netdev.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_netdev.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index b6c645fc6c48..bab8cec86658 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1167,15 +1167,6 @@ int mlx4_en_start_port(struct net_device *dev)
1167 1167
1168 /* Must redo promiscuous mode setup. */ 1168 /* Must redo promiscuous mode setup. */
1169 priv->flags &= ~(MLX4_EN_FLAG_PROMISC | MLX4_EN_FLAG_MC_PROMISC); 1169 priv->flags &= ~(MLX4_EN_FLAG_PROMISC | MLX4_EN_FLAG_MC_PROMISC);
1170 if (mdev->dev->caps.steering_mode ==
1171 MLX4_STEERING_MODE_DEVICE_MANAGED) {
1172 mlx4_flow_steer_promisc_remove(mdev->dev,
1173 priv->port,
1174 MLX4_FS_PROMISC_UPLINK);
1175 mlx4_flow_steer_promisc_remove(mdev->dev,
1176 priv->port,
1177 MLX4_FS_PROMISC_ALL_MULTI);
1178 }
1179 1170
1180 /* Schedule multicast task to populate multicast list */ 1171 /* Schedule multicast task to populate multicast list */
1181 queue_work(mdev->workqueue, &priv->mcast_task); 1172 queue_work(mdev->workqueue, &priv->mcast_task);
@@ -1227,6 +1218,32 @@ void mlx4_en_stop_port(struct net_device *dev)
1227 /* Set port as not active */ 1218 /* Set port as not active */
1228 priv->port_up = false; 1219 priv->port_up = false;
1229 1220
1221 /* Promsicuous mode */
1222 if (mdev->dev->caps.steering_mode ==
1223 MLX4_STEERING_MODE_DEVICE_MANAGED) {
1224 priv->flags &= ~(MLX4_EN_FLAG_PROMISC |
1225 MLX4_EN_FLAG_MC_PROMISC);
1226 mlx4_flow_steer_promisc_remove(mdev->dev,
1227 priv->port,
1228 MLX4_FS_PROMISC_UPLINK);
1229 mlx4_flow_steer_promisc_remove(mdev->dev,
1230 priv->port,
1231 MLX4_FS_PROMISC_ALL_MULTI);
1232 } else if (priv->flags & MLX4_EN_FLAG_PROMISC) {
1233 priv->flags &= ~MLX4_EN_FLAG_PROMISC;
1234
1235 /* Disable promiscouos mode */
1236 mlx4_unicast_promisc_remove(mdev->dev, priv->base_qpn,
1237 priv->port);
1238
1239 /* Disable Multicast promisc */
1240 if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) {
1241 mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
1242 priv->port);
1243 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
1244 }
1245 }
1246
1230 /* Detach All multicasts */ 1247 /* Detach All multicasts */
1231 memset(&mc_list[10], 0xff, ETH_ALEN); 1248 memset(&mc_list[10], 0xff, ETH_ALEN);
1232 mc_list[5] = priv->port; /* needed for B0 steering support */ 1249 mc_list[5] = priv->port; /* needed for B0 steering support */