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: 742b0a57f5 ("pipeline: add table statistics to SWX")
Cc: stable@dpdk.org

Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
Churchill Khangar 2021-08-02 11:02:12 +05:30 committed by Thomas Monjalon
parent 22545454b6
commit 69fa4a61ae

View File

@ -10940,8 +10940,8 @@ rte_swx_ctl_pipeline_table_stats_read(struct rte_swx_pipeline *p,
table_stats = &p->table_stats[table->id]; table_stats = &p->table_stats[table->id];
memcpy(&stats->n_pkts_action, memcpy(stats->n_pkts_action,
&table_stats->n_pkts_action, table_stats->n_pkts_action,
p->n_actions * sizeof(uint64_t)); p->n_actions * sizeof(uint64_t));
stats->n_pkts_hit = table_stats->n_pkts_hit[1]; stats->n_pkts_hit = table_stats->n_pkts_hit[1];