numam-dpdk/app
Dmitry Kozlyuk 1a7374c956 eal: fix side effect in some pointer arithmetic macros
RTE_PTR_SUB(ptr, x) and RTE_PTR_ALIGN_FLOOR() worked incorrectly
if "ptr" was an expression:

    uint32_t arr[3];

    RTE_PTR_SUB(arr + 1, sizeof(arr[0]));
    // expected: (uint32_t *)((uintptr_t)(arr + 1) - 4) == arr
    // actual:   (uint32_t *)((uintptr_t) arr + 1  - 4) != arr

    RTE_PTR_ALIGN_FLOOR(arr + 2, sizeof(arr[0]));
    // expected: RTE_ALIGN_FLOOR((uintptr_t)(arr + 2), 4) == &arr[2]
    // actual:   RTE_ALIGN_FLOOR((uintptr_t) arr + 2,  4) == &arr[0]

Fix the macros and extend the relevant unit test.
Convert uses of a custom test failure macro to RTE_TEST_ASSERT*().

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2022-09-21 15:31:03 +02:00
..
dumpcap app/dumpcap: allow help/version without primary process 2022-03-08 09:32:59 +01:00
pdump app/pdump: free mempool at resources cleanup 2022-03-08 00:19:31 +01:00
proc-info app/procinfo: dump device private info 2022-06-26 17:51:14 +02:00
test eal: fix side effect in some pointer arithmetic macros 2022-09-21 15:31:03 +02:00
test-acl app/acl: support different formats for IPv6 address 2022-05-30 23:31:37 +02:00
test-bbdev baseband/acc100: configure ACC101 from PF 2022-06-21 20:04:49 +02:00
test-cmdline
test-compress-perf app/compress-perf: fix number of queue pairs to setup 2022-03-04 10:53:09 +01:00
test-crypto-perf test/crypto-perf: support SDAP for PDCP operations 2022-06-21 20:04:49 +02:00
test-eventdev app/eventdev: increase number of descriptors 2022-06-20 21:28:18 +02:00
test-fib app/fib: fix division by zero 2022-02-11 08:50:13 +01:00
test-flow-perf app/flow-perf: fix build with GCC 12 2022-06-15 10:21:19 +02:00
test-gpudev gpudev: use CPU mapping in communication list 2022-02-22 20:08:52 +01:00
test-pipeline app: remove unneeded atomic header include 2021-11-17 11:07:06 +01:00
test-pmd app/testpmd: fix RSS types display 2022-07-08 12:28:38 +02:00
test-regex app/regex: fix mbuf size for multi-segment buffer 2022-07-05 22:19:03 +02:00
test-sad
meson.build build: make pdump optional 2021-11-17 12:49:19 +01:00