[dpdk-dev] [PATCH] pipeline: fix table stats

Churchill Khangar churchill.khangar at intel.com
Mon Aug 2 06:35:14 CEST 2021


This patch fixes syntax of memcpy function to copy arrays which was
wrong typically leading to memory corruption for more than a few
actions involved.

Fixes: 742b0a57f50e4 ("pipeline: add table statistics to SWX")

Signed-off-by: Churchill Khangar <churchill.khangar at intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
 lib/pipeline/rte_swx_pipeline.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/pipeline/rte_swx_pipeline.c b/lib/pipeline/rte_swx_pipeline.c
index 84505e2..8eb978a 100644
--- a/lib/pipeline/rte_swx_pipeline.c
+++ b/lib/pipeline/rte_swx_pipeline.c
@@ -10940,8 +10940,8 @@ struct meter_profile meter_profile_default = {
 
 	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];
-- 
1.8.3.1



More information about the dev mailing list