lpm: fix vector IPv4 lookup
authorRuifeng Wang <ruifeng.wang@arm.com>
Thu, 14 Jan 2021 06:59:22 +0000 (06:59 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 14 Jan 2021 13:19:57 +0000 (14:19 +0100)
commit5702b7bf1ce509d2f40d732ba4e2af5b1269e0d8
tree7a273cb54e17204cdc3d6fc1fe887477b49471f1
parent6e4d4a6381c47cfe6d75225945b3f6a5f8453214
lpm: fix vector IPv4 lookup

rte_lpm_lookupx4 could return wrong next hop when more than 256 tbl8
groups are created. This is caused by incorrect type casting of tbl8
group index that been stored in tbl24 entry. The casting caused group
index truncation and hence wrong tbl8 group been searched.

Issue fixed by applying proper mask to tbl24 entry to get tbl8 group index.

Fixes: dc81ebbacaeb ("lpm: extend IPv4 next hop field")
Fixes: cbc2f1dccfba ("lpm/arm: support NEON")
Fixes: d2cc7959342b ("lpm: add AltiVec for ppc64")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
lib/librte_lpm/rte_lpm_altivec.h
lib/librte_lpm/rte_lpm_neon.h
lib/librte_lpm/rte_lpm_sse.h