Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6668242imm; Tue, 24 Jul 2018 00:32:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfHhdOpPQho9C7ZcW82VXimbDAsQ/7Q0kZt7eWgcdoc+suQzEOZ2Se/oKgOWmA5iFNflwIR X-Received: by 2002:a17:902:7894:: with SMTP id q20-v6mr16187853pll.3.1532417554273; Tue, 24 Jul 2018 00:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532417554; cv=none; d=google.com; s=arc-20160816; b=TQXhlCLYzT1H0R8G/dSlTQY5ZgJPWf8XQ5XxV2lGWbPcdp4yOPtSDIhCL1WaAS5IrB HfKOA+LJcb7a8ErFWc5v0/ZtGxgZy8Gu2H+W0ELESe169KQe0lh5n5wkEwlHyQ3uS5MM jUncCaM7W6V5SnQXg9QFvapNtnWI3CRQXdgFjce8SEheVr7JmebpwryZ8b5vHHb9iqVu S1Q3MGEnfqdyRAAN8QjcjZDcnq7fIaCSKTyZCl0MvjGGMmgXvvzu+xSFcK+aJN9lSE7R i0+71naq7ydv1h70LSmgAjJw/A3rtmyYP3P31GCxUiNplOq1ncWjLaLPagBrCV4TEiT4 rc9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=TOuz6DHHJAXa3QUs4hgmNjcOqYDMAYjxpWOCbKgtkmA=; b=eg3s5RXAnePu+G0sVeQZr32qtyEkRCqyx9+cSbj25IwjiTZN5XfsiKfZBZ8EYyeuFw Gcrn6ZDVjqBEuE7aquP+ONwOF+4WD6h274Zxxko1g5F20ZPQD4IOQYzGjy3HVUFWPTFh TgFfbTJ3fLW3ZcaMVoLwViMPwaambOYEWRM4jy7iRximeSP7kbeEyDS6DyHKel4apgou teQqyN18ObMeY2nu6AA8+hMNQLIR6ZtgG/LSYWTfOu78275XzKy0t0zhsphB/7MXShHx XsywwKJaZP7Bn6wSv4QNXnBmMxbM/kb0Tqun30bBwp7Lle9Y+ELt5iG76Ou7RQhnT0vG F/4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b="OiEK/LVL"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2-v6si11683246pfs.2.2018.07.24.00.32.19; Tue, 24 Jul 2018 00:32:34 -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; dkim=pass header.i=@broadcom.com header.s=google header.b="OiEK/LVL"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388532AbeGXIgO (ORCPT + 99 others); Tue, 24 Jul 2018 04:36:14 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:43113 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388385AbeGXIgN (ORCPT ); Tue, 24 Jul 2018 04:36:13 -0400 Received: by mail-yw0-f194.google.com with SMTP id l189-v6so1188343ywb.10 for ; Tue, 24 Jul 2018 00:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TOuz6DHHJAXa3QUs4hgmNjcOqYDMAYjxpWOCbKgtkmA=; b=OiEK/LVLiR8QXMiGXyqvp5MfvplKyupmrpOL4A45I6BzOEUuEO+nE0isogX3J39VPJ K6XSEKCsYjqyfcEApgerHSPEwKvlIan1GK1WeFA8EUrh6a1LUvu8VroG4T/PjOf7jkBI Fd7OFJhDX2cWUoespZqqGfSYPjR2q5vIwm458= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TOuz6DHHJAXa3QUs4hgmNjcOqYDMAYjxpWOCbKgtkmA=; b=Xxot6clvayqknpQ+mbfLGsBPYI3OANj30tJHFD3lSRkvXXVNc1tukdUTsWqITlYK29 M3lleID2DQ9iHKNvtepOFKrvthOKNkQ2SqhBSJujM918FxsLDB/nOMiLaFkMa2cv2JHD wcTTdES3/yQMDjDPt8SyhSzrTFHJecKjPar8/YJHcY5uj2quayJ8Tgmyp7won88EKEnl K66pozOeYUVrjAA04WWPXSSMvfwGxuztNj/kg1VH8+nK7uIWjQGAAErTRcGsJmqQHfIa Gk0E3Qmvg6RDoiGdu19a8GDJKewEUIfS5c4aVbvEuLBOmCuQZsqz3P44Tame907LTKbQ 8heg== X-Gm-Message-State: AOUpUlFWBqH1OcCyGR++kPLcPowg0S9QmrOkh2LS6VQFk1bCqdNz+VSq yrU8fzHVqLxnMtMZ8kHxvVNpZlpPuP5bnXWq/dumYQ== X-Received: by 2002:a0d:f142:: with SMTP id a63-v6mr8591015ywf.204.1532417467731; Tue, 24 Jul 2018 00:31:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:e716:0:0:0:0:0 with HTTP; Tue, 24 Jul 2018 00:31:06 -0700 (PDT) In-Reply-To: <20180724052454.21524-1-yuehaibing@huawei.com> References: <20180724052454.21524-1-yuehaibing@huawei.com> From: Michael Chan Date: Tue, 24 Jul 2018 00:31:06 -0700 Message-ID: Subject: Re: [PATCH net-next] bnxt_en: Fix logic of forward the VF MAC address to PF in bnxt_vf_validate_set_mac To: YueHaibing , Vasundhara Volam Cc: David Miller , open list , Netdev Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 23, 2018 at 10:24 PM, YueHaibing wrote: > 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; I'm not sure if this is correct. If firmware spec < 0x10202, the VF MAC address is not forwarded to the PF and so it doesn't have to match and mac_ok should still be true. I think we are missing that condition with this patch. I need to let my colleague Vasundhara comment on this. She is more familiar with this logic. > - } 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 > >