DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Subject: [PATCH 3/7] net/bnxt: refactor VNIC context cleanup
Date: Thu,  8 Feb 2024 09:13:26 -0800	[thread overview]
Message-ID: <20240208171330.31139-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20240208171330.31139-1-ajit.khaparde@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]

Currently the VNIC context cleanup is being called a little early
leading to the VNIC RSS context being freed prior to the filter
cleanup corresponding to the VNIC. But since these filters could
still be referenced by the default VNIC the hardware fails to find
the corresponding VNIC context in some rare cases.

Modify the cleanup sequence for the VNICs to free the VNIC contexts
after the filters and the actual VNIC is freed up in the firmware.

Also make sure to clear the rx_mask with mask of 0 for default VNIC.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 17527a3c4d..397b4a0e05 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3570,16 +3570,18 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 		if (vnic->fw_vnic_id == INVALID_HW_RING_ID)
 			continue;
 
+		if (vnic->func_default && (bp->flags & BNXT_FLAG_DFLT_VNIC_SET))
+			bnxt_hwrm_cfa_l2_clear_rx_mask(bp, vnic);
 		bnxt_clear_hwrm_vnic_flows(bp, vnic);
 
 		bnxt_clear_hwrm_vnic_filters(bp, vnic);
 
-		bnxt_hwrm_vnic_ctx_free(bp, vnic);
-
 		bnxt_hwrm_vnic_tpa_cfg(bp, vnic, false);
 
 		bnxt_hwrm_vnic_free(bp, vnic);
 
+		bnxt_hwrm_vnic_ctx_free(bp, vnic);
+
 		rte_free(vnic->fw_grp_ids);
 		vnic->fw_grp_ids = NULL;
 	}
-- 
2.39.2 (Apple Git-143)


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

  parent reply	other threads:[~2024-02-08 17:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08 17:13 [PATCH 0/7] bnxt bug fixes Ajit Khaparde
2024-02-08 17:13 ` [PATCH 1/7] net/bnxt: avoid seg fault in Tx queue release Ajit Khaparde
2024-02-08 17:13 ` [PATCH 2/7] net/bnxt: modify locking for representor Tx Ajit Khaparde
2024-02-08 17:13 ` Ajit Khaparde [this message]
2024-02-08 17:13 ` [PATCH 4/7] net/bnxt: cleanup vnic ref count Ajit Khaparde
2024-02-08 17:13 ` [PATCH 5/7] net/bnxt: adjust session name on multi host system Ajit Khaparde
2024-02-08 17:13 ` [PATCH 6/7] net/bnxt: update consumer index of NQ regularly Ajit Khaparde
2024-02-08 17:13 ` [PATCH 7/7] net/bnxt: update RSS algorithm capability Ajit Khaparde
2024-02-08 21:50 ` [PATCH 0/7] bnxt bug fixes Ajit Khaparde
2024-02-22  2:50   ` Patrick Robb
2024-02-22  3:20     ` Ajit Khaparde

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=20240208171330.31139-4-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=kishore.padmanabha@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).