[V3] table: fix bucket empty logic

Message ID ef01a4154319e3ed81389cd082e8acf98b241974.1625656725.git.thierry.herbelot@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [V3] table: fix bucket empty logic |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Thierry Herbelot July 7, 2021, 11:19 a.m. UTC
  Due to a typo, only 3 out of 4 keys in the bucket of the exact match
table were considered, which can result in valid keys being
incorrectly dropped from the table.

Fixes: d0a00966618ba ("table: add exact match SWX table")
Cc: stable@dpdk.org
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
--
V3: reword commit log
V2: reword patch title
---
 lib/table/rte_swx_table_em.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Cristian Dumitrescu July 7, 2021, 11:23 a.m. UTC | #1
> -----Original Message-----
> From: Thierry Herbelot <thierry.herbelot@6wind.com>
> Sent: Wednesday, July 7, 2021 12:19 PM
> To: dev@dpdk.org
> Cc: Thierry Herbelot <thierry.herbelot@6wind.com>; Thomas Monjalon
> <thomas@monjalon.net>; stable@dpdk.org; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Subject: [PATCH V3] table: fix bucket empty logic
> 
> Due to a typo, only 3 out of 4 keys in the bucket of the exact match
> table were considered, which can result in valid keys being
> incorrectly dropped from the table.
> 
> Fixes: d0a00966618ba ("table: add exact match SWX table")
> Cc: stable@dpdk.org
> Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> 
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> --
> V3: reword commit log
> V2: reword patch title
> ---
>  lib/table/rte_swx_table_em.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
  
Thomas Monjalon July 9, 2021, 8:43 p.m. UTC | #2
> > Due to a typo, only 3 out of 4 keys in the bucket of the exact match
> > table were considered, which can result in valid keys being
> > incorrectly dropped from the table.
> > 
> > Fixes: d0a00966618ba ("table: add exact match SWX table")
> > Cc: stable@dpdk.org
> > Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> > 
> > Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> 
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/table/rte_swx_table_em.c b/lib/table/rte_swx_table_em.c
index 788e25f6b912..03b28c4c9da0 100644
--- a/lib/table/rte_swx_table_em.c
+++ b/lib/table/rte_swx_table_em.c
@@ -280,7 +280,7 @@  table_key_data(struct table *t, uint32_t key_id)
 static inline int
 bkt_is_empty(struct bucket_extension *bkt)
 {
-	return (!bkt->sig[0] && !bkt->sig[1] && !bkt->sig[2] && !bkt->sig[2]) ?
+	return (!bkt->sig[0] && !bkt->sig[1] && !bkt->sig[2] && !bkt->sig[3]) ?
 		1 : 0;
 }