[PATCH 4/7] net/bnxt: cleanup vnic ref count

Ajit Khaparde ajit.khaparde at broadcom.com
Thu Feb 8 18:13:27 CET 2024


From: Damodharam Ammepalli <damodharam.ammepalli at broadcom.com>

Cleanup vnic ref count when port is stopped.
When vlan strip is set/unset the current active
vnics are destroyed and recreated with VNIC id
provided by firmware. The default vnic at index 0
still has ref_cnt=1 while rx_queues are reset to 0,
which fails the check under bnxt_vnic_rss_action_free()

Resetting the vnic->ref_cnt in bnxt_free_all_hwrm_resources()
post FW handshake in clean-up path.

Signed-off-by: Damodharam Ammepalli <damodharam.ammepalli at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_hwrm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index 397b4a0e05..1d523d6dec 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -3584,6 +3584,8 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 
 		rte_free(vnic->fw_grp_ids);
 		vnic->fw_grp_ids = NULL;
+		if (vnic->ref_cnt && !vnic->rx_queue_cnt)
+			vnic->ref_cnt--;
 	}
 	/* Ring resources */
 	bnxt_free_all_hwrm_rings(bp);
-- 
2.39.2 (Apple Git-143)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4218 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mails.dpdk.org/archives/dev/attachments/20240208/a3290bcb/attachment.bin>


More information about the dev mailing list