DPDK patches and discussions
 help / color / mirror / Atom feed
From: mablexidana <mablexidana@163.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] fix lpm bugs
Date: Wed, 21 Oct 2015 17:54:13 +0800 (CST)	[thread overview]
Message-ID: <5e5d9466.100a4.15089d2018f.Coremail.mablexidana@163.com> (raw)

hi:
    We test some lpm cases and find some bugs, below is how to fix it. thanks :)
---
 lib/librte_lpm/rte_lpm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 163ba3c..b5199ff 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -735,7 +735,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked,
                                        lpm->tbl24[i].depth <= depth ) {
                                lpm->tbl24[i].valid = INVALID;
                        }
-                       else {
+                       else if (lpm->tbl24[i].ext_entry == 1){
                                /*
                                 * If TBL24 entry is extended, then there has
                                 * to be a rule with depth >= 25 in the
@@ -770,6 +770,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked,


                struct rte_lpm_tbl8_entry new_tbl8_entry = {
                        .valid = VALID,
+                       .valid_group = VALID,
                        .depth = sub_rule_depth,
                        .next_hop = lpm->rules_tbl
                        [sub_rule_index].next_hop,
@@ -781,7 +782,7 @@ delete_depth_small(struct rte_lpm *lpm, uint32_t ip_masked,
                                        lpm->tbl24[i].depth <= depth ) {
                                lpm->tbl24[i] = new_tbl24_entry;
                        }
-                       else {
+                       else  if (lpm->tbl24[i].ext_entry == 1) {
                                /*
                                 * If TBL24 entry is extended, then there has
                                 * to be a rule with depth >= 25 in the
--
1.8.5.2 (Apple Git-48)

             reply	other threads:[~2015-10-21  9:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-21  9:54 mablexidana [this message]
2015-10-21 11:07 ` Bruce Richardson
2015-10-22  2:15   ` mablexidana
2015-10-23  4:40     ` mablexidana
     [not found]     ` <29ae0ca8.e6db.15093aafa12.Coremail.mablexidana@163.com>
2015-10-23  9:08       ` Mcnamara, John

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=5e5d9466.100a4.15089d2018f.Coremail.mablexidana@163.com \
    --to=mablexidana@163.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).