[1/1] ml/cnxk: exclude caching run stats from xstats

Message ID 20231128140400.11921-1-syalavarthi@marvell.com (mailing list archive)
State Accepted
Delegated to: Jerin Jacob
Headers
Series [1/1] ml/cnxk: exclude caching run stats from xstats |

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/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance 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/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Srikanth Yalavarthi Nov. 28, 2023, 2:04 p.m. UTC
  From: Anup Prabhu <aprabhu@marvell.com>

Exclude the hardware and firmware latency of model data
caching run from xstats calculation.

Fixes: 9cfad6c334f2 ("ml/cnxk: update device and model xstats functions")

Signed-off-by: Anup Prabhu <aprabhu@marvell.com>
Acked-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
  

Comments

Jerin Jacob Dec. 5, 2023, 11:24 a.m. UTC | #1
On Tue, Nov 28, 2023 at 10:17 PM Srikanth Yalavarthi
<syalavarthi@marvell.com> wrote:
>
> From: Anup Prabhu <aprabhu@marvell.com>
>
> Exclude the hardware and firmware latency of model data
> caching run from xstats calculation.
>
> Fixes: 9cfad6c334f2 ("ml/cnxk: update device and model xstats functions")
>
> Signed-off-by: Anup Prabhu <aprabhu@marvell.com>
> Acked-by: Srikanth Yalavarthi <syalavarthi@marvell.com>


Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-main. Thanks


    ml/cnxk: fix xstats calculation

    Exclude the hardware and firmware latency of model data
    caching run from xstats calculation.

    Fixes: 9cfad6c334f2 ("ml/cnxk: update device and model xstats functions")
    Cc: stable@dpdk.org

    Signed-off-by: Anup Prabhu <aprabhu@marvell.com>
    Acked-by: Srikanth Yalavarthi <syalavarthi@marvell.com>

> ---
>  drivers/ml/cnxk/cn10k_ml_ops.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
> index 7f7e5efceac..53700387335 100644
> --- a/drivers/ml/cnxk/cn10k_ml_ops.c
> +++ b/drivers/ml/cnxk/cn10k_ml_ops.c
> @@ -288,6 +288,7 @@ cn10k_ml_model_xstat_get(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *l
>  static int
>  cn10k_ml_cache_model_data(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer)
>  {
> +       struct cn10k_ml_layer_xstats *xstats;
>         char str[RTE_MEMZONE_NAMESIZE];
>         const struct plt_memzone *mz;
>         uint64_t isize = 0;
> @@ -309,6 +310,16 @@ cn10k_ml_cache_model_data(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *
>                                       PLT_PTR_ADD(mz->addr, isize), 1);
>         plt_memzone_free(mz);
>
> +       /* Reset sync xstats. */
> +       xstats = layer->glow.sync_xstats;
> +       xstats->hw_latency_tot = 0;
> +       xstats->hw_latency_min = UINT64_MAX;
> +       xstats->hw_latency_max = 0;
> +       xstats->fw_latency_tot = 0;
> +       xstats->fw_latency_min = UINT64_MAX;
> +       xstats->fw_latency_max = 0;
> +       xstats->dequeued_count = 0;
> +
>         return ret;
>  }
>
> --
> 2.42.0
>
  

Patch

diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index 7f7e5efceac..53700387335 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -288,6 +288,7 @@  cn10k_ml_model_xstat_get(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *l
 static int
 cn10k_ml_cache_model_data(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer)
 {
+	struct cn10k_ml_layer_xstats *xstats;
 	char str[RTE_MEMZONE_NAMESIZE];
 	const struct plt_memzone *mz;
 	uint64_t isize = 0;
@@ -309,6 +310,16 @@  cn10k_ml_cache_model_data(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *
 				      PLT_PTR_ADD(mz->addr, isize), 1);
 	plt_memzone_free(mz);
 
+	/* Reset sync xstats. */
+	xstats = layer->glow.sync_xstats;
+	xstats->hw_latency_tot = 0;
+	xstats->hw_latency_min = UINT64_MAX;
+	xstats->hw_latency_max = 0;
+	xstats->fw_latency_tot = 0;
+	xstats->fw_latency_min = UINT64_MAX;
+	xstats->fw_latency_max = 0;
+	xstats->dequeued_count = 0;
+
 	return ret;
 }