Skip to content

Commit 02c8379

Browse files
akihikodakianguy11
authored andcommitted
igbvf: Regard vf reset nack as success
vf reset nack actually represents the reset operation itself is performed but no address is assigned. Therefore, e1000_reset_hw_vf should fill the "perm_addr" with the zero address and return success on such an occasion. This prevents its callers in netdev.c from saying PF still resetting, and instead allows them to correctly report that no address is assigned. Fixes: 6ddbc4c ("igb: Indicate failure on vf reset for empty mac address") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Tested-by: Marek Szlosek <marek.szlosek@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 85eb39b commit 02c8379

File tree

1 file changed

+10
-3
lines changed
  • drivers/net/ethernet/intel/igbvf

1 file changed

+10
-3
lines changed

drivers/net/ethernet/intel/igbvf/vf.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright(c) 2009 - 2018 Intel Corporation. */
33

4+
#include <linux/etherdevice.h>
5+
46
#include "vf.h"
57

68
static s32 e1000_check_for_link_vf(struct e1000_hw *hw);
@@ -131,11 +133,16 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
131133
/* set our "perm_addr" based on info provided by PF */
132134
ret_val = mbx->ops.read_posted(hw, msgbuf, 3);
133135
if (!ret_val) {
134-
if (msgbuf[0] == (E1000_VF_RESET |
135-
E1000_VT_MSGTYPE_ACK))
136+
switch (msgbuf[0]) {
137+
case E1000_VF_RESET | E1000_VT_MSGTYPE_ACK:
136138
memcpy(hw->mac.perm_addr, addr, ETH_ALEN);
137-
else
139+
break;
140+
case E1000_VF_RESET | E1000_VT_MSGTYPE_NACK:
141+
eth_zero_addr(hw->mac.perm_addr);
142+
break;
143+
default:
138144
ret_val = -E1000_ERR_MAC_INIT;
145+
}
139146
}
140147
}
141148

0 commit comments

Comments
 (0)