Skip to content

Commit 17b0dfa

Browse files
pavanchebbikuba-moo
authored andcommitted
bnxt_en: Skip ethtool RSS context configuration in ifdown state
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: b3d0083 ("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> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://lore.kernel.org/r/20240409215431.41424-2-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 930fd7f commit 17b0dfa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,6 +1876,11 @@ static int bnxt_set_rxfh_context(struct bnxt *bp,
18761876
return -EOPNOTSUPP;
18771877
}
18781878

1879+
if (!netif_running(bp->dev)) {
1880+
NL_SET_ERR_MSG_MOD(extack, "Unable to set RSS contexts when interface is down");
1881+
return -EAGAIN;
1882+
}
1883+
18791884
if (*rss_context != ETH_RXFH_CONTEXT_ALLOC) {
18801885
rss_ctx = bnxt_get_rss_ctx_from_index(bp, *rss_context);
18811886
if (!rss_ctx) {

0 commit comments

Comments
 (0)