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 B55F141B96 for ; Wed, 1 Feb 2023 02:14:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A79A842B8C; Wed, 1 Feb 2023 02:14:33 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id D29904021F; Wed, 1 Feb 2023 02:14:30 +0100 (CET) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4P63nK33cgzJs9p; Wed, 1 Feb 2023 09:12:53 +0800 (CST) Received: from [10.67.103.231] (10.67.103.231) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 1 Feb 2023 09:14:28 +0800 Message-ID: Date: Wed, 1 Feb 2023 09:14:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] app/testpmd: fix forwarding stats for Tx dropped To: Ferruh Yigit , Aman Singh , Yuying Zhang , David Marchand , Ferruh Yigit , Maxime Coquelin CC: , , Joshua Washington References: <20230131115603.640254-1-ferruh.yigit@amd.com> From: "lihuisong (C)" In-Reply-To: <20230131115603.640254-1-ferruh.yigit@amd.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Maybe many PMDs do not support oerrors statistics, which cause this problem isn't found. LGTM Acked-by: Huisong Li 在 2023/1/31 19:56, Ferruh Yigit 写道: > There is an inconsistency at displaying Tx dropped value for per port > forwarding stats and accumulated forwarding stats. > > While displaying per port TX-dropped value, it only takes > 'ports_stats[pt_id].tx_dropped' into account, > but for accumulated TX-dropped results it takes both > 'ports_stats[pt_id].tx_dropped' & 'stats.oerrors' into account. > > To fix, make both per port and accumulated stats display 'tx_dropped' > and 'stats.oerrors' (ports_stats[pt_id].tx_dropped + stats.oerrors). > > Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand") > Cc: stable@dpdk.org > > Reported-by: Joshua Washington > Signed-off-by: Ferruh Yigit > --- > > Cc: david.marchand@redhat.com > > Mail list reference: > https://inbox.dpdk.org/dev/a440ab60-9624-f21e-396a-239bdf2aa1a1@amd.com/ > --- > app/test-pmd/testpmd.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 60eb9579ded1..6f4749b8af0c 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -2057,6 +2057,8 @@ fwd_stats_display(void) > fwd_cycles += fs->core_cycles; > } > for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) { > + uint64_t tx_dropped = 0; > + > pt_id = fwd_ports_ids[i]; > port = &ports[pt_id]; > > @@ -2078,8 +2080,9 @@ fwd_stats_display(void) > total_recv += stats.ipackets; > total_xmit += stats.opackets; > total_rx_dropped += stats.imissed; > - total_tx_dropped += ports_stats[pt_id].tx_dropped; > - total_tx_dropped += stats.oerrors; > + tx_dropped += ports_stats[pt_id].tx_dropped; > + tx_dropped += stats.oerrors; > + total_tx_dropped += tx_dropped; > total_rx_nombuf += stats.rx_nombuf; > > printf("\n %s Forward statistics for port %-2d %s\n", > @@ -2106,8 +2109,8 @@ fwd_stats_display(void) > > printf(" TX-packets: %-14"PRIu64" TX-dropped: %-14"PRIu64 > "TX-total: %-"PRIu64"\n", > - stats.opackets, ports_stats[pt_id].tx_dropped, > - stats.opackets + ports_stats[pt_id].tx_dropped); > + stats.opackets, tx_dropped, > + stats.opackets + tx_dropped); > > if (record_burst_stats) { > if (ports_stats[pt_id].rx_stream)