net/iavf: fix port stats not cleared

Message ID 20230830065451.2976544-1-yidingx.zhou@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix port stats not cleared |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Yiding Zhou Aug. 30, 2023, 6:54 a.m. UTC
  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")
Cc: stable@dpdk.org

Signed-off-by: Kuan Xu <kuanx.xu@intel.com>
Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Liao, TingtingX Sept. 5, 2023, 8:06 a.m. UTC | #1
> -----Original Message-----
> From: Yiding Zhou <yidingx.zhou@intel.com> 
> Sent: 2023年8月30日 14:55
> To: dev@dpdk.org
> Cc: Zhou, YidingX <yidingx.zhou@intel.com>; stable@dpdk.org; Xu, KuanX <kuanx.xu@intel.com>
> Subject: [PATCH] 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")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kuan Xu <kuanx.xu@intel.com>
> Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
> 
Tested-by: Tingting Liao <tingtingx.liao@intel.com>
  

Patch

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index f2fc5a5621..24c6342dee 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -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);