From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0a-0016ce01.pphosted.com [67.231.148.157]) by dpdk.org (Postfix) with ESMTP id 8CE0D685E for ; Thu, 12 May 2016 02:06:39 +0200 (CEST) Received: from pps.filterd (m0095336.ppops.net [127.0.0.1]) by mx0a-0016ce01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u4C030hD007108; Wed, 11 May 2016 17:06:38 -0700 Received: from avcashub1.qlogic.com ([198.186.0.117]) by mx0a-0016ce01.pphosted.com with ESMTP id 22tyrfe2vm-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT); Wed, 11 May 2016 17:06:38 -0700 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.192) with Microsoft SMTP Server id 14.3.235.1; Wed, 11 May 2016 17:06:37 -0700 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id u4C06bos015477; Wed, 11 May 2016 17:06:37 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: CC: , , Rasesh Mody , Harish Patil Date: Wed, 11 May 2016 17:06:21 -0700 Message-ID: <1463011585-15429-1-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 MIME-Version: 1.0 Content-Type: text/plain disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8162 signatures=670716 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1605110314 Subject: [dpdk-dev] [PATCH v5 1/5] bnx2x: fixed stats get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2016 00:06:40 -0000 Fix stats_get() routine to display drop counters under imissed counter. Fixes: 540a211084a7 ("bnx2x: driver core") Signed-off-by: Rasesh Mody Signed-off-by: Harish Patil --- drivers/net/bnx2x/bnx2x_ethdev.c | 16 ++++++++++++++++ drivers/net/bnx2x/bnx2x_rxtx.c | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 071b44f..3ff57c4 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -276,6 +276,9 @@ static void bnx2x_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { struct bnx2x_softc *sc = dev->data->dev_private; + uint32_t brb_truncate_discard; + uint64_t brb_drops; + uint64_t brb_truncates; PMD_INIT_FUNC_TRACE(); @@ -316,6 +319,19 @@ bnx2x_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->rx_nombuf = HILO_U64(sc->eth_stats.no_buff_discard_hi, sc->eth_stats.no_buff_discard_lo); + + brb_drops = + HILO_U64(sc->eth_stats.brb_drop_hi, + sc->eth_stats.brb_drop_lo); + + brb_truncates = + HILO_U64(sc->eth_stats.brb_truncate_hi, + sc->eth_stats.brb_truncate_lo); + + brb_truncate_discard = sc->eth_stats.brb_truncate_discard; + + stats->imissed = brb_drops + brb_truncates + + brb_truncate_discard + stats->rx_nombuf; } static void diff --git a/drivers/net/bnx2x/bnx2x_rxtx.c b/drivers/net/bnx2x/bnx2x_rxtx.c index 752a5e8..e825bce 100644 --- a/drivers/net/bnx2x/bnx2x_rxtx.c +++ b/drivers/net/bnx2x/bnx2x_rxtx.c @@ -408,6 +408,8 @@ bnx2x_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) new_mb = bnx2x_rxmbuf_alloc(rxq->mb_pool); if (unlikely(!new_mb)) { PMD_RX_LOG(ERR, "mbuf alloc fail fp[%02d]", fp->index); + rte_eth_devices[rxq->port_id].data-> + rx_mbuf_alloc_failed++; goto next_rx; } -- 1.7.10.3