Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6580076imm; Mon, 23 Jul 2018 22:28:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfBdrmEeBbHBVailAQILUkTbBdorZt+FhBNHWchY7H7MbI5k7y39TUmM/imxY5XLwCS5s08 X-Received: by 2002:a63:3f05:: with SMTP id m5-v6mr14773142pga.51.1532410138618; Mon, 23 Jul 2018 22:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532410138; cv=none; d=google.com; s=arc-20160816; b=q1CIu7eTR2Ss5VdZb5eMotso74yK3GtapylywRl5Y0nk64BOKzOLHPNOp7DMPSkYEE x+IS1UaG7RyNb68AUVRYCxfjP7UIufJGGKdb7z6dpYkeelEr10cwSkZRD2Mg4Uihw7gi BvaC+rsoorbaV/Dp3ooulWWaVFmUWfdfcdn+l1J2qx8o4JguFtCh/Eino3wOx5TJRKDf grCwVDIMHou19eS5UyNJoNZKFwZCscCGhmEGSawqFmYQZUJriIWaJnf0xWibLnpZ5J1z lbHhjuK3dIa5H7gQJPuL3AWlcE4hJZgC+k+12rE6G+kh6mRZMnoD6Ng6hQPXog7ObW38 7Clg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=RXuk0oK2hSYXCY3wJssEO8wGJUc4ihpLeEEAqmZbsr4=; b=eBN+WhXr+HJiyyeEkn0ui0/1ln/idlXxuRziPaCHZ4HRku3QHIJWTKi5kctHCb2D56 OaCdOPwIH6VMrJhJ6O8zFwLu3wzPChC1wdCIQqdBReXqdNSsxi6Izl9Tt/naywnp+m6c oDmN2c0UAguV6k17rHp27G6vZf9h98kWZxWWly2oLQww1oQK1uWlFtZRanwEnB6Kl3pA vXSvfGeujrrR00BMwlpIedM10Ret28QoylPV8t8Mtbwa+kcNcyt0dr37owzNRbLvDiPf /Xk/Fcp+7q+mD78+qdoRegZrrHGyPiVNXwH/rCoBjyYl99tVscv+0643nXYUPQNaEt1V d+rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2-v6si11198919pfv.57.2018.07.23.22.28.43; Mon, 23 Jul 2018 22:28:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388264AbeGXGc2 (ORCPT + 99 others); Tue, 24 Jul 2018 02:32:28 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52476 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388109AbeGXGc2 (ORCPT ); Tue, 24 Jul 2018 02:32:28 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 8DCCFC6B94902; Tue, 24 Jul 2018 13:27:43 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Tue, 24 Jul 2018 13:27:37 +0800 From: YueHaibing To: , CC: , , 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> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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