DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Damodharam Ammepalli <damodharam.ammepalli@broadcom.com>
Subject: [PATCH 4/7] net/bnxt: cleanup vnic ref count
Date: Thu,  8 Feb 2024 09:13:27 -0800	[thread overview]
Message-ID: <20240208171330.31139-5-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20240208171330.31139-1-ajit.khaparde@broadcom.com>

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

From: Damodharam Ammepalli <damodharam.ammepalli@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@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@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)


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

  parent reply	other threads:[~2024-02-08 17:14 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 ` [PATCH 3/7] net/bnxt: refactor VNIC context cleanup Ajit Khaparde
2024-02-08 17:13 ` Ajit Khaparde [this message]
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-5-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=damodharam.ammepalli@broadcom.com \
    --cc=dev@dpdk.org \
    /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).