[Patch v2] net/netvsc: report correct stats values

Ferruh Yigit ferruh.yigit at xilinx.com
Tue May 3 21:03:54 CEST 2022


On 5/3/2022 7:18 PM, Long Li wrote:
>> Subject: Re: [Patch v2] net/netvsc: report correct stats values
>>
>> On Tue, 26 Apr 2022 22:56:14 +0100
>> Ferruh Yigit <ferruh.yigit at 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.

Where the initial values are coming from, 'hn_vf_stats_get()'?

If 'hn_vf_stats_get()' fills the stats, what are the values kept in 
'txq->stats.*' in above updated loop?


More information about the stable mailing list