Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, kuba@kernel.org,
Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Subject: [PATCH net 4/6] bnxt_en: Return -EOPNOTSUPP for ETHTOOL_GREGS on VFs.
Date: Sun, 20 Sep 2020 21:08:57 -0400 [thread overview]
Message-ID: <1600650539-19967-5-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1600650539-19967-1-git-send-email-michael.chan@broadcom.com>
From: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Debug firmware commands are not supported on VFs to read registers.
This patch avoids logging unnecessary access_denied error on VFs
when user calls ETHTOOL_GREGS.
By returning error in get_regs_len() method on the VF, the get_regs()
method will not be called.
Fixes: b5d600b027eb ("bnxt_en: Add support for 'ethtool -d'")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
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 6c75101..fecdfd8 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1322,6 +1322,9 @@ static int bnxt_get_regs_len(struct net_device *dev)
struct bnxt *bp = netdev_priv(dev);
int reg_len;
+ if (!BNXT_PF(bp))
+ return -EOPNOTSUPP;
+
reg_len = BNXT_PXP_REG_LEN;
if (bp->fw_cap & BNXT_FW_CAP_PCIE_STATS_SUPPORTED)
--
1.8.3.1
next prev parent reply other threads:[~2020-09-21 1:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 1:08 [PATCH net 0/6] bnxt_en: Bug fixes Michael Chan
2020-09-21 1:08 ` [PATCH net 1/6] bnxt_en: Use memcpy to copy VPD field info Michael Chan
2020-09-21 1:08 ` [PATCH net 2/6] bnxt_en: return proper error codes in bnxt_show_temp Michael Chan
2020-09-21 1:08 ` [PATCH net 3/6] bnxt_en: Protect bnxt_set_eee() and bnxt_set_pauseparam() with mutex Michael Chan
2020-09-21 1:08 ` Michael Chan [this message]
2020-09-21 1:08 ` [PATCH net 5/6] bnxt_en: Fix HWRM_FUNC_QSTATS_EXT firmware call Michael Chan
2020-09-21 1:08 ` [PATCH net 6/6] bnxt_en: Fix wrong flag value passed to HWRM_PORT_QSTATS_EXT fw call Michael Chan
2020-09-21 2:05 ` [PATCH net 0/6] bnxt_en: Bug fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1600650539-19967-5-git-send-email-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vasundhara-v.volam@broadcom.com \
--subject='Re: [PATCH net 4/6] bnxt_en: Return -EOPNOTSUPP for ETHTOOL_GREGS on VFs.' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).