From: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>
To: "Singh, Jasvinder" <jasvinder.singh@intel.com>,
"Iremonger, Bernard" <bernard.iremonger@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Yigit, Ferruh" <ferruh.yigit@intel.com>,
"Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
"adrien.mazarguil@6wind.com" <adrien.mazarguil@6wind.com>
Cc: "Iremonger, Bernard" <bernard.iremonger@intel.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v5 1/6] librte_table: fix acl entry add and delete functions
Date: Wed, 20 Sep 2017 12:21:11 +0000 [thread overview]
Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BABCE7F@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <54CBAA185211B4429112C315DA58FF6D33253912@IRSMSX103.ger.corp.intel.com>
> -----Original Message-----
> From: Singh, Jasvinder
> Sent: Monday, September 18, 2017 4:30 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org;
> Yigit, Ferruh <ferruh.yigit@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; adrien.mazarguil@6wind.com
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>; stable@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v5 1/6] librte_table: fix acl entry add and
> delete functions
>
> Hi Bernard,
>
> <snip>
>
> > --- a/lib/librte_table/rte_table_acl.c
> > +++ b/lib/librte_table/rte_table_acl.c
> > @@ -316,8 +316,7 @@ struct rte_table_acl {
> > 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;
> > }
> > }
>
> In this case, table entry which is being added already presents in the table.
> So, first the pointer to that entry from the memory[] that stores the pipeline
> table data(struct rte_pipeline_table_entry) associated with key is retrieved
> and the changes (action and metadara) are stored in the internal table
> pointed by action_table. So, above fix doesn't seem correct.
>
> > @@ -353,8 +352,8 @@ struct rte_table_acl {
> > 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;
> > }
> > @@ -435,7 +434,7 @@ struct rte_table_acl {
> > 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);
>
>
> Above fixes also seems not correct. As per documentation, *entry_ptr is
> intended to store the handle to the pipeline table entry containing the data
> associated with the current key instead of pointing to memory used to store
> the acl rules, etc. Please refer rte_table_acl_create() where memory is
> initialized and organized to stores different types of internal tables (pointed
> by action_table, acl_rule_list and acl_rule_memory).
NACK
Fully agree with Jasvinder.
Existing code is correct, proposed code changes are wrong.
next prev parent reply other threads:[~2017-09-20 12:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1504693668-2062-1-git-send-email-bernard.iremonger@intel.com>
2017-09-07 16:43 ` [dpdk-stable] " Bernard Iremonger
2017-09-18 15:29 ` [dpdk-stable] [dpdk-dev] " Singh, Jasvinder
2017-09-20 12:21 ` Dumitrescu, Cristian [this message]
2017-09-29 8:25 ` Iremonger, Bernard
2017-09-07 16:43 ` [dpdk-stable] [PATCH v5 2/6] librte_table: fix acl lookup function Bernard Iremonger
2017-09-20 12:24 ` Dumitrescu, Cristian
2017-09-29 8:27 ` Iremonger, Bernard
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=3EB4FA525960D640B5BDFFD6A3D891267BABCE7F@IRSMSX108.ger.corp.intel.com \
--to=cristian.dumitrescu@intel.com \
--cc=adrien.mazarguil@6wind.com \
--cc=bernard.iremonger@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jasvinder.singh@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).