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 0C5E041D44 for ; Thu, 23 Feb 2023 00:27:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 00AEF431AE; Thu, 23 Feb 2023 00:27:38 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 0343540DF6; Thu, 23 Feb 2023 00:27:34 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1004) id 3DAEF209A983; Wed, 22 Feb 2023 15:27:34 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3DAEF209A983 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1677108454; bh=SbT6CYVVo8cBLg/udJpdqGYWDkNHpnGy4H5MmuQDfQo=; h=From:To:Cc:Subject:Date:From; b=AFLoNfC6/b8sUOVn1jyTuADydmhTooFRFHInhwnXnWcui9s2u80+rk6XdmsgqKWFV g9xm0+soomHQowrRnpWTPuPYsmW4XQI/wYqV1huiJgV+Uy3H0akit4Aj+RMiUFzn9D osQRs/lhNbyNukXlDBzGmIDzmXUms7OBSVOx+41g= From: longli@linuxonhyperv.com To: Ferruh Yigit Cc: dev@dpdk.org, Ajay Sharma , Long Li , stable@dpdk.org Subject: [PATCH] net/mana: fix incorrectly reported counters in stats Date: Wed, 22 Feb 2023 15:27:24 -0800 Message-Id: <1677108444-17072-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 For per port counters and we should report summed values from all queues. Cc: stable@dpdk.org Signed-off-by: Long Li --- drivers/net/mana/mana.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c index 43221e743e..8a782c0d63 100644 --- a/drivers/net/mana/mana.c +++ b/drivers/net/mana/mana.c @@ -616,9 +616,9 @@ mana_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) if (!txq) continue; - stats->opackets = txq->stats.packets; - stats->obytes = txq->stats.bytes; - stats->oerrors = txq->stats.errors; + stats->opackets += txq->stats.packets; + stats->obytes += txq->stats.bytes; + stats->oerrors += txq->stats.errors; if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { stats->q_opackets[i] = txq->stats.packets; @@ -633,9 +633,9 @@ mana_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) if (!rxq) continue; - stats->ipackets = rxq->stats.packets; - stats->ibytes = rxq->stats.bytes; - stats->ierrors = rxq->stats.errors; + stats->ipackets += rxq->stats.packets; + stats->ibytes += rxq->stats.bytes; + stats->ierrors += rxq->stats.errors; /* There is no good way to get stats->imissed, not setting it */ -- 2.32.0