From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, pavan.chebbi@broadcom.com,
andrew.gospodarek@broadcom.com,
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [PATCH net-next 1/7] bnxt_en: Skip ethtool RSS context configuration in ifdown state
Date: Tue, 9 Apr 2024 14:54:25 -0700 [thread overview]
Message-ID: <20240409215431.41424-2-michael.chan@broadcom.com> (raw)
In-Reply-To: <20240409215431.41424-1-michael.chan@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]
From: Pavan Chebbi <pavan.chebbi@broadcom.com>
The current implementation requires the ifstate to be up when
configuring the RSS contexts. It will try to fetch the RX ring
IDs and will crash if it is in ifdown state. Return error if
!netif_running() to prevent the crash.
An improved implementation is in the works to allow RSS contexts
to be changed while in ifdown state.
Fixes: b3d0083caf9a ("bnxt_en: Support RSS contexts in ethtool .{get|set}_rxfh()")
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 9c49f629d565..68444234b268 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1876,6 +1876,11 @@ static int bnxt_set_rxfh_context(struct bnxt *bp,
return -EOPNOTSUPP;
}
+ if (!netif_running(bp->dev)) {
+ NL_SET_ERR_MSG_MOD(extack, "Unable to set RSS contexts when interface is down");
+ return -EAGAIN;
+ }
+
if (*rss_context != ETH_RXFH_CONTEXT_ALLOC) {
rss_ctx = bnxt_get_rss_ctx_from_index(bp, *rss_context);
if (!rss_ctx) {
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2024-04-09 21:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 21:54 [PATCH net-next 0/7] bnxt_en: Updates for net-next Michael Chan
2024-04-09 21:54 ` Michael Chan [this message]
2024-04-09 23:26 ` [PATCH net-next 1/7] bnxt_en: Skip ethtool RSS context configuration in ifdown state Jacob Keller
2024-04-09 23:51 ` Michael Chan
2024-04-10 19:29 ` Jacob Keller
2024-04-09 21:54 ` [PATCH net-next 2/7] bnxt_en: Remove a redundant NULL check in bnxt_register_dev() Michael Chan
2024-04-09 23:35 ` Jacob Keller
2024-04-09 21:54 ` [PATCH net-next 3/7] bnxt_en: Remove unneeded MSIX base structure fields and code Michael Chan
2024-04-09 23:36 ` Jacob Keller
2024-04-09 21:54 ` [PATCH net-next 4/7] bnxt_en: Refactor bnxt_rdma_aux_device_init/uninit functions Michael Chan
2024-04-09 23:37 ` Jacob Keller
2024-04-09 21:54 ` [PATCH net-next 5/7] bnxt_en: Change MSIX/NQs allocation policy Michael Chan
2024-04-09 23:40 ` Jacob Keller
2024-04-09 23:48 ` Michael Chan
2024-04-10 19:28 ` Jacob Keller
2024-04-09 21:54 ` [PATCH net-next 6/7] bnxt_en: Utilize ulp client resources if RoCE is not registered Michael Chan
2024-04-09 23:41 ` Jacob Keller
2024-04-09 21:54 ` [PATCH net-next 7/7] bnxt_en: Update MODULE_DESCRIPTION Michael Chan
2024-04-09 23:42 ` Jacob Keller
2024-04-11 3:10 ` [PATCH net-next 0/7] bnxt_en: Updates for net-next patchwork-bot+netdevbpf
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=20240409215431.41424-2-michael.chan@broadcom.com \
--to=michael.chan@broadcom.com \
--cc=andrew.gospodarek@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=somnath.kotur@broadcom.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).