Skip to contentSkip to conversation

lpm: fix tlb8 only not freed for depth=24

PATCH In review Wei Dai 3 participants 6 messages Aug 1, 2016 – Aug 8, 2016

lore
Share & tools
lore

Wei Dai

author
#0 lore raw

PATCH 1/2 lpm: fix tlb8 only not freed for depth=24

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")
---
 lib/librte_lpm/rte_lpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_lpm/rte_lpm.c +2 -2
index 6f65d1c..24fec4b 100644
@@ -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++) {
 
Signature · 1 line
2.5.5
Acked-by on v1 1/2
#1 lore raw
Quoted 4 lines · Wei Dai

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.

The title needs a bit of rewording, I think e.g.
lpm: fix freeing unused sub-table on rule delete

Otherwise:

author
#2 lore raw

PATCH v3 1/3 lpm: fix freeing unused sub-table on rule delete

In reply to Wei Dai

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")
---
 lib/librte_lpm/rte_lpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_lpm/rte_lpm.c +2 -2
index 6f65d1c..24fec4b 100644
@@ -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++) {
 
Signature · 1 line
2.5.5
author
#3 lore raw

Re: [PATCH v3 1/3] lpm: fix freeing unused sub-table on rule delete

This patch is same as patch 15063 which has been acked by Bruce Richardson. Only title and message body of git log has been revised according to Bruce's advice.

Quoted 45 lines

-----Original Message-----
From: Dai, Wei
Sent: Wednesday, August 3, 2016 3:02 PM
To: [email protected]
Cc: Dai, Wei <[email protected]>
Subject: [PATCH v3 1/3] lpm: fix freeing unused sub-table on rule delete

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")
---
 lib/librte_lpm/rte_lpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_lpm/rte_lpm.c index renamed from lib/librte_lpm/rte_lpm.c +0 -0

6f65d1c..24fec4b 100644

lib/librte_lpm/rte_lpm.c +2 -3
@@ -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

#4 lore raw

Re: [PATCH v3 1/3] lpm: fix freeing unused sub-table on rule delete

Quoted 3 lines · Wei

This patch is same as patch 15063 which has been acked by Bruce Richardson. Only title and message body of git log has been revised according to Bruce's advice.

For future, you can carry Ac with new version of the patch for these kind of cases.

author
#5 lore raw

PATCH v4 1/3 lpm: fix freeing unused sub-table on rule delete

In reply to Wei Dai

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")
---
 lib/librte_lpm/rte_lpm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_lpm/rte_lpm.c +2 -2
index 6f65d1c..24fec4b 100644
@@ -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++) {
 
Signature · 1 line
2.5.5