From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id D74487D6E; Wed, 23 Aug 2017 15:51:28 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 23 Aug 2017 06:51:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,417,1498546800"; d="scan'208";a="121888187" Received: from sivswdev01.ir.intel.com (HELO localhost.localdomain) ([10.237.217.45]) by orsmga004.jf.intel.com with ESMTP; 23 Aug 2017 06:51:26 -0700 From: Bernard Iremonger To: dev@dpdk.org, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com, adrien.mazarguil@6wind.com Cc: Bernard Iremonger , stable@dpdk.org Date: Wed, 23 Aug 2017 14:51:11 +0100 Message-Id: <1503496275-27492-3-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <20170525154634.44352-1-ferruh.yigit@intel.com> References: <20170525154634.44352-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v1 2/6] librte_table: fix acl entry add and delete functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 13:51:29 -0000 The rte_table_acl_entry_add() function was returning data from acl_memory instead of acl_rule_memory. It was also returning data from entry instead of entry_ptr. The rte_table_acl_entry_delete() function was returning data from acl_memory instead of acl_rule_memory. Fixes: 166923eb2f78 ("table: ACL") Cc: stable@dpdk.org Signed-off-by: Bernard Iremonger --- lib/librte_table/rte_table_acl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/librte_table/rte_table_acl.c b/lib/librte_table/rte_table_acl.c index 900f658..9865b05 100644 --- a/lib/librte_table/rte_table_acl.c +++ b/lib/librte_table/rte_table_acl.c @@ -292,8 +292,7 @@ if (status == 0) { *key_found = 1; *entry_ptr = &acl->memory[i * acl->entry_size]; - memcpy(*entry_ptr, entry, acl->entry_size); - + memcpy(entry, *entry_ptr, acl->entry_size); return 0; } } @@ -329,8 +328,8 @@ rte_acl_free(acl->ctx); acl->ctx = ctx; *key_found = 0; - *entry_ptr = &acl->memory[free_pos * acl->entry_size]; - memcpy(*entry_ptr, entry, acl->entry_size); + *entry_ptr = &acl->acl_rule_memory[free_pos * acl->entry_size]; + memcpy(entry, *entry_ptr, acl->entry_size); return 0; } @@ -411,7 +410,7 @@ acl->ctx = ctx; *key_found = 1; if (entry != NULL) - memcpy(entry, &acl->memory[pos * acl->entry_size], + memcpy(entry, &acl->acl_rule_memory[pos * acl->entry_size], acl->entry_size); return 0; -- 1.9.1