Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7141668imm; Tue, 24 Jul 2018 09:02:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe0s+q3V1qF3DK5GY1/5XQH3H40tA0hGoYNDp9metkct5AZbaeRuu8P7qhp99+FNdxg0ZdP X-Received: by 2002:a65:448a:: with SMTP id l10-v6mr17010418pgq.382.1532448158379; Tue, 24 Jul 2018 09:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532448158; cv=none; d=google.com; s=arc-20160816; b=jRG358YdOiapvELTy3nUG7ZmDPRIss7ldr5hr+OD2L7jsbE06XmJhioOpEDZMOy+El gwPKcag28UqnE91LJUmDK7ighUqxOnCfbLvJ3xuGaDvKsE0n6o/mpxTrES0mkph4lxHi WG1w8T4qLmhGS4IyJBFVXTB5TLBRwue21nJ8nY+cmjkacB938Jcw9FK/efVUs4bLh90k 3MVcJIObl5yLFBEg1G/dTYucRNio1+Z0xsLM4q255+oHvo8y2uVep6w4UUi0U8n36a6j WO8a+RT5hH/2UgxN+I9B8QUETU3TfUj79T1XJlqnNMejIV8nNS/rONQENnLC472mO4zg FRcQ== 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=NFNc/eMgMHVYssqhOW92yZM6cke7oGOzzYhvQJd7hdk=; b=FXIXn+MXncYL/7hh9G9tjeq1Eqi5cXay2Y659ip6yDPJjVkRO5dYRzKKSL7KLWRxm7 X7RjNhv0iGLe+OEnTfub+wgmSXMc92oJ8bcPMXCXaZRX58gnTaKIWNQEKZjcMq6F166k 1HOJYJbnzZdQIeRFmNSXgeD+uCPsmZSnJ0xAcpZelbQkSo6YA4NefFJ2e2vl6EmYHfBS BgV+GhIsh5Ar8xGWOxrAyoW6KIniOJp5AsVAOxHeZRvs6MsGH2Tl0SreAt22NypwDA0n kRv8kw132vNF2R/81NSTIxqTD9Ij4jyUO2+Yc4h2uSShx5vE6rOr6qvbUx8ij+F8z7ue XhAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=gdU4dB5a; 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 v4-v6si10290080plo.208.2018.07.24.09.02.23; Tue, 24 Jul 2018 09:02:38 -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=gdU4dB5a; 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 S2388573AbeGXRIl (ORCPT + 99 others); Tue, 24 Jul 2018 13:08:41 -0400 Received: from mail-yw0-f195.google.com ([209.85.161.195]:36516 "EHLO mail-yw0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388330AbeGXRIk (ORCPT ); Tue, 24 Jul 2018 13:08:40 -0400 Received: by mail-yw0-f195.google.com with SMTP id v197-v6so1717880ywg.3 for ; Tue, 24 Jul 2018 09:01:31 -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=NFNc/eMgMHVYssqhOW92yZM6cke7oGOzzYhvQJd7hdk=; b=gdU4dB5aYn2s2h83Zj9R3E6kQoO8ATfRx18dqr4wixzLWmC3TllWfYSNGh9cakeqL5 qLtWe2ZxXJdnFXnZSLt16G8fnOL5K/6c5ch/PK7UykXiLq+1sUjp3hC159fIirF2/BoC 6idunzmqZihA5WFcpSkJsDSfxt9s0NoJxUbD8= 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=NFNc/eMgMHVYssqhOW92yZM6cke7oGOzzYhvQJd7hdk=; b=ODzZHa89rtkiChXyzUyg0n+WHgE7xcJZi9lNWy+5Fbdt9/0IHV/Li8X9dYH6iPjP+H J80sN2Wtzkx4nzWoR3rp6mGjY64RUQMmtLLP5GoPnf5SuLwbaQ/oPfVDY9bKdbrxta1r tJRw3sTIDLfok+QtVoEtRAAa+io9rwmwuA0lkJ9i7f8AYhD4XNbPO27XY7+EAAnV3hCt uitDk/S1eCtLL58mLjfpODkq9czQ+05iJzDdgsOY8ZKlDvxqWqnpHtkw0iRnvhAyKmtK p/UNPVQ96gPiSEUNXme1TLxTBnRJ0hzOLQHmO/tFwEns0MtRF8jGKHN1a3sGjv7Gu9UA hP5w== X-Gm-Message-State: AOUpUlG9XOR+jAyU6IylCGaXG2WO4V8TWf36lXf3Rmghjsj2B4IfZbMM gVTZMlgcme0V4VXHuXbw5e7tL+xq0u3ZOXuobwm3UA== X-Received: by 2002:a81:f102:: with SMTP id h2-v6mr9673237ywm.297.1532448089613; Tue, 24 Jul 2018 09:01:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:c651:0:0:0:0:0 with HTTP; Tue, 24 Jul 2018 09:01:29 -0700 (PDT) In-Reply-To: References: <20180724052454.21524-1-yuehaibing@huawei.com> From: Vasundhara Volam Date: Tue, 24 Jul 2018 21:31:29 +0530 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: Michael Chan Cc: YueHaibing , 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 Tue, Jul 24, 2018 at 1:01 PM, Michael Chan wrote: > > 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. Yes Michael, you are right. Also, the plain else condition is to cover a special case to allow VF to modify it's own MAC when PF has not assigned a valid MAC address and HWRM spec code > 0x10202. > > > - } 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 > > > >