[dpdk-dev] [dpdk-stable] [PATCH v2] test/common: fix log2 check

David Marchand david.marchand at redhat.com
Fri Dec 20 15:43:20 CET 2019


On Fri, Dec 20, 2019 at 3:02 PM David Marchand
<david.marchand at redhat.com> wrote:
>
> We recently started to get random failures on the common_autotest ut with
> clang on Ubuntu 16.04.6.
>
> Example: https://travis-ci.com/DPDK/dpdk/jobs/263177424
>
> Wrong rte_log2_u64(0) val 0, expected ffffffff
> Test Failed
>
> The ut passes 0 to log2() to get an expected value.
>
> Quoting log2 / log(3) manual:
> If x is zero, then a pole error occurs, and the functions return
> -HUGE_VAL, -HUGE_VALF, or -HUGE_VALL, respectively.
>
> rte_log2_uXX helpers handle 0 as a special value and return 0.
> Let's have dedicated tests for this case.
>
> Fixes: 05c4345ef5c2 ("test: add unit test for integer log2 function")
> Cc: stable at dpdk.org
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> Acked-by: Aaron Conole <aconole at redhat.com>

Applied with mentioned fix.


-- 
David Marchand



More information about the dev mailing list