[4/7] net/bnxt: cleanup vnic ref count
Checks
Commit Message
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(+)
@@ -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);