From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 39D9041BB3;
	Fri,  3 Feb 2023 00:00:36 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 1B21940DDA;
	Fri,  3 Feb 2023 00:00:36 +0100 (CET)
Received: from mail-vk1-f170.google.com (mail-vk1-f170.google.com
 [209.85.221.170])
 by mails.dpdk.org (Postfix) with ESMTP id A657E40A79
 for <dev@dpdk.org>; Fri,  3 Feb 2023 00:00:33 +0100 (CET)
Received: by mail-vk1-f170.google.com with SMTP id v81so1708424vkv.5
 for <dev@dpdk.org>; Thu, 02 Feb 2023 15:00:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=iyMvxPafFgMx/gbNIWUO00HTkyjNWLbnjDiKaHrG9sc=;
 b=D9qAvtrkcp8rbWtpjSuuGEaDA/EM+ExMwyyvULKQgeAJaC2lCEyPDcnp2xNLfAkpxK
 jserf53q7D1LYJvz9c7qshrzE3m0VTo6WrZMh5BAQbk5F/8Nw5tEiPpl9NWLLYl781AE
 oSQzGhV5lgBXwS8x0QA6uU7P+dZLYlIqSe9X6OhDsPDkiw7Xw+iSsP+m/09Fns+c/ioP
 9xld3yMuTl9yClLlHG4jnwec1zeZC5p3O/uwIcnMGRKuj7NNCD6nDhtmqFDL6BrdXwsO
 +K+Jtowqb8YeZSqz8OPGqogLPHZrr4rzKZo27P9Z3p8DptnkXyg/LZCjTPCz/tmGLlw5
 ej3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=iyMvxPafFgMx/gbNIWUO00HTkyjNWLbnjDiKaHrG9sc=;
 b=Rwzm5ggz0WE5xfAvdGevIDQ/hzUBrfLaGs6GxdFxktu+GwQjGw4YYQ7YsGhOTH7Czh
 uRjRYm4uvShgraux9NWy097w5Q8lfQ1p2KAD4iJPHXO4dL5kwe9iB0uBl7MUpQiPqThs
 nro9zjk02DYlaKaU30btw0cftAghUOKKX4uuFMWQ8mf4BiZEVpuuc2KLWIh6V03DzDKn
 CI03r4jHt+jiK8Zpe2Gj6k6Lak/0893atec4Ng+NPrFHUm8iMag6xtyJ6CmlRoqi3Ekt
 8FWAkwo0lsQ5DpVIBuK7WDLIrKl4CE9uXuEpzRkwfUmAmefT7/EF7AYlmM86o+ccSKow
 vYrQ==
X-Gm-Message-State: AO0yUKXhXwdHXGslMn+pXkFAxQXt2/VMZw1rzRAoW68ZvRHMNRUVQaaa
 Ab5i8dmrin6w3gGrZJayaTestshMFQmNfi/kFeOKWA==
X-Google-Smtp-Source: AK7set+hIPy+80F6UNcOpCSzaagdSTEic3545zoU1HNZbALgLZRM9VCRXUgH4+TPb/yB3kA57VVsrW64xS6z9UmvN7E=
X-Received: by 2002:a1f:fece:0:b0:3ea:1a72:aad6 with SMTP id
 l197-20020a1ffece000000b003ea1a72aad6mr1214189vki.15.1675378832929; Thu, 02
 Feb 2023 15:00:32 -0800 (PST)
MIME-Version: 1.0
References: <20221124073335.3985214-1-junfeng.guo@intel.com>
 <fa58bec0-c7e7-3c9f-fb03-7c4b773bc4be@amd.com>
 <20221207083948.22af7cae@hermes.local>
 <CANzqiF5eu9D4jWvNfFPp8vB2NESbkZiNk+N2suCrqH23H7gqhQ@mail.gmail.com>
 <CALuQH+V1US5Op2A-zvzLKX2MORYqh8P7d2KBrG6fFHtQuh+S=g@mail.gmail.com>
 <78fcfa68-120b-af64-fb42-aa2031d45592@amd.com>
 <CALuQH+WaAR_dZ0ECdKLH8u4grv2Z3mfzogvDVnakGu5NQY80sA@mail.gmail.com>
 <a440ab60-9624-f21e-396a-239bdf2aa1a1@amd.com>
