Skip to contentSkip to conversation

net/iavf: fix port stats not cleared

PATCH Superseded Yiding Zhou 3 participants 4 messages Aug 30, 2023 – Sep 11, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix port stats not cleared

Call 'iavf_dev_stats_reset' during the initialization of the VF in order to clear any statistics that may exist from the last use of the VF and to avoid statistics errors.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
---
 drivers/net/iavf/iavf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/iavf/iavf_ethdev.c +1 -0
index f2fc5a5621..24c6342dee 100644
@@ -2721,6 +2721,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 
 	iavf_default_rss_disable(adapter);
 
+	iavf_dev_stats_reset(eth_dev);
 
 	/* Start device watchdog */
 	iavf_dev_watchdog_enable(adapter);
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 7 lines

-----Original Message-----
From: Yiding Zhou <[email protected]>
Sent: 2023年8月30日 14:55
To: [email protected]
Cc: Zhou, YidingX <[email protected]>; [email protected]; Xu, KuanX <[email protected]>
Subject: [PATCH] net/iavf: fix port stats not cleared

Quoted 8 lines

Call 'iavf_dev_stats_reset' during the initialization of the VF in order to clear any statistics that may exist from the last use of the VF and to avoid statistics errors.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
#2 lore raw

PATCH v2 1/1 net/iavf: fix port stats not cleared

In reply to Yiding Zhou

After VF reset, kernel driver may reuse the orignal VSI without reset its stats. Call 'iavf_dev_stats_reset' during the initialization of the VF in order to clear any statistics that may exist from the last use of the VF and to avoid statistics errors.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
---
 drivers/net/iavf/iavf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/iavf/iavf_ethdev.c +1 -0
index f2fc5a5621..24c6342dee 100644
@@ -2721,6 +2721,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 
 	iavf_default_rss_disable(adapter);
 
+	iavf_dev_stats_reset(eth_dev);
 
 	/* Start device watchdog */
 	iavf_dev_watchdog_enable(adapter);
Signature · 1 line
2.34.1
Acked-by on v2 1/1 Applied
#3 lore raw
Quoted 37 lines

-----Original Message-----
From: Yiding Zhou <[email protected]>
Sent: Thursday, September 7, 2023 10:40 AM
To: [email protected]
Cc: Zhou, YidingX <[email protected]>; [email protected]; Xu, KuanX <[email protected]>
Subject: [PATCH v2] net/iavf: fix port stats not cleared

After VF reset, kernel driver may reuse the orignal VSI without reset its stats. Call 'iavf_dev_stats_reset' during the initialization of the VF in order to clear any statistics that may exist from the last use of the VF and to avoid statistics errors.

Fixes 22b123a36d07 ("net/avf: initialize PMD")
---
 drivers/net/iavf/iavf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/iavf/iavf_ethdev.c +1 -1
index f2fc5a5621..24c6342dee 100644
@@ -2721,6 +2721,7 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)
 
 	iavf_default_rss_disable(adapter);
 
+	iavf_dev_stats_reset(eth_dev);
 
 	/* Start device watchdog */
 	iavf_dev_watchdog_enable(adapter);
--
Quoted 1 line

2.34.1

Applied to dpdk-next-net-intel.

Thanks
Qi