Skip to content

Commit

Permalink
igbvf: Regard vf reset nack as success
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Tested-by: Marek Szlosek <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
  • Loading branch information
akihikodaki authored and anguy11 committed Mar 16, 2023
1 parent 85eb39b commit 02c8379
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions drivers/net/ethernet/intel/igbvf/vf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2009 - 2018 Intel Corporation. */

#include <linux/etherdevice.h>

#include "vf.h"

static s32 e1000_check_for_link_vf(struct e1000_hw *hw);
Expand Down Expand Up @@ -131,11 +133,16 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw)
/* set our "perm_addr" based on info provided by PF */
ret_val = mbx->ops.read_posted(hw, msgbuf, 3);
if (!ret_val) {
if (msgbuf[0] == (E1000_VF_RESET |
E1000_VT_MSGTYPE_ACK))
switch (msgbuf[0]) {
case E1000_VF_RESET | E1000_VT_MSGTYPE_ACK:
memcpy(hw->mac.perm_addr, addr, ETH_ALEN);
else
break;
case E1000_VF_RESET | E1000_VT_MSGTYPE_NACK:
eth_zero_addr(hw->mac.perm_addr);
break;
default:
ret_val = -E1000_ERR_MAC_INIT;
}
}
}

Expand Down

0 comments on commit 02c8379

Please sign in to comment.