From: Wei Dai <wei.dai@intel.com>
To: dev@dpdk.org
Cc: Wei Dai <wei.dai@intel.com>
Subject: [dpdk-dev] [PATCH v4 1/3] lpm: fix freeing unused sub-table on rule delete
Date: Mon, 8 Aug 2016 14:39:51 +0800 [thread overview]
Message-ID: <1470638391-126250-1-git-send-email-wei.dai@intel.com> (raw)
In-Reply-To: <1470207736-20760-1-git-send-email-wei.dai@intel.com>
When all rules with depth > 24 are deleted in a same sub-table
(tlb8 group) and only a rule with depth <=24 is left in it,
this sub-table (tlb8 group) should be recycled.
Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
Fixes: af75078fece3 ("first public release")
Signed-off-by: Wei Dai <wei.dai@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_lpm/rte_lpm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index 6f65d1c..24fec4b 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -1533,7 +1533,7 @@ tbl8_recycle_check_v20(struct rte_lpm_tbl_entry_v20 *tbl8,
* and if so check the rest of the entries to verify that they
* are all of this depth.
*/
- if (tbl8[tbl8_group_start].depth < MAX_DEPTH_TBL24) {
+ if (tbl8[tbl8_group_start].depth <= MAX_DEPTH_TBL24) {
for (i = (tbl8_group_start + 1); i < tbl8_group_end;
i++) {
@@ -1580,7 +1580,7 @@ tbl8_recycle_check_v1604(struct rte_lpm_tbl_entry *tbl8,
* and if so check the rest of the entries to verify that they
* are all of this depth.
*/
- if (tbl8[tbl8_group_start].depth < MAX_DEPTH_TBL24) {
+ if (tbl8[tbl8_group_start].depth <= MAX_DEPTH_TBL24) {
for (i = (tbl8_group_start + 1); i < tbl8_group_end;
i++) {
--
2.5.5
prev parent reply other threads:[~2016-08-08 6:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-01 7:03 [dpdk-dev] [PATCH 1/2] lpm: fix tlb8 only not freed for depth=24 Wei Dai
2016-08-02 15:49 ` Bruce Richardson
2016-08-03 7:02 ` [dpdk-dev] [PATCH v3 1/3] lpm: fix freeing unused sub-table on rule delete Wei Dai
2016-08-03 7:13 ` Dai, Wei
2016-08-03 8:58 ` Ferruh Yigit
2016-08-08 6:39 ` Wei Dai [this message]
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=1470638391-126250-1-git-send-email-wei.dai@intel.com \
--to=wei.dai@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).