From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 15BDFA0471 for ; Tue, 16 Jul 2019 14:23:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E68C11B94F; Tue, 16 Jul 2019 14:23:20 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 3CD8F3423; Tue, 16 Jul 2019 14:23:17 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 1D282A4005F; Tue, 16 Jul 2019 12:23:15 +0000 (UTC) Received: from [192.168.1.11] (85.187.13.152) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Jul 2019 13:23:07 +0100 To: Ferruh Yigit , A.McLoughlin , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger CC: , , , "Thomas Monjalon" , Stephen Hemminger References: <20190712083221.4987-1-aideen.mcloughlin@intel.com> From: Andrew Rybchenko Message-ID: <6dec383f-a559-7036-8ecd-22f11f2c1d5f@solarflare.com> Date: Tue, 16 Jul 2019 15:23:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [85.187.13.152] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24764.000 X-TM-AS-Result: No-11.608800-8.000000-10 X-TMASE-MatchedRID: 0dFPYP4mu5TmLzc6AOD8DfHkpkyUphL9er1wlVoR6TT8JeEVpdrhiq8D a+YMPrYEMgcmoO0ASSlbQn8J6EplzD9ETA4D04a1AZ0lncqeHqEacZilk37ECBnAauHjLiLMmWt BTTraifVJ7dabANaS20F5UsBBexLaN1Tif0308mJ8nLwuiNHSSEtc8DbogbSE31GU/N5W5BB8sS N5lGYrmNgnpu3lFvM8vTydVA5XJXkCfFb31W2ncG6yfYFZzrGdQ8iUCoDj8MRaDILwf1HV4Q486 iB1uTN51UVeRhm40I9G50X+MGJjtYn7DYFw3ayGPPQ52FQZE7QIKj6WwO7KdX9nRLJB1yYQgqzo Yk1bwftcDFlpiLAwwEJGYivF5rnzmJVbmNrrG2B7ofPRmlJvl2WfaLPCK8n6K8VLPDcP9n7sh1c sNX6njEZ8Q7isDF3bnagtny7ZPcRNfs8n85Te8oMbH85DUZXyseWplitmp0j6C0ePs7A07YVH0d q7wY7u5v6n9MN6AS6gNFcqkJ1GlmoCD22lskAC8AsbvVOAZWo+racHD50J7g== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.608800-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24764.000 X-MDID: 1563279796-XrgKVa_37tVM Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] app/testpmd: fix doubling of 'total TX dropped' X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" On 7/15/19 5:53 PM, Ferruh Yigit wrote: > On 7/12/2019 9:32 AM, A.McLoughlin wrote: >> The 'Accumulated forward statistics for all ports' incorrectly displayed >> double the actual value for 'total_tx_dropped'. This was because 2 >> lines in the same function both incremented total_tx_dropped every time >> a packet was dropped. I removed one of these lines to fix this issue. >> >> Fixes: 53324971a14e ("app/testpmd: display/clear forwarding stats on demand") >> Cc: david.marchand@redhat.com >> Cc: stable@dpdk.org >> >> Signed-off-by: A.McLoughlin >> --- >> app/test-pmd/testpmd.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c >> index 3ed3523b7..c41bada50 100644 >> --- a/app/test-pmd/testpmd.c >> +++ b/app/test-pmd/testpmd.c >> @@ -1555,7 +1555,6 @@ 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; >> total_rx_nombuf += stats.rx_nombuf; >> >> > > Hi Aideen, > > Indeed 'rte_eth_stats->oerrors' and 'tx_dropped' are different values, > > in testpmd, 'TX-total' is taken as "total_xmit + total_tx_dropped", from this > description it may be fair to say > "total_tx_dropped = oerrors + tx_dropped" > > This is easier to see in HW devices, 'oerrors' is the packets sent to HW but HW > reported failure for some reason, so these packets not transmitted to the medium. > 'tx_dropped' is mostly calculated by application, driver returns packets that > can't able to sent to HW, so application can re-try to send or free them and > increase 'tx_dropped' counter. > > > The problem is in the virtual drivers, the packets not able to sent are > calculated as 'oerrors' and tx_burst functions returns the number of the > successfully sent packets which cause application calculate remaining ones as > 'tx_dropped' which cause the duplication. I don't understand how it is. Tx burst returns a number of owned packets (either successfully transmitted or internally dropped/freed). If it is smaller than number of packets in request, other packets are either retried or calculated as tx_dropped. > In virtual drivers we need to give a decision, if free the wrong packets and > increase the 'oerrors' or return packets backs to application without increasing > the 'oerrors', so that application can try to do something with packets or free > them increasing 'tx_dropped'. > > @David, @Andrew, do you have a suggestion?