From mboxrd@z Thu Jan 1 00:00:00 1970 From: YueHaibing Subject: [PATCH net-next] bnxt_en: Fix logic of forward the VF MAC address to PF in bnxt_vf_validate_set_mac Date: Tue, 24 Jul 2018 13:24:54 +0800 Message-ID: <20180724052454.21524-1-yuehaibing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , YueHaibing To: , Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Based on the comments,req->l2addr must match the VF MAC address if firmware spec >= 1.2.2, mac_ok can be true. Signed-off-by: YueHaibing --- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index a649108..7925964 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -954,12 +954,9 @@ static int bnxt_vf_validate_set_mac(struct bnxt *bp, struct bnxt_vf_info *vf) if (ether_addr_equal((const u8 *)req->l2_addr, vf->mac_addr)) mac_ok = true; } else if (is_valid_ether_addr(vf->vf_mac_addr)) { - if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr)) + if (ether_addr_equal((const u8 *)req->l2_addr, vf->vf_mac_addr) && + bp->hwrm_spec_code >= 0x10202) mac_ok = true; - } else if (bp->hwrm_spec_code < 0x10202) { - mac_ok = true; - } else { - mac_ok = true; } if (mac_ok) return bnxt_hwrm_exec_fwd_resp(bp, vf, msg_size); -- 2.7.0