From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, ferruh.yigit@intel.com,
konstantin.ananyev@intel.com, cristian.dumitrescu@intel.com,
adrien.mazarguil@6wind.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v1 2/6] librte_table: fix acl entry add and delete functions
Date: Wed, 23 Aug 2017 14:51:11 +0100 [thread overview]
Message-ID: <1503496275-27492-3-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <20170525154634.44352-1-ferruh.yigit@intel.com>
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 --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
parent reply other threads:[~2017-08-23 13:51 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20170525154634.44352-1-ferruh.yigit@intel.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1503496275-27492-3-git-send-email-bernard.iremonger@intel.com \
--to=bernard.iremonger@intel.com \
--cc=adrien.mazarguil@6wind.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=konstantin.ananyev@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).