From: Qiao Ma <mqaio@linux.alibaba.com>
To: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
kuba@kernel.org, gustavoars@kernel.org, cai.huoqing@linux.dev,
aviad.krawczyk@huawei.com, zhaochen6@huawei.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next v2 3/3] net: hinic: fix bug that u64_stats_sync is not initialized
Date: Mon, 4 Jul 2022 16:57:46 +0800 [thread overview]
Message-ID: <c9adcbb3c5f5b60bbc13a6f240a6326ee2c3d7b7.1656921519.git.mqaio@linux.alibaba.com> (raw)
In-Reply-To: <d63e9b95be458dccd15a6f060553711d51962212.1656921519.git.mqaio@linux.alibaba.com>
In-Reply-To: <cover.1656921519.git.mqaio@linux.alibaba.com>
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@linux.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
next prev parent reply other threads:[~2022-07-04 8:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 8:57 [PATCH net-next v2 0/3] net: hinic: fix three bugs about dev_get_stats Qiao Ma
2022-07-04 8:57 ` [PATCH net-next v2 1/3] net: hinic: fix bug that ethtool get wrong stats Qiao Ma
2022-07-04 8:57 ` [PATCH net-next v2 2/3] net: hinic: avoid kernel hung in hinic_get_stats64() Qiao Ma
2022-07-04 8:57 ` Qiao Ma [this message]
2022-07-04 12:04 ` [PATCH net-next v2 1/3] net: hinic: fix bug that ethtool get wrong stats kernel test robot
2022-07-06 9:52 ` kernel test robot
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=c9adcbb3c5f5b60bbc13a6f240a6326ee2c3d7b7.1656921519.git.mqaio@linux.alibaba.com \
--to=mqaio@linux.alibaba.com \
--cc=aviad.krawczyk@huawei.com \
--cc=cai.huoqing@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavoars@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=zhaochen6@huawei.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
all inboxes | Powered by JetHome®