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 62B0945BE5; Mon, 28 Oct 2024 03:09:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E608140678; Mon, 28 Oct 2024 03:08:54 +0100 (CET) Received: from smtpbg151.qq.com (smtpbg151.qq.com [18.169.211.239]) by mails.dpdk.org (Postfix) with ESMTP id AF6724065E for ; Mon, 28 Oct 2024 03:08:50 +0100 (CET) X-QQ-mid: bizesmtpsz8t1730081328t9lcgx4 X-QQ-Originating-IP: T7gU74u0aFOB0G+LJ4TJzT+gS+DA9c48gQYDmzhcZ2U= Received: from wxdbg.localdomain.com ( [36.24.66.21]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 28 Oct 2024 10:08:47 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13548977480319350377 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Subject: [PATCH v2 09/13] net/ngbe: add Tx descriptor error statistics Date: Mon, 28 Oct 2024 10:31:43 +0800 Message-Id: <20241028023147.60157-10-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: NhUkPfKlCtQwiK1njQ1TqnsEOQxbgpJAjAxU+jarvB3FtSnzti0jF4Jk Lap1vP9P2gMXNS/gKf2hENAC5Ktx29Pm5OK2ML9x8aXEkyarQZHOifqs/P9bsSoiiWc3ROW SALTbqDA2QV7Wo5LJV9+cOBm63ADoln8Pb9lXSNuYnvYFQxCdtNo/ad9NJQLpBjMqvIWcDC Ox25wyaPgpbNLS+JWGCNd4zSZK/vUZdWoorHqyJFvf48CGYnNfeoMw81TzYGGERZ1aiz0qm AUbZErKSYEj2JiVXnXzuqcLPzMoJi2QgQhVjjRdm7+5RsffOkHT9k10IPiNHKBKekx0QK4b e62AL4dStp5LfSvmYjOZCdfjDp0/k3yoD79vGzRyIrPblkX/AFeohqze11vjkDCyAZqUcZD Nzv+JdY9qvl3TFN4PvN5CwREnl2MnoI/tcyAfeY/TxONaavtDCUP9BPK8iRybLvkFrK8tTw O5LX6WXj0A2cuu0D572dj0dW1z6dJIBFlgTfsJfGgmelvqGJaGVF0M1AdM1HcHqEyDAyaOh XpnfQ5w2K21//jnz0bgTZUsnNVq8cjCs9qumgLX9Trz2n+yZcssTrDJvsnhNUWza/gE9Gz4 ubHsPMFcWszX3KyMvXxHIusaJKvWstc81zRALQh62JGpTFBUtsgZpIg+o1d9KoyPzV3nU9e X2H9WeThduUSxiAWrrZiSaTP5Rv8SbHAW1xNsV7Tj+0jMnZgp3l1zNkMj2otzFiCE/vel5V a2UN/tJc8fXbk8uNTGdsE3DHmCfeiB4fIfQeXQegQMCO6jpTUfJDZYXQUxMJZaZ2Sz60OUr Zy4o/639tPYU/1NDUDywM7nSkFuYneXxeQXepVvDmiX0JnfnhA4rh2NQjTySiaDAb7uS6gd WyaWgvRnrIjavpBuTUQa6zeZxh5sB98F7RPh6UpY/3pEXCcRqp7U/RYJ/aR69tHEx4nfwXX aFLXyltckRl/T3uABgn8wHxpSCEy/ag6ElTo= 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/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