diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index f4cf68861069..ea044bbcd384 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifdef CONFIG_BNXT_SRIOV | 21 | #ifdef CONFIG_BNXT_SRIOV |
22 | static int bnxt_vf_ndo_prep(struct bnxt *bp, int vf_id) | 22 | static int bnxt_vf_ndo_prep(struct bnxt *bp, int vf_id) |
23 | { | 23 | { |
24 | if (bp->state != BNXT_STATE_OPEN) { | 24 | if (!test_bit(BNXT_STATE_OPEN, &bp->state)) { |
25 | netdev_err(bp->dev, "vf ndo called though PF is down\n"); | 25 | netdev_err(bp->dev, "vf ndo called though PF is down\n"); |
26 | return -EINVAL; | 26 | return -EINVAL; |
27 | } | 27 | } |
@@ -804,10 +804,9 @@ void bnxt_update_vf_mac(struct bnxt *bp) | |||
804 | if (!is_valid_ether_addr(resp->perm_mac_address)) | 804 | if (!is_valid_ether_addr(resp->perm_mac_address)) |
805 | goto update_vf_mac_exit; | 805 | goto update_vf_mac_exit; |
806 | 806 | ||
807 | if (ether_addr_equal(resp->perm_mac_address, bp->vf.mac_addr)) | 807 | if (!ether_addr_equal(resp->perm_mac_address, bp->vf.mac_addr)) |
808 | goto update_vf_mac_exit; | 808 | memcpy(bp->vf.mac_addr, resp->perm_mac_address, ETH_ALEN); |
809 | 809 | /* overwrite netdev dev_adr with admin VF MAC */ | |
810 | memcpy(bp->vf.mac_addr, resp->perm_mac_address, ETH_ALEN); | ||
811 | memcpy(bp->dev->dev_addr, bp->vf.mac_addr, ETH_ALEN); | 810 | memcpy(bp->dev->dev_addr, bp->vf.mac_addr, ETH_ALEN); |
812 | update_vf_mac_exit: | 811 | update_vf_mac_exit: |
813 | mutex_unlock(&bp->hwrm_cmd_lock); | 812 | mutex_unlock(&bp->hwrm_cmd_lock); |