From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B71CB45BAC; Wed, 23 Oct 2024 08:29:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9690D40ED6; Wed, 23 Oct 2024 08:28:42 +0200 (CEST) Received: from smtpbguseast3.qq.com (smtpbguseast3.qq.com [54.243.244.52]) by mails.dpdk.org (Postfix) with ESMTP id D6B9240E3B for ; Wed, 23 Oct 2024 08:28:28 +0200 (CEST) X-QQ-mid: bizesmtpsz8t1729664906ty5gddj X-QQ-Originating-IP: aWFRJhL762djKg1ndF/idfr2z98ZMme8dSzfvIUPSdo= Received: from wxdbg.localdomain.com ( [125.122.84.15]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Oct 2024 14:28:25 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8938348752206542135 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Subject: [PATCH 09/13] net/ngbe: add Tx descriptor error statistics Date: Wed, 23 Oct 2024 14:48:32 +0800 Message-Id: <20241023064836.2017879-10-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241023064836.2017879-1-jiawenwu@trustnetic.com> References: <20241023064836.2017879-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz8a-1 X-QQ-XMAILINFO: M2pBd1R7V2XaPrY1DGKw+YzTcqYMavkEFh+hSlxa/fLRlIwcTkdlLoQA ShIrS5/gHkaWrX/YQwt+efItsD1Q0pMvcTWTzRks89rtt9M6ym/i3fr+50OWZa0t5+gtPHw jpr4Y+juynkHAPuEaR+3TvgBPLPkD5oWl0WI6W4R6XCPAwD9dABIrchii/9oJVmhg8tlx7u gBahYmNYLmiRZBkctd5Pal8qWQviXEg7tcg2XaToNxeGYDjxp8a8kak39AGMZDVD8X8wifx s521YsxUjCLfw20Yhne6BifCNcSi4q6pGEKjaeiA1q/DVwIo+JLeaXuHfMrcYjUDXe1gF01 XaeFz6xBSxoVVfCpinaG+hE5Y6L2z/V5vfZJF/CdrU1q+7uAK7oREEiIQHPK74IOFL21lYY ra2M7pr5vBOjeh+hiQa4RoIS3Bo7BFJUR1hi2eTXaaOw5Je9iLOs3hHWwmMtj/Y34STBCyr +VYpuhveD4tqFj3/a8n8HOsMLqHni0RqQC6UbLDapqZa72iaR9q4m9tGpGcObmRqSsHQhcL 21EMbcFrYV9J+PyeQR1T6uEiRdB0eQbW5jpRR2Wft4PBx8WfHNgall7VOy3Sy5WmjZr6ekC I6EuOpontWWM4071fa0SA6ejl2QcX6xgPm+tVj7nfG4Z3MTM9HyJXJK9E+Vqz+xmDmGrR5M 9sIfaoxIRTxrx+7HrM547s45+3f7O5XUQZLplEQ/M7UX/TypZVjtqlmrcZwhrwhBGTheYNV sont6g/tgxs6nUlPlfl1j5olRndGO3OjS2/xgO/JEsEi+6yVFV/WHKRQrWY/L4lw+uwZmSE 93TqatCjtkzWowpfPLUM4V8nGJvxUVp3QFpqeSElQLBkplZKW0oYt5CvvYxqjDOT7VyuAeg g5kofYMmhenLO6N1523SDIuczwNeXpbUHI2uoEWlbWqCktagIB98R4qfw9lPOIl/5YUUhqE p5Np60AQIHSXhLr2sCGlE9zEB X-QQ-XMRINFO: NS+P29fieYNw95Bth2bWPxk= X-QQ-RECHKSPAM: 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Count the number of packets not sent due to Tx descriptor error. Signed-off-by: Jiawen Wu --- drivers/net/ngbe/ngbe_ethdev.c | 6 ++++++ drivers/net/ngbe/ngbe_rxtx.c | 2 ++ drivers/net/ngbe/ngbe_rxtx.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/net/ngbe/ngbe_ethdev.c b/drivers/net/ngbe/ngbe_ethdev.c index 6c45ffaad3..d9d2daf656 100644 --- a/drivers/net/ngbe/ngbe_ethdev.c +++ b/drivers/net/ngbe/ngbe_ethdev.c @@ -1507,6 +1507,7 @@ ngbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) struct ngbe_hw_stats *hw_stats = NGBE_DEV_STATS(dev); struct ngbe_stat_mappings *stat_mappings = NGBE_DEV_STAT_MAPPINGS(dev); + struct ngbe_tx_queue *txq; uint32_t i, j; ngbe_read_stats_registers(hw, hw_stats); @@ -1559,6 +1560,11 @@ ngbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) /* Tx Errors */ stats->oerrors = 0; + for (i = 0; i < dev->data->nb_tx_queues; i++) { + txq = dev->data->tx_queues[i]; + stats->oerrors += txq->desc_error; + } + return 0; } diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c index 25a314f10a..8d31d47de9 100644 --- a/drivers/net/ngbe/ngbe_rxtx.c +++ b/drivers/net/ngbe/ngbe_rxtx.c @@ -629,6 +629,7 @@ ngbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, tx_pkt = *tx_pkts++; if (ngbe_check_pkt_err(tx_pkt)) { rte_pktmbuf_free(tx_pkt); + txq->desc_error++; continue; } @@ -2100,6 +2101,7 @@ ngbe_dev_tx_queue_setup(struct rte_eth_dev *dev, ngbe_set_tx_function(dev, txq); txq->ops->reset(txq); + txq->desc_error = 0; dev->data->tx_queues[queue_idx] = txq; diff --git a/drivers/net/ngbe/ngbe_rxtx.h b/drivers/net/ngbe/ngbe_rxtx.h index 7574db32d8..8534ec123a 100644 --- a/drivers/net/ngbe/ngbe_rxtx.h +++ b/drivers/net/ngbe/ngbe_rxtx.h @@ -375,6 +375,7 @@ struct ngbe_tx_queue { const struct ngbe_txq_ops *ops; /**< txq ops */ const struct rte_memzone *mz; + uint64_t desc_error; }; struct ngbe_txq_ops { -- 2.27.0