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 BDC59A046B for ; Tue, 23 Jul 2019 13:16:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08E751BFF1; Tue, 23 Jul 2019 13:16:20 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 7E4A31BFE9 for ; Tue, 23 Jul 2019 13:16:18 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id v129so28516912vsb.11 for ; Tue, 23 Jul 2019 04:16:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SdO98UIS+iTZ70qvh7zwbT8JNzaOeEbD6EzWHwkVlh4=; b=ZVOdMzS7rY5QPkfHIbuvZ7Hhx3bgOyGuJ65r+ZwnjlqoH3CLRBwlDs3gripCgriilX 8VT9Y7oNnAe+7uT6nEIu8S1RMbBaRuflSLOutG0pa8ZjNrVxrvPCB0vVfHTkxNZT0SHV K6X331iaMeH82UeFEQHrR09pv2pOBvIA4AF14SIXmsD3/RKZmHGTu+Vapz3YPRR72nBT Kt+PiEo0NUHbF1P/WV8UJ1ri+t9/fpnuUDCmAO4TsCH3VU8bvPO799+4B6Dtx3HlCrbQ WLJtJKIKWUZJIFzs+HZwa3vtLIvzq+abQ0FkFUOYw8+SZ0Zx5JR+qNcXTcpYkv2X0o7H r9qg== X-Gm-Message-State: APjAAAXffSBqoJoEvYTYMveW5/JJmLkvbzdrxVox0orLrw2y8bS0VABG lYNvTpzbCRpj1WIKHxEwXRfc27sGTT6ERLG9eScSag== X-Google-Smtp-Source: APXvYqx3z6OAp/gC4Irls4blj36T3IcB7BA2ZgSFtLDXAepGX32hdVExHflzDQfTZQHUJ24n+QA1dHKRcL3d6RAkaFk= X-Received: by 2002:a67:2ec8:: with SMTP id u191mr49212789vsu.39.1563880577635; Tue, 23 Jul 2019 04:16:17 -0700 (PDT) MIME-Version: 1.0 References: <20190712083221.4987-1-aideen.mcloughlin@intel.com> <6dec383f-a559-7036-8ecd-22f11f2c1d5f@solarflare.com> <131f21d3-dd47-4536-655a-0bb7af54ee0e@intel.com> <20190716142823.GA1313@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: From: David Marchand Date: Tue, 23 Jul 2019 13:16:06 +0200 Message-ID: To: Ferruh Yigit Cc: Andrew Rybchenko , Bruce Richardson , "A.McLoughlin" , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger , dev , dpdk stable , Thomas Monjalon , Stephen Hemminger Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix doubling of 'total TX dropped' X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Tue, Jul 16, 2019 at 5:29 PM Ferruh Yigit wrote: > > On 7/16/2019 4:00 PM, Andrew Rybchenko wrote: > > On 7/16/19 5:28 PM, Bruce Richardson wrote: > >> On Tue, Jul 16, 2019 at 03:23:03PM +0100, Ferruh Yigit wrote: > >>> On 7/16/2019 1:23 PM, Andrew Rybchenko wrote: > >>>> 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. > >>> > >>> Virtual PMDs, at least the ones I checked, calculating not sent packets as > >>> error, also application calculates them as tx_dropped. > >>> > >>> Like: > >>> https://git.dpdk.org/dpdk/tree/drivers/net/ring/rte_eth_ring.c?h=v19.08-rc1#n97 > >>> > >> That is probably incorrect to do. Virtual PMDs should behave as real ones > >> do as far as possible. I think we should change them to not count as errors > >> any that are not handled by the driver, provided those are returned to the > >> app. > > > > I agree with Bruce. It is a bug in ring PMD. If so, too fast attempts to > > transmit packets will blow up err_pkts counter. > > > > +1, as far as I can see following PMDs requires fixing: > ring > kni > pcap > tap I already have fixes for some of them (found when I started to look at the stats). -- David Marchand