table: fix exact match lookup

Message ID 20201105152746.24821-1-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series table: fix exact match lookup |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Cristian Dumitrescu Nov. 5, 2020, 3:27 p.m. UTC
  Fix for the exact match lookup function.

Fixes: d0a00966618b ("table: add exact match SWX table")

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
---
 lib/librte_table/rte_swx_table_em.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

David Marchand Nov. 13, 2020, 1:04 p.m. UTC | #1
On Thu, Nov 5, 2020 at 4:27 PM Cristian Dumitrescu
<cristian.dumitrescu@intel.com> wrote:
>
> Fix for the exact match lookup function.
>
> Fixes: d0a00966618b ("table: add exact match SWX table")
>
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>

Applied, thanks.
  

Patch

diff --git a/lib/librte_table/rte_swx_table_em.c b/lib/librte_table/rte_swx_table_em.c
index 85c77ad03..5f6722306 100644
--- a/lib/librte_table/rte_swx_table_em.c
+++ b/lib/librte_table/rte_swx_table_em.c
@@ -720,19 +720,19 @@  table_lookup(void *table,
 		uint32_t bkt_key_id;
 
 		bkt_sig0 = input_sig ^ bkt->sig[0];
-		if (bkt_sig0)
+		if (!bkt_sig0)
 			mask0 = 1 << 0;
 
 		bkt_sig1 = input_sig ^ bkt->sig[1];
-		if (bkt_sig1)
+		if (!bkt_sig1)
 			mask1 = 1 << 1;
 
 		bkt_sig2 = input_sig ^ bkt->sig[2];
-		if (bkt_sig2)
+		if (!bkt_sig2)
 			mask2 = 1 << 2;
 
 		bkt_sig3 = input_sig ^ bkt->sig[3];
-		if (bkt_sig3)
+		if (!bkt_sig3)
 			mask3 = 1 << 3;
 
 		mask_all = (mask0 | mask1) | (mask2 | mask3);