From: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, ajit.khaparde@broadcom.com
Subject: [dpdk-dev] [PATCH 6/9] net/bnxt: use common function to destroy VNIC resource
Date: Mon, 31 May 2021 12:56:41 +0530 [thread overview]
Message-ID: <20210531072644.24656-7-kalesh-anakkur.purayil@broadcom.com> (raw)
In-Reply-To: <20210531072644.24656-1-kalesh-anakkur.purayil@broadcom.com>
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Use the function bnxt_vnic_destroy() to destroy VNIC resources
and thereby eliminate few duplicate code.
Fixes: 8d0a244b40b2 ("net/bnxt: cleanup VNIC after flow validate")
Fixes: 49d0709b257f ("net/bnxt: delete and flush L2 filters cleanly")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
drivers/net/bnxt/bnxt_flow.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index ed201a3..59489b5 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1577,10 +1577,7 @@ bnxt_flow_validate(struct rte_eth_dev *dev,
vnic = find_matching_vnic(bp, filter);
if (vnic) {
if (STAILQ_EMPTY(&vnic->filter)) {
- rte_free(vnic->fw_grp_ids);
- bnxt_hwrm_vnic_ctx_free(bp, vnic);
- bnxt_hwrm_vnic_free(bp, vnic);
- vnic->rx_queue_cnt = 0;
+ bnxt_vnic_cleanup(bp, vnic);
bp->nr_vnics--;
PMD_DRV_LOG(DEBUG, "Free VNIC\n");
}
@@ -2045,12 +2042,7 @@ _bnxt_flow_destroy(struct bnxt *bp,
*/
if (vnic && !vnic->func_default &&
STAILQ_EMPTY(&vnic->flow_list)) {
- rte_free(vnic->fw_grp_ids);
- if (vnic->rx_queue_cnt > 1)
- bnxt_hwrm_vnic_ctx_free(bp, vnic);
-
- bnxt_hwrm_vnic_free(bp, vnic);
- vnic->rx_queue_cnt = 0;
+ bnxt_vnic_cleanup(bp, vnic);
bp->nr_vnics--;
}
} else {
--
2.10.1
next prev parent reply other threads:[~2021-05-31 7:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-31 7:26 [dpdk-dev] [PATCH 0/9] bnxt PMD fixes Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 1/9] net/bnxt: fix error message when VNIC prepare fails Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 2/9] net/bnxt: set flow error when free filter is not available Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 3/9] net/bnxt: remove unnecessary code Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 4/9] net/bnxt: fix error handling when VNIC prepare fails Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 5/9] net/bnxt: set flow error when tunnel redirection free fails Kalesh A P
2021-05-31 7:26 ` Kalesh A P [this message]
2021-05-31 7:26 ` [dpdk-dev] [PATCH 7/9] net/bnxt: fix check for PTP support in FW Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 8/9] net/bnxt: improve log message Kalesh A P
2021-05-31 7:26 ` [dpdk-dev] [PATCH 9/9] net/bnxt: remove unnecessary comment Kalesh A P
2021-06-08 23:07 ` [dpdk-dev] [PATCH 0/9] bnxt PMD fixes 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=20210531072644.24656-7-kalesh-anakkur.purayil@broadcom.com \
--to=kalesh-anakkur.purayil@broadcom.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.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).