From: "Dai, Wei" <wei.dai@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>,
"Richardson, Bruce" <bruce.richardson@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3 3/3] lpm: remove redundant check when adding lpm rule
Date: Wed, 3 Aug 2016 07:17:42 +0000 [thread overview]
Message-ID: <49759EB36A64CF4892C1AFEC9231E8D63A2688A4@PGSMSX106.gar.corp.intel.com> (raw)
In-Reply-To: <1470207858-21149-1-git-send-email-wei.dai@intel.com>
This patch is same as patch 15064 which has been acked by Bruce Richardson.
Resending it as 2/3 of a series of patches for same rte_lpm.c .
> -----Original Message-----
> From: Dai, Wei
> Sent: Wednesday, August 3, 2016 3:04 PM
> To: dev@dpdk.org
> Cc: Dai, Wei <wei.dai@intel.com>
> Subject: [PATCH v3 3/3] lpm: remove redundant check when adding lpm rule
>
> When a rule with depth > 24 is added into an existing rule with depth <=24, a
> new tbl8 is allocated, the existing rule first fulfill whole new tbl8, so the filed
> valid of each entry in this tbl8 is always true and depth of each entry is always
> <= 24 before adding the new rule with depth > 24.
>
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> ---
> lib/librte_lpm/rte_lpm.c | 22 ++++++----------------
> 1 file changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index
> 24fec4b..ec67765 100644
> --- a/lib/librte_lpm/rte_lpm.c
> +++ b/lib/librte_lpm/rte_lpm.c
> @@ -940,14 +940,9 @@ add_depth_big_v20(struct rte_lpm_v20 *lpm,
> uint32_t ip_masked, uint8_t depth,
>
> /* Insert new rule into the tbl8 entry. */
> for (i = tbl8_index; i < tbl8_index + tbl8_range; i++) {
> - if (!lpm->tbl8[i].valid ||
> - lpm->tbl8[i].depth <= depth) {
> - lpm->tbl8[i].valid = VALID;
> - lpm->tbl8[i].depth = depth;
> - lpm->tbl8[i].next_hop = next_hop;
> -
> - continue;
> - }
> + lpm->tbl8[i].valid = VALID;
> + lpm->tbl8[i].depth = depth;
> + lpm->tbl8[i].next_hop = next_hop;
> }
>
> /*
> @@ -1071,14 +1066,9 @@ add_depth_big_v1604(struct rte_lpm *lpm,
> uint32_t ip_masked, uint8_t depth,
>
> /* Insert new rule into the tbl8 entry. */
> for (i = tbl8_index; i < tbl8_index + tbl8_range; i++) {
> - if (!lpm->tbl8[i].valid ||
> - lpm->tbl8[i].depth <= depth) {
> - lpm->tbl8[i].valid = VALID;
> - lpm->tbl8[i].depth = depth;
> - lpm->tbl8[i].next_hop = next_hop;
> -
> - continue;
> - }
> + lpm->tbl8[i].valid = VALID;
> + lpm->tbl8[i].depth = depth;
> + lpm->tbl8[i].next_hop = next_hop;
> }
>
> /*
> --
> 2.5.5
next prev parent reply other threads:[~2016-08-03 7:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-01 13:47 [dpdk-dev] [PATCH] " Wei Dai
2016-08-02 2:09 ` [dpdk-dev] [PATCH v2] " Wei Dai
2016-08-02 16:04 ` Bruce Richardson
2016-08-02 21:36 ` Thomas Monjalon
2016-08-03 9:16 ` Bruce Richardson
2016-08-03 7:04 ` [dpdk-dev] [PATCH v3 3/3] " Wei Dai
2016-08-03 7:17 ` Dai, Wei [this message]
2016-08-03 7:20 ` Dai, Wei
2016-08-08 6:42 ` [dpdk-dev] [PATCH v4 " Wei Dai
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=49759EB36A64CF4892C1AFEC9231E8D63A2688A4@PGSMSX106.gar.corp.intel.com \
--to=wei.dai@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@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).