Recently reported, the introduction of pmd information exports led to a
breakage of cryptodev unit tests because the test infrastructure relies on the
cryptodev names being available in macros. This patch fixes the pmd naming to
use the macro names. Note that the macro names were already pre-stringified,
which won't work as the PMD_REGISTER_DRIVER macro requires the name in both a
processing token and stringified form. As such the names are defined now as
tokens, and converted where needed to stringified form on demand using RTE_STR.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
For all drivers that currently implement xstats, the id field in the
rte_eth_stats_name structure equals the entry's array index. This
patch eliminates the redundant id field as a direct index lookup is
faster than a search for the matching id field.
Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
After introducing the stack handler in the previous commit,
we now have very similar code to the custom handler in test_mempool.c,
which creates a custom mempool based on simple mallocs.
The stack handler is a cleaner example of adding a new mempool handler,
so this commit replaces the custom handler test with a stack
handler test, and removes the custom handler code.
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
The mempool_count and mempool_free_count behaved contrary to what their
names suggested. The free_count function actually returned the number of
elements that were allocated from the pool, not the number unallocated as
the name implied.
Fix this by introducing two new functions to replace the old ones,
* rte_mempool_avail_count to replace rte_mempool_count
* rte_mempool_in_use_count to replace rte_mempool_free_count
In this patch, the new functions are added, and the old ones are marked
as deprecated. All apps and examples that use the old functions are
updated to use the new functions.
Fixes: af75078fec ("first public release")
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Number of forwarding cores must be equal or less than
number of forwarding streams, otherwise two cores
would try to use a same queue on a port, which is not allowed.
Fixes: f2bb7ae1d2 ("app/testpmd: handle all Rx queues in RSS setup")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
The mempool cache is only available to EAL threads as a per-lcore
resource. Change this so that the user can create and provide their own
cache on mempool get and put operations. This works with non-EAL threads
too. This commit introduces the new API calls:
rte_mempool_cache_create(size, socket_id)
rte_mempool_cache_free(cache)
rte_mempool_cache_flush(cache, mp)
rte_mempool_default_cache(mp, lcore_id)
Changes the API calls:
rte_mempool_generic_put(mp, obj_table, n, cache, flags)
rte_mempool_generic_get(mp, obj_table, n, cache, flags)
The cache-oblivious API calls use the per-lcore default local cache.
Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This commit introduces the API calls:
rte_mempool_generic_put(mp, obj_table, n, is_mp)
rte_mempool_generic_get(mp, obj_table, n, is_mc)
Deprecates the API calls:
rte_mempool_mp_put_bulk(mp, obj_table, n)
rte_mempool_sp_put_bulk(mp, obj_table, n)
rte_mempool_mp_put(mp, obj)
rte_mempool_sp_put(mp, obj)
rte_mempool_mc_get_bulk(mp, obj_table, n)
rte_mempool_sc_get_bulk(mp, obj_table, n)
rte_mempool_mc_get(mp, obj_p)
rte_mempool_sc_get(mp, obj_p)
We also check cookies in one place now.
Signed-off-by: Lazaros Koromilas <l@nofutznetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This adds test cases for exercising the external state machine API to
the mode 4 autotest.
Signed-off-by: Eric Kinzie <ehkinzie@gmail.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
ring_size value is wrongly type casted to uint16_t.
It should be type casted to uint32_t, as maximum
ring size is 28bit long. Wrong type cast
wrapping around the ring size values bigger than 65535.
Fixes: caa7028276 ("app/pdump: add tool for packet capturing")
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Test_multi_session was freeing mbufs used in the multiple sessions
created and setting obuf to NULL after it, but ibuf was not being
set to NULL, and therefore, it was being freed again (ibuf and obuf
are pointing at the same address), in the ut_teardown() function.
Fixes: 1b9cb73ece ("app/test: fix qat autotest failure")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
The PCI test was failing because some fake devices had no PCI class.
Fixes: 1dbba1650c ("app/test: remove real PCI ids")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
In cryptodev tests, when input and output buffers were the same,
the mbuf was being freed twice, causing refcnt_atomic to be negative.
Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Icc complains about variable may be used without setting.
Fixes: 97fe6461c7 ("app/test: add SNOW 3G performance test")
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Acked-by: John Griffin <john.griffin@intel.com>
The build was failing sometimes when building with multiple
parallel jobs:
# rm build/build/app/test/*res*
# make -j6
objcopy: 'resource.tmp': No such file
The reason is that each resource was built from the same temporary file.
The failure is seen because of a race condition when removing the
temporary file after each resource creation.
It also means that some resources may be created from the wrong source.
The fix is to have a different input file for each resource.
The source file is not directly used because it may have a long path
which is used by objcopy to name the symbols after some transformations.
When linking a tar resource, the input file is already in the current
directory. The hard case is for simply linked resources.
The trick is to create a symbolic link of the source file if it is not
already in the current build directory.
Then there is a replacement of dot by an underscore to predict the
symbol names computed by objcopy which must be redefined.
There is an additional change for the test_resource_c which is both
a real source file and a test resource. An intermediate file
test_resource.res is created to avoid compiling resource.c from the
wrong directory through a symbolic link.
Fixes: 1e9e0a6270 ("app/test: fix resource creation with objcopy on FreeBSD")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This patch introduced scalable multi-writer Cuckoo Hash insertion
based on a split Cuckoo Search and Move operation using Intel
TSX. It can do scalable hash insertion with 22 cores with little
performance loss and negligible TSX abortion rate.
* Added an extra rte_hash flag definition to switch default single writer
Cuckoo Hash behavior to multiwriter.
- If HTM is available, it would use hardware feature for concurrency.
- If HTM is not available, it would fall back to spinlock.
* Created a rte_cuckoo_hash_x86.h file to hold all x86-arch related
cuckoo_hash functions. And rte_cuckoo_hash.c uses compile time flag to
select x86 file or other platform-specific implementations. While HTM check
is still done at runtime (same idea with
RTE_HASH_EXTRA_FLAGS_TRANS_MEM_SUPPORT)
* Moved rte_hash private struct definitions to rte_cuckoo_hash.h, to allow
rte_cuckoo_hash_x86.h or future platform dependent functions to include.
* Following new functions are created for consistent names when new platform
TM support are added.
- rte_hash_cuckoo_move_insert_mw_tm: do insertion with bucket movement.
- rte_hash_cuckoo_insert_mw_tm: do insertion without bucket movement.
* One extra multi-writer test case is added.
Signed-off-by: Wei Shen <wei1.shen@intel.com>
Signed-off-by: Sameh Gobriel <sameh.gobriel@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Until now, the objects stored in a mempool were internally stored in a
ring. This patch introduces the possibility to register external handlers
replacing the ring.
The default behavior remains unchanged, but calling the new function
rte_mempool_set_ops_byname() right after rte_mempool_create_empty() allows
the user to change the handler that will be used when populating
the mempool.
This patch also adds a set of default ops (function callbacks) based
on rte_ring.
Signed-off-by: David Hunt <david.hunt@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
- added VXLAN, GENEVE and NVGRE tunnel flow types
- added PORT flow type for accounting physical/virtual
port or channel number in flow creation
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Fixes memory leaks detected by Coverity. These are due to ephemeral
memory allocations not being freed when errors occur.
Coverity issue: 127348
Fixes: e2aae1c1ce ("ethdev: remove name from extended statistic fetch")
Signed-off-by: Remy Horton <remy.horton@intel.com>
SNOW3G and KASUMI unit tests are very similar and
they were using duplicated code, so this commit
refactor and remove some of the duplicated functions.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
With the new libsso library, buffers can be encrypted/decrypted,
providing an offset in bits, so an extra unit test has been
added to cover this case.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Snow3G PMD supports now buffers that are non byte multiple,
so tests to cover this case have been added.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
No padding was added in the input buffers for snow3G tests,
due to a wrong calculation of the length (should be multiple
of the block size). This fix takes into account the case
where the length is not byte multiple.
Fixes: 8bdf665fe6 ("app/test: add SNOW 3G")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Instead of modifying the content of the buffers, to compare them
at bit-level, use the new macro TEST_ASSERT_BUFFERS_ARE_EQUAL_BIT,
which does not make any modifications in the buffers.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
In order to compare buffers with length and offset in bits,
new macros have been created, which use the previous compare function
to compare full bytes and then, compare first and last bytes of
each buffer separately.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Instead of using the previous RTE_APP_TEST_DEBUG macro,
to dump memory when it was enabled (with rte_hexdump),
a new TEST_HEXDUMP is defined, which will call rte_hexdump
if RTE_LOG_LEVEL is set to RTE_LOG_DEBUG.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
When RTE_APP_TEST_DEBUG is set, there were some errors:
app/test/test_cryptodev.c: In function ‘create_gcm_operation’:
app/test/test_cryptodev.c:3619:18: error: ‘struct rte_crypto_op’ has no member named ‘digest’
ut_params->op->digest.data,
^
app/test/test_cryptodev.c:3620:18: error: ‘struct rte_crypto_op’ has no member named ‘digest’
ut_params->op->digest.length);
^
app/test/test_cryptodev.c:3662:41: error: ‘struct rte_crypto_op’ has no member named ‘iv’
rte_hexdump(stdout, "iv:", ut_params->op->iv.data, iv_pad_len);
^
app/test/test_cryptodev.c:3664:17: error: ‘struct rte_crypto_op’ has no member named ‘additional_auth’
ut_params->op->additional_auth.data, aad_len);
Fixes: eec136f3c5 ("aesni_gcm: add driver for AES-GCM crypto operations")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Cryptodev performance tests do not need to use any function
from rte_hexdump.h.
Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Updating the AES performance test in line with snow3g performance test.
Output format has been updated so as to get better understanding of numbers.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Adding performance test for snow3g wireless algorithm.
Performance test can run over both software and hardware.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
This patch adds the HMAC-SHA224 and HMAC-SHA384 digest generation and
verification tests to crypto
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch reworks the crypto AES unit test by introducing a new unified
test function
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Using of the /dev/stdin generates a warning when compiling on FreeBSD:
objcopy: Warning: '/dev/stdin' is not an ordinary file
app/test/Makefile:78: recipe for target 'test_resource_c.res.o' failed
# ls -l /dev/stdin
lrwxr-xr-x 1 root wheel 4 Jun 17 12:24 /dev/stdin -> fd/0
Replace /dev/stdin by a temporary file.
Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
The objcopy and tar commands were printed even in quiet mode.
They are now replaced by a simple line and still visible in verbose mode.
Fixes: ab64f5df80 ("app/test: support resources externally linked")
Fixes: 66819e6c11 ("app/test: support resources archived by tar")
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Call rte_pdump_init and rte_pdump_uninit for packet
capturing initialization and uninitialization.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
The new pdump tool is added for packet capturing on dpdk.
This tool runs as secondary process by default.
Tool facilitates the command line options like
port, device_id, queue which user should pass on
to the tool to request the packet capture on those devices.
Tool creates the rte ring, mempool and pcap vdev and
calls the enable API of the pdump library with port/device_id,
queue, ring and mempool as arguments to enable the packet
capture on specific devices and gets the packets from the
primary process over the ring. Once the packets are
received, those packets will be send to the pcap vdev.
Tool can be terminated by using ctrl+c(SIGINT) upon which tool
calls the disable API of the pdump library to disable the packet capture
and dequeues the rest of the packets from the ring and sends them on
to the pcap vdev, then after releases all allocated resources.
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
The current extended ethernet statistics fetching involve doing several
string operations, which causes performance issues if there are lots of
statistics and/or network interfaces. This patch changes the test-pmd
and proc_info applications to use the new xstats API, and removes
deprecated code associated with the old API.
Signed-off-by: Remy Horton <remy.horton@intel.com>
Calling rte_eth_dev_rss_hash_update without checking return value.
Fixed by handle return value and print out error status.
Coverity issue: 119251
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch show topology at forwarding start.
"show config fwd" also does this, but showing it directly can reduce the
possibility of misconfiguration.
Currently fwd_config_display() calls fwd_config_setup(), this misleading
behavior will be fixed in other patches.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch removes constraints in rxq handling when multiqueue is enabled
to handle all the rxqs.
Current testpmd forces a dedicated core for each rxq, some rxqs may be
ignored when core number is less than rxq number, and that causes confusion
and inconvenience.
One example: an engineer was doing multiqueue test, there're 2
ports in guest each with 4 queues, and testpmd was used as the forwarding
engine in guest, as usual he used 1 core for forwarding, as a results he
only saw traffic from port 0 queue 0 to port 1 queue 0, then a lot of
emails and quite some time are spent to root cause it, and of course it's
caused by this unreasonable testpmd behavior.
Moreover, even if we understand this behavior, if we want to test the
above case, we still need 8 cores for a single guest to poll all the
rxqs, obviously this is too expensive.
We met quite a lot cases like this, one recent example:
http://openvswitch.org/pipermail/dev/2016-June/072110.html
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch adds throughput numbers (in the period since last use of this
command) in port statistics display for "show port stats (port_id|all)".
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch enables configurable tx_first burst number.
Use "start tx_first (burst_num)" to specify how many bursts of packets to
be sent before forwarding start, or "start tx_first" like before for the
default 1 burst send.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This patch adds retry option in testpmd to prevent most packet losses.
It can be enabled by "set fwd <mode> retry". All modes except rxonly
support this option.
Adding retry mechanism expands test case coverage to support scenarios
where packet loss affects test results.
Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>