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 4C32645BAC; Wed, 23 Oct 2024 08:28:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E5C6C40EE1; Wed, 23 Oct 2024 08:28:34 +0200 (CEST) Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by mails.dpdk.org (Postfix) with ESMTP id 27E8C40E44 for ; Wed, 23 Oct 2024 08:28:24 +0200 (CEST) X-QQ-mid: bizesmtpsz8t1729664902t2fcqpr X-QQ-Originating-IP: iuIuRNZYrIsyFvCzlxJJZcVq5UEdNf6iBmSPosXjHYE= Received: from wxdbg.localdomain.com ( [125.122.84.15]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 23 Oct 2024 14:28:21 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13443699343871972369 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu Subject: [PATCH 07/13] net/txgbe: add Tx descriptor error statistics Date: Wed, 23 Oct 2024 14:48:30 +0800 Message-Id: <20241023064836.2017879-8-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: New1l5u9k9F/Vr7RME7rxy4Ngxoap6K4Vw5OxGvICEv+DlgxluBnBmO+ 6wGc8EhaETY1SIxFLZBLF/dXAOZ1/6lDColKXkAKWIsI48kMpyPi2E6lf6smE2TT13MBwTz kxoTsxVwDl4/iq5lxlbj9b7Mm9K+RXF+fboQPlLabB+tQGmi5i9TGFxZLicoQ+8j/C/4A0Q bxByCPxodyvbjgeRh+/wbf3Mccd5cf+Ud5uo8W1+tPb19mNZBabuoc90ZmhRDai10fii7FH 3RHBnrxLaj5VRrHK6XU6jayK/tOZp9I35BBfwbBtIHxymoUOVub+c3xj51dzKPjgd4EB6Yr y2svMTzGZK1o8T0rdldc5c146Pnzasru+l5Jm59dFObdSIpUBSyv6yQJPy6ZdA1aNWtlRMd yFfg95wI601WYz+pt6P5tZqJLcp8L+2ORuVi5MdiXiMJTGlCz30oNIA4+eVUQJo+vsgeZc3 FefSOYQeVVm8yAJ7n1rJza+hc7viybLv6DZ82ThEhLdR4szLH4moI28NEYZ2+k1nM5lh9lg p8YBdrmZ7pJLXs6V/EvHiJh4l3xjyfR+b4/2RhqcZPMZNhvqlY2di1xHG3kX8EhZw2E5w+Z 1qfwjbLbGrznOmDDSthPlUwrhFX2p4XkNUtK+FIt1ARvdVfBrJwZb1vfOSqzcghvpSHS4Sn IB4+p8CpoALrasy/ZUYNcFZc1MiIxSkEmN0wkVS4pbKyWir6L2t+NVTIoduItQcTEGvqNbV 8nodKHQs5XipRVAZqGlQYUhTNBWdogNKYM9a0PJaU2KL/TO83/FjLydr4KJSnPKKNl56Pxl XRlhynrwoPa/NaSb3yO/zlEZ0zVReP6JhY6LQWc7YstgFJozyk5nkGKqPDimAn9nEqqM1Hx ZfW9VXYYPVyKhsN9pHWUN84biKLzxb1SRJdYwQxRgxjCNsX08abu+mvMcHaOCM40wGMuPVA cfO01sDxtHwrG/xZ6w/o9AgXzV2yiIdizPZM= X-QQ-XMRINFO: MSVp+SPm3vtS1Vd6Y4Mggwc= 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