From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wei.dai@intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id 6715EF72
 for <dev@dpdk.org>; Mon,  1 Aug 2016 09:04:55 +0200 (CEST)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga104.fm.intel.com with ESMTP; 01 Aug 2016 00:04:53 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.28,454,1464678000"; d="scan'208";a="1006110043"
Received: from dpdk2.bj.intel.com ([172.16.182.189])
 by orsmga001.jf.intel.com with ESMTP; 01 Aug 2016 00:04:52 -0700
From: Wei Dai <wei.dai@intel.com>
To: dev@dpdk.org
Cc: Wei Dai <wei.dai@intel.com>
Date: Mon,  1 Aug 2016 15:03:20 +0800
Message-Id: <1470035000-72828-1-git-send-email-wei.dai@intel.com>
X-Mailer: git-send-email 2.5.5
Subject: [dpdk-dev] [PATCH 1/2] lpm: fix tlb8 only not freed for depth=24
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 01 Aug 2016 07:04:58 -0000

When all rules with depth > 24 are deleted in a same tlb8 group
and only leave a rule with depth <= 24 in this group, the tlb8
group should be recycled.

Fixes: af75078fece3 ("first public release")

Signed-off-by: Wei Dai <wei.dai@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