From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D24ECA04FF for ; Thu, 24 Mar 2022 18:45:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C621742834; Thu, 24 Mar 2022 18:45:57 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 09E7440683; Thu, 24 Mar 2022 18:45:54 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1004) id 1722C20DEC8F; Thu, 24 Mar 2022 10:45:54 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1722C20DEC8F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1648143954; bh=WQc+EhTxa59WmgIXl3oNhlggGWt2dK2IcGg17qAwsVA=; h=From:To:Cc:Subject:Date:From; b=e+Z3HOikKDsEhGENg2eJEFdTivszXvbEJUMofrojBtP+Slr0TRkkaCAHya6YGTJYg FFZzkHyNfdrC2MJQDpfXZ7RdHD5tkUJXmdgZI6nPmLC7+Gcv2S2QaIwvlLiKmuXhKQ 9RCOr0geq69Zph0JMdzvUddO9ymY5DU6VuZJmeNw= From: longli@linuxonhyperv.com To: dev@dpdk.org, Stephen Hemminger Cc: Long Li , stable@dpdk.org Subject: [Patch v2] net/netvsc: report correct stats values Date: Thu, 24 Mar 2022 10:45:48 -0700 Message-Id: <1648143948-17821-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Long Li The netvsc should add to the values from the VF and report the sum. Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device") Cc: stable@dpdk.org Signed-off-by: Long Li --- 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; } } @@ -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; return 0; } -- 2.32.0