linux/drivers/net/ethernet/mellanox/mlx4
Jack Morgenstein 2b3ddf27f4 net/mlx4_core: Replace VF zero mac with random mac in mlx4_core
By design, when no default MAC addresses are set in the Hypervisor for VFs,
the VFs are passed zero-macs. When such a MAC is received by the VF, it
generates a random MAC address and registers that MAC address
with the Hypervisor.

This random mac generation is currently done in the mlx4_en module.
There is a problem, though, if the mlx4_ib module is loaded by a VF before
the mlx4_en module. In this case, for RoCE, mlx4_ib will see the un-replaced
zero-mac and register that zero-mac as part of QP1 initialization.

Having a zero-mac in the port's MAC table creates problems for a
Baseboard Management Console. The BMC occasionally sends packets with a
zero-mac destination MAC. If there is a zero-mac present in the port's
MAC table, the FW will send such BMC packets to the host driver rather than
to the wire, and BMC will stop working.

To address this problem, we move the replacement of zero-mac addresses
with random-mac addresses to procedure mlx4_slave_cap(), which is part of the
driver startup for VFs, and is before activation of mlx4_ib and mlx4_en.
As a result, zero-mac addresses will never be registered in the port MAC table
by the driver.

In addition, when mlx4_en does initialize the net device, it needs to set
the NET_ADDR_RANDOM flag in the netdev structure if the address was
randomly generated. This is done so that udev on the VM does not create
a new device name after each VF probe (VM boot and such). To accomplish this,
we add a per-port flag in mlx4_dev which gets set whenever mlx4_core replaces
a zero-mac with a randomly-generated mac. This flag is examined when mlx4_en
initializes the net-device.

Fix was suggested by Matan Barak <matanb@mellanox.com>

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-10-14 19:14:44 -07:00
..
alloc.c net: Mellanox: Delete unnecessary checks before the function call "vunmap" 2015-02-09 14:10:05 -08:00
catas.c net/mlx4_core: Enable device recovery flow with SRIOV 2015-01-25 14:43:14 -08:00
cmd.c net/mlx4_core: Relieve cpu load average on the port sending flow 2015-07-26 16:29:25 -07:00
cq.c net/mlx4_core: Make sure there are no pending async events when freeing CQ 2015-05-30 23:35:34 -07:00
en_clock.c ptp: mlx4: use helpers for converting ns to timespec. 2015-03-31 17:19:19 -04:00
en_cq.c net/mlx4_core: Fix unintialized variable used in error path 2015-08-27 16:40:27 -07:00
en_dcb_nl.c net/mlx4: New file for QoS related firmware commands 2015-04-02 16:25:02 -04:00
en_ethtool.c net/mlx4_en: Add support for hardware accelerated 802.1ad vlan 2015-07-27 15:00:37 -07:00
en_main.c net/mlx4: Postpone the registration of net_device 2015-08-30 18:12:20 -04:00
en_netdev.c net/mlx4_core: Replace VF zero mac with random mac in mlx4_core 2015-10-14 19:14:44 -07:00
en_port.c net/mlx4_en: Use HW counters for rx/tx bytes/packets in PF device 2015-06-24 00:42:33 -07:00
en_port.h net/mlx4_en: Use PTYS register to query ethtool settings 2014-10-28 17:18:00 -04:00
en_resources.c net/mlx4_core: Allocate default counter per port 2015-06-15 17:23:02 -07:00
en_rx.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-09-26 06:01:33 -04:00
en_selftest.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-03-03 21:16:48 -05:00
en_tx.c net/mlx4_en: Add support for hardware accelerated 802.1ad vlan 2015-07-27 15:00:37 -07:00
eq.c net/mlx4_core: Fix wrong index in propagating port change event to VFs 2015-07-26 16:29:25 -07:00
fw_qos.c net/mlx4: Add mlx4_SET_VPORT_QOS implementation 2015-04-02 16:25:02 -04:00
fw_qos.h net/mlx4: Added qos_vport QP configuration in VST mode 2015-04-02 16:25:03 -04:00
fw.c net/mlx4_core: Replace VF zero mac with random mac in mlx4_core 2015-10-14 19:14:44 -07:00
fw.h net/mlx4_core: Preparations for 802.1ad VLAN support 2015-07-27 15:00:36 -07:00
icm.c net/mlx4_core: Maintain a persistent memory for mlx4 device 2015-01-25 14:43:13 -08:00
icm.h mlx4_core: Fix GFP flags parameters to be gfp_t 2014-06-04 10:19:13 -07:00
intf.c net/mlx4: Postpone the registration of net_device 2015-08-30 18:12:20 -04:00
Kconfig net/mlx4: Set proper build dependancy with vxlan 2014-04-01 16:25:51 -04:00
main.c net/mlx4_core: Replace VF zero mac with random mac in mlx4_core 2015-10-14 19:14:44 -07:00
Makefile net/mlx4: New file for QoS related firmware commands 2015-04-02 16:25:02 -04:00
mcg.c net/mlx4: Handle return codes in mlx4_qp_attach_common 2015-09-29 21:14:01 -07:00
mlx4_en.h net/mlx4_en: Add support for hardware accelerated 802.1ad vlan 2015-07-27 15:00:37 -07:00
mlx4_stats.h net/mlx4_en: Fix off-by-four in ethtool 2015-06-24 00:42:32 -07:00
mlx4.h net/mlx4_core: Replace VF zero mac with random mac in mlx4_core 2015-10-14 19:14:44 -07:00
mr.c net/mlx4_core: Fix mpt_entry initialization in mlx4_mr_rereg_mem_write() 2015-02-04 16:17:45 -08:00
pd.c net/mlx4_core: Remove duplicate code line from procedure mlx4_bf_alloc 2015-01-27 17:12:57 -08:00
port.c net/mlx4_en: Add RX-ALL support 2015-04-02 16:25:04 -04:00
profile.c net/mlx4_core: use swap() in mlx4_make_profile() 2015-06-11 15:19:41 -07:00
qp.c net/mlx4_core: Fix mailbox leak in error flow when performing update qp 2015-10-09 07:27:51 -07:00
reset.c net/mlx4_core: Maintain a persistent memory for mlx4 device 2015-01-25 14:43:13 -08:00
resource_tracker.c net/mlx4_core: Fix resource tracker error flow in add_res_range 2015-10-09 07:27:52 -07:00
sense.c
srq.c IB/mlx4: Implement IB_QP_CREATE_USE_GFP_NOIO 2014-06-02 14:58:11 -07:00