diff mbox

[dpdk-dev,v1,2/6] librte_table: fix acl entry add and delete functions

Message ID 1503496275-27492-3-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Superseded, archived
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Bernard Iremonger Aug. 23, 2017, 1:51 p.m. UTC
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 <bernard.iremonger@intel.com>
---
 lib/librte_table/rte_table_acl.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox

Patch

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;