From: Thierry Herbelot Date: Wed, 7 Jul 2021 11:19:05 +0000 (+0200) Subject: table: fix bucket empty check X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3fc2ddffde95478b65d8b58df5210293e63c00ee;p=dpdk.git table: fix bucket empty check 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 Signed-off-by: Thierry Herbelot Acked-by: Cristian Dumitrescu --- diff --git a/lib/table/rte_swx_table_em.c b/lib/table/rte_swx_table_em.c index 788e25f6b9..03b28c4c9d 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; }