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 3855846623 for ; Fri, 25 Apr 2025 04:08:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 325E8400D7; Fri, 25 Apr 2025 04:08:17 +0200 (CEST) Received: from out28-5.mail.aliyun.com (out28-5.mail.aliyun.com [115.124.28.5]) by mails.dpdk.org (Postfix) with ESMTP id 78D31400D5 for ; Fri, 25 Apr 2025 04:08:15 +0200 (CEST) Received: from localhost.localdomain(mailfrom:kyo.liu@nebula-matrix.com fp:SMTPD_---.cW5c8KV_1745546891 cluster:ay29) by smtp.aliyun-inc.com; Fri, 25 Apr 2025 10:08:11 +0800 From: Kyo Liu To: kyo.liu@nebula-matrix.com, dimon.zhao@nebula-matrix.com Cc: Long Li , stable@dpdk.org Subject: [PATCH v1 09/10] net/netvsc: add stats counters from VF Date: Fri, 25 Apr 2025 02:07:57 +0000 Message-ID: <20250425020758.3794-9-kyo.liu@nebula-matrix.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250425020758.3794-1-kyo.liu@nebula-matrix.com> References: <20250425020758.3794-1-kyo.liu@nebula-matrix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 driver should add per-queue and rx_nombuf counters from VF. Fixes: 4e9c73e96e83 ("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 e5b052d569..ca626ccf60 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -809,8 +809,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; } } @@ -826,12 +826,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.43.0