DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] lpm: remove redundant check when adding lpm rule
@ 2016-08-01 13:47 Wei Dai
  2016-08-02  2:09 ` [dpdk-dev] [PATCH v2] " Wei Dai
  0 siblings, 1 reply; 9+ messages in thread
From: Wei Dai @ 2016-08-01 13:47 UTC (permalink / raw)
  To: dev; +Cc: Wei Dai

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 vaild of
each entry in this tbl8 is always true and depth of each
entry is always < 24 before adding new rule with depth > 24.

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 lib/librte_lpm/rte_lpm.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 24fec4b..5bdc23f 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -1071,14 +1071,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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-08-08  6:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 13:47 [dpdk-dev] [PATCH] lpm: remove redundant check when adding lpm rule 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
2016-08-03  7:20     ` Dai, Wei
2016-08-08  6:42     ` [dpdk-dev] [PATCH v4 " Wei Dai

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).