[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c9adcbb3c5f5b60bbc13a6f240a6326ee2c3d7b7.1656921519.git.mqaio@linux.alibaba.com>
Date: Mon, 4 Jul 2022 16:57:46 +0800
From: Qiao Ma <mqaio@...ux.alibaba.com>
To: davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
kuba@...nel.org, gustavoars@...nel.org, cai.huoqing@...ux.dev,
aviad.krawczyk@...wei.com, zhaochen6@...wei.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH net-next v2 3/3] net: hinic: fix bug that u64_stats_sync is not initialized
In get_drv_queue_stats(), the local variable {txq|rxq}_stats
should be initialized first before calling into
hinic_{rxq|txq}_get_stats(), this patch fixes it.
Fixes: edd384f682cc ("net-next/hinic: Add ethtool and stats")
Signed-off-by: Qiao Ma <mqaio@...ux.alibaba.com>
---
drivers/net/ethernet/huawei/hinic/hinic_ethtool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c
index 93192f58ac88..75e9711bd2ba 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_ethtool.c
@@ -1371,6 +1371,9 @@ static void get_drv_queue_stats(struct hinic_dev *nic_dev, u64 *data)
u16 i = 0, j = 0, qid = 0;
char *p;
+ u64_stats_init(&txq_stats.syncp);
+ u64_stats_init(&rxq_stats.syncp);
+
for (qid = 0; qid < nic_dev->num_qps; qid++) {
if (!nic_dev->txqs)
break;
--
1.8.3.1
Powered by blists - more mailing lists