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 BB218A00C4; Mon, 11 Apr 2022 05:02:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAF8441611; Mon, 11 Apr 2022 05:02:24 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id A68F7406B4 for ; Mon, 11 Apr 2022 05:02:20 +0200 (CEST) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KcDCY4HHdz1HBhP; Mon, 11 Apr 2022 11:01:45 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 11 Apr 2022 11:02:18 +0800 From: Chengwen Feng To: , , CC: Subject: [PATCH 3/4] examples/dma: support enqueue drop statistic Date: Mon, 11 Apr 2022 10:56:33 +0800 Message-ID: <20220411025634.33032-4-fengchengwen@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220411025634.33032-1-fengchengwen@huawei.com> References: <20220411025634.33032-1-fengchengwen@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected 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 The copy drop statistic counted in two scenarios: DMA copy failures and enqueue failures. so it is difficult to locate the problem. This patch adds enqueue drop statistic to fix the it. Signed-off-by: Chengwen Feng --- examples/dma/dmafwd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/dma/dmafwd.c b/examples/dma/dmafwd.c index dd576bcf77..6b1b777cb8 100644 --- a/examples/dma/dmafwd.c +++ b/examples/dma/dmafwd.c @@ -58,6 +58,7 @@ struct dma_port_statistics { uint64_t tx[RTE_MAX_ETHPORTS]; uint64_t tx_dropped[RTE_MAX_ETHPORTS]; uint64_t copy_dropped[RTE_MAX_ETHPORTS]; + uint64_t enqueue_dropped[RTE_MAX_ETHPORTS]; }; struct dma_port_statistics port_statistics; struct total_statistics { @@ -132,12 +133,14 @@ print_port_stats(uint16_t port_id) "\nPackets sent: %34"PRIu64 "\nPackets received: %30"PRIu64 "\nPackets dropped on tx: %25"PRIu64 - "\nPackets dropped on copy: %23"PRIu64, + "\nPackets dropped on copy: %23"PRIu64 + "\nPackets dropped on enqueue: %20"PRIu64, port_id, port_statistics.tx[port_id], port_statistics.rx[port_id], port_statistics.tx_dropped[port_id], - port_statistics.copy_dropped[port_id]); + port_statistics.copy_dropped[port_id], + port_statistics.enqueue_dropped[port_id]); } /* Print out statistics for one dmadev device. */ @@ -227,8 +230,9 @@ print_stats(char *prgname) print_port_stats(port_id); delta_ts.total_packets_dropped += - port_statistics.tx_dropped[port_id] - + port_statistics.copy_dropped[port_id]; + port_statistics.tx_dropped[port_id] + + port_statistics.copy_dropped[port_id] + + port_statistics.enqueue_dropped[port_id]; delta_ts.total_packets_tx += port_statistics.tx[port_id]; delta_ts.total_packets_rx += @@ -450,7 +454,7 @@ dma_rx_port(struct rxtx_port_config *rx_config) (void *)&pkts_burst_copy[nb_enq], nb_rx - nb_enq); - port_statistics.copy_dropped[rx_config->rxtx_port] += + port_statistics.enqueue_dropped[rx_config->rxtx_port] += (nb_rx - nb_enq); } } -- 2.33.0