summaryrefslogtreecommitdiff
path: root/drivers/net/bnxt/bnxt_rxr.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@broadcom.com>2017-06-01 12:07:13 -0500
committerFerruh Yigit <ferruh.yigit@intel.com>2017-06-12 10:41:28 +0100
commit577d3dced0dc3c5773b770f501a09fc357c64646 (patch)
treebe362f0f2ffc34f4f611e77be5f3f7443a85b0fd /drivers/net/bnxt/bnxt_rxr.c
parent3e12fdb78e82297d79d356b7870aecfe18a63df7 (diff)
downloaddpdk-next-eventdev-577d3dced0dc3c5773b770f501a09fc357c64646.zip
dpdk-next-eventdev-577d3dced0dc3c5773b770f501a09fc357c64646.tar.gz
dpdk-next-eventdev-577d3dced0dc3c5773b770f501a09fc357c64646.tar.xz
net/bnxt: refactor the query stats
1) Use hwrm_stat_ctx_query command to query statistics Using hwrm_stat_ctx_query command will allow polling the statistics from hardware instead of using the current push model from the hardware which does a DMA of the stats to the host at fixed intervals. 2) Use the rx_mbuf_alloc_fail to track mbuf alloc failures. 3) We were wrongly incrementing hwrm_cmd_seq in bnxt_hwrm_stat_clear and bnxt_hwrm_stat_ctx_alloc functions. This patch fixes that. Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Diffstat (limited to 'drivers/net/bnxt/bnxt_rxr.c')
-rw-r--r--drivers/net/bnxt/bnxt_rxr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 5f30e02..bee67d3 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -68,8 +68,10 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq,
struct rte_mbuf *data;
data = __bnxt_alloc_rx_data(rxq->mb_pool);
- if (!data)
+ if (!data) {
+ rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
return -ENOMEM;
+ }
rx_buf->mbuf = data;
@@ -87,8 +89,10 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq,
struct rte_mbuf *data;
data = __bnxt_alloc_rx_data(rxq->mb_pool);
- if (!data)
+ if (!data) {
+ rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
return -ENOMEM;
+ }
if (rxbd == NULL)
RTE_LOG(ERR, PMD, "Jumbo Frame. rxbd is NULL\n");
@@ -319,8 +323,10 @@ static inline struct rte_mbuf *bnxt_tpa_end(
struct rte_mbuf *new_data = __bnxt_alloc_rx_data(rxq->mb_pool);
RTE_ASSERT(new_data != NULL);
- if (!new_data)
+ if (!new_data) {
+ rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
return NULL;
+ }
tpa_info->mbuf = new_data;
return mbuf;
@@ -676,8 +682,10 @@ int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq)
for (i = 0; i < BNXT_TPA_MAX; i++) {
rxr->tpa_info[i].mbuf =
__bnxt_alloc_rx_data(rxq->mb_pool);
- if (!rxr->tpa_info[i].mbuf)
+ if (!rxr->tpa_info[i].mbuf) {
+ rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail);
return -ENOMEM;
+ }
}
}
RTE_LOG(DEBUG, PMD, "%s TPA alloc Done!\n", __func__);