net/ice: fix DCF port statistics not cleared

Message ID 20231031070426.843086-1-zhichaox.zeng@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/ice: fix DCF port statistics 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/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Zhichao Zeng Oct. 31, 2023, 7:04 a.m. UTC
As the kernel driver does not reset the statistics after exiting testpmd,
the previous statistics being retained the next time testpmd is started.

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

Fixes: 7564d5509611 ("net/ice: add DCF hardware initialization")
Cc: stable@dpdk.org

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
---
 drivers/net/ice/ice_dcf_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Qi Zhang Nov. 1, 2023, 12:51 a.m. UTC | #1
> -----Original Message-----
> From: Zeng, ZhichaoX <zhichaox.zeng@intel.com>
> Sent: Tuesday, October 31, 2023 3:04 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Liao, TingtingX <tingtingx.liao@intel.com>; Zeng,
> ZhichaoX <zhichaox.zeng@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Wang,
> Haiyue <haiyue.wang@intel.com>
> Subject: [PATCH] net/ice: fix DCF port statistics not cleared
> 
> As the kernel driver does not reset the statistics after exiting testpmd, the
> previous statistics being retained the next time testpmd is started.

Please describe the issue in general but not testpmd specific.

> 
> Call 'ice_dcf_stats_reset' during the initialization of the DCF in order to clear
> any statistics that may exist from the last use of the DCF and to avoid statistics
> errors.
> 
> Fixes: 7564d5509611 ("net/ice: add DCF hardware initialization")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
> ---
>  drivers/net/ice/ice_dcf_ethdev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c
> index 065ec728c2..29699c2c32 100644
> --- a/drivers/net/ice/ice_dcf_ethdev.c
> +++ b/drivers/net/ice/ice_dcf_ethdev.c
> @@ -1937,6 +1937,8 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)
>  		return -1;
>  	}
> 
> +	ice_dcf_stats_reset(eth_dev);
> +
>  	dcf_config_promisc(adapter, false, false);
>  	return 0;
>  }
> --
> 2.34.1
  

Patch

diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c
index 065ec728c2..29699c2c32 100644
--- a/drivers/net/ice/ice_dcf_ethdev.c
+++ b/drivers/net/ice/ice_dcf_ethdev.c
@@ -1937,6 +1937,8 @@  ice_dcf_dev_init(struct rte_eth_dev *eth_dev)
 		return -1;
 	}
 
+	ice_dcf_stats_reset(eth_dev);
+
 	dcf_config_promisc(adapter, false, false);
 	return 0;
 }