diff options
author | Or Gerlitz <ogerlitz@mellanox.com> | 2013-08-01 12:55:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-01 18:09:35 -0400 |
commit | 0508ad646836007e6e6b62331eee7356844eac3d (patch) | |
tree | d406229143269e3e8861b8b6fd459db7261ae6b4 | |
parent | 8a226b2cfa776db6011fc84b71578513161cd3d3 (diff) |
net/mlx4_core: Don't give VFs MAC addresses which are derived from the PF MAC
If the user has not assigned a MAC address to a VM, then don't give it MAC which
is based on the PF one. The current derivation scheme is wrong and leads to VM
MAC collisions when the number of cards/hypervisors becomes big enough.
Instead, just give it zeros and let them figure out what to do with that.
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/fw.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 8873d6802c80..6fc6dabc78d5 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -845,16 +845,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
845 | MLX4_CMD_NATIVE); | 845 | MLX4_CMD_NATIVE); |
846 | 846 | ||
847 | if (!err && dev->caps.function != slave) { | 847 | if (!err && dev->caps.function != slave) { |
848 | /* if config MAC in DB use it */ | 848 | def_mac = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac; |
849 | if (priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac) | ||
850 | def_mac = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac; | ||
851 | else { | ||
852 | /* set slave default_mac address */ | ||
853 | MLX4_GET(def_mac, outbox->buf, QUERY_PORT_MAC_OFFSET); | ||
854 | def_mac += slave << 8; | ||
855 | priv->mfunc.master.vf_admin[slave].vport[vhcr->in_modifier].mac = def_mac; | ||
856 | } | ||
857 | |||
858 | MLX4_PUT(outbox->buf, def_mac, QUERY_PORT_MAC_OFFSET); | 849 | MLX4_PUT(outbox->buf, def_mac, QUERY_PORT_MAC_OFFSET); |
859 | 850 | ||
860 | /* get port type - currently only eth is enabled */ | 851 | /* get port type - currently only eth is enabled */ |