Skip to content

Commit

Permalink
ml/cnxk: fix xstats calculation
Browse files Browse the repository at this point in the history
Exclude the hardware and firmware latency of model data
caching run from xstats calculation.

Fixes: 9cfad6c ("ml/cnxk: update device and model xstats functions")
Cc: [email protected]

Signed-off-by: Anup Prabhu <[email protected]>
Acked-by: Srikanth Yalavarthi <[email protected]>
  • Loading branch information
anup-prabhu authored and jerinjacobk committed Dec 5, 2023
1 parent 18ad4b5 commit 90af2a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/ml/cnxk/cn10k_ml_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 90af2a7

Please sign in to comment.