lpm: use SVE for bulk lookup
PATCH 1/1 lpm: use SVE for bulk lookup
SVE was used for lookupx4 where four entries are looked up at a time. It is not an ideal case for SVE implementation which does not bound to vector length.
Changed to use SVE implementation in bulk lookup when the feature is available. And optimized the SVE implementation.
The lookupx4 sticks to NEON implementation.
--- lib/lpm/rte_lpm.h | 6 ++- lib/lpm/rte_lpm_sve.h | 96 +++++++++++++++++++++++++------------------ 2 files changed, 61 insertions(+), 41 deletions(-)
lib/lpm/rte_lpm.h +4 -2
@@ -400,9 +400,11 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],#if defined(RTE_ARCH_ARM )#ifdef RTE_HAS_SVE_ACLE #include "rte_lpm_sve.h" -#else -#include "rte_lpm_neon.h" +#undef rte_lpm_lookup_bulk +#define rte_lpm_lookup_bulk (lpm, ips, next_hops, n) \ + __rte_lpm_lookup_vec(lpm, ips, next_hops, n)#endif +#include "rte_lpm_neon.h" #elif defined(RTE_ARCH_PPC_64 )#include "rte_lpm_altivec.h" #elif defined(RTE_ARCH_X86 )
lib/lpm/rte_lpm_sve.h +57 -39
121 lines not on this page · raw message
Signature · 1 line
2.25.1
Thomas Monjalon
Applied09/01/2023 10:28, Ruifeng Wang:
Quoted 8 lines
SVE was used for lookupx4 where four entries are looked up at a time. It is not an ideal case for SVE implementation which does not bound to vector length.
Changed to use SVE implementation in bulk lookup when the feature is available. And optimized the SVE implementation.
The lookupx4 sticks to NEON implementation.Signed-off-by Ruifeng Wang <[email protected]>
Applied, thanks.