Currently, extmem autotest only covers the external malloc heap
API. Extend it to also cover the non-heap, register/unregister
external memory API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Extend the extmem autotest to check whether the memseg lists for
externally allocated memory are always marked as external.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Currently, only scenario with valid IOVA table is tested. Fix this
by also testing without IOVA table - in these cases, EAL should
always return RTE_BAD_IOVA for all memsegs, and contiguous memzone
allocation should fail.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
We will be adding a new extmem test that will behave roughly similar
to already existing, so clarify function names to distinguish between
these tests, as well as factor out the common parts.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Add missing implementation for 64-bit log2 function, and extend
the unit test to test this new function. Also, remove duplicate
reimplementation of this function from testpmd and memalloc.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Add missing implementation for 64-bit fls function, and extend
unit test to test the new function as well.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Add an rte_bsf64 function that follows the convention of existing
rte_bsf32 function. Also, add missing implementation for safe
version of rte_bsf32, and implement unit tests for all recently
added bsf varieties.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Currently, fbarray autotest is only built by make, but is
missing from meson build files.
Fixes: 7985860c18 ("test/fbarray: add autotests")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
The 'external_mem_autotest' was defined in the meson build, but
the actual source file was not being compiled by meson.
Fixes: b270daa43b ("test: support external memory")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Use memory autotest to also test segment fd API. This will not do
any checks - just see if the relevant API's return success or
indicate that the API is not supported.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
SPDK uses the rte_mem_event_callback_register API to
create RDMA memory regions (MRs) for newly allocated regions
of memory. This is used in both the SPDK NVMe-oF target
and the NVMe-oF host driver.
DPDK creates internal malloc_elem structures for these
allocated regions. As users malloc and free memory, DPDK
will sometimes merge malloc_elems that originated from
different allocations that were notified through the
registered mem_event callback routine. This results
in subsequent allocations that can span across multiple
RDMA MRs. This requires SPDK to check each DPDK buffer to
see if it crosses an MR boundary, and if so, would have to
add considerable logic and complexity to describe that
buffer before it can be accessed by the RNIC. It is somewhat
analagous to rte_malloc returning a buffer that is not
IOVA-contiguous.
As a malloc_elem gets split and some of these elements
get freed, it can also result in DPDK sending an
RTE_MEM_EVENT_FREE notification for a subset of the
original RTE_MEM_EVENT_ALLOC notification. This is also
problematic for RDMA memory regions, since unregistering
the memory region is all-or-nothing. It is not possible
to unregister part of a memory region.
To support these types of applications, this patch adds
a new --match-allocations EAL init flag. When this
flag is specified, malloc elements from different
hugepage allocations will never be merged. Memory will
also only be freed back to the system (with the requisite
memory event callback) exactly as it was originally
allocated.
Since part of this patch is extending the size of struct
malloc_elem, we also fix up the malloc autotests so they
do not assume its size exactly fits in one cacheline.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Add few functional and perfomance tests
for rte_rwlock_read_trylock() and rte_rwlock_write_trylock().
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Use the new rte_comp_op_bulk_free API.
Add trace to catch any mempool elements not freed at test end.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shally.verma@caviumnetworks.com>
Acked-by: Lee Daly <lee.daly@intel.com>
This removes the magic number from the assignment of the engine variable,
which is used in the debug trace.
Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Need to release the port and the ring resources after test. Otherwise,
it will cause failure to allocate memory when reentry the test.
Fixes: ea764af ("app/test: add performance test for ring driver")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
power_kvm_vm_autotest should run on kvm vm and
virtio-ports should exist, if not test should skip.
Hence changed return as TEST_SKIPPED.
Fixes: 0ea2dd4409 ("test: skip when required lib not available")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Fixed the interrupt type using error.
Check valid alarm should use TEST_INTERRUPT_HANDLE_VALID_ALARM.
Fixes: 493b8e173f ("eal: add device event handle in interrupt thread")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Before 18.05, DPDK could not release memory back to the system
neither at runtime nor before shutting down. Over the course of
18.05 up to 18.11, code was introduced to release memory at
runtime, as well as an rte_eal_cleanup() function that is supposed
to release all EAL-allocated memory before shutting down DPDK.
When 3f9e31d71d ("test: clean up on exit") was introduced, the
test application started to use rte_eal_cleanup() to release all
used memory after execution. However, the EAL flags autotest
still relies on the old behavior of leaving stuff behind in the
hugetlbfs.
The fix is twofold. First, the test to check for leftover files
in hugetlbfs is no longer valid as it is, because test application
now removes all files from hugetlbfs after exit. However, if we
use the --legacy-mem option, then old behavior of leaving files
in hugetlbfs after execution is restored. So the first fix is to
add --legacy-mem to all the tests that expect files in hugetlbfs
to be leftover.
However, we also need to test if default memory mode *doesn't*
leave any files behind, so we also extend the test to check for
these scenarios as well. So, both memtest1 and memtest2 are run
in legacy and default mem modes, and are checked for any leftover
files that are or are not supposed to be there.
Fixes: 3f9e31d71d ("test: clean up on exit")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
One of the failure paths were not updated to clean up on exit,
most likely due to rebase error. Fix the failure path to clean
up instead of simply exiting.
Fixes: 3f9e31d71d ("test: clean up on exit")
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
The value of array index 'i' is out of bound because of the previous
loop it has been used.
Assuming intention is using '0' since the check before free is robufs[0]
check, fixing according.
Fixes: ecd867faa8 ("test/reorder: fix freeing mbuf twice")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Power_acpi_cpufreq_autotest should not be run on VM and platforms
which dont have acpi_cpufreq module loaded.
Hence changed return as TEST_SKIPPED
Fixes: 0ea2dd4409 ("test: skip when required lib not available")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
The hash read-write autotest generates a lot of text, which is very dense
on the screen. Even the summary at the end is hard to follow as everything
is very compact. We can improve readability by highlighting the starts of
the various sections, and by indenting the values within subsections.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Convert host machine endianness to networking endianness for
comparison of incoming packets with BPF filter
Suggested-by: Brian Brooks <brian.brooks@arm.com>
Signed-off-by: Malvika Gupta <malvika.gupta@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
The function returns the last (most-significant) bit set.
Added unit testcase to verify rte_fls_u32().
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reduced test duration for hash_multiwriter_autotest.
Number of entries and total insertions are reduced
such that the duration is less than 10 seconds.
Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Acked-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reduced test duration for func_reentrancy_autotest.
Reduced MAX_LPM_ITER_TIMES, introduced new macro
MAX_ITER_ONCE to reduce the unique key check and
altered the macro MAX_ITER_TIMES to MAX_ITER_MULTI.
Combined for loops thereby reduced snprintf calls
and repeated iterations.
Such that the duration is less than 10 seconds.
Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
When running unit tests automatically, either via script, from meson,
or otherwise, the same set of options may be used for each run, for
example to set a standard coremask to be used for all tests.
To facilitate this, this patch adds support for the test binary taking
additional EAL parameters from the environment and appending them to the
argc/argv list passed to eal init. This allows parameter modification
without having to edit test scripts etc.
There are now two environment variables which can be used for running
tests:
* DPDK_TEST - (added previously) passes the test name to be run
automatically rather than running the app interactively.
Used by "meson test" when running tests individually or
as part of a suite.
* DPDK_TEST_PARAMS - new parameter to specify the commandline arguments
to use with the test binary. For example to run a test,
or tests, on only 16 lcores, and to skip pci scan we can
set this to "-l 0-15 --no-pci".
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
Make clear which engine is compressing and which is decompressing
in debug output. Also add newline and print ratio = 0 if test fails.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Change unit test app to check only for op->status =
RTE_CRYPTO_OP_STATUS_SUCCESS/ERROR instead of calling rsa_verify().
as the cryptodev API is expected to return error incase of data
mismatch.
Signed-off-by: Ayuj Verma <ayuj.verma@caviumnetworks.com>
Signed-off-by: Akash Saxena <akash.saxena@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Unit testcases are added for metrics library
Added metrics unit test to autotest list
Updated meson build file
Updated MAINTAINERSHIP for metrics unit test
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Divided main test to smaller logical tests.
Registered with UT framework.
Added cleanup of the resources else ring creation fails
during consecutive test runs.
Freed the allocated mempool, rings and uninitalized the drivers.
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reduced test duration for timer_racecond unit test.
This wil help to receive quicker test results.
Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
The test application didn't call rte_eal_cleanup() on exit, which
caused leftover hugepages and memory leaks when running secondary
processes. Fix this by calling rte_eal_cleanup() on exit.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Reshma Pattan <reshma.pattan@intel.com>
Disabled the alarm_autotest UT in FreeBSD
Interrupts are not supported in FreeBSD.
Alarm API depends on interrupts, so disabled alarm test on FreeBSD.
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Add a new rte_delay_us_sleep() function that uses nanosleep().
This function can be used by applications to not implement
their own nanosleep() based callback and by internal DPDK
code if CPU non-blocking delay needed.
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
If a value contains a comma, rte_kvargs_tokenize() will split here.
In order to support list syntax [a,b] as value, an extra parsing of
the square brackets is added.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Add read-write concurrency test to meson and autotest
file.
Fixes: 0eb3726ebc ("test/hash: add test for read/write concurrency")
Cc: stable@dpdk.org
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
The hash scaling unit test is not really needed
any more since the multi-writer is supported now
inside the library and it is tested by multi-writer
unit test.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit improves the readwrite test to consider
extendable table feature.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit improves the readwrite unit test to cover
more corner cases and reduces the testing time by
reducing the total key count.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
With sequential key, the test will cover more corner
cases with jhash instead of crc hash, since jhash
generates more random hash pattern on sequential key.
It is useful for functional verification.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Check the prerequisites to run the test
1.checked whether the rte_kni module is loaded, if not fail testcase
2.checked whether the rte_kni module is loaded with loop back mode,
if not skip packet forwarding testcase and log
3.Disabled the test in freebsd as test is not supported
Fixes: 5233e5924a ("app/test: update kni")
Cc: stable@dpdk.org
Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Add a new API function to KNI, rte_kni_update_link() to allow DPDK
applications to update the link status for KNI network interfaces in
the linux kernel.
Signed-off-by: Dan Gora <dg@adax.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Unit tests to check for hash lookup and bulk-lookup perf
with lock-free enabled and with lock-free disabled.
Unit tests performed with readers running in parallel with writers.
Tests include:
- hash lookup on existing keys with:
- hash add causing NO key-shifts of existing keys in the table
- hash lookup on existing keys likely to be on shift-path with:
- hash add causing key-shifts of existing keys in the table
- hash lookup on existing keys NOT likely to be on shift-path with:
- hash add causing key-shifts of existing keys in the table
- hash lookup on non-existing keys with:
- hash add causing NO key-shifts of existing keys in the table
- hash add causing key-shifts of existing keys in the table
- hash lookup on keys likely to be on shift-path with:
- multiple writers causing key-shifts of existing keys in the table
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
rte_hash_lookup_xxx APIs return the index of slot in
the key store. Application(reader) can use that index to reference
other data structures in its scope. Because of this, the
index should not be freed till the application completes
using the index.
RTE_HASH_EXTRA_FLAGS_NO_FREE_ON_DEL is introduced to support this.
When this flag is enabled rte_hash_del_xxx APIs do not free the
key-store index/internal memory associated with the deleted
entry. The new API rte_hash_free_key_with_position should be called
to free the key-store index/internal memory after calling
rte_hash_del_xxx APIs.
Suggested-by: Yipeng Wang <yipeng1.wang@intel.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
RW concurrency is required with single writer and multiple reader
usecase as well. Hence, multi-writer should not be enabled by default when
RW concurrency is enabled.
Fixes: f2e3001b53 ("hash: support read/write concurrency")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit changes the current rte_hash unit test to
test the extendable table feature and performance.
Signed-off-by: Yipeng Wang <yipeng1.wang@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>