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 19EB145BE5; Mon, 28 Oct 2024 03:09:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B0E440648; Mon, 28 Oct 2024 03:09:05 +0100 (CET) Received: from smtpbg150.qq.com (smtpbg150.qq.com [18.132.163.193]) by mails.dpdk.org (Postfix) with ESMTP id C48E74060A for ; Mon, 28 Oct 2024 03:08:58 +0100 (CET) X-QQ-mid: bizesmtpsz8t1730081321tdh688d X-QQ-Originating-IP: GQNW5YV3cV2JH38+r7WXL0P2XY76C1Q8RbO8yibqA+s= Received: from wxdbg.localdomain.com ( [36.24.66.21]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 28 Oct 2024 10:08:40 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 8201093619708008879 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Subject: [PATCH v2 07/13] net/txgbe: add Tx descriptor error statistics Date: Mon, 28 Oct 2024 10:31:41 +0800 Message-Id: <20241028023147.60157-8-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241028023147.60157-1-jiawenwu@trustnetic.com> References: <20241023064836.2017879-1-jiawenwu@trustnetic.com> <20241028023147.60157-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: Mm/8i8/T4ynebcIX8kOemOfJHahVf98g56eghHw+W/NLH0VjjVZzrSGw CfahLvnXaMWZymOjvx2vtFbchf2VL3l4F9gfv6gIJuzbTu4uJOvhdYvZpAUvOFMTQtOvDwk nXvpOIXt8k0p3FPRKBfx/Zmb94UHSaG8ld+uvYsEElUfe8gABPozCXjYMU381+dqdmdaD1f VHXN0xWaidJaqaldlYfXtcE9dQ17CdqrcRk3U/0KDt5YDYvxOdSBueRIS5h+SsNsfwcT+vc WIUpSByaIZq1Cy790wO56Sc+Efm7//FZu7FF5D02BGjwwKDxZyO1gzW3HGTUtOVbH9ae4xX KstS7w5uhCZYys6S+WYgbfjh473Kvr1sdDx2ye7jx6OQMg0VJFO0lzEw9QPrUbvMCLzTMRS Aoza8Uu6hX55aiS2/Nr6CnU5H2cgEKj/VzxTjFQa4DumMrWJGFvW6WKi+pEclaxgbwVEJjm Vb0kVtF/cDxWO2NZW4a9pGuk4dnpZqQp7xpyykASezNbrL/eWfAvSBjbN84DMxQoMBvhxnt noU8EKF5jed20qO1+K+Hci38UZuQ2vuFN605q0h5P7ZxOZ5T44hg+S91v8Hc18zH/qWo5WT cEI6VWtGmUyFmjelf1bRCfOWoauRe+aLAlHVvb/epl2Uw+k2vCqas10OryNieUvsGX4sGNa SzXlgwMWcC68A52sMBganSqRTVixP3M8kqu2aC7uc79GxmhJY4yvMlIkK0fHoh+KxaZo5s0 D18e1jAwGnpQ5irH0VyQle84yzAfG5xNUb6sUTmuxAIc2stE4/xYqOmHZBT2RML+QQi9uq2 /1ID29+LITScdGHxmXIXu4jHLzTqNxGnrbIhxeKUY1ezuu8KknSVkcyQxeE5plUKAUgtCdj 6r86150hSaqcbP5B9xwv8YNbMQlNp07UFQmb80pWBaF3PSaFYUg9dBHmWqi2xULnJHZTsl0 5YLPNYmtugLddr9AbuTECYWXU X-QQ-XMRINFO: Nq+8W0+stu50PRdwbJxPCL0= 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/txgbe/txgbe_ethdev.c | 6 ++++++ drivers/net/txgbe/txgbe_rxtx.c | 3 +++ drivers/net/txgbe/txgbe_rxtx.h | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index bafa9cf829..0c76e986f4 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2344,6 +2344,7 @@ txgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) struct txgbe_hw_stats *hw_stats = TXGBE_DEV_STATS(dev); struct txgbe_stat_mappings *stat_mappings = TXGBE_DEV_STAT_MAPPINGS(dev); + struct txgbe_tx_queue *txq; uint32_t i, j; txgbe_read_stats_registers(hw, hw_stats); @@ -2398,6 +2399,11 @@ txgbe_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/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c index 06acbd0881..fc9e7b14f5 100644 --- a/drivers/net/txgbe/txgbe_rxtx.c +++ b/drivers/net/txgbe/txgbe_rxtx.c @@ -894,6 +894,7 @@ txgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, tx_pkt = *tx_pkts++; if (txgbe_check_pkt_err(tx_pkt)) { rte_pktmbuf_free(tx_pkt); + txq->desc_error++; continue; } @@ -2523,6 +2524,7 @@ txgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, txgbe_set_tx_function(dev, txq); txq->ops->reset(txq); + txq->desc_error = 0; dev->data->tx_queues[queue_idx] = txq; @@ -4980,6 +4982,7 @@ txgbe_tx_queue_clear_error(void *param) if (!txq->resetting) continue; + txq->desc_error++; txgbe_dev_save_tx_queue(hw, i); /* tx ring reset */ diff --git a/drivers/net/txgbe/txgbe_rxtx.h b/drivers/net/txgbe/txgbe_rxtx.h index e668b60b1e..622a0d3981 100644 --- a/drivers/net/txgbe/txgbe_rxtx.h +++ b/drivers/net/txgbe/txgbe_rxtx.h @@ -412,6 +412,7 @@ struct txgbe_tx_queue { /**< indicates that IPsec TX feature is in use */ #endif const struct rte_memzone *mz; + uint64_t desc_error; bool resetting; }; -- 2.27.0