Skip to contentSkip to conversation

net/bnxt: fix logic error when freeing RSS context

PATCH Applied Lance Richardson 2 participants 2 messages Jul 10, 2019 – Jul 16, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: fix logic error when freeing RSS context

The conditional used to determine whether freeing RSS contexts for thor vs. non-thor controller was reversed. Fix this, also reset number of active RSS contexts to zero after release in the thor case.

Fixes 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")
---
 drivers/net/bnxt/bnxt_hwrm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/bnxt/bnxt_hwrm.c +2 -1
index 696974c83..71f03775a 100644
@@ -2312,12 +2312,13 @@ void bnxt_free_all_hwrm_resources(struct bnxt *bp)
 
 		bnxt_clear_hwrm_vnic_filters(bp, vnic);
 
-		if (!BNXT_CHIP_THOR(bp)) {
+		if (BNXT_CHIP_THOR(bp)) {
 			for (j = 0; j < vnic->num_lb_ctxts; j++) {
 				bnxt_hwrm_vnic_ctx_free(bp, vnic,
 							vnic->fw_grp_ids[j]);
 				vnic->fw_grp_ids[j] = INVALID_HW_RING_ID;
 			}
+			vnic->num_lb_ctxts = 0;
 		} else {
 			bnxt_hwrm_vnic_ctx_free(bp, vnic, vnic->rss_rule);
 			vnic->rss_rule = INVALID_HW_RING_ID;
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 8 lines · Lance Richardson

The conditional used to determine whether freeing RSS contexts for thor vs. non-thor controller was reversed. Fix this, also reset number of active RSS contexts to zero after release in the thor case.

Fixes 38412304b50a ("net/bnxt: enable RSS for thor-based controllers")

Applied to dpdk-next-net/master, thanks.