This patch adds support for meter configuration profiles.
Benefits: simplified configuration procedure, improved performance.
Q1: What is the configuration profile and why does it make sense?
A1: The configuration profile represents the set of configuration
parameters for a given meter object, such as the rates and sizes for
the token buckets. The configuration profile concept makes sense when
many meter objects share the same configuration, which is the typical
usage model: thousands of traffic flows are each individually metered
according to just a few service levels (i.e. profiles).
Q2: How is the configuration profile improving the performance?
A2: The performance improvement is achieved by reducing the memory
footprint of a meter object, which results in better cache utilization
for the typical case when large arrays of meter objects are used. The
internal data structures stored for each meter object contain:
a) Constant fields: Low level translation of the configuration
parameters that does not change post-configuration. This is
really duplicated for all meters that use the same
configuration. This is the configuration profile data that is
moved away from the meter object. Current size (implementation
dependent): srTCM = 32 bytes, trTCM = 32 bytes.
b) Variable fields: Time stamps and running counters that change
during the on-going traffic metering process. Current size
(implementation dependent): srTCM = 24 bytes, trTCM = 32 bytes.
Therefore, by moving the constant fields to a separate profile
data structure shared by all the meters with the same
configuration, the size of the meter object is reduced by ~50%.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Get rid of global static ring variable and don't reuse rings
between test runs.
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Fixes: 4e32101f9b ("ring: support freeing")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Add a teardown function that frees allocated resources.
Fixes: d0c9b58d71 ("app/test: new reorder unit test")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
The KNI library is not built on FreeBSD, so it needs to be an
optional rather than a mandatory dependency for building the autotest
binary.
Fixes: b5dc795a8a ("test: build app with meson as dpdk-test")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The power library is not built on FreeBSD, so it needs to be an
optional rather than a mandatory dependency for building the autotest
binary.
Fixes: b5dc795a8a ("test: build app with meson as dpdk-test")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
The power management and KNI libraries are not compiled on a FreeBSD
platform, which means that the tests can't run. Add in stub code for
these cases, allowing the tests to still be compiled, but to report
as skipped in those cases.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
The binaries and apps in DPDK all need to be linked against the
execinfo library on FreeBSD so add this as a dependency in cases
where it is found. It's available by default on BSD, but not
at all on Linux
Fixes: 16ade738fd ("app/testpmd: build with meson")
Fixes: 89f0711f9d ("examples: build some samples with meson")
Fixes: b5dc795a8a ("test: build app with meson as dpdk-test")
Fixes: 2ff67267b0 ("app/eventdev: build with meson")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
This patch replaces the uses of default mempool ops API
with newly supported best_mempool_ops API.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Currently, memzone autotest expects there to be no memzones
present by the time the test is run. Some hardware drivers
will allocate memzones for internal use during initialization,
resulting in tests failing due to unexpected memzones being
allocated before the test was run.
Fix this by making sure all memzones allocated by this test
have a common prefix, and making callback increment a counter
on encountering memzones with this prefix. Also, separately
increment another counter that will count total number of
memzones left after test, and compares it to previously stored
number of memzones, to ensure that we didn't accidentally
allocated/freed any memzones we weren't supposed to. This
also doubles as a test for correct operation of memzone_walk().
Fixes: 71330483a1 ("test/memzone: fix memory leak")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Ensure that memzone count in eal mem config is incremented and
decremented whenever memzones are allocated and freed.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Radoslaw Biernacki <radoslaw.biernacki@linaro.org>
Function reentrancy test limits maximum number of iterations based
on the number of memzones and cores, however it doesn't free the
memzones after the fact, so on a machine with big amount of cores
the tests will fail due to running out of memzones.
Fix this by introducing cleanup functions for ring and mempool
reentrancy tests.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Some variables in the PMD perf test were declared as global,
but they are only used in this test, so they should actually
be declared as static.
Fixes: 002ade70e9 ("app/test: measure cycles per packet in Rx/Tx")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch adds following:
1. Option to configure the mac address during create. Generate random
address only if the user has not provided any valid address.
2. Inform usespace, if mac address is being changed in linux.
3. Implement default handling of mac address change in the corresponding
ethernet device.
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Increase the default RX/TX ring sizes to 1024/1024 to
accommodate for NICs with higher throughput (25G, 40G etc)
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Skeleton rawdevice test cases are part of driver layer. This patch
allows test cases to be executed using 'rawdev_autotest' command
in test framework.
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Before this patch, the debug_autotest would call fork(),
call rte_panic() or rte_exit() in the child process, and
examine the return code to verify that rte_panic() and
rte_exit() were correctly reporting failures.
With the inclusion of the rte_eal_cleanup() patch, rte_exit()
was modified to cleanly tear-down EAL allocations. Currently
only one library (service cores) is allocated by EAL at startup
and should be cleaned up. This library has a check on a normal
(non-hugepage) variable to protect against double cleanup. The
service cores finalize() function itself frees back hugepage mem.
Given the fork() approach from the unit test, and the fact that
the double-free check is on an ordinary variable, causes multiple
child processed (fork()-ed from the unit-test runner) to attempt
to free the huge-page memory multiple times. The variable to
protect against double-cleanup was not effective, as the fork()
would restore it to show initialized in the next child.
The solution is to call rte_service_finalize() *before* calling
fork(), which results in the service cores double-cleanup variable
to be zero before the fork(), and hence the child processes never
free the hugepage service-cores memory (correct behavior, as the
unit-test suite is still running, and owns the hugepages).
Fixes: aec9c13c52 ("eal: add function to release internal resources")
Reported-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Added support for detecting march and mcpu by reading midr_el1 register.
The implementer, primary part number values read can be used to figure
out the underlying arm cpu.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
This commit adds most of the remaining tests to the meson build.
They can be run using test binary as normal, or via "ninja test".
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
This patch enables the test/test app to be built. It also adds
the test binary to be a meson-test, which allows the meson test
infrastructure to be used to run tests.
Tests are listed using the same test binary, however each test
sets a different DPDK_TEST environment variable. The string contents
of this DPDK_TEST env var is entered in the command line interface.
As such, the familiar test names such as "ring_perf_autotest" etc
are valid tests to run using this meson test infrastructure.
Note that the tests are run serially, given that we cannot run
multiple primary processes at a time. As each test must initialize
EAL this takes some time depending on the number of hugepages.
In future, we could improve this to run multiple tests from one
EAL init, but it is out of scope for this patchset.
Finally, an option to build the tests is added to the meson build
options. When disabled, the unit test code in test/test is not
compiled. The default is set to 'true'. To disable, run:
$ meson configure -Dtests=false
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Add comparison to make sure memory pointed to by
digest pointer is not overwritten in NULL auth case.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Add checks during build to ensure that all symbols in the EXPERIMENTAL
version map section have __experimental tags on their definitions, and
enable the warnings needed to announce their use. Also add an
ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files
to declare the acceptability of experimental api usage
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Simple functional test for rte_smp_mb() implementations.
Also when executed on a single lcore could be used as rough
estimation how many cycles particular implementation of rte_smp_mb()
might take.
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit provides a set of tests for verifying the correctness and
performance of both unsigned 32 and 64bit reciprocal based division.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Create a rte_ethdev_driver.h file and move PMD specific APIs here.
Drivers updated to include this new header file.
There is no update in header content and since ethdev.h included by
ethdev_driver.h, nothing changed from driver point of view, only
logically grouping of APIs. From applications point of view they can't
access to driver specific APIs anymore and they shouldn't.
More PMD specific data structures still remain in ethdev.h because of
inline functions in header use them. Those will be handled separately.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
time() is defined in time.h
Fixes: ffbe3be0d4 ("app/test: add libcrypto")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Move software eventdev specific test (test_eventdev_sw) to
driver/event/sw/.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Move octeontx eventdev specific test (test_eventdev_octeontx.c) to
driver/event/octeontx.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Adding common test assertion macros for unit testing.
Replaced common macros in test/test.h with new RTE_TEST_ASSERT_* macros.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
This commit introduces a capability for disabling the "implicit" release
functionality for a port, which prevents the eventdev PMD from issuing
outstanding releases for previously dequeued events when dequeuing a new
batch of events.
If a PMD does not support this capability, the application will receive an
error if it attempts to setup a port with implicit releases disabled.
Otherwise, if the port is configured with implicit releases disabled, the
application must release each dequeued event by invoking
rte_event_enqueue_burst() with RTE_EVENT_OP_RELEASE or
RTE_EVENT_OP_FORWARD.
Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
This commit introduces dynamically-sized IQs, by switching the underlying
data structure from a fixed-size ring to a linked list of queue 'chunks.'
This has a number of benefits:
- Certain corner cases were observed in which all of a pipeline's flows
could be pinned to one port for extended periods, effectively turning a
multi-core pipeline into single-core one. This was caused by an event
producer having a larger new_event_threshold than the IQ depth, and
injecting large numbers of packets that are ultimately backpressured in a
worker's rx_ring, causing those packets' flows to be scheduled to that
port.
The dynamically sized IQ does not have this problem because each IQ can
grow large enough to store all the system's events, such that
backpressure will not reach the worker_ring.
- Slight performance improvement (~1-2%) in high throughput scenarios,
tested with eventdev_pipeline_sw_pmd.
This implementation has a small increase in the queue storage memory
footprint (~70KB). This commit also removes the iq_size xstat, which no
longer applies to this implementation.
Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
This commit reinitializes a queue before it is reconfigured, such that
reorder buffer memory is not leaked.
This bug masked a few other problems, which this commit corrects as well:
- sw_port_link() allowed a port to link to a queue twice, such that the
port could then successfully unlink the queue twice. Now the link
function checks whether a port is already linked to the queue, and if so
returns success but doesn't assign the a port a second slot in the
queue's cq map.
- test_eventdev.c's test_eventdev_unlink() was unlinking a queue twice
from the same port, and expecting the second unlink to succeed. Now the
test unlinks, links, then unlinks again.
- test_eventdev.c's test_eventdev_link_get() was linking a single queue but
expecting the unlink function to return nb_queues (where nb_queues > 1).
The test now checks for a return value of 1.
Fixes: 5ffb2f142d ("event/sw: support event queues")
Fixes: 371a688fc1 ("event/sw: support linking queues to ports")
Fixes: f8f9d233ea ("test/eventdev: add unit tests")
Cc: stable@dpdk.org
Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
octeontx test application was using non RTE_EVENT_TYPE_CPU
event type to generate the event from CPU. Upon the introduction
of ethdev Rx adapter, RTE_EVENT_TYPE_ETHDEV has special
meaning. So avoid using non RTE_EVENT_TYPE_CPU event types
to inject events from CPU.
Fixes: d0d6549860 ("net/octeontx: support event Rx adapter")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Move all static variables defined in header file to c file.
error log: /usr/bin/ld: Warning: size of symbol 'count' changed
from 8 in test_pmd_perf.o to 24 in test_flow_classify.o
Fixes: 50bdac5916 ("flow_classify: remove table id parameter from API")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Use of rte_eal_mbuf_default_mempool_ops() API will
allow to override pool handler through "--mbuf-pool-ops-name"
eal command line argument.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Use of rte_eal_mbuf_default_mempool_ops() API will
allow to override pool handler through "--mbuf-pool-ops-name"
eal command line argument.
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Remove the requirement to have a port bound to igb_uio in
order to run this test suite.
Fixes: 9c9befea4f ("test: add flow classify unit tests")
Cc: stable@dpdk.org
Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
When reserving memzone for mz[], it will out of mz[RTE_MAX_MEMZONE] memory
bound after the counter reached to RTE_MAX_MEMZONE. It will flush the
counter's memory and lead to mz[] memory cannot be freed.
Fixd by extend to mz[RTE_MAX_MEMZONE + 1].
Fixes: ff909fe21f ("mem: introduce memzone freeing")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>