Skip to content

Commit

Permalink
net/bnxt: use common function to free VNIC resource
Browse files Browse the repository at this point in the history
[ upstream commit 3e3fecf ]

Use the function bnxt_vnic_destroy() to destroy VNIC resources
and thereby eliminate few duplicate code.

Fixes: 8d0a244 ("net/bnxt: cleanup VNIC after flow validate")
Fixes: 49d0709 ("net/bnxt: delete and flush L2 filters cleanly")

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>
  • Loading branch information
Kalesh AP authored and cpaelzer committed Aug 9, 2021
1 parent f6e2a4d commit 024de73
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/net/bnxt/bnxt_flow.c
Expand Up @@ -1541,10 +1541,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");
}
Expand Down Expand Up @@ -1926,12 +1923,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 {
Expand Down

0 comments on commit 024de73

Please sign in to comment.