From: Kishore Padmanabha <[email protected]>

When rx queue is not started and the stats context id is not
allocated then skip the stats collection.

Signed-off-by: Kishore Padmanabha <[email protected]>
Reviewed-by: Ajit Khaparde <[email protected]>
Reviewed-by: Kalesh AP <[email protected]>
---
 drivers/net/bnxt/bnxt_stats.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 9d7cdf925d..697f9ad9fe 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -656,6 +656,9 @@ static int bnxt_stats_get_ext(struct rte_eth_dev *eth_dev,
                if (!rxq->rx_started)
                        continue;
 
+               if (cpr->hw_stats_ctx_id == HWRM_NA_SIGNATURE)
+                       continue;
+
                rc = bnxt_hwrm_ring_stats_ext(bp, cpr->hw_stats_ctx_id, i,
                                              &ring_stats, true);
                if (unlikely(rc))
@@ -717,6 +720,8 @@ int bnxt_stats_get_op(struct rte_eth_dev *eth_dev,
 
                if (!rxq->rx_started)
                        continue;
+               if (cpr->hw_stats_ctx_id == HWRM_NA_SIGNATURE)
+                       continue;
 
                rc = bnxt_hwrm_ring_stats(bp, cpr->hw_stats_ctx_id, i,
                                          &ring_stats, true);
-- 
2.39.5 (Apple Git-154)

Reply via email to