Skip to content

Commit e123d93

Browse files
pavanchebbikuba-moo
authored andcommitted
bnxt_en: Fix RSS context delete logic
We need to free the corresponding RSS context VNIC in FW everytime an RSS context is deleted in driver. Commit 667ac33 added a check to delete the VNIC in FW only when netif_running() is true to help delete RSS contexts with interface down. Having that condition will make the driver leak VNICs in FW whenever close() happens with active RSS contexts. On the subsequent open(), as part of RSS context restoration, we will end up trying to create extra VNICs for which we did not make any reservation. FW can fail this request, thereby making us lose active RSS contexts. Suppose an RSS context is deleted already and we try to process a delete request again, then the HWRM functions will check for validity of the request and they simply return if the resource is already freed. So, even for delete-when-down cases, netif_running() check is not necessary. Remove the netif_running() condition check when deleting an RSS context. Reported-by: Jakub Kicinski <kicinski@meta.com> Fixes: 667ac33 ("eth: bnxt: allow deleting RSS contexts when the device is down") Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com> Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Link: https://patch.msgid.link/20260219185313.2682148-2-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 470c7ca commit e123d93

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • drivers/net/ethernet/broadcom/bnxt

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10889,12 +10889,10 @@ void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx,
1088910889
struct bnxt_ntuple_filter *ntp_fltr;
1089010890
int i;
1089110891

10892-
if (netif_running(bp->dev)) {
10893-
bnxt_hwrm_vnic_free_one(bp, &rss_ctx->vnic);
10894-
for (i = 0; i < BNXT_MAX_CTX_PER_VNIC; i++) {
10895-
if (vnic->fw_rss_cos_lb_ctx[i] != INVALID_HW_RING_ID)
10896-
bnxt_hwrm_vnic_ctx_free_one(bp, vnic, i);
10897-
}
10892+
bnxt_hwrm_vnic_free_one(bp, &rss_ctx->vnic);
10893+
for (i = 0; i < BNXT_MAX_CTX_PER_VNIC; i++) {
10894+
if (vnic->fw_rss_cos_lb_ctx[i] != INVALID_HW_RING_ID)
10895+
bnxt_hwrm_vnic_ctx_free_one(bp, vnic, i);
1089810896
}
1089910897
if (!all)
1090010898
return;

0 commit comments

Comments
 (0)