DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@xilinx.com>
To: <longli@linuxonhyperv.com>, <dev@dpdk.org>,
	Stephen Hemminger <sthemmin@microsoft.com>
Cc: Long Li <longli@microsoft.com>, <stable@dpdk.org>
Subject: Re: [Patch v2] net/netvsc: report correct stats values
Date: Tue, 26 Apr 2022 22:56:14 +0100	[thread overview]
Message-ID: <7f51e773-6ded-b736-fb02-5e3b391353b9@xilinx.com> (raw)
In-Reply-To: <1648143948-17821-1-git-send-email-longli@linuxonhyperv.com>

On 3/24/2022 5:45 PM, longli@linuxonhyperv.com wrote:
> From: Long Li <longli@microsoft.com>
> 
> The netvsc should add to the values from the VF and report the sum.
> 

Per port stats already accumulated, like:
'stats->opackets += txq->stats.packets;'

> Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device")
> Cc: stable@dpdk.org
> Signed-off-by: Long Li <longli@microsoft.com>
> ---
>   drivers/net/netvsc/hn_ethdev.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
> index 0a357d3645..a6202d898b 100644
> --- a/drivers/net/netvsc/hn_ethdev.c
> +++ b/drivers/net/netvsc/hn_ethdev.c
> @@ -804,8 +804,8 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
>   		stats->oerrors += txq->stats.errors;
>   
>   		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.

>   		}
>   	}
>   
> @@ -821,12 +821,12 @@ static int hn_dev_stats_get(struct rte_eth_dev *dev,
>   		stats->imissed += rxq->stats.ring_full;
>   
>   		if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) {
> -			stats->q_ipackets[i] = rxq->stats.packets;
> -			stats->q_ibytes[i] = rxq->stats.bytes;
> +			stats->q_ipackets[i] += rxq->stats.packets;
> +			stats->q_ibytes[i] += rxq->stats.bytes;
>   		}
>   	}
>   
> -	stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;
> +	stats->rx_nombuf += dev->data->rx_mbuf_alloc_failed;

Why '+='? Is 'dev->data->rx_mbuf_alloc_failed' reset somewhere between 
two consecutive stats get call?

Anyway, above line has no affect, since the 'stats->rx_nombuf' is 
overwritten by 'rte_eth_stats_get()'. So above line can be removed.

>   	return 0;
>   }
>   


  reply	other threads:[~2022-04-26 21:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 17:45 longli
2022-04-26 21:56 ` Ferruh Yigit [this message]
2022-04-26 22:45   ` Stephen Hemminger
2022-05-03 18:18     ` Long Li
2022-05-03 19:03       ` Ferruh Yigit
2022-05-03 19:14         ` Long Li
2022-05-03 19:55           ` Ferruh Yigit
2022-05-03 20:48             ` Long Li
2022-05-04 12:33               ` Ferruh Yigit
2022-05-04 18:38                 ` Long Li
2022-05-05 16:28                   ` Ferruh Yigit
2022-05-05 16:40                     ` Stephen Hemminger
2022-05-05 16:57                       ` Ferruh Yigit
2022-05-10  5:33                         ` Long Li
2022-05-10 11:29                           ` Ferruh Yigit
2022-05-10 18:03                             ` Long Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f51e773-6ded-b736-fb02-5e3b391353b9@xilinx.com \
    --to=ferruh.yigit@xilinx.com \
    --cc=dev@dpdk.org \
    --cc=longli@linuxonhyperv.com \
    --cc=longli@microsoft.com \
    --cc=stable@dpdk.org \
    --cc=sthemmin@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).