From: Churchill Khangar Date: Mon, 2 Aug 2021 05:32:12 +0000 (+0530) Subject: pipeline: fix table statistics X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=69fa4a61ae5d942004221830e7d1fa589d4398f2;p=dpdk.git pipeline: fix table statistics This patch fixes the memcpy function call which was incorrect and led to memory corruption for tables with more that just a few actions. Fixes: 742b0a57f50e4 ("pipeline: add table statistics to SWX") Cc: stable@dpdk.org Signed-off-by: Churchill Khangar Acked-by: Cristian Dumitrescu --- diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c index 84505e2a45..8eb978a30c 100644 --- a/lib/pipeline/rte_swx_pipeline.c +++ b/lib/pipeline/rte_swx_pipeline.c @@ -10940,8 +10940,8 @@ rte_swx_ctl_pipeline_table_stats_read(struct rte_swx_pipeline *p, table_stats = &p->table_stats[table->id]; - memcpy(&stats->n_pkts_action, - &table_stats->n_pkts_action, + memcpy(stats->n_pkts_action, + table_stats->n_pkts_action, p->n_actions * sizeof(uint64_t)); stats->n_pkts_hit = table_stats->n_pkts_hit[1];