table: fix exact match SWX table lookup
authorCristian Dumitrescu <cristian.dumitrescu@intel.com>
Thu, 5 Nov 2020 15:27:46 +0000 (15:27 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 13 Nov 2020 12:55:07 +0000 (13:55 +0100)
Fix for the exact match lookup function.

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

Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
lib/librte_table/rte_swx_table_em.c

index 85c77ad..5f67223 100644 (file)
@@ -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);