net/bnxt: fix logic when freeing RSS context
authorLance Richardson <lance.richardson@broadcom.com>
Wed, 10 Jul 2019 14:24:09 +0000 (10:24 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:35 +0000 (14:31 +0200)
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")

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_hwrm.c

index 696974c..71f0377 100644 (file)
@@ -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;