In-Reply-To: <a440ab60-9624-f21e-396a-239bdf2aa1a1@amd.com>
From: Joshua Washington <joshwash@google.com>
Date: Thu, 2 Feb 2023 15:00:21 -0800
Message-ID: <CALuQH+V60GJFY0UkS3ZyM+L_HD_ZvFMoRhS=sXaV1m8LtAsjzQ@mail.gmail.com>
Subject: Re: [PATCH] net/gve: add support for basic stats
To: Ferruh Yigit <ferruh.yigit@amd.com>
Cc: Rushil Gupta <rushilg@google.com>,
 Stephen Hemminger <stephen@networkplumber.org>, 
 Junfeng Guo <junfeng.guo@intel.com>, qi.z.zhang@intel.com,
 jingjing.wu@intel.com, 
 beilei.xing@intel.com, dev@dpdk.org, jeroendb@google.com, jrkim@google.com, 
 Xiaoyun Li <xiaoyun.li@intel.com>
Content-Type: multipart/alternative; boundary="00000000000033c11105f3bf8848"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

--00000000000033c11105f3bf8848
Content-Type: text/plain; charset="UTF-8"

Tested-by: Joshua Washington <joshwash@google.com>

On Tue, Jan 31, 2023 at 2:05 AM Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 1/31/2023 1:51 AM, Joshua Washington wrote:
> > Hello,
> >
> > I tested it out, and the updates to testpmd seem to work.
> >
>
> Hi Joshua,
>
> Thanks for testing, I will send a patch soon.
>
> But this was testpmd issue, do you have any objection with the net/gve
> patch, if not can you please record this with ack/review/tested-by tags,
> so I can proceed with it.
>
> > Before applying the second patch:
> >   ---------------------- Forward statistics for port 0
> >  ----------------------
> >   RX-packets: 0              RX-dropped: 0             RX-total: 0
> >   TX-packets: 43769238       TX-dropped: 62634         TX-total: 43831872
> >
> >
> ----------------------------------------------------------------------------
> >
> >   ---------------------- Forward statistics for port 1
> >  ----------------------
> >   RX-packets: 0              RX-dropped: 0             RX-total: 0
> >   TX-packets: 43761119       TX-dropped: 70753         TX-total: 43831872
> >
> >
> ----------------------------------------------------------------------------
> >
> >   +++++++++++++++ Accumulated forward statistics for all
> > ports+++++++++++++++
> >   RX-packets: 0              RX-dropped: 0             RX-total: 0
> >   TX-packets: 87530357       TX-dropped: 157302        TX-total: 87687659
> >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > 62634 + 70753 = 133387 != 157302
> >
> > After applying the second patch:
> >   ---------------------- Forward statistics for port 0
> >  ----------------------
> >   RX-packets: 0              RX-dropped: 0             RX-total: 0
> >   TX-packets: 12590721       TX-dropped: 36638         TX-total: 12627359
> >
> >
> ----------------------------------------------------------------------------
> >
> >   ---------------------- Forward statistics for port 1
> >  ----------------------
> >   RX-packets: 0              RX-dropped: 0             RX-total: 0
> >   TX-packets: 12596255       TX-dropped: 31746         TX-total: 12628001
> >
> >
> ----------------------------------------------------------------------------
> >
> >   +++++++++++++++ Accumulated forward statistics for all
> > ports+++++++++++++++
> >   RX-packets: 0              RX-dropped: 0             RX-total: 0
> >   TX-packets: 25186976       TX-dropped: 68384         TX-total: 25255360
> >
> >
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> > Thanks,
> > Josh
> >
> > On Wed, Jan 18, 2023 at 8:22 AM Ferruh Yigit <ferruh.yigit@amd.com
> > <mailto:ferruh.yigit@amd.com>> wrote:
> >
> >     On 12/19/2022 7:38 PM, Joshua Washington wrote:
> >     > Hello,
> >     >
> >     > As it turns out, this error actually propagates to the "total"
> >     stats as
> >     > well, which I assume is just calculated by adding TX-packets and
> >     > TX-dropped. Here are the full stats from the example that Rushil
> >     mentioned:
> >     >
> >     >   ---------------------- Forward statistics for port 0
> >     >  ----------------------
> >     >   RX-packets: 2453802        RX-dropped: 0             RX-total:
> >     2453802
> >     >   TX-packets: 34266881       TX-dropped: 447034        TX-total:
> >     34713915
> >     >
> >     >
> >
>  ----------------------------------------------------------------------------
> >     >
> >     >   ---------------------- Forward statistics for port 1
> >     >  ----------------------
> >     >   RX-packets: 34713915       RX-dropped: 0             RX-total:
> >     34713915
> >     >   TX-packets: 2453802        TX-dropped: 0             TX-total:
> >     2453802
> >     >
> >     >
> >
>  ----------------------------------------------------------------------------
> >     >
> >     >   +++++++++++++++ Accumulated forward statistics for all
> >     > ports+++++++++++++++
> >     >   RX-packets: 37167717       RX-dropped: 0             RX-total:
> >     37167717
> >     >   TX-packets: 36720683       TX-dropped: 807630        TX-total:
> >     37528313
> >     >
> >     >
> >
>  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >     >
> >     > It can be seen that the stats for the individual ports are
> consistent,
> >     > but the TX-total and TX-dropped are not consistent with the stats
> for
> >     > the individual ports, as I believe that the TX-total and RX-total
> >     > accumulated stats should be equal.
> >     >
> >
> >     Hi Joshua, Rushil,
> >
> >     As I checked for it, issue may be related to testpmd stats display,
> >
> >     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.
> >
> >     If you can reproduce it easily, can you please test with following
> >     change:
> >
> >      diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> >      index 134d79a55547..49322d07d7d6 100644
> >      --- a/app/test-pmd/testpmd.c
> >      +++ b/app/test-pmd/testpmd.c
> >      @@ -2056,6 +2056,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];
> >
> >      @@ -2077,8 +2079,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",
> >      @@ -2105,8 +2108,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)
> >
> >
> >     >
> >     > On Mon, Dec 19, 2022 at 11:17 AM Rushil Gupta <rushilg@google.com
> >     <mailto:rushilg@google.com>
> >     > <mailto:rushilg@google.com <mailto:rushilg@google.com>>> wrote:
> >     >
> >     >     Hi all
> >     >     Josh just found out some inconsistencies in the Tx/Rx
> >     statistics sum
> >     >     for all ports. Not sure if we can screenshot here but it goes
> like
> >     >     this:
> >     >     Tx-dropped for port0: 447034
> >     >     Tx-dropped for port1: 0
> >     >     Accumulated forward statistics for all ports: 807630
> >     >
> >     >     Please note that this issue is only with Tx-dropped (not
> >     >     Tx-packets/Tx-total).
> >     >
> >     >
> >     >     On Wed, Dec 7, 2022 at 8:39 AM Stephen Hemminger
> >     >     <stephen@networkplumber.org
> >     <mailto:stephen@networkplumber.org>
> >     <mailto:stephen@networkplumber.org
> >     <mailto:stephen@networkplumber.org>>> wrote:
> >     >     >
> >     >     > On Wed, 7 Dec 2022 15:09:08 +0000
> >     >     > Ferruh Yigit <ferruh.yigit@amd.com
> >     <mailto:ferruh.yigit@amd.com> <mailto:ferruh.yigit@amd.com
> >     <mailto:ferruh.yigit@amd.com>>>
> >     >     wrote:
> >     >     >
> >     >     > > On 11/24/2022 7:33 AM, Junfeng Guo wrote:
> >     >     > > > Add support for dev_ops of stats_get and stats_reset.
> >     >     > > >
> >     >     > > > Queue stats update will be moved into xstat [1], but the
> >     basic
> >     >     stats
> >     >     > > > items may still be required. So we just keep the
> remaining
> >     >     ones and
> >     >     > > > will implement the queue stats via xstats in the coming
> >     release.
> >     >     > > >
> >     >     > > > [1]
> >     >     > > > https://elixir.bootlin.com/dpdk/v22.07/
> >     <https://elixir.bootlin.com/dpdk/v22.07/>
> >     >     <https://elixir.bootlin.com/dpdk/v22.07/
> >     <https://elixir.bootlin.com/dpdk/v22.07/>> \
> >     >     > > >     source/doc/guides/rel_notes/deprecation.rst#L118
> >     >     > > >
> >     >     > > > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com
> >     <mailto:xiaoyun.li@intel.com>
> >     >     <mailto:xiaoyun.li@intel.com <mailto:xiaoyun.li@intel.com>>>
> >     >     > > > Signed-off-by: Junfeng Guo <junfeng.guo@intel.com
> >     <mailto:junfeng.guo@intel.com>
> >     >     <mailto:junfeng.guo@intel.com <mailto:junfeng.guo@intel.com>>>
> >     >     > >
> >     >     > > <...>
> >     >     > >
> >     >     > > > +static int
> >     >     > > > +gve_dev_stats_get(struct rte_eth_dev *dev, struct
> >     >     rte_eth_stats *stats)
> >     >     > > > +{
> >     >     > > > +   uint16_t i;
> >     >     > > > +
> >     >     > > > +   for (i = 0; i < dev->data->nb_tx_queues; i++) {
> >     >     > > > +           struct gve_tx_queue *txq =
> >     dev->data->tx_queues[i];
> >     >     > > > +           if (txq == NULL)
> >     >     > > > +                   continue;
> >     >     > > > +
> >     >     > > > +           stats->opackets += txq->packets;
> >     >     > > > +           stats->obytes += txq->bytes;
> >     >     > > > +           stats->oerrors += txq->errors;
> >     >     > >
> >     >     > > Hi Junfeng, Qi, Jingjing, Beilei,
> >     >     > >
> >     >     > > Above logic looks wrong to me, did you test it?
> >     >     > >
> >     >     > > If the 'gve_dev_stats_get()' called multiple times (without
> >     >     stats reset
> >     >     > > in between), same values will be keep added to stats.
> >     >     > > Some hw based implementations does this, because reading
> >     from stats
> >     >     > > registers automatically reset those registers but this
> >     shouldn't
> >     >     be case
> >     >     > > for this driver.
> >     >     > >
> >     >     > > I expect it to be something like:
> >     >     > >
> >     >     > > local_stats = 0
> >     >     > > foreach queue
> >     >     > >       local_stats += queue->stats
> >     >     > > stats = local_stats
> >     >     >
> >     >     > The zero of local_stats is unnecessary.
> >     >     > The only caller of the PMD stats_get is rte_ethdev_stats_get
> >     >     > and it zeros the stats structure before calling the PMD.
> >     >     >
> >     >     >
> >     >     > int
> >     >     > rte_eth_stats_get(uint16_t port_id, struct rte_eth_stats
> *stats)
> >     >     > {
> >     >     >         struct rte_eth_dev *dev;
> >     >     >
> >     >     >         RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> >     >     >         dev = &rte_eth_devices[port_id];
> >     >     >
> >     >     >         memset(stats, 0, sizeof(*stats));
> >     >     > ...
> >     >     >         stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
> >     >     >         return eth_err(port_id,
> (*dev->dev_ops->stats_get)(dev,
> >     >     stats));
> >     >     >
> >     >     > If any PMD has extra memset in their stats get that could be
> >     removed.
> >     >
> >     >
> >     >
> >     > --
> >     >
> >     > Joshua Washington | Software Engineer | joshwash@google.com
> >     <mailto:joshwash@google.com>
> >     > <mailto:joshwash@google.com <mailto:joshwash@google.com>> | (414)
> >     366-4423 <tel:(414)%20366-4423>
> >     >
> >
> >
> >
> > --
> >
> > Joshua Washington | Software Engineer | joshwash@google.com
> > <mailto:joshwash@google.com> | (414) 366-4423
> >
>
>

-- 

Joshua Washington | Software Engineer | joshwash@google.com | (414) 366-4423

--00000000000033c11105f3bf8848
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Tested-by: Joshua Washington &lt;<a href=3D"mailto:joshwas=
h@google.com">joshwash@google.com</a>&gt;</div><br><div class=3D"gmail_quot=
e"><div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jan 31, 2023 at 2:05 AM Fe=
rruh Yigit &lt;<a href=3D"mailto:ferruh.yigit@amd.com">ferruh.yigit@amd.com=
</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:=
0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">=
On 1/31/2023 1:51 AM, Joshua Washington wrote:<br>
&gt; Hello,<br>
&gt; <br>
&gt; I tested it out, and the updates to testpmd seem to work.<br>
&gt; <br>
<br>
Hi Joshua,<br>
<br>
Thanks for testing, I will send a patch soon.<br>
<br>
But this was testpmd issue, do you have any objection with the net/gve<br>
patch, if not can you please record this with ack/review/tested-by tags,<br=
>
so I can proceed with it.<br>
<br>
&gt; Before applying the second patch:<br>
&gt; =C2=A0 ---------------------- Forward statistics for port 0<br>
&gt; =C2=A0----------------------<br>
&gt; =C2=A0 RX-packets: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R=
X-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total: 0<br>
&gt; =C2=A0 TX-packets: 43769238 =C2=A0 =C2=A0 =C2=A0 TX-dropped: 62634 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 TX-total: 43831872<br>
&gt; =C2=A0<br>
&gt; ----------------------------------------------------------------------=
------<br>
&gt; <br>
&gt; =C2=A0 ---------------------- Forward statistics for port 1<br>
&gt; =C2=A0----------------------<br>
&gt; =C2=A0 RX-packets: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R=
X-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total: 0<br>
&gt; =C2=A0 TX-packets: 43761119 =C2=A0 =C2=A0 =C2=A0 TX-dropped: 70753 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 TX-total: 43831872<br>
&gt; =C2=A0<br>
&gt; ----------------------------------------------------------------------=
------<br>
&gt; <br>
&gt; =C2=A0 +++++++++++++++ Accumulated forward statistics for all<br>
&gt; ports+++++++++++++++<br>
&gt; =C2=A0 RX-packets: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R=
X-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total: 0<br>
&gt; =C2=A0 TX-packets: 87530357 =C2=A0 =C2=A0 =C2=A0 TX-dropped: 157302 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0TX-total: 87687659<br>
&gt; =C2=A0<br>
&gt; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
++++++<br>
&gt; <br>
&gt; 62634=C2=A0+ 70753 =3D 133387 !=3D 157302<br>
&gt; <br>
&gt; After applying the second patch:<br>
&gt; =C2=A0 ---------------------- Forward statistics for port 0<br>
&gt; =C2=A0----------------------<br>
&gt; =C2=A0 RX-packets: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R=
X-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total: 0<br>
&gt; =C2=A0 TX-packets: 12590721 =C2=A0 =C2=A0 =C2=A0 TX-dropped: 36638 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 TX-total: 12627359<br>
&gt; =C2=A0<br>
&gt; ----------------------------------------------------------------------=
------<br>
&gt; <br>
&gt; =C2=A0 ---------------------- Forward statistics for port 1<br>
&gt; =C2=A0----------------------<br>
&gt; =C2=A0 RX-packets: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R=
X-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total: 0<br>
&gt; =C2=A0 TX-packets: 12596255 =C2=A0 =C2=A0 =C2=A0 TX-dropped: 31746 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 TX-total: 12628001<br>
&gt; =C2=A0<br>
&gt; ----------------------------------------------------------------------=
------<br>
&gt; <br>
&gt; =C2=A0 +++++++++++++++ Accumulated forward statistics for all<br>
&gt; ports+++++++++++++++<br>
&gt; =C2=A0 RX-packets: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0R=
X-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total: 0<br>
&gt; =C2=A0 TX-packets: 25186976 =C2=A0 =C2=A0 =C2=A0 TX-dropped: 68384 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 TX-total: 25255360<br>
&gt; =C2=A0<br>
&gt; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=
++++++<br>
&gt; <br>
&gt; Thanks,<br>
&gt; Josh<br>
&gt; <br>
&gt; On Wed, Jan 18, 2023 at 8:22 AM Ferruh Yigit &lt;<a href=3D"mailto:fer=
ruh.yigit@amd.com" target=3D"_blank">ferruh.yigit@amd.com</a><br>
&gt; &lt;mailto:<a href=3D"mailto:ferruh.yigit@amd.com" target=3D"_blank">f=
erruh.yigit@amd.com</a>&gt;&gt; wrote:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0On 12/19/2022 7:38 PM, Joshua Washington wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; Hello,<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; As it turns out, this error actually propagate=
s to the &quot;total&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0stats as<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; well,=C2=A0which I assume is just calculated b=
y adding TX-packets and<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; TX-dropped. Here are the full stats from the e=
xample that Rushil<br>
&gt;=C2=A0 =C2=A0 =C2=A0mentioned:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 ---------------------- Forward statisti=
cs for port 0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0----------------------<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 RX-packets: 2453802 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0RX-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total:=
<br>
&gt;=C2=A0 =C2=A0 =C2=A02453802<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 TX-packets: 34266881 =C2=A0 =C2=A0 =C2=
=A0 TX-dropped: 447034 =C2=A0 =C2=A0 =C2=A0 =C2=A0TX-total:<br>
&gt;=C2=A0 =C2=A0 =C2=A034713915<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0---------------------------------------------------=
-------------------------<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 ---------------------- Forward statisti=
cs for port 1<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0----------------------<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 RX-packets: 34713915 =C2=A0 =C2=A0 =C2=
=A0 RX-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total:<br>
&gt;=C2=A0 =C2=A0 =C2=A034713915<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 TX-packets: 2453802 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0TX-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 TX-total:=
<br>
&gt;=C2=A0 =C2=A0 =C2=A02453802<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0---------------------------------------------------=
-------------------------<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 +++++++++++++++ Accumulated forward sta=
tistics for all<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; ports+++++++++++++++<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 RX-packets: 37167717 =C2=A0 =C2=A0 =C2=
=A0 RX-dropped: 0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RX-total:<br>
&gt;=C2=A0 =C2=A0 =C2=A037167717<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0 TX-packets: 36720683 =C2=A0 =C2=A0 =C2=
=A0 TX-dropped: 807630 =C2=A0 =C2=A0 =C2=A0 =C2=A0TX-total:<br>
&gt;=C2=A0 =C2=A0 =C2=A037528313<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0+++++++++++++++++++++++++++++++++++++++++++++++++++=
+++++++++++++++++++++++++<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; It can be seen that the stats for the individu=
al ports are consistent,<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; but the TX-total and TX-dropped are not consis=
tent with the stats for<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; the individual ports,=C2=A0as I believe that t=
he TX-total and RX-total<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; accumulated stats should be equal.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Hi Joshua, Rushil,<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0As I checked for it, issue may be related to testpm=
d stats display,<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0While displaying per port TX-dropped value, it only=
 takes<br>
&gt;=C2=A0 =C2=A0 =C2=A0&#39;ports_stats[pt_id].tx_dropped&#39; into accoun=
t,<br>
&gt;=C2=A0 =C2=A0 =C2=A0but for accumulated TX-dropped results it takes bot=
h<br>
&gt;=C2=A0 =C2=A0 =C2=A0&#39;ports_stats[pt_id].tx_dropped&#39; &amp; &#39;=
stats.oerrors&#39; into account.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0If you can reproduce it easily, can you please test=
 with following<br>
&gt;=C2=A0 =C2=A0 =C2=A0change:<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0diff --git a/app/test-pmd/testpmd.c b/app/tes=
t-pmd/testpmd.c<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0index 134d79a55547..49322d07d7d6 100644<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0--- a/app/test-pmd/testpmd.c<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+++ b/app/test-pmd/testpmd.c<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0@@ -2056,6 +2056,8 @@ fwd_stats_display(void)=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fwd_cycles +=3D fs-&gt;core_cycles=
;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (i =3D 0; i &=
lt; cur_fwd_config.nb_fwd_ports; i++) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0uint64_t tx_dropped =3D 0;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0pt_id =3D fwd_ports_ids[i];<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0port =3D &amp;ports[pt_id];<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0@@ -2077,8 +2079,9 @@ fwd_stats_display(void)=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_recv +=3D stats.ipackets;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_xmit +=3D stats.opackets;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_rx_dropped +=3D stats.imissed;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_tx_dropped +=3D ports_stats[pt_id].tx_dropped;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_tx_dropped +=3D stats.oerrors;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0tx_dropped +=3D ports_stats[pt_id].tx_dropped;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0tx_dropped +=3D stats.oerrors;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_tx_dropped +=3D tx_dropped;<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0total_rx_nombuf=C2=A0 +=3D stats.rx_nombuf;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0printf(&quot;\n=C2=A0 %s Forward statistics for port %-2d %s\n=
&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0@@ -2105,8 +2108,8 @@ fwd_stats_display(void)=
<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0printf(&quot;=C2=A0 TX-packets: %-14&quot;PRIu64&quot; TX-drop=
ped:<br>
&gt;=C2=A0 =C2=A0 =C2=A0%-14&quot;PRIu64<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;TX-total: %-&quot;PRIu64&quot;\n&q=
uot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats.opackets, ports_stats[pt_id].tx_dr=
opped,<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats.opackets + ports_stats[pt_id].tx_d=
ropped);<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats.opackets, tx_dropped,<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 stats.opackets + tx_dropped);<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0if (record_burst_stats) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ports_stats[pt_id].rx_stream)<=
br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; On Mon, Dec 19, 2022 at 11:17 AM Rushil Gupta =
&lt;<a href=3D"mailto:rushilg@google.com" target=3D"_blank">rushilg@google.=
com</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:rushilg@google.com" ta=
rget=3D"_blank">rushilg@google.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; &lt;mailto:<a href=3D"mailto:rushilg@google.co=
m" target=3D"_blank">rushilg@google.com</a> &lt;mailto:<a href=3D"mailto:ru=
shilg@google.com" target=3D"_blank">rushilg@google.com</a>&gt;&gt;&gt; wrot=
e:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Hi all<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Josh just found out some in=
consistencies in the Tx/Rx<br>
&gt;=C2=A0 =C2=A0 =C2=A0statistics sum<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0for all ports. Not sure if =
we can screenshot here but it goes like<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0this:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Tx-dropped for port0: 44703=
4<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Tx-dropped for port1: 0<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Accumulated forward statist=
ics for all ports: 807630<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Please note that this issue=
 is only with Tx-dropped (not<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0Tx-packets/Tx-total).<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0On Wed, Dec 7, 2022 at 8:39=
 AM Stephen Hemminger<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&lt;<a href=3D"mailto:steph=
en@networkplumber.org" target=3D"_blank">stephen@networkplumber.org</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:stephen@networkplumber=
.org" target=3D"_blank">stephen@networkplumber.org</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:stephen@networkplumber=
.org" target=3D"_blank">stephen@networkplumber.org</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:stephen@networkplumber=
.org" target=3D"_blank">stephen@networkplumber.org</a>&gt;&gt;&gt; wrote:<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; On Wed, 7 Dec 2022 15:=
09:08 +0000<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; Ferruh Yigit &lt;<a hr=
ef=3D"mailto:ferruh.yigit@amd.com" target=3D"_blank">ferruh.yigit@amd.com</=
a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:ferruh.yigit@amd.com" =
target=3D"_blank">ferruh.yigit@amd.com</a>&gt; &lt;mailto:<a href=3D"mailto=
:ferruh.yigit@amd.com" target=3D"_blank">ferruh.yigit@amd.com</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:ferruh.yigit@amd.com" =
target=3D"_blank">ferruh.yigit@amd.com</a>&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; On 11/24/2022 7:3=
3 AM, Junfeng Guo wrote:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; Add support =
for dev_ops of stats_get and stats_reset.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; Queue stats =
update will be moved into xstat [1], but the<br>
&gt;=C2=A0 =C2=A0 =C2=A0basic<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0stats<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; items may st=
ill be required. So we just keep the remaining<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0ones and<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; will impleme=
nt the queue stats via xstats in the coming<br>
&gt;=C2=A0 =C2=A0 =C2=A0release.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; [1]<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; <a href=3D"h=
ttps://elixir.bootlin.com/dpdk/v22.07/" rel=3D"noreferrer" target=3D"_blank=
">https://elixir.bootlin.com/dpdk/v22.07/</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;<a href=3D"https://elixir.bootlin.com/dpdk/v22.=
07/" rel=3D"noreferrer" target=3D"_blank">https://elixir.bootlin.com/dpdk/v=
22.07/</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&lt;<a href=3D"https://elix=
ir.bootlin.com/dpdk/v22.07/" rel=3D"noreferrer" target=3D"_blank">https://e=
lixir.bootlin.com/dpdk/v22.07/</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;<a href=3D"https://elixir.bootlin.com/dpdk/v22.=
07/" rel=3D"noreferrer" target=3D"_blank">https://elixir.bootlin.com/dpdk/v=
22.07/</a>&gt;&gt; \<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt;=C2=A0 =C2=A0=
 =C2=A0source/doc/guides/rel_notes/deprecation.rst#L118<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; Signed-off-b=
y: Xiaoyun Li &lt;<a href=3D"mailto:xiaoyun.li@intel.com" target=3D"_blank"=
>xiaoyun.li@intel.com</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:xiaoyun.li@intel.com" =
target=3D"_blank">xiaoyun.li@intel.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailt=
o:xiaoyun.li@intel.com" target=3D"_blank">xiaoyun.li@intel.com</a> &lt;mail=
to:<a href=3D"mailto:xiaoyun.li@intel.com" target=3D"_blank">xiaoyun.li@int=
el.com</a>&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; Signed-off-b=
y: Junfeng Guo &lt;<a href=3D"mailto:junfeng.guo@intel.com" target=3D"_blan=
k">junfeng.guo@intel.com</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:junfeng.guo@intel.com"=
 target=3D"_blank">junfeng.guo@intel.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailt=
o:junfeng.guo@intel.com" target=3D"_blank">junfeng.guo@intel.com</a> &lt;ma=
ilto:<a href=3D"mailto:junfeng.guo@intel.com" target=3D"_blank">junfeng.guo=
@intel.com</a>&gt;&gt;&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &lt;...&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +static int<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +gve_dev_sta=
ts_get(struct rte_eth_dev *dev, struct<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0rte_eth_stats *stats)<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +{<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0uint16_t i;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0for (i =3D 0; i &lt; dev-&gt;data-&gt;nb_tx_queues; i++) {<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct gve_tx_queue *txq =3D<br>
&gt;=C2=A0 =C2=A0 =C2=A0dev-&gt;data-&gt;tx_queues[i];<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (txq =3D=3D NULL)<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0continue;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stats-&gt;opackets +=3D txq-&gt;packets;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stats-&gt;obytes +=3D txq-&gt;bytes;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; &gt; +=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0stats-&gt;oerrors +=3D txq-&gt;errors;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; Hi Junfeng, Qi, J=
ingjing, Beilei,<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; Above logic looks=
 wrong to me, did you test it?<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; If the &#39;gve_d=
ev_stats_get()&#39; called multiple times (without<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0stats reset<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; in between), same=
 values will be keep added to stats.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; Some hw based imp=
lementations does this, because reading<br>
&gt;=C2=A0 =C2=A0 =C2=A0from stats<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; registers automat=
ically reset those registers but this<br>
&gt;=C2=A0 =C2=A0 =C2=A0shouldn&#39;t<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0be case<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; for this driver.<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; I expect it to be=
 something like:<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; local_stats =3D 0=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; foreach queue<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt;=C2=A0 =C2=A0 =C2=
=A0 =C2=A0local_stats +=3D queue-&gt;stats<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; &gt; stats =3D local_s=
tats<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; The zero of local_stat=
s is unnecessary.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; The only caller of the=
 PMD stats_get is rte_ethdev_stats_get<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; and it zeros the stats=
 structure before calling the PMD.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; int<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; rte_eth_stats_get(uint=
16_t port_id, struct rte_eth_stats *stats)<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0struct rte_eth_dev *dev;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0dev =3D &amp;rte_eth_devices[port_id];<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0memset(stats, 0, sizeof(*stats));<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; ...<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0stats-&gt;rx_nombuf =3D dev-&gt;data-&gt;rx_mbuf_alloc_failed;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0return eth_err(port_id, (*dev-&gt;dev_ops-&gt;stats_get)(dev,<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0stats));<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&gt; If any PMD has extra m=
emset in their stats get that could be<br>
&gt;=C2=A0 =C2=A0 =C2=A0removed.<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; --<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; Joshua Washington=C2=A0|=C2=A0Software Enginee=
r |=C2=A0<a href=3D"mailto:joshwash@google.com" target=3D"_blank">joshwash@=
google.com</a><br>
&gt;=C2=A0 =C2=A0 =C2=A0&lt;mailto:<a href=3D"mailto:joshwash@google.com" t=
arget=3D"_blank">joshwash@google.com</a>&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; &lt;mailto:<a href=3D"mailto:joshwash@google.c=
om" target=3D"_blank">joshwash@google.com</a> &lt;mailto:<a href=3D"mailto:=
joshwash@google.com" target=3D"_blank">joshwash@google.com</a>&gt;&gt;=C2=
=A0|=C2=A0(414)<br>
&gt;=C2=A0 =C2=A0 =C2=A0366-4423 &lt;tel:(414)%20366-4423&gt;<br>
&gt;=C2=A0 =C2=A0 =C2=A0&gt; =C2=A0<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; -- <br>
&gt; <br>
&gt; Joshua Washington=C2=A0|=C2=A0Software Engineer |=C2=A0<a href=3D"mail=
to:joshwash@google.com" target=3D"_blank">joshwash@google.com</a><br>
&gt; &lt;mailto:<a href=3D"mailto:joshwash@google.com" target=3D"_blank">jo=
shwash@google.com</a>&gt;=C2=A0|=C2=A0<a href=3D"tel:(414)%20366-4423" valu=
e=3D"+14143664423" target=3D"_blank">(414) 366-4423</a><br>
&gt; =C2=A0<br>
<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr"><br><div style=3D"line-height:1=
.5em;padding-top:10px;margin-top:10px;color:rgb(85,85,85);font-family:sans-=
serif"><span style=3D"border-width:2px 0px 0px;border-style:solid;border-co=
lor:rgb(213,15,37);padding-top:2px;margin-top:2px">Joshua Washington=C2=A0|=
</span><span style=3D"border-width:2px 0px 0px;border-style:solid;border-co=
lor:rgb(51,105,232);padding-top:2px;margin-top:2px">=C2=A0Software Engineer=
 |</span><span style=3D"border-width:2px 0px 0px;border-style:solid;border-=
color:rgb(0,153,57);padding-top:2px;margin-top:2px">=C2=A0<a href=3D"mailto=
:joshwash@google.com" target=3D"_blank">joshwash@google.com</a>=C2=A0|</spa=
n><span style=3D"border-width:2px 0px 0px;border-style:solid;border-color:r=
gb(238,178,17);padding-top:2px;margin-top:2px">=C2=A0(414) 366-4423</span><=
/div><span style=3D"color:rgb(0,0,0);font-family:Tinos;font-size:medium">=
=C2=A0</span><br></div></div>

--00000000000033c11105f3bf8848--