[PATCH] lpm: fix SVE bulk lookup loop bound for small bursts
Thomas Monjalon
thomas at monjalon.net
Mon Nov 2 14:22:45 CET 2026
27/10/2026 17:14, Rupesh Chiluka:
> In __rte_lpm_lookup_vec() (SVE), the main loop condition was
>
> for (i = 0; i < n - vl; i += vl)
>
> where n is uint32_t and vl is uint64_t. When n < vl the subtraction
> is done in 64-bit unsigned arithmetic and wraps to a very large
> value, so the loop does not terminate at the end of the input array.
> It reads past the end of ips[] resulting in a segmentation fault.
>
> Rewrite the condition as "i + vl < n" so no unsigned wrap occurs. The
> existing tail handling with svwhilelt_b32() covers the remaining
> elements, including n == 0.
>
> Fixes: b29ccbea24 ("lpm: use SVE for bulk lookup")
> Cc: stable at dpdk.org
>
> Signed-off-by: Rupesh Chiluka <rchiluka at marvell.com>
Applied, thanks.
More information about the stable
mailing list