net/mlx4_en: Handle vxlan steering rules for mac address changes
authorOr Gerlitz <ogerlitz@mellanox.com>
Wed, 12 Mar 2014 15:16:31 +0000 (17:16 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Mar 2014 20:12:41 +0000 (16:12 -0400)
When the device mac address is changed, we must deregister the vxlan
steering rule associated with the previous mac, and register a new
steering rule using the new mac.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c

index fad45316200aa0fbcb115e3f6b4ec56a24ca29cd..ba212611157324c2147080afd95c2d5966b76e36 100644 (file)
@@ -742,6 +742,14 @@ static int mlx4_en_replace_mac(struct mlx4_en_priv *priv, int qpn,
                                err = mlx4_en_uc_steer_add(priv, new_mac,
                                                           &qpn,
                                                           &entry->reg_id);
+                               if (err)
+                                       return err;
+                               if (priv->tunnel_reg_id) {
+                                       mlx4_flow_detach(priv->mdev->dev, priv->tunnel_reg_id);
+                                       priv->tunnel_reg_id = 0;
+                               }
+                               err = mlx4_en_tunnel_steer_add(priv, new_mac, qpn,
+                                                              &priv->tunnel_reg_id);
                                return err;
                        }
                }