]> git.droids-corp.org - dpdk.git/commitdiff
net/bnxt: fix stat context allocation
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Sat, 30 Oct 2021 03:50:20 +0000 (09:20 +0530)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Sun, 31 Oct 2021 16:02:36 +0000 (17:02 +0100)
stat_ctx_alloc is called within the context of each rx/tx ring.
i.e from bnxt_alloc_hwrm_rx_ring and bnxt_alloc_hwrm_tx_ring().
So, there is no need to invoke bnxt_alloc_all_hwrm_stat_ctxs()
from bnxt_start_nic().

Fixes: 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/bnxt_hwrm.c
drivers/net/bnxt/bnxt_hwrm.h

index 91f114ecbcecb5da72f8234b4cf9d25428b4b8d7..c8dad8a7c5f9fe4f42bc7d7c34b3484c5c12431f 100644 (file)
@@ -747,12 +747,6 @@ static int bnxt_start_nic(struct bnxt *bp)
        if (BNXT_CHIP_P5(bp))
                bp->max_ring_grps = BNXT_MAX_RSS_CTXTS_P5;
 
-       rc = bnxt_alloc_all_hwrm_stat_ctxs(bp);
-       if (rc) {
-               PMD_DRV_LOG(ERR, "HWRM stat ctx alloc failure rc: %x\n", rc);
-               goto err_out;
-       }
-
        rc = bnxt_alloc_hwrm_rings(bp);
        if (rc) {
                PMD_DRV_LOG(ERR, "HWRM ring alloc failure rc: %x\n", rc);
index 82e89b7c8af7d4b091a984e8b49a71663a1d348f..55dcb1dd6a3502778a5a88ec9438bad2c3841044 100644 (file)
@@ -2648,37 +2648,6 @@ bnxt_free_all_hwrm_stat_ctxs(struct bnxt *bp)
        return 0;
 }
 
-int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp)
-{
-       struct bnxt_cp_ring_info *cpr;
-       unsigned int i;
-       int rc = 0;
-
-       for (i = 0; i < bp->rx_cp_nr_rings; i++) {
-               struct bnxt_rx_queue *rxq = bp->rx_queues[i];
-
-               cpr = rxq->cp_ring;
-               if (cpr->hw_stats_ctx_id == HWRM_NA_SIGNATURE) {
-                       rc = bnxt_hwrm_stat_ctx_alloc(bp, cpr);
-                       if (rc)
-                               return rc;
-               }
-       }
-
-       for (i = 0; i < bp->tx_cp_nr_rings; i++) {
-               struct bnxt_tx_queue *txq = bp->tx_queues[i];
-
-               cpr = txq->cp_ring;
-               if (cpr->hw_stats_ctx_id == HWRM_NA_SIGNATURE) {
-                       rc = bnxt_hwrm_stat_ctx_alloc(bp, cpr);
-                       if (rc)
-                               return rc;
-               }
-       }
-
-       return rc;
-}
-
 static int
 bnxt_free_all_hwrm_ring_grps(struct bnxt *bp)
 {
index 6dc23b93ac6dbf775ca3a4a00b716829f0c86a2e..72d486468c811f950394b57ae919ce02c0b40bfa 100644 (file)
@@ -188,7 +188,6 @@ int bnxt_hwrm_vnic_plcmode_cfg(struct bnxt *bp,
 int bnxt_hwrm_vnic_tpa_cfg(struct bnxt *bp,
                           struct bnxt_vnic_info *vnic, bool enable);
 
-int bnxt_alloc_all_hwrm_stat_ctxs(struct bnxt *bp);
 int bnxt_clear_all_hwrm_stat_ctxs(struct bnxt *bp);
 int bnxt_alloc_all_hwrm_ring_grps(struct bnxt *bp);
 void bnxt_free_cp_ring(struct bnxt *bp, struct bnxt_cp_ring_info *cpr);