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 20DC0A0561; Fri, 5 Mar 2021 03:15:01 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4CF4022A33D; Fri, 5 Mar 2021 03:14:57 +0100 (CET) Received: from smtpbg501.qq.com (smtpbg501.qq.com [203.205.250.101]) by mails.dpdk.org (Postfix) with ESMTP id F1CCD22A346 for ; Fri, 5 Mar 2021 03:14:54 +0100 (CET) X-QQ-mid: bizesmtp20t1614910488t5pfpyfe Received: from jiawenwu.trustnetic.com (unknown [183.129.236.74]) by esmtp6.qq.com (ESMTP) with id ; Fri, 05 Mar 2021 10:14:48 +0800 (CST) X-QQ-SSF: 01400000002000C0D000B00A0000000 X-QQ-FEAT: C9wdu1Lgdo/Yv3pqlCuiiSGTh+hHQcDU2Kg6PYDXv7ckwAVOwqh9LJJQNG/jr h8e+slwxuSP4/d6JoYunCTl6BWvYOL46v35tqHf0pYLy0jHNYApi5g/yKXD5gJpTkdaTpes AcTqjWjCSVRdaXWZbz3Yb9xoNHu3YxvGM4zARTg+Tn6ksoj7Uuam+yVFUA6+9JPAD4Yx70B MoEQqrcAcLGWvc9axjf69wZaUl9kd5OtiN+asJIloxoz0zaRm/f5BW1zxxxyPHNP/5pYJwv F6RTg4BJQzS1Iygx80T77ea+GUdfSLpffUiZlauqiubZ2CvHjHEACZYzU3GIrodxEv2yaA6 U7goHdiPYL6o4F/0Nk= X-QQ-GoodBg: 2 From: Jiawen Wu To: dev@dpdk.org Cc: Jiawen Wu , stable@dpdk.org Date: Fri, 5 Mar 2021 10:14:36 +0800 Message-Id: <20210305021438.10144-3-jiawenwu@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20210305021438.10144-1-jiawenwu@trustnetic.com> References: <20210305021438.10144-1-jiawenwu@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:trustnetic.com:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 Subject: [dpdk-dev] [PATCH v2 2/4] net/txgbe: fix Rx missed packet counter 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 Sender: "dev" Add the Rx dropped packet counter into stats->imissed, to ensure the stats correct. Fixes: c9bb590d4295 ("net/txgbe: support device statistics") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu --- drivers/net/txgbe/base/txgbe_type.h | 1 + drivers/net/txgbe/txgbe_ethdev.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h index ef8358ae3..2c8a3866a 100644 --- a/drivers/net/txgbe/base/txgbe_type.h +++ b/drivers/net/txgbe/base/txgbe_type.h @@ -353,6 +353,7 @@ struct txgbe_hw_stats { u64 rx_management_packets; u64 tx_management_packets; u64 rx_management_dropped; + u64 rx_dma_drop; u64 rx_drop_packets; /* Basic Error */ diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 90137d0ce..1ab8d2cde 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2080,6 +2080,7 @@ txgbe_read_stats_registers(struct txgbe_hw *hw, hw_stats->rx_bytes += rd64(hw, TXGBE_DMARXOCTL); hw_stats->tx_bytes += rd64(hw, TXGBE_DMATXOCTL); + hw_stats->rx_dma_drop += rd32(hw, TXGBE_DMARXDROP); hw_stats->rx_drop_packets += rd32(hw, TXGBE_PBRXDROP); /* MAC Stats */ @@ -2228,7 +2229,8 @@ txgbe_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) } /* Rx Errors */ - stats->imissed = hw_stats->rx_total_missed_packets; + stats->imissed = hw_stats->rx_total_missed_packets + + hw_stats->rx_dma_drop; stats->ierrors = hw_stats->rx_crc_errors + hw_stats->rx_mac_short_packet_dropped + hw_stats->rx_length_errors + -- 2.21.0.windows.1