From patchwork Mon Nov 16 00:27:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11906995 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A1F0C63697 for ; Mon, 16 Nov 2020 00:28:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F200622314 for ; Mon, 16 Nov 2020 00:28:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="SadjDcwA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728160AbgKPA2N (ORCPT ); Sun, 15 Nov 2020 19:28:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbgKPA2M (ORCPT ); Sun, 15 Nov 2020 19:28:12 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50295C0613CF for ; Sun, 15 Nov 2020 16:28:12 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id 131so1454792pfb.9 for ; Sun, 15 Nov 2020 16:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6rPe1iq7+fcLr9VBmsv3jn5BZ44p0yB9+/X5hPyBzIo=; b=SadjDcwADYRK5IZFsAVcAItSo8LlEk0K3GIyIVfmM5Uj+gFXFnmWthk6uUluTDRmce SXwmz6SgMTS03JUh4HsXFKogsI/WUK0id2aQFAbI1SiNzTqVaJD8cdTmHbE+/Jp0JgoG CT9f7hUCC+FbdJmnsUAOieWkfS0OxCE504VV8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6rPe1iq7+fcLr9VBmsv3jn5BZ44p0yB9+/X5hPyBzIo=; b=Y7PTn+bEYbqZRP1j4D6JKuByZjNqS3RfxcjtgW1URnLhekXkjPll6mrymgRuPzYtZO tN9TfLo1p8xT1D635YoEURENfYXyvwitljnGHFCZ+0uB9krjK/VPgeWch9zhE6EkWfi5 agan14lvBhyNXs42cO/Pxfp8ExOIClaufKwcEZtPcHjtR8osvFJ+tQgV21iN0JJU8fVA 9nD+DmGOhhYz1ey8EDAV6f6PBGE2g4hK4NC+FHfzW4J01TcFgFwS51w43e7P7K79q81W FGM3HnnD0yMc92yzaqn+4PaoREGbWRSP5KptpXobId6gq691TRv7hSHWp3zflS6RBAKV xl5Q== X-Gm-Message-State: AOAM533d0aYImLMZCZ+BSYAL3SRrmY56tKg4TGlRVHPeR1kGLkE4By33 +wyZC9qSeoTxmBFbJGYFMRwM/vmAeZjyCw== X-Google-Smtp-Source: ABdhPJy6axevHbK/ZUVkylS6spqU8S0yQcAXodhtWYOJh0dfmzHIWM8jKoQl5uK3EoRtfBq1fWALHQ== X-Received: by 2002:a62:db03:0:b029:196:45d6:9bb3 with SMTP id f3-20020a62db030000b029019645d69bb3mr3460203pfg.74.1605486491604; Sun, 15 Nov 2020 16:28:11 -0800 (PST) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i19sm2942563pgk.44.2020.11.15.16.28.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Nov 2020 16:28:11 -0800 (PST) From: Michael Chan To: kuba@kernel.org Cc: netdev@vger.kernel.org, gospo@broadcom.com Subject: [PATCH net 1/4] bnxt_en: read EEPROM A2h address using page 0 Date: Sun, 15 Nov 2020 19:27:49 -0500 Message-Id: <1605486472-28156-2-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> References: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Edwin Peer The module eeprom address range returned by bnxt_get_module_eeprom() should be 256 bytes of A0h address space, the lower half of the A2h address space, and page 0 for the upper half of the A2h address space. Fix the firmware call by passing page_number 0 for the A2h slave address space. Fixes: 42ee18fe4ca2 ("bnxt_en: Add Support for ETHTOOL_GMODULEINFO and ETHTOOL_GMODULEEEPRO") Signed-off-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 53687bc7fcf5..f133ea5674cb 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -2997,7 +2997,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev, /* Read A2 portion of the EEPROM */ if (length) { start -= ETH_MODULE_SFF_8436_LEN; - rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 1, + rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 0, start, length, data); } return rc; From patchwork Mon Nov 16 00:27:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11906997 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A2DEC56202 for ; Mon, 16 Nov 2020 00:28:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C59122453 for ; Mon, 16 Nov 2020 00:28:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="V0JoSfAo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbgKPA2P (ORCPT ); Sun, 15 Nov 2020 19:28:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbgKPA2P (ORCPT ); Sun, 15 Nov 2020 19:28:15 -0500 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D9B6C0613CF for ; Sun, 15 Nov 2020 16:28:15 -0800 (PST) Received: by mail-pf1-x444.google.com with SMTP id y7so11955239pfq.11 for ; Sun, 15 Nov 2020 16:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eh95oG6m78nGWcDQKnSbVSOp6jJ+eezsqO/KsSw4K9k=; b=V0JoSfAo/W/rRJtr6SbxHKeQNA5gMhMt2+yP07b74qa7F/y9lvbVlDdXmUhZlpclLn xAqGQT3In86hgTd+vbNGOxmNEhvrxMMRRRAfkZR8fczmTupzMfZqKydvONqDbupLk6gC MO1aSRK+XiHNTVVHqAQIuHSML3Vo71skREmPc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eh95oG6m78nGWcDQKnSbVSOp6jJ+eezsqO/KsSw4K9k=; b=pbua8TQnq5KcjvQb/5zvF97tEQv6RfO5vsmcY86rvFnHFgBBWgfSC9g95UeJH6JJ/h KGz1OyRIakZDlGoZENsOATuiXpZhfETU2QFkQMqiyvmG8h6JaE0dAa9dbK4v6OYXvsx2 91bZI12ZOHl207KW3/+rIfpqlQkgisFk/jTvPcGFa2WGKd7e9uCUYiTYPrN7DseV/bon u3OI8oymONOvGJgDeF2WZzjUDhc45Do5m2BT9UJqZTwrwgfPjsdmmMTdaKckd90+jPXd +JO/2ENL7zCwQc04QGAVDbrGD6BGGmShpM1quloTOmHPosLM4i9u5DYgxv7QhBR/No79 mO8g== X-Gm-Message-State: AOAM531Ujd4qXYsHo+JxoTSPDqJeGX9HVhhP5YSS64zrgA9at6AFH7vy IuC3z7JGrQ3UN85ngt5zDDd+i8kI4eHl0g== X-Google-Smtp-Source: ABdhPJwBwnXTAu0dnVo8b0dfZiHspbNZWhQh7SVwz+HKUZIAvSyx7VNeZCtUaK2NHWuWx6ADtgOoHQ== X-Received: by 2002:a17:90a:3cc4:: with SMTP id k4mr6492780pjd.106.1605486494567; Sun, 15 Nov 2020 16:28:14 -0800 (PST) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i19sm2942563pgk.44.2020.11.15.16.28.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Nov 2020 16:28:14 -0800 (PST) From: Michael Chan To: kuba@kernel.org Cc: netdev@vger.kernel.org, gospo@broadcom.com Subject: [PATCH net 2/4] bnxt_en: Free port stats during firmware reset. Date: Sun, 15 Nov 2020 19:27:50 -0500 Message-Id: <1605486472-28156-3-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> References: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Firmware is unable to retain the port counters during any kind of fatal or non-fatal resets, so we must clear the port counters to avoid false detection of port counter overflow. Fixes: fea6b3335527 ("bnxt_en: Accumulate all counters.") Reviewed-by: Edwin Peer Reviewed-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 7975f59735d6..448e1ba762ee 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4099,7 +4099,8 @@ static void bnxt_free_mem(struct bnxt *bp, bool irq_re_init) bnxt_free_ntp_fltrs(bp, irq_re_init); if (irq_re_init) { bnxt_free_ring_stats(bp); - if (!(bp->fw_cap & BNXT_FW_CAP_PORT_STATS_NO_RESET)) + if (!(bp->fw_cap & BNXT_FW_CAP_PORT_STATS_NO_RESET) || + test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) bnxt_free_port_stats(bp); bnxt_free_ring_grps(bp); bnxt_free_vnics(bp); From patchwork Mon Nov 16 00:27:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11906999 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05A40C63699 for ; Mon, 16 Nov 2020 00:28:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AB7522314 for ; Mon, 16 Nov 2020 00:28:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="AYUqGN7x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728262AbgKPA2T (ORCPT ); Sun, 15 Nov 2020 19:28:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbgKPA2S (ORCPT ); Sun, 15 Nov 2020 19:28:18 -0500 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47DB3C0613CF for ; Sun, 15 Nov 2020 16:28:18 -0800 (PST) Received: by mail-pg1-x541.google.com with SMTP id j19so4605883pgg.5 for ; Sun, 15 Nov 2020 16:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ay7zhmBkaHC5Ra+dBoVCVWdhN2ITDGmxmdv79eXwAgE=; b=AYUqGN7xNocwgnOwvymhC1iT3Cz1qCr7v9sl/J/fLYaiFdKhCEhyCYAr+B1y1Ki+hW DMCs3dc9/1+Oyazuu640E3p3g0qi2rZvP6xbbaloD9hF87mVAwmhFChnIARCVHjBjr4b 1tPvMZGVPA9EWEUuGR98btJUYk2dPmubuSVXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ay7zhmBkaHC5Ra+dBoVCVWdhN2ITDGmxmdv79eXwAgE=; b=KLz0JT9hNT9kmcGvs4dCrCiW9kmN2xaTXoPya0oFVLYJtsUJIWC1lmiFna1oJgXZrr Bwt8a/DXYpqsA9MwODJka3v1PpbHpeY2DHKcSW4IaYqeDIQraGEq5oBJpg4pYXdouG1z IsCCcFwtuC60fxI+ruUA9RFCLlmyPH89WyeL69NZIsnEwMQD0/U4yXOtZZh38FM7R2/w 6qYNyF2rSbZdXzUr+l7RlaFCC3P8paXnfyrMv/VYTMxMU+hI5ZQc8HNusupmJ7Ia9zfY h+Xc4115xg4wTj6AukKoH1wv/IczoqERbuUN//8OKcHfeB90FzfpfMdGIEmfe7z71G6u zsVQ== X-Gm-Message-State: AOAM530hEjldI+530MAiNIxVS+nwajfk2Dox4z1Zkg0pmyGl3eMFUiuc svVJ3j3tfBM2liCqMFuqUD3GWvPoM83Zag== X-Google-Smtp-Source: ABdhPJxRsVJmovsamKluv3durcCbKYX/i1N9dz6LMWfraqLLD/h4MgFRjXr9tlgyK7xizDsx0Juc+Q== X-Received: by 2002:a17:90b:1642:: with SMTP id il2mr12094688pjb.81.1605486497601; Sun, 15 Nov 2020 16:28:17 -0800 (PST) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i19sm2942563pgk.44.2020.11.15.16.28.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Nov 2020 16:28:17 -0800 (PST) From: Michael Chan To: kuba@kernel.org Cc: netdev@vger.kernel.org, gospo@broadcom.com Subject: [PATCH net 3/4] bnxt_en: Fix counter overflow logic. Date: Sun, 15 Nov 2020 19:27:51 -0500 Message-Id: <1605486472-28156-4-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> References: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org bnxt_add_one_ctr() adds a hardware counter to a software counter and adjusts for the hardware counter wraparound against the mask. The logic assumes that the hardware counter is always smaller than or equal to the mask. This assumption is mostly correct. But in some cases if the firmware is older and does not provide the accurate mask, the driver can use a mask that is smaller than the actual hardware mask. This can cause some extra carry bits to be added to the software counter, resulting in counters that far exceed the actual value. Fix it by masking the hardware counter with the mask passed into bnxt_add_one_ctr(). Fixes: fea6b3335527 ("bnxt_en: Accumulate all counters.") Reviewed-by: Vasundhara Volam Reviewed-by: Pavan Chebbi Reviewed-by: Edwin Peer Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 448e1ba762ee..7c21aaa8b9af 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7758,6 +7758,7 @@ static void bnxt_add_one_ctr(u64 hw, u64 *sw, u64 mask) { u64 sw_tmp; + hw &= mask; sw_tmp = (*sw & ~mask) | hw; if (hw < (*sw & mask)) sw_tmp += mask + 1; From patchwork Mon Nov 16 00:27:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 11907001 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,MIME_HEADER_CTYPE_ONLY,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,T_TVD_MIME_NO_HEADERS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D7B3C63777 for ; Mon, 16 Nov 2020 00:28:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B60BA22453 for ; Mon, 16 Nov 2020 00:28:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FYLox68P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728268AbgKPA2V (ORCPT ); Sun, 15 Nov 2020 19:28:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726311AbgKPA2V (ORCPT ); Sun, 15 Nov 2020 19:28:21 -0500 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 661FBC0613CF for ; Sun, 15 Nov 2020 16:28:21 -0800 (PST) Received: by mail-pl1-x62d.google.com with SMTP id b3so7363591pls.11 for ; Sun, 15 Nov 2020 16:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wZg4N1OroWqzJ2KATpMjhmsnCL6QQ1tG206kDMGQNOE=; b=FYLox68P+SoWDMuX81EZoRa0WLniufwg6kdP1XOze6qMf51HfjEKMjtygr0+R63E3c uP8+P4DoYIqLuA2eeq/BrFiV/nOI4vsd784DCShz+zSJ47GUtWowzPXRwGzLNxtWolx5 2fUBAhTy0g5lc5ViBIj2I7HU0F6gPjbcWxMSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wZg4N1OroWqzJ2KATpMjhmsnCL6QQ1tG206kDMGQNOE=; b=enVTs5m4z37oipBJRd4wH1qeDnUAFnzq5gaFKH6NFKydaJ2IcFpVk33ixcI463YST2 +9VMMrjqKtwImBmmafxmgDa1M3waIdgDKDlax2T474C9hLBB/U1o1fnSt9+uuWRCZLQ3 dXrlEL8n2zdQv1mdSBqg6bqydBuXcdsu25epH3+SYNVBRBegS52CwnquZt4iiXzQM6Sg /2M8BaBzgIOTy3CoVVjiG2cnLWWDpt5aoizRJGQP3Ffc+NiIvpiDQE5yFgnTBSl0sc2G hRUkntdhprz5pHSmyOYc6qAfpwwB53w5v6nBiyRmAngVlevgbklfhupd3pp0fbdwg/0r uzUw== X-Gm-Message-State: AOAM531vlGfdChFcasiEFqN5rXS9Z7PdIONHkd9SdI1gajxFQyErgvo/ akrDaXG9hr3efykeZAVv2Z+I2TmzMCInBQ== X-Google-Smtp-Source: ABdhPJxnUyb+AoDHwZATq7fXcmxBAkNMOVhgXppel5nZNlbM8Lv3z3KMhUHi4KpsHwYH+XwcNDzXug== X-Received: by 2002:a17:902:900a:b029:d7:d966:4f29 with SMTP id a10-20020a170902900ab02900d7d9664f29mr10565293plp.85.1605486500656; Sun, 15 Nov 2020 16:28:20 -0800 (PST) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id i19sm2942563pgk.44.2020.11.15.16.28.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Nov 2020 16:28:20 -0800 (PST) From: Michael Chan To: kuba@kernel.org Cc: netdev@vger.kernel.org, gospo@broadcom.com Subject: [PATCH net 4/4] bnxt_en: Avoid unnecessary NVM_GET_DEV_INFO cmd error log on VFs. Date: Sun, 15 Nov 2020 19:27:52 -0500 Message-Id: <1605486472-28156-5-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> References: <1605486472-28156-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vasundhara Volam VFs do not have access permissions to issue NVM_GET_DEV_INFO firmware command. Fixes: 4933f6753b50 ("bnxt_en: Add bnxt_hwrm_nvm_get_dev_info() to query NVM info.") Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index f133ea5674cb..1471c9a36238 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -2079,6 +2079,9 @@ int bnxt_hwrm_nvm_get_dev_info(struct bnxt *bp, struct hwrm_nvm_get_dev_info_input req = {0}; int rc; + if (BNXT_VF(bp)) + return -EOPNOTSUPP; + bnxt_hwrm_cmd_hdr_init(bp, &req, HWRM_NVM_GET_DEV_INFO, -1, -1); mutex_lock(&bp->hwrm_cmd_lock); rc = _hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);