Skip to content

Commit 707e7e9

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Always forward VF MAC address to the PF.
The current code already forwards the VF MAC address to the PF, except in one case. If the VF driver gets a valid MAC address from the firmware during probe time, it will not forward the MAC address to the PF, incorrectly assuming that the PF already knows the MAC address. This causes "ip link show" to show zero VF MAC addresses for this case. This assumption is not correct. Newer firmware remembers the VF MAC address last used by the VF and provides it to the VF driver during probe. So we need to always forward the VF MAC address to the PF. The forwarded MAC address may now be the PF assigned MAC address and so we need to make sure we approve it for this case. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7328a23 commit 707e7e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8678,8 +8678,8 @@ static int bnxt_init_mac_addr(struct bnxt *bp)
86788678
memcpy(bp->dev->dev_addr, vf->mac_addr, ETH_ALEN);
86798679
} else {
86808680
eth_hw_addr_random(bp->dev);
8681-
rc = bnxt_approve_mac(bp, bp->dev->dev_addr);
86828681
}
8682+
rc = bnxt_approve_mac(bp, bp->dev->dev_addr);
86838683
#endif
86848684
}
86858685
return rc;

drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,8 @@ static int bnxt_vf_configure_mac(struct bnxt *bp, struct bnxt_vf_info *vf)
923923
if (req->enables & cpu_to_le32(FUNC_VF_CFG_REQ_ENABLES_DFLT_MAC_ADDR)) {
924924
if (is_valid_ether_addr(req->dflt_mac_addr) &&
925925
((vf->flags & BNXT_VF_TRUST) ||
926-
(!is_valid_ether_addr(vf->mac_addr)))) {
926+
!is_valid_ether_addr(vf->mac_addr) ||
927+
ether_addr_equal(req->dflt_mac_addr, vf->mac_addr))) {
927928
ether_addr_copy(vf->vf_mac_addr, req->dflt_mac_addr);
928929
return bnxt_hwrm_exec_fwd_resp(bp, vf, msg_size);
929930
}

0 commit comments

Comments
 (0)