From ce7a41008133c1865313cf80f8ba14905accefbb Mon Sep 17 00:00:00 2001 From: Wenzhuo Lu Date: Sun, 14 Feb 2016 16:54:59 +0800 Subject: [PATCH] ixgbe/base: set VF MAC address only when acked by PF This patch resolves an issue where VF mac address is zeroed out in cases where the VF driver is loaded while the PF interface is down. The solution is to only set it when we get an ACK from the PF. Fixes: 6202266e5680 ("ixgbe/base: vf changes") Signed-off-by: Wenzhuo Lu --- doc/guides/rel_notes/release_16_04.rst | 6 ++++++ drivers/net/ixgbe/base/ixgbe_vf.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst index b07491aabe..6500dc7df5 100644 --- a/doc/guides/rel_notes/release_16_04.rst +++ b/doc/guides/rel_notes/release_16_04.rst @@ -182,6 +182,12 @@ Drivers Fixed an incorrect device MTU being set due to ethernet header and CRC lengths being added twice. +* **ixgbe: Fixed zeroed VF mac address.** + + Resolved an issue where VF mac address is zeroed out in cases where the VF + driver is loaded while the PF interface is down. + The solution is to only set it when we get an ACK from the PF. + * **aesni_mb: Fixed wrong return value when creating a device.** cryptodev_aesni_mb_init() was returning the device id of the device created, diff --git a/drivers/net/ixgbe/base/ixgbe_vf.c b/drivers/net/ixgbe/base/ixgbe_vf.c index 50f5e54d6a..dbb5194987 100644 --- a/drivers/net/ixgbe/base/ixgbe_vf.c +++ b/drivers/net/ixgbe/base/ixgbe_vf.c @@ -228,7 +228,9 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_NACK)) return IXGBE_ERR_INVALID_MAC_ADDR; - memcpy(hw->mac.perm_addr, addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK)) + memcpy(hw->mac.perm_addr, addr, IXGBE_ETH_LENGTH_OF_ADDRESS); + hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD]; return ret_val; -- 2.20.1