From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F39D4A0C4D; Mon, 2 Aug 2021 14:10:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D883941147; Mon, 2 Aug 2021 14:10:05 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id F2F154003D for ; Mon, 2 Aug 2021 14:10:03 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10063"; a="213430202" X-IronPort-AV: E=Sophos;i="5.84,288,1620716400"; d="scan'208";a="213430202" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2021 05:10:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,288,1620716400"; d="scan'208";a="669191172" Received: from ena-1.iind.intel.com ([10.190.200.140]) by fmsmga005.fm.intel.com with ESMTP; 02 Aug 2021 05:09:58 -0700 From: Churchill Khangar To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, churchill.khangar@intel.com, yogesh.jangra@intel.com, venkata.suresh.kumar.p@intel.com Date: Mon, 2 Aug 2021 10:05:14 +0530 Message-Id: <1627878914-246973-1-git-send-email-churchill.khangar@intel.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] pipeline: fix table stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Cristian Dumitrescu --- 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