> Subject: Re: [Patch v2] net/netvsc: report correct stats values
> 
> On Tue, 26 Apr 2022 22:56:14 +0100
> Ferruh Yigit <ferruh.yi...@xilinx.com> wrote:
> 
> > >                   if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
> > > -                 stats->q_opackets[i] = txq->stats.packets;
> > > -                 stats->q_obytes[i] = txq->stats.bytes;
> > > +                 stats->q_opackets[i] += txq->stats.packets;
> > > +                 stats->q_obytes[i] += txq->stats.bytes;
> >
> > This is per queue stats, 'stats->q_opackets[i]', in next iteration of
> > the loop, 'i' will be increased and 'txq' will be updated, so as far
> > as I can see the above change has no affect.
> 
> Agree, that is why it was just assignment originally.

The condition here is a little different. NETVSC is a master device with 
another PMD running as a slave. When reporting stats values, it needs to add 
the values from the slave PMD. The original code just overwrites the values 
from its slave PMD.

Reply via email to