Commit Graph

2121 Commits

Author SHA1 Message Date
Konstantin Ananyev
6bba97cb6f test/crypto: add CPU crypto mode for AESNI MB
This patch adds ability to run unit tests in cpu crypto mode
for AESNI MB cryptodev.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-19 17:15:14 +02:00
Pablo de Lara
042bb56544 test/crypto: fix flag check
An incorrect flag check was done, using "&&" instead of "&".

Fixes: 2717246ecd ("cryptodev: replace mbuf scatter gather flag")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-04-19 17:15:14 +02:00
Anatoly Burakov
4a5a867844 test/malloc: add bad parameter tests for realloc
Realloc did not have bad parameter autotest. Add them.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
2020-04-21 14:57:40 +02:00
Anatoly Burakov
dd46777794 test/malloc: run realloc tests on external heap
Due to the fact that the rte_realloc() test depends on the layout of
underlying memory, it can sometimes fail due to fragmentation of the
memory. To address this, make it so that the realloc autotests are run
using a newly created external memory heap instead of main memory.

Bugzilla ID: 424

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
2020-04-21 14:57:40 +02:00
Konstantin Ananyev
7c5e68cb26 test/ring: add functional tests for new sync modes
Extend test_ring_autotest with new test-cases for RTS/HTS sync modes.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-04-21 12:52:55 +02:00
Konstantin Ananyev
582581d578 test/ring: add stress test for MT peek API
Introduce new test case to test MT peek API.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-04-21 12:52:55 +02:00
Konstantin Ananyev
1cf65e4341 test/ring: add contention stress test for HTS ring
Introduce new test case to test HTS ring mode under contention.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-04-21 12:52:55 +02:00
Konstantin Ananyev
a9e23c7f0b test/ring: add contention stress test for RTS ring
Introduce new test case to test RTS ring mode under contention.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-04-21 12:52:55 +02:00
Konstantin Ananyev
ebff988d0c ring: prepare ring to allow new sync schemes
To make these preparations two main things are done:
- Change from *single* to *sync_type* to allow different
  synchronisation schemes to be applied.
  Mark *single* as deprecated in comments.
  Add new functions to allow user to query ring sync types.
  Replace direct access to *single* with appropriate function call.
- Move actual rte_ring and related structures definitions into a
  separate file: <rte_ring_core.h>. It allows to refer contents
  of <rte_ring_elem.h> from <rte_ring.h> without introducing a
  circular dependency.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-04-21 11:34:09 +02:00
Konstantin Ananyev
bf28df24e9 test/ring: add contention stress test
Introduce stress test for ring enqueue/dequeue operations.
Performs the following pattern on each slave worker:
dequeue/read-write data from the dequeued objects/enqueue.
Serves as both functional and performance test of ring
enqueue/dequeue operations under high contention
(for both over committed and non-over committed scenarios).

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-04-21 11:34:09 +02:00
Thomas Monjalon
f2fc83b40f replace unused attributes
There is a common macro __rte_unused, avoiding warnings,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:30:58 +02:00
Thomas Monjalon
33011cb3df replace always-inline attributes
There is a macro __rte_always_inline, forcing functions to be inlined,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:16:46 +02:00
Thomas Monjalon
ef5baf3486 replace packed attributes
There is a common macro __rte_packed for packing structs,
which is now used where appropriate for consistency.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-04-16 18:16:46 +02:00
Suanming Mou
fc202a6f2a bitmap: add init with all bits set
Currently, in the case to use bitmap as resource allocator, after
bitmap creation, all the bitmap bits should be set to indicate the
bit available. Every time when allocate one bit, search for the set
bits and clear it to make it in use.

Add a new rte_bitmap_init_with_all_set() function to have a quick
fill up the bitmap bits.

Comparing with the case create the bitmap as empty and set the bitmap
one by one, the new function costs less cycles.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-04-15 16:10:12 +02:00
Thomas Monjalon
5f1a4a8a12 test: remove meson dependency on /proc file
Meson is detecting the path /proc/sys/vm/nr_hugepages in the call to cat
in app/test/meson.build and then adding it as a build dependency.
This causes build loop if the timestamp of this file keeps changing.

It is fixed by hiding hugepage check in a shell script.

Fixes: 77784ef0fb ("test: allow no-huge mode for fast-tests")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2020-04-15 15:45:24 +02:00
Pavan Nikhilesh
9fdc9986cf app/eventdev: validate producer type
Validate the producer type used for pipeline and order test suites.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-04-04 17:11:23 +02:00
Pavan Nikhilesh
acec04c4b2 build: disable experimental API check internally
Remove setting ALLOW_EXPERIMENTAL_API individually for each Makefile and
meson.build. Instead, enable ALLOW_EXPERIMENTAL_API flag across app, lib
and drivers.
This changes reduces the clutter across the project while still
maintaining the functionality of ALLOW_EXPERIMENTAL_API i.e. warning
external applications about experimental API usage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-04-14 16:22:34 +02:00
Nagadheeraj Rottela
2a41db7589 crypto/nitrox: support 3DES-CBC
This patch adds 3DES CBC mode cipher algorithm.

Signed-off-by: Nagadheeraj Rottela <rnagadheeraj@marvell.com>
2020-04-05 18:40:34 +02:00
Nicolas Chautru
d793a6f401 app/bbdev: update test vectors
Modification to vectors parameters used for unit test
for coverage and performance test of bbdev drivers
across all devices.
Updating and reducing list for focused coverage on relevant
code blocks for 4G and 5G. Less focus on 4G TB mode as there is
some question how to best support this with mbuf limitations and
if effect are not used.
Removing scenarios with negative LLR assumptions which are not
used with any PMDs and historical only.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Nicolas Chautru
6e024c4b91 app/bbdev: support offload test for LDPC
Adding support for the offload latency tests when
using the LDPC encoder and decoder operations.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Nicolas Chautru
f162c47533 app/bbdev: support LDPC interrupt test
Adding missing implementation for the interrupt tests
for LDPC encoder and decoders.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Nicolas Chautru
f41c6e4d39 app/bbdev: add performance tests
Includes support for BLER (Block Error Rate) wireless
performance test with new arguments for SNR and number
of iterations for 5G. This generates LLRs for a given
SNR level then measures the ratio of code blocks being
successfully decoded or not.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Nicolas Chautru
335c11fd27 app/bbdev: support HARQ validation
Adding functionality to validate HARQ for different
devices implementation.
Adding capacity to fetch HARQ data when required as
part of this validation.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Nicolas Chautru
9f17582c7c app/bbdev: rename FPGA LTE macros to be more explicit
Self-contained and cosmetic renaming of macro
so that to be more explicit for future extension.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Nicolas Chautru
31a7853d1e baseband/turbo_sw: support large size code block
This is to support cases when the input data for
decoding a code block is larger than 64kB and would
not fit as a contiguous block of data into one
mbuf. In that case the length from the operation
supersedes the mbuf default structure.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-04-05 18:26:04 +02:00
Arek Kusztal
305de56097 test/crypto: add AES-GCM J0 case
This patch adds crypto J0 test case to AES-GCM

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-04-05 18:26:04 +02:00
Ruifeng Wang
40a49a89d7 test/ipsec: fix crash in session destroy
Segfault was observed when running ipsec unit test:

 + TestCase [10] : test_ipsec_replay_inb_repeat_null_null_wrapper
                   succeeded
 + TestCase [11] : test_ipsec_replay_inb_inside_burst_null_null_wrapper
                   succeeded
 + TestCase [12] : test_ipsec_crypto_inb_burst_2sa_null_null_wrapper
                   succeeded
 + TestCase [13] : test_ipsec_crypto_inb_burst_2sa_4grp_null_null_wrapper
                   succeeded
Segmentation fault

Data corruption happens due to incorrect destroy of session. Security
session needs process different from crypto session.

Destroy corresponding sessions according to different security actions.

Fixes: 05fe65eb66 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-04-05 18:26:04 +02:00
Mairtin o Loingsigh
09e72e8499 test/crypto: add AES-256 DOCSIS test vectors
This patch adds test vectors for AES-256 and sets QAT as the
target PMD.

Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-04-05 18:26:04 +02:00
Vladimir Medvedkin
dc38ae8d08 app/test-fib: add in default build
Build test-fib application.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-04-10 11:38:02 +02:00
Vladimir Medvedkin
8cd3ef5635 app/test-fib: get rid of libresolv dependency
Get rid of using inet_net_pton(). Implement it internally in the app.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-04-10 11:38:02 +02:00
Vladimir Medvedkin
d19034ae63 app/test-fib: fix 32-bits build
Change format for uint64_t to %"PRIu64" to make compiler happy.

Fixes: 103809d032 ("app/test-fib: add test application for FIB")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-04-10 11:37:57 +02:00
Vladimir Medvedkin
f1caf7f859 app/test-fib: fix possible use of uninitialized data
Compiler can throw warning message for routes and lookup files.

Fixes: 103809d032 ("app/test-fib: add test application for FIB")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-04-10 11:06:49 +02:00
Yunjian Wang
ffcf831454 kvargs: fix buffer overflow when parsing list
When the input string is "key=[", the ending '\0' is replaced
by a ',', leading to a heap buffer overflow.

Check the content of ctx1 to avoid this problem.

Fixes: cc0579f233 ("kvargs: support list value")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-03-27 17:03:46 +01:00
Olivier Matz
4bf2b36fd1 test/kvargs: fix invalid cases check
The return was not properly placed, and only the first test case
was validated.

Fixes: e495f54355 ("kvargs: add test case in app/test")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-03-27 17:03:43 +01:00
Olivier Matz
55fa01f7ed test/kvargs: fix to consider empty elements as valid
Empty elements passed to the kvargs parser are silently
ignored. Examples of valid strings:
  ""
  ","
  ",,,,,,key=val,,,,"

Fix the unit tests to conform to this behavior.

Note: the test_invalid_kvargs() function is currently broken, which
explain why the tests were not failing. It is fixed in the next commit.

Fixes: e495f54355 ("kvargs: add test case in app/test")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2020-03-27 17:03:31 +01:00
Ruifeng Wang
77784ef0fb test: allow no-huge mode for fast-tests
In environments where hugepage are not available, such as
containers, many cases in fast-tests suite should also run
if no-huge EAL option is used.

Flag is appended to each case in fast-tests suite to indicate
whether it lives with no-huge mode.
With the flag, fast-tests suite can be generated based on
detected hugepage availability of building environment.
All cases will be valid if hugepage is available, whereas
only applicable cases will be added if environment has no
hugepage support.

Suggested-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-03-24 11:14:25 +01:00
Ruifeng Wang
27fb5dd285 test: skip some subtests in no-huge mode
When running with '--no-huge' flag, tests failed with messages as:
    ACL context creation with invalid NUMA should have failed!
    fbk hash creation should have failed
    test_table_pipeline: Check pipeline invalid params failed.

These cases test against invalid socket ID as input parameter, and
expect error return. But function calls return success because
invalid sock ID is overwritten to SOCKET_ID_ANY when in no-huge mode.

The tests against invalid socket ID are skipped in no-huge mode.

Fixes: 5640171c52 ("malloc: fix external heap allocation in no-huge mode")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2020-03-24 11:14:22 +01:00
David Marchand
7d0c2354a5 test: load drivers when required
Concatenating to test_args if event_eth_tx_adapter_autotest is executed
makes all subsequent tests inherit from the drivers loading while this
is unneeded.

Fixes: 207b1c813f ("test: fix build without ring PMD")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2020-03-24 08:37:21 +01:00
Xiao Zhang
ecbc857013 ethdev: add PFCP header to flow API
This patch adds the new flow item RTE_FLOW_ITEM_TYPE_PFCP to flow API to
match a PFCP header.
Add sample PFCP rules for testpmd guide. Since Session Endpoint
Identifier (SEID) only will be present in PFCP Session header and PFCP
Session headers shall be identified when the S field is equal to 1, when
create rules for PFCP Session header with certain SEID the S field need
be set 1.

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-03-18 10:21:42 +01:00
Xiao Zhang
573ef95dc7 app/testpmd: parse flow command line for AH
Add AH and AH SPI to testpmd rte flow command line.
Add note and sample AH rules in testpmd guide.

Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-03-18 10:21:41 +01:00
Timothy Redaelli
20c1854f07 app/pipeline: fix build with gcc 10
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: 48f31ca50c ("app/pipeline: packet framework benchmark")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-03-04 10:19:02 +01:00
Timothy Redaelli
53ba646a0a test: fix build with gcc 10
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: 08e0c75814 ("test/fib: add performance autotests")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-03-04 10:11:07 +01:00
Hemant Agrawal
08ab4769c2 add top-level SPDX license tag
This patch adds top level SPDX license identifiers for some of the DPDK
source and scripts, where the copyright owners have not yet agreed to
replace the full BSD-3 license plate.

This patch also add SPDX license tag for a file with no
previous license plates. (DPDK is BSD-3)

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-02-22 16:11:53 +01:00
Hariprasad Govindharajan
7eeda4d55a app/testpmd: fix return of port list parser
The function parse_port_list() is designed to return
unsigned int value. After sanitizing the inputs,
it is returning -1. Changed it to return 0.

Fixes: 2df00d562d ("app/testpmd: add --portlist option")

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-21 11:41:21 +01:00
Wisam Jaddo
f1cfa5687f app/testpmd: fix identifier size for port attach
Identifier for new port may contain white list options,
and white list options will not fit into 128 from STR_TOKEN_SIZE,
instead having 4096 char from STR_MULTI_TOKEN_SIZE will provide
better and more options

Fixes: edab33b1c0 ("app/testpmd: support port hotplug")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2020-02-21 11:41:20 +01:00
Ferruh Yigit
5e4154cec4 app/testpmd: guarantee port array access in range
Coverity complains about out of bound access, which is a false positive.

The return value of the 'parse_port_list()' can't be bigger than
'maxsize' because of the logic in the function. ('value >= (int)maxsize'
check and 'marked[]' usage.)

But this is not explicitly clear, causing coverity warning and same
question can be rise by reviews later.

Adding a redundant check to highlight the access is in range, this is
done by replacing existing redundant check.

This is also good to protect against out out bound access in case
'parse_port_list()' behaviour changes later unexpectedly.

Coverity issue: 354229
Fixes: 2df00d562d ("app/testpmd: add --portlist option")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2020-02-19 15:40:24 +01:00
Thomas Monjalon
e162f1a751 test/ipsec: fix a typo in function name
The name of the static function check_cryptodev_capablity()
is fixed for the word "capability".
There is no functional change.

The same typo is fixed in a comment in ip_fragmentation example.

Fixes: 05fe65eb66 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-02-20 11:16:46 +01:00
Thomas Monjalon
8aca7abd93 app/crypto-perf: use common macros for min/max
The macros RTE_MIN and RTE_MAX can be used in DPDK applications.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-20 11:16:46 +01:00
Vladimir Medvedkin
103809d032 app/test-fib: add test application for FIB
Introduce new application to provide user to evaluate and perform
custom functional and performance tests for FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2020-02-16 19:31:09 +01:00
Reshma Pattan
207b1c813f test: fix build without ring PMD
Some unit tests has dependency on RING PMD,
so this patch is trying to fix those and other
closely related issues.

1)pdump, latency, bitrate, ring PMD and test_event_eth_tx_adapter
unit tests are dependent on ring PMD, so compile those
tests only when ring PMD is enabled else ignore.

2)get rid of make file error which was added by bond unit test
for ring PMD disabled case which is not necessary.

3)Tx adapter UT is dependent on RING PMD, but it was
observed that it was missing from the run in meson
build, so added it. TX adapter UT uses 'sw event and
'null' pmd drivers, so for shared builds the drivers .so
path has to be passed to the test args of meson UT run.

Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library")
Fixes: fdeb30fa71 ("test/bitrate: add unit tests for bitrate library")
Fixes: 1e3676a06e ("test/latency: add unit tests for latencystats library")
Fixes: 46cf97e4bb ("eventdev: add test for eth Tx adapter")
Fixes: d23e09e0ef ("app/test: link with ring pmd when needed")
Cc: stable@dpdk.org

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Nikhil Rao <nikhil.rao@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
2020-02-16 19:08:53 +01:00
Pavan Nikhilesh
0d4ba74965 app/eventdev: fix pipeline test with meson build
Add missing pipeline test to meson build.

Fixes: 2ff67267b0 ("app/eventdev: build with meson")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-02-15 08:50:35 +01:00
Wei Hu (Xavier)
150c9ac2df app/testpmd: update Rx offload after setting MTU
Currently, Rx offload capabilities and max_rx_pkt_len in the struct
variable named rte_port are not updated after setting mtu successfully
in port_mtu_set function by 'port config mtu <port_id> <value>' command.
This may lead to reconfig mtu to the initial value in the driver when
recalling rte_eth_dev_configure API interface.

This patch updates Rx offload capabilities and max_rx_pkt_len after
setting mtu successfully when configuring mtu.

Fixes: ae03d0d18a ("app/testpmd: command to configure MTU")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-14 12:42:13 +01:00
Thomas Monjalon
0654d4a8ad app/testpmd: fix hot-unplug detaching
There is a possible race condition in the hotplug path
in rmv_port_callback(). If a port is created between
close_port(port_id) and detach_port_device(port_id),
then the port_id will have been reallocated to a different
device which will be wrongly detached.

Since a check was added in detach_port_device() for
manual detach case, the hotplug path was even more broken.
It became impossible to run because the new check prevented
to run detach_port_device() after the port is closed.

The solution for both issues is to not rely on the port_id
for detaching the rte_device.
The function detach_port_device() is split to allow calling
detach_device() directly with the rte_device pointer, saved
before closing the port.

Fixes: 43d0e30498 ("app/testpmd: fix invalid port detaching")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-14 12:42:13 +01:00
Thomas Monjalon
5edee5f6da app/testpmd: rename function for detaching by devargs
There is a function detach_port_device() which takes a port_id,
and a function detach_device() which takes a devargs string.
In order to add a third function accepting a rte_device pointer,
the function detach_device() is renamed into detach_devargs().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-14 12:42:13 +01:00
Thomas Monjalon
c8743d5f15 app/testpmd: add port check before manual detach
User may try to run "port detach <port_id>"
for an already detached device.
It has been decided to protect from such usage in testpmd,
so a check was added to detach_port_device() in DPDK 19.11.
This check might be removed to allow hotplug path detaching
the device of a closed port.
Whatever will be decided in future, this check is also added
before the call to detach_port_device().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-14 12:42:13 +01:00
Hariprasad Govindharajan
2df00d562d app/testpmd: add --portlist option
In current version, we are setting the ports
using portmask. With portmask, we can use only
up to 64 ports. This portlist option enables the user
to use more than 64 ports.
Now we can specify the ports in 2 different ways
 - Using portmask (-p [0x]nnn): mask must be in hex format
 - Using portlist in the following format
 --portlist <p1>[-p2][,p3[-p4],...]

 --portmask 0x2 is same as --portlist 1
 --portmask 0x3 is same as --portlist 0-1

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
2020-02-14 12:42:12 +01:00
Viacheslav Ovsiienko
0eb89ba9f4 app/testpmd: fix txonly flow generation entropy
The testpmd application in txonly forwarding mode has an option
to generate the packet flows by varying the destination IP address.
The patch increments the IP for each packet sent, this improves
the entropy and RSS distribution on the peer receiving size
is getting more uniform.

Fixes: 01b645dcff ("app/testpmd: move txonly prepare in separate function")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-14 12:42:12 +01:00
Marcin Smoczynski
2a9f232ce6 test/crypto: add CPU crypto mode cases
This patch adds ability to run unit tests in cpu crypto mode for AESNI
GCM cryptodev.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-13 12:41:21 +01:00
Artur Trybula
1692bc53df test/compress: replace test vector
This patch replaces an existing test vector with a new one containing
public domain text only. This is to avoid any potential issues
re-licensing content as BSD-3 which has no clear original license.

Fixes: b06aa643ca ("test/compress: add initial unit tests")
Cc: stable@dpdk.org

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
2020-02-13 12:41:04 +01:00
Thomas Monjalon
80139e3549 fix Mellanox copyright and SPDX tag
Mellanox owns Tilera and EZchip, so the copyrights can be converted.
At the same time, the license header is switched to SPDX tag format,
and a typo is fixed in another copyright line.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-02-13 18:47:28 +01:00
Konstantin Ananyev
e33afed904 test/acl: add 32-bit range test case
Add new test-case to improve test coverage for 32-bit range fields.

Suggested-by: Ido Goshen <ido@cgstowernetworks.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-02-13 14:43:56 +01:00
Thomas Monjalon
43e34a229d build: remove redundant config include
The header file rte_config.h is always included by make or meson.
If required in an exported API header file, it must be included
in the public header file for external applications.
In the internal files, explicit include of rte_config.h is useless,
and can be removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2020-02-11 16:50:59 +01:00
Viacheslav Ovsiienko
5d3e7176ee test/mbuf: check pinned external buffer
This patch adds unit test for the mbufs allocated from
the special pool with pinned external data buffers.

The pinned buffer mbufs are tested in the same way as
regular ones with taking into account some specifics
of cloning/attaching.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-02-06 16:17:14 +01:00
Stephen Hemminger
ab30f26aaa app/pdump: fix build with clang
Clang checks indentation and found incorrect indentation in pdump.

app/pdump/main.c:598:3: error: misleading indentation;
statement is not part of the previous 'if'
[-Werror,-Wmisleading-indentation]

Fixes: caa7028276 ("app/pdump: add tool for packet capturing")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-02-06 09:20:56 +01:00
Thomas Monjalon
c886f4263a mk: ignore missing field initializers warning
Three warnings are commonly disabled in DPDK with make and meson:
	* address-of-packed-member
		always disabled
	* missing-field-initializers
		disabled with meson
		disabled with make + clang or make + gcc < 4.7
		disabled with make + gcc <= 5 for test files and event drivers
	* packed-not-aligned
		disabled with meson

This change is removing exceptions for missing-field-initializers.
As it is always disabled, some redundant configs are cleaned up.

Now the situation is:
	* address-of-packed-member
		always disabled
	* missing-field-initializers
		always disabled
	* packed-not-aligned
		disabled with meson

It could alternatively be decided to disable missing-field-initializers
only for old gcc (< 6).

The warning packed-not-aligned is not modified in this change.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-06 09:09:37 +01:00
Artur Trybula
2695db95a1 test/compress: add cycle-count mode to perf tool
This commit adds cycle-count mode to the compression perf tool.
The new mode enhances the compression performance tool to allow
cycle-count measurement of both hardware and softwate PMDs.

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-02-05 15:20:51 +01:00
Adam Dybkowski
a7cfae49fd test/crypto: refactor unit tests into one combined array
This patch refactors most of unit tests to be contained in one
combined array, and run depending on the PMD capabilities instead of
providing multiple array with tests for individual PMDs.
Only a subset of unit tests was merged into one array - it combines
all tests originally meant to be run on these PMDs:
null, aesni_mb, aesni_gcm, openssl, qat, sw_snow3g, sw_kasumi, sw_zuc.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-05 15:20:51 +01:00
Adam Dybkowski
8a7e5aaf60 test/crypto: add capability checks
This patch adds capability checks to many tests meant to be run
in the future on various PMDs. This way the code is prepared for
more thorough refactoring in order to create one big central
unit tests array.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-05 15:17:36 +01:00
Adam Dybkowski
842aade2aa test/crypto: refactor unit tests
This patch gets rid of individual functions that all call
test_blockcipher_all_tests separately for every PMD and instead
provides just one set universal for all PMDs that's basing on the
driver id from the global variable gbl_driver_id.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-02-05 15:17:36 +01:00
Wei Hu (Xavier)
8a43329728 app/testpmd: fix uninitialized members when setting PFC
Only a part of members in the local structure variable named pfc_conf
are initialized in the function named cmd_priority_flow_ctrl_set_parsed
when typing "set pfc_ctrl..." command, and others are random values.
However, those uninitialized members may cause failure.

This patch adds clearing zero operation before calling the API named
rte_eth_dev_priority_flow_ctrl_set API with pfc_conf as the input
parameter.

Fixes: 9b53e542e9 ("app/testpmd: add priority flow control")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-05 09:51:21 +01:00
Wei Hu (Xavier)
3b687ec6e1 app/testpmd: fix initial value when setting PFC
Currently, the initial values of the local structure variable named
rx_tx_onoff_2_lfc_mode and rx_tx_onoff_2_pfc_mode are different in the
similar part of these two following functions:
	cmd_link_flow_ctrl_set_parsed
	cmd_priority_flow_ctrl_set_parsed
1) The code snippset in cmd_link_flow_ctrl_set_parsed function:
	static enum rte_eth_fc_mode rx_tx_onoff_2_lfc_mode[2][2] = {
	    {RTE_FC_NONE, RTE_FC_TX_PAUSE}, {RTE_FC_RX_PAUSE, RTE_FC_FULL}
	};

	if (!cmd || cmd == &cmd_link_flow_control_set_rx)
		rx_fc_en = (!strcmp(res->rx_lfc_mode, "on")) ? 1 : 0;
	if (!cmd || cmd == &cmd_link_flow_control_set_tx)
		tx_fc_en = (!strcmp(res->tx_lfc_mode, "on")) ? 1 : 0;

	fc_conf.mode = rx_tx_onoff_2_lfc_mode[rx_fc_en][tx_fc_en];
	<...>
	ret = rte_eth_dev_flow_ctrl_set(res->port_id, &fc_conf);
	<...>
2) The code snippset in cmd_priority_flow_ctrl_set_parsed function:
	static enum rte_eth_fc_mode rx_tx_onoff_2_pfc_mode[2][2] = {
	    {RTE_FC_NONE, RTE_FC_RX_PAUSE}, {RTE_FC_TX_PAUSE, RTE_FC_FULL}
	};

	rx_fc_enable = (!strncmp(res->rx_pfc_mode, "on",2)) ? 1 : 0;
	tx_fc_enable = (!strncmp(res->tx_pfc_mode, "on",2)) ? 1 : 0;
	pfc_conf.fc.mode =
		 rx_tx_onoff_2_pfc_mode[rx_fc_enable][tx_fc_enable];
	<...>
	ret = rte_eth_dev_priority_flow_ctrl_set(res->port_id, &pfc_conf);
	<...>
The initial value of rx_tx_onoff_2_pfc_mode is wrong, it should be the
same as rx_tx_onoff_2_lfc_mode.

Fixes: 9b53e542e9 ("app/testpmd: add priority flow control")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-05 09:51:21 +01:00
Ori Kam
bd164530ec app/testpmd: fix copy of dynamic flag name
When working with testpmd and setting the dynflag name, we copy the
name given by the cmd to the dynflag name.

The issue is that the size of the dynflag name is smaller then the
string used by testpmd.

This commit solves this issue by checking that the length of the requested
flag name is not too long.

Coverity issue: 353610
Fixes: b57b66a97e ("app/testpmd: support mbuf dynamic flag")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2020-02-05 09:51:21 +01:00
Ori Kam
56d5c1eedf app/testpmd: fix uninitialized members of MPLS
Some of the members of the MPLS struct are not initialized.
This commit init the uninitialized members.

Coverity issue: 325735
Fixes: 3e77031be8 ("app/testpmd: add MPLSoGRE encapsulation")
Cc: stable@dpdk.org

Signed-off-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-05 09:51:21 +01:00
Stephen Hemminger
8d7c19d9e4 app/testpmd: fix RFC addresses for Tx only
The previous patch to change default IP addresses for tx only
mode got the wrong values (typo).

Fixes: bf5b2126bf ("app/testpmd: add ability to set Tx IP and UDP parameters")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-02-05 09:51:20 +01:00
Honnappa Nagarahalli
2cc1d7b40f test/hash: move lock-free tests to perf tests
Move reader writer lock free tests to performance tests.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-02-05 19:42:24 +01:00
Honnappa Nagarahalli
03a0ed1a59 test/hash: add lock-free functional tests
Add lock-free reader writer concurrency functional tests.
These tests will provide the same coverage that non lock-free
APIs have.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-02-05 19:42:24 +01:00
Amit Gupta
f6208425eb test/hash: split into shorter subtests
hash_readwrite test was taking too much time to complete in Travis.
Test is split into functional and perf test.
perf test is being moved under perf testsuites in meson.

Signed-off-by: Amit Gupta <agupta3@marvell.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2020-02-05 19:42:24 +01:00
Thomas Monjalon
f5862ae99e cryptodev: revert Chacha20-Poly1305 AEAD algorithm
API makes think that rte_cryptodev_info_get() cannot return
a value >= 3 (RTE_CRYPTO_AEAD_LIST_END in 19.11).
20.02-rc1 was returning 3 (RTE_CRYPTO_AEAD_CHACHA20_POLY1305).
So the ABI compatibility contract was broken.

It could be solved with some function versioning,
but because a lack of time, the feature is reverted for now.

This reverts following commits:
- 6c9f3b347e ("cryptodev: add Chacha20-Poly1305 AEAD algorithm")
- 2c512e64d6 ("crypto/qat: support Chacha Poly")
- d55e01f579 ("test/crypto: add Chacha Poly cases")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2020-02-05 15:14:46 +01:00
Pavan Nikhilesh
71bdd8a178 app: use common macro RTE_DIM
Use RTE_DIM macro to calculate array size.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2020-02-05 14:37:41 +01:00
Viacheslav Ovsiienko
72512e1897 app/testpmd: add mempool with external data buffers
The new mbuf pool type is added to testpmd. To engage the
mbuf pool with externally attached data buffers the parameter
"--mp-alloc=xbuf" should be specified in testpmd command line.

The objective of this patch is just to test whether mbuf pool
with externally attached data buffers works OK. The memory for
data buffers is allocated from DPDK memory, so this is not
"true" external memory from some physical device (this is
supposed the most common use case for such kind of mbuf pool).

The user should be aware that not all drivers support the mbuf
with EXT_ATTACHED_BUF flags set in newly allocated mbuf (many
PMDs just overwrite ol_flags field and flag value is getting
lost).

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-01-20 23:37:49 +01:00
Bruce Richardson
599d67b6a4 app/test: remove meson dependency on file in /sys
Meson versions 0.52 and 0.53 are being overly smart and detecting the path
"/sys/devices/system/cpu/present" in the call to cat in
app/test/meson.build and then adding it as a dependency to the build
configuration. This causes issues on systems where the timestamp of that
file always returns the current time, since it means that the build.ninja
file is always out of date, and therefore needs to be rebuilt.

We can fix this by just using a simple shell script to return the coremask
appropriately for BSD and Linux, and removing that code logic from meson -
thereby hiding the use of the /sys file.

Fixes: c70622ac6f ("test: detect number of cores with meson")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2020-01-20 16:37:27 +01:00
Xueming Li
1e8a4e97b0 app/testpmd: add flow dump command
New flow dump CLI to dump device internal representation information
of flows into screen.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-01-17 19:59:19 +01:00
Dekel Peled
47e7ad1b91 app/testpmd: support GTP message type
This patch adds CLI option to enter the msg_type value for GTP
flow pattern item.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-01-17 19:59:19 +01:00
Ori Kam
b57b66a97e app/testpmd: support mbuf dynamic flag
DPDK now supports registration of dynamic flags (dynf) to the mbuf.
dynf can be given any name, and can be used with a supporting PMD or
supporting application.

Due to the generic concept of the dynf, it is impossible and
meaningless, to define register set/get function for each flag.
This commit introduce a generic way to register and set/clear such
flags.

The basic syntax:
port config <port id> dynf <name> <set|clear>

The first step the new flag is registered. Regardless if the action is
set or clear.
There is no way to unregister the flag, after registering it.

The second step, if the action is set then we set the requested flag.
If this is the first flag that is enabled we also register a call back
for the Tx. In this call back we set the flag.
If the action is clear the requested flag is cleared, and if there
are no more flags that are set, the call back is removed.

The reason that the set is only applied in Tx is that in case of Rx
it is assumed that the value comes from the PMD.

If log is enabled the name of the flag, and value will be printed
in the packet info.
In order for the log to work correctly the registration of the flag
must be done before setting verbose.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-01-17 19:59:19 +01:00
Bernard Iremonger
eda749cd22 app/testpmd: improve flow command debug
print function name in port_flow_complain()

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-01-17 19:59:18 +01:00
Bernard Iremonger
6a42e7ef9d app/testpmd: parse flow command line for ESP
add ITEM_ESP
add ITEM_ESP_SPI
update release notes for testpmd changes
add sample ESP rules in testpmd guide

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-01-17 19:59:18 +01:00
Rory Sexton
65388f4c4c ethdev: add L2TPv3 over IP header to flow API
This patch adds the new flow item RTE_FLOW_ITEM_TYPE_L2TPV3OIP to
flow API to match a L2TPv3 over IP header. This patch supports only
L2TPv3 over IP header format which is different to L2TPv2/L2TPv3
over UDP. The difference in header formats between L2TPv3 over IP
and L2TP over UDP require a separate implementation for each.

Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Signed-off-by: Dariusz Jagus <dariuszx.jagus@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-01-17 19:46:26 +01:00
Dekel Peled
dcd05da0ae app/testpmd: fix GENEVE flow item
Previous patch added support of GENEVE pattern item in flow rule.
Function flow_item_default_mask() was not updated, so using it with
GENEVE item returns null.
Using testpmd command "set raw_decap" or "set raw_encap" with
GENEVE item, without specifying any parameters, results in
segmentation fault.

This patch updates function flow_item_default_mask(),
adding case to handle GENEVE item.

Fixes: 0f4203fe9d ("app/testpmd: support GENEVE pattern item in flow rules")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-01-17 19:46:02 +01:00
Suanming Mou
8482ffe4b6 ethdev: add IPv4/IPv6 DSCP rewrite action
For some overlay network, such as VXLAN, the DSCP field in the new outer
IP header after VXLAN decapsulation may need to be updated accordingly.

This commit introduce the DSCP modify action for IPv4 and IPv6.

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
2020-01-17 19:46:02 +01:00
Stephen Hemminger
5e516c8983 app/testpmd: call cleanup on exit
The rte_eal_cleanup code is not exercised by testpmd which
is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can
be checked with tools like valgrind.

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2020-01-17 19:46:01 +01:00
Ciara Power
c11562a121 app/testpmd: fix device mcast list error handling
The multicast set list function now has a return value, which is checked
by the calling functions. A rollback occurs on detection of failure, to
realign local config with the device config.

The error print statement in the function had included the port_id and
mc_addr_nb values in the wrong order, these are now swapped.

Fixes: 8fff667578 ("app/testpmd: new command to add/remove multicast MAC addresses")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-01-17 19:45:23 +01:00
Kalesh AP
e1d44d0ad6 app/testpmd: show MAC addresses added to a port
Patch adds a runtime function to display the unicast and
multicast MAC addresses added to a port.

Syntax:
	show port (port_id) macs|mcast_macs

Usage:
testpmd> show port 0 macs
Number of MAC address added: 1
  B0:26:28:7F:F5:C1
testpmd>
testpmd> show port 0 mcast_macs
Number of Multicast MAC address added: 0
testpmd>
testpmd> mac_addr add 0 B0:26:28:7F:22:33
testpmd> mac_addr add 0 B0:26:28:7F:22:34
testpmd> show port 0 macs
Number of MAC address added: 3
  B0:26:28:7F:F5:C1
  B0:26:28:7F:22:33
  B0:26:28:7F:22:34
testpmd>
testpmd> mac_addr remove 0 B0:26:28:7F:22:33
testpmd> show port 0 macs
Number of MAC address added: 2
  B0:26:28:7F:F5:C1
  B0:26:28:7F:22:34

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-01-17 19:45:23 +01:00
Honnappa Nagarahalli
1fa5d0099e test/ring: add custom element size performance tests
Adjust the performance test cases to test rte_ring_xxx_elem APIs.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-01-19 19:32:50 +01:00
Honnappa Nagarahalli
a9fe152363 test/ring: add custom element size functional tests
Add basic infrastructure to test rte_ring_xxx_elem APIs.
Adjust the existing test cases to test for various ring
element sizes.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-01-19 19:32:50 +01:00
Honnappa Nagarahalli
542cf18b99 test/ring: use division for cycle count calculation
Use division instead of modulo operation to calculate more
accurate cycle count.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2020-01-19 19:23:20 +01:00
Arek Kusztal
d55e01f579 test/crypto: add Chacha Poly cases
This patch adds Chacha20-Poly1305 implementation to
cryptodev tests.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-01-16 17:11:27 +01:00
Adam Dybkowski
c6c267a00a test/crypto: add mixed encypted-digest
This patch adds unit tests for QAT PMD for mixed encrypted-digest
cases, involving SNOW3G UIA2, ZUC EIA3, AES CMAC and NULL auth
algorithms together with SNOW3G UEA2, ZUC EEA3, AES CTR and NULL
cipher algorithms in various combinations.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-01-15 16:45:04 +01:00
Sunila Sahu
f225c04008 test/crypto: add ECPM cases
Add test vectors and verify routines for
asymmetric operation, EC Point Multiplication.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
2020-01-15 15:01:55 +01:00
Ayuj Verma
d90e58a783 test/crypto: add ECDSA sign/verify cases
This patch adds ECDSA sign and verify test
routine and test vectors.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
2020-01-15 15:01:55 +01:00
Adam Dybkowski
b26ef1a11f test/crypto: fix missing operation status check
This patch adds checking of the symmetric crypto operation status
that was silently skipped before. It fixes the wireless algorithms
session creation (SNOW3G, KASUMI, ZUC) and passing of the digest
data for the verification by PMD. Also fixed the missing aad padding
issue revealed after op status checking was introduced.

Fixes: c0f87eb525 ("cryptodev: change burst API to be crypto op oriented")
Fixes: 77a217a19b ("test/crypto: add AES-CCM tests")
Cc: stable@dpdk.org

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Tested-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
2020-01-15 14:13:13 +01:00
Pavan Nikhilesh
e1a3ce20d8 test/event: fix OCTEON TX2 event device name
Fix octeontx2 event device name used in eventdevice test.

Fixes: 62561532ac ("event/octeontx2: add SSO selftest")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-15 12:06:05 +01:00
Pavan Nikhilesh
2155b9ca1a test/event: fix unintended vdev creation
Virtual eventdevice should only be created when there is no existing
device with the same name.

Fixes: e0f4a0ed42 ("test: skip tests when missing requirements")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-01-15 12:05:38 +01:00
David Marchand
30a0df64aa test/common: fix log2 check
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: 05c4345ef5 ("test: add unit test for integer log2 function")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2019-12-20 15:05:41 +01:00
Allain Legacy
749dc3e1f5 test/cfgfile: replace license text with SPDX tag
Replacing full license text with SPDX tag.

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2019-11-28 03:12:55 +01:00
Vladimir Medvedkin
0c6c8320f6 test/thash: replace license text with SPDX tag
Signed-off-by: Vladimir Medvedkin <medvedkinv@gmail.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-11-28 03:02:51 +01:00
Harry van Haaren
505a2b0c64 test/service: fix wait for service core
This commit fixes a sporadic failure of the service_autotest
unit test, as seen in the DPDK CI. The failure occurs as the main test
thread did not wait on the service-thread to return, and allowing it
to read a flag before the service was able to write to it.

The fix changes the wait API call to specific the service-core ID,
and this waits for cores with both ROLE_RTE and ROLE_SERVICE.

The rte_eal_mp_wait_lcore() call does not (and should not) wait
for service cores, so must not be used to wait on service-cores.

Fixes: f038a81e1c ("service: add unit tests")
Cc: stable@dpdk.org

Reported-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2019-11-27 21:23:17 +01:00
Pavan Nikhilesh
7392ad06f5 app/testpmd: use better randomness for Tx split
Use rte_rand() instead of random() for better randomness.

Coverity issue: 337666
Fixes: 79bec05b32 ("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-26 18:05:15 +01:00
David Marchand
9e6b36c34c app/testpmd: reduce memory consumption
Following [1], testpmd memory consumption has skyrocketted.
The rte_port structure has gotten quite fat.

struct rte_port {
[...]
  struct rte_eth_rxconf rx_conf[65536];            /* 266280 3145728 */
  /* --- cacheline 53312 boundary (3411968 bytes) was 40 bytes ago --- */
  struct rte_eth_txconf tx_conf[65536];            /* 3412008 3670016 */
  /* --- cacheline 110656 boundary (7081984 bytes) was 40 bytes ago --- */
[...]
  /* size: 8654936, cachelines: 135234, members: 31 */
[...]

testpmd handles RTE_MAX_ETHPORTS ports (32 by default) which means that it
needs ~256MB just for this internal representation.

The reason is that a testpmd rte_port (the name is quite confusing, as
it is a local type) maintains configurations for all queues of a port.
But where you would expect testpmd to use RTE_MAX_QUEUES_PER_PORT as the
maximum queue count, the rte_port uses MAX_QUEUE_ID set to 64k.

Prefer the ethdev maximum value.

After this patch:
struct rte_port {
[...]
  struct rte_eth_rxconf      rx_conf[1025];        /*  8240 49200 */
  /* --- cacheline 897 boundary (57408 bytes) was 32 bytes ago --- */
  struct rte_eth_txconf      tx_conf[1025];        /* 57440 57400 */
  /* --- cacheline 1794 boundary (114816 bytes) was 24 bytes ago --- */
[...]
  /* size: 139488, cachelines: 2180, members: 31 */
[...]

With this, we can ask for less memory in test-null.sh.

[1]: https://git.dpdk.org/dpdk/commit/?id=436b3a6b6e62

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-26 18:05:15 +01:00
Stephen Hemminger
149677c9a3 app/testpmd: fix memory leak on detach
The RTE_FOREACH_MATCHING_DEV iterator requires that
if a break is done before the end of the loop,
the function rte_eth_iterator_cleanup() must be called.

Fixes: 55e51c9624 ("app/testpmd: add device related commands")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-11-26 18:05:15 +01:00
Archana Muniganti
7f9816b9b2 app/crypto-perf: fix input of AEAD decrypt
In AEAD decrypt (verify mode), test data should point to
cipher text instead of plain text

Fixes: 5b2b0a740f ("app/crypto-perf: overwrite mbuf when verifying")
Cc: stable@dpdk.org

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-11-25 11:01:36 +01:00
Hemant Agrawal
6f23893285 test/event_crypto: fix check for HW support
When HW is available but the mode mismatches, it is better
to skip the test case.

Fixes: aa026482ba ("test/event_crypto: no service core when HW support available")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2019-11-26 07:49:31 +01:00
Hemant Agrawal
0b1e11b0b6 test/event_crypto: fix to avail mempool entries
Added the missed code to avail the mempool entries before
pool free.

Fixes: 24054e3640 ("test/crypto: use separate session mempools")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2019-11-26 07:49:31 +01:00
Hemant Agrawal
18d934cb51 test/event_crypto: fix missing IV for AES
The IV was not set, which was causing HW based SEC on DPAA1
to fail.

Fixes: b2196237eb ("test/event_crypto: change cipher algo")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2019-11-26 07:49:31 +01:00
Pavan Nikhilesh
a8d88bfbce app/eventdev: check function errors
Fix unchecked return values reported by coverity.

Coverity Issue: 336861
Coverity Issue: 349906
Fixes: 032a965a8f ("app/eventdev: support Tx adapter")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2019-11-26 07:49:31 +01:00
Pavan Nikhilesh
93b7794b83 app/eventdev: fix divide by zero
Fix possible divide by zero condition when calculating percentages.

Coverity issue: 277205
Coverity issue: 277234
Fixes: d008f20bce ("app/eventdev: add event timer adapter as a producer")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2019-11-26 07:49:31 +01:00
Stephen Hemminger
06710448c9 remove blank lines at end of file
Remove trailing blank lines. They serve no purpose and are just
editor leftovers.
These can cause git to complain about whitespace errors during merges.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2019-11-26 00:12:08 +01:00
Gavin Hu
1b32cc619b test/rcu: fix build for small number of cores
If the RTE_MAX_LCORE is less than 10, a compilation error is generated:
app/test/test_rcu_qsbr.c:234:10: error: comparison of integer
expressions of different signedness: ‘unsigned int’ and ‘int’
[-Werror=sign-compare]

The cause is (RTE_MAX_LCORE - 10) results in a negative value.

To fix, use rte_rand() to find a number between 0 and RTE_MAX_LCORE.

Fixes: b87089b0bb ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
2019-11-25 23:51:53 +01:00
Matan Azrad
43d0e30498 app/testpmd: fix invalid port detaching
The port was not validated before detaching.

Ignore port detach operation when the port is not valid.

Fixes: f8e5baa266 ("app/testpmd: check not detaching device twice")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-11-21 00:18:02 +01:00
David Marchand
8fad2e5ab2 app/testpmd: report invalid command line parameter
We currently do not check that a non option string has been passed to
testpmd.

Example:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
	--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
testpmd> show config fwd
io packet forwarding - ports=2 - cores=1 - streams=2 - NUMA support
enabled, MP allocation mode: native
Logical Core 1 (socket 0) forwards packets on 2 streams:
  RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
  RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00

Here nb-cores=2 is just ignored, while the (probably sleepy) user did not
notice this.

Validate that all strings passed to testpmd are part of a known option.

After this patch:
$ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
	--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
[...]
Invalid parameter: nb-cores=2
EAL: Error - exiting with code: 1
  Cause: Command line incorrect

While at it, when passing an unknown option, print the string that gets
refused by getopt_long to help the user.

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

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20 17:36:06 +01:00
Dekel Peled
d56ec3dcad app/testpmd: fix cleanup of Tx metadata offload
Commit in fixes tag removed the match_metadata Tx offload.
This patch removes the option to select this offload from testpmd
menu, help text and documentation.

It also modifies the cmd_show_tx_metadata_parsed() function, to
display the value correctly, and the dump_pkt_burst() function to
display the relevant (Tx/Rx) metadata only.

Fixes: 9bf26e1318 ("ethdev: move egress metadata to dynamic field")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-11-20 17:36:06 +01:00
Reshma Pattan
5fde1a7592 net: use IPV4 VHL constant
Use new macro RTE_IPV4_VHL_DEF instead of IP_VHL_DEF
wherever applicable.

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-20 17:36:06 +01:00
Akhil Goyal
b795e127e8 crypto/openssl: support in-place scatter gather
As per current support, Scatter Gather is only supported
for out of place input and output buffers.
This patch add support for Scatter Gather for in-place buffers.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2019-11-20 12:35:51 +01:00
Akhil Goyal
8fd2b5a60d app/crypto-perf: support PDCP
test-crypto-perf app is updated to calculate PDCP
throughput numbers.

2 new params are added for PDCP
--pdcp-sn-sz <5/7/12/15/18>
--pdcp-domain <control/user>

./dpdk-test-crypto-perf --master-lcore 0 -l 0,1 --log-level=8 --
--devtype crypto_dpaa2_sec --optype pdcp --cipher-algo aes-ctr
--cipher-op encrypt --auth-algo null --auth-op generate  --auth-key-sz
16 --ptest throughput --total-ops 100000 --burst-sz 64 --buffer-sz
64,390,1512  --pool-sz 4096 --silent --pdcp-sn-sz 12 --pdcp-domain
control

Signed-off-by: Manish Tomar <manish.tomar@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2019-11-20 12:35:51 +01:00
Krzysztof Kanas
18562261ab test: optimise fd closing in forks
Caught while investigating timeouts on a ARM64 server.

Stracing a test process running the eal_flags_autotest, we can see that
the fork helper is checking all possible file descriptors from
getdtablesize() to 2, and close the existing ones.
We can do better by inspecting this forked process /proc/self/fd
directory.

Besides, checking file descriptors via /proc/self/fd only makes sense for
Linux. This code was a noop on FreeBSD.

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

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Krzysztof Kanas <kkanas@marvell.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2019-11-15 09:35:20 +01:00
Stephen Hemminger
08a234788e cmdline: remove unnecessary #ifdef
The #ifdef to conditionally include <sys/socket.h> on BSD
is unnecessary. It is harmless to include the header on other
OS's. An extra include is better than an #ifdef.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-11-12 18:35:17 +01:00
Dekel Peled
4a72909224 app/testpmd: set maximum LRO packet size
This patch implements use of the API for LRO aggregated packet
max size.
It adds command-line and runtime commands to configure this value,
and adds option to show the supported value.
Documentation is updated accordingly.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-12 01:44:05 +01:00
Pavan Nikhilesh
b0a9354ae7 app/testpmd: disable packet type parsing by default
Disable packey type parsing on port init, user can enable ptype parsing
by issuing set ptype command.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-11 16:15:37 +01:00
Pavan Nikhilesh
e48491afb8 app/testpmd: add command to set supported packet types
Add command to set supported ptype mask.
Usage:
	set port <port_id> ptype_mask <ptype_mask>

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-11 16:15:37 +01:00
Pavan Nikhilesh
5d30897295 ethdev: add mbuf RSS update as an offload
Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf:#️⃣:rss`.
PMDs notify the validity of `rte_mbuf:#️⃣rss` to the application
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Also update testpmd rx_offload command to include RSS_HASH

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-11 16:15:36 +01:00
Stephen Hemminger
bd67b67724 app/testpmd: block xstats for hidden ports
All the other testpmd commands block access to devices that
are owned. Looks like xstat got overlooked.

Fixes: bfd5051b43 ("app/testpmd: new command to get extended statistics")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-11-11 14:23:02 +01:00
Ori Kam
1c69df45f8 app/testpmd: support hairpin
This commit introduce the hairpin queues to the testpmd.
the hairpin queue is configured using --hairpinq=<n>
the hairpin queue adds n queue objects for both the total number
of TX queues and RX queues.
The connection between the queues are 1 to 1, first Rx hairpin queue
will be connected to the first Tx hairpin queue

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-08 23:15:05 +01:00
Xiaoyu Min
2b4cd8ad5e app/testpmd: fix IP next proto in set raw decap/encap
The IP's next protocol will be specified by user when set IP-in-IP
tunnel header via set raw decap/encap commands.

Currently this field is wrongly set to zero if there is no upper layer.
This leads to the encapsulated IP-in-IP tunnel header is not correct.

This next protocol field should be leave it as-is if there is no upper
layer or value is already set.

Fixes: 30626def03 ("app/testpmd: support raw encap/decap actions")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2019-11-08 23:15:05 +01:00
Kiran Kumar K
fae9aa717d app/testpmd: support checking descriptor status
Adding support to check TX and RX descriptor status.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-11-08 23:15:05 +01:00
Viacheslav Ovsiienko
9bf26e1318 ethdev: move egress metadata to dynamic field
The dynamic mbuf fields were introduced by [1]. The egress metadata is
good candidate to be moved from statically allocated field tx_metadata to
dynamic one. Because mbufs are used in half-duplex fashion only, it is
safe to share this dynamic field with ingress metadata.

The shared dynamic field contains either egress (if application going to
transmit mbuf with tx_burst) or ingress (if mbuf is received with rx_burst)
metadata and can be accessed by RTE_FLOW_DYNF_METADATA() macro or with
rte_flow_dynf_metadata_set() and rte_flow_dynf_metadata_get() helper
routines. PKT_TX_DYNF_METADATA/PKT_RX_DYNF_METADATA flag will be set
along with the data.

The mbuf dynamic field must be registered by calling
rte_flow_dynf_metadata_register() prior accessing the data.

The availability of dynamic mbuf metadata field can be checked with
rte_flow_dynf_metadata_avail() routine.

DEV_TX_OFFLOAD_MATCH_METADATA offload and configuration flag is removed.
The metadata support in PMDs is engaged on dynamic field registration.

Metadata feature is getting complex. We might have some set of actions
and items that might be supported by PMDs in multiple combinations,
the supported values and masks are the subjects to query by perfroming
trials (with rte_flow_validate).

[1] http://patches.dpdk.org/patch/62040/

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-11-08 23:15:05 +01:00
Viacheslav Ovsiienko
e02ecc1324 ethdev: extend flow metadata
Currently, metadata can be set on egress path via mbuf tx_metadata field
with PKT_TX_METADATA flag and RTE_FLOW_ITEM_TYPE_META matches metadata.

This patch extends the metadata feature usability.

1) RTE_FLOW_ACTION_TYPE_SET_META

When supporting multiple tables, Tx metadata can also be set by a rule and
matched by another rule. This new action allows metadata to be set as a
result of flow match.

2) Metadata on ingress

There's also need to support metadata on ingress. Metadata can be set by
SET_META action and matched by META item like Tx. The final value set by
the action will be delivered to application via metadata dynamic field of
mbuf which can be accessed by RTE_FLOW_DYNF_METADATA() macro or with
rte_flow_dynf_metadata_set() and rte_flow_dynf_metadata_get() helper
routines. PKT_RX_DYNF_METADATA flag will be set along with the data.

The mbuf dynamic field must be registered by calling
rte_flow_dynf_metadata_register() prior to use SET_META action.

The availability of dynamic mbuf metadata field can be checked
with rte_flow_dynf_metadata_avail() routine.

If application is going to engage the metadata feature it registers
the metadata  dynamic fields, then PMD checks the metadata field
availability and handles the appropriate fields in datapath.

For loopback/hairpin packet, metadata set on Rx/Tx may or may not be
propagated to the other path depending on hardware capability.

MARK and METADATA look similar and might operate in similar way,
but not interacting.

Initially, there were proposed two metadata related actions:

- RTE_FLOW_ACTION_TYPE_FLAG
- RTE_FLOW_ACTION_TYPE_MARK

These actions set the special flag in the packet metadata, MARK action
stores some specified value in the metadata storage, and, on the packet
receiving PMD puts the flag and value to the mbuf and applications can
see the packet was threated inside flow engine according to the appropriate
RTE flow(s). MARK and FLAG are like some kind of gateway to transfer some
per-packet information from the flow engine to the application via
receiving datapath. Also, there is the item of type RTE_FLOW_ITEM_TYPE_MARK
provided. It allows us to extend the flow match pattern with the capability
to match the metadata values set by MARK/FLAG actions on other flows.

From the datapath point of view, the MARK and FLAG are related to the
receiving side only. It would useful to have the same gateway on the
transmitting side and there was the feature of type RTE_FLOW_ITEM_TYPE_META
was proposed. The application can fill the field in mbuf and this value
will be transferred to some field in the packet metadata inside the flow
engine. It did not matter whether these metadata fields are shared because
of MARK and META items belonged to different domains (receiving and
transmitting) and could be vendor-specific.

So far, so good, DPDK proposes some entities to control metadata inside
the flow engine and gateways to exchange these values on a per-packet basis
via datapaths.

As we can see, the MARK and META means are not symmetric, there is absent
action which would allow us to set META value on the transmitting path.
So, the action of type:

- RTE_FLOW_ACTION_TYPE_SET_META was proposed.

The next, applications raise the new requirements for packet metadata.
The flow ngines are getting more complex, internal switches are introduced,
multiple ports might be supported within the same flow engine namespace.
From the DPDK points of view, it means the packets might be sent on one
eth_dev port and received on the other one, and the packet path inside
the flow engine entirely belongs to the same hardware device. The simplest
example is SR-IOV with PF, VFs and the representors. And there is a
brilliant opportunity to provide some out-of-band channel to transfer
some extra data from one port to another one, besides the packet data
itself. And applications would like to use this opportunity.

It is supposed for application to use trials (with rte_flow_validate)
to detect which metadata features (FLAG, MARK, META) actually supported
by PMD and underlying hardware. It might depend on PMD configuration,
system software, hardware settings, etc., and should be detected
in run time.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-11-08 23:15:04 +01:00
Haiyue Wang
8dedb54699 ethdev: enhance burst mode information API
Change the type of burst mode information from bit field to free string
data, so that each PMD can describe the Rx/Tx busrt functions flexibly.

Fixes: eb5902504a ("ethdev: add API for getting burst mode information")
Fixes: 6b6609f68c ("net/i40e: support Rx/Tx burst mode info")
Fixes: e9a10e6c21 ("net/ice: support Rx/Tx burst mode info")
Fixes: 7fe108edcf ("app/testpmd: show Rx/Tx burst mode description")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Ray Kinsella <ray.kinsella@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2019-11-08 23:15:04 +01:00
Viacheslav Ovsiienko
9a2f44c762 ethdev: add flow tag
A tag is a transient data which can be used during flow match. This can be
used to store match result from a previous table so that the same pattern
need not be matched again on the next table. Even if outer header is
decapsulated on the previous match, the match result can be kept.

Some device expose internal registers of its flow processing pipeline and
those registers are quite useful for stateful connection tracking as it
keeps status of flow matching. Multiple tags are supported by specifying
index.

Example testpmd commands are:

  flow create 0 ingress pattern ... / end
    actions set_tag index 2 value 0xaa00bb mask 0xffff00ff /
            set_tag index 3 value 0x123456 mask 0xffffff /
            vxlan_decap / jump group 1 / end

  flow create 0 ingress pattern ... / end
    actions set_tag index 2 value 0xcc00 mask 0xff00 /
            set_tag index 3 value 0x123456 mask 0xffffff /
            vxlan_decap / jump group 1 / end

  flow create 0 ingress group 1
    pattern tag index is 2 value spec 0xaa00bb value mask 0xffff00ff /
            eth ... / end
    actions ... jump group 2 / end

  flow create 0 ingress group 1
    pattern tag index is 2 value spec 0xcc00 value mask 0xff00 /
            tag index is 3 value spec 0x123456 value mask 0xffffff /
            eth ... / end
    actions ... / end

  flow create 0 ingress group 2
    pattern tag index is 3 value spec 0x123456 value mask 0xffffff /
            eth ... / end
    actions ... / end

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-11-08 23:15:04 +01:00
Artur Trybula
6bbc5a9236 test/compress: refactor unit tests
Core engine refactoring (test_deflate_comp_decomp function).
Smaller specialized functions created.

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
2019-11-08 13:53:09 +01:00
Hemant Agrawal
0f56ca1aae ipsec: remove redundant replay window size
The rte_security lib has introduced replay_win_sz,
so it can be removed from the rte_ipsec lib.

The relevant tests, app are also update to reflect
the usages.

Note that esn and anti-replay fileds were earlier used
only for ipsec library, they were enabling the libipsec
by default. With this change esn and anti-replay setting
will not automatically enabled libipsec.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-11-08 13:51:16 +01:00
Hemant Agrawal
cd60a8680f test/crypto: enable additional cases for dpaax
This patch enables short buffer and 12 bit IV AES-CTR cases
for dpaax_sec pmds.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-11-08 13:51:16 +01:00
Pablo de Lara
4b70152374 crypto/aesni_gcm: support in-place chained mbufs
IPSec Multi buffer library supports encryption on multiple segments.
When dealing with chained buffers (multiple segments), as long as
the operation is in-place, the destination buffer does not have to
be contiguous (unlike in the case of out-of-place operation).
Therefore, the limitation of not supporting in-place chained mbuf
can be removed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2019-11-08 13:51:16 +01:00
Vladimir Medvedkin
3e43647cd6 app/test-sad: add sanity checks
Coverity reported about two division by zero:
*** CID 350344:  Incorrect expression  (DIVIDE_BY_ZERO)
Although in fact these dividers will never be equal to 0,
adding explicit checks in lookup() to make coverity happy
will not affect the execution speed.

Fixes: 908be0651a ("app/test-sad: add test application for IPsec SAD")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-11-08 13:51:16 +01:00
Thomas Monjalon
14cba9ee22 cmdline: replace FreeBSD ifdef for IP address parsing
The constants like AF_INET are in sys/socket.h in FreeBSD.
The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
in order to be consistent across DPDK files, and allow to grep
for EXEC_ENV among other benefits.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-11-08 15:34:10 +01:00
Andrzej Ostruszka
1d3bb890a4 test: clean LTO warnings
During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘stats.greatest_free_size’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
  return len - overhead;

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2019-11-08 15:23:37 +01:00
Andrzej Ostruszka
99c2566414 app/eventdev: clean LTO warnings
During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘service_id’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
    ret = evt_service_setup(service_id);

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2019-11-08 15:18:05 +01:00
David Christensen
e79f49b4e2 test/atomic: add atomic 16/32/64-bit exchanges test
The test works by creating a token comprised of random data
and a CRC8 value, using the rte_atomicXX_exchange to exchange
the new token for a previously generated token, and then
verifying that the exchanged data is intact (i.e. the CRC8
is still correct for the data).

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2019-11-07 17:46:43 +01:00
Vladimir Medvedkin
82962b6abb test/rib: speed up rib6 autotests
Split slow part of rib6_autotest into rib6_slow_autotest

Fixes: abab6d2966 ("test/rib: add IPv6 autotests")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2019-11-07 17:46:43 +01:00
Vladimir Medvedkin
23f5fb667c test/rib: speed up rib autotests
Split slow part of rib_autotest into rib_slow_autotest

Fixes: b35df4dd66 ("test/rib: add autotests")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2019-11-07 17:46:43 +01:00
Olivier Matz
b2ca1e1cae test/mempool: fix false positive result
The ret variable, initialized to -1, is changed to 0 during the test,
making the test successful in some cases where it should return a
failure.

Fix this by always using the GOTO_ERR() macro that sets the ret
variable before doing the goto.

Fixes: 923ceaeac1 ("test/mempool: add unit test cases")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2019-11-06 11:55:23 +01:00
Vladimir Medvedkin
0d89a9569a test/fib: add IPv6 performance autotests
Performance IPv6 tests for the FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-11-06 00:11:55 +01:00
Vladimir Medvedkin
08e0c75814 test/fib: add performance autotests
Performance tests for the new FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-11-06 00:11:55 +01:00
Vladimir Medvedkin
cae5d9fc48 test/fib: add IPv6 autotests
Functional IPv6 tests for the FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-11-06 00:11:44 +01:00
Vladimir Medvedkin
4ccd42591f test/fib: add autotests
Functional tests for the new FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-11-06 00:11:44 +01:00
Vladimir Medvedkin
abab6d2966 test/rib: add IPv6 autotests
Functional tests for RIB6.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-11-06 00:11:36 +01:00
Vladimir Medvedkin
b35df4dd66 test/rib: add autotests
Functional tests for the new RIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-11-06 00:09:03 +01:00
Pavan Nikhilesh
8ada5b15a9 test: use common macro RTE_DIM
Use RTE_DIM instead of re-defining ARRAY_SIZE.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Gage Eads <gage.eads@intel.com>
2019-10-27 14:40:55 +01:00
Ciara Power
7edbf7ddfd app/procinfo: use strlcpy for copying string
Replaced strncpy and strcpy with strlcpy.
Also replaced snprintf with strlcpy where applicable.
Using strlcpy is safe practice when copying strings, as it will include
a null terminator.

Fixes: 2deb6b5246 ("app/procinfo: add collectd format and host id")
Fixes: 8a37f37fc2 ("app/procinfo: add --show-port")
Cc: stable@dpdk.org

Reported-by: Reshma Pattan <reshma.pattan@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2019-10-27 11:33:24 +01:00
David Marchand
ab35397e7a test/mem: remove dependency on EAL internals
Rather than dereference the mem_config internal structure, we can rely
on the rte_memzone_walk API and count memzones.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-10-27 10:41:08 +01:00
David Marchand
974be46e9e mem: hide internal heap header
Let's avoid exporting structures without an identified usecase.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2019-10-27 10:39:56 +01:00
Xiaoyu Min
739e045bf2 app/testpmd: support multiple raw encap/decap
In some scenarios, the raw_encap/raw_decap actions could be multiple in
one single flow (e,g. hirepin flow):

  ... actions raw_decap / raw_encap / raw_decap / raw_encap / ...

This requires the testpmd supports multiple raw_encap/raw_decap data
settings as well.

With the multiple raw_encap/raw_decap settings, the testpmd commands –
set raw_encap / set raw_decap will become:

  set raw_encap <index> <item pattern>
  set raw_decap <index> <item pattern>

And the actions – raw_encap/raw_decap also could optionally choose which
global raw_encap/raw_decap confs to be used by index:

  ... actions raw_decap index 1 / raw_encap index 2 / ...

If there is no `index` specified, the default index is 0:

  set raw_encap <item pattern>
  ... actions raw_decap / raw_encap / ...

which will use raw_encap index 0.

In addition to the set raw_encap/raw_decap commands,

  show <raw_encap/raw_decap> <index>
  show <raw_encap/raw_decap> all

are also introduced into in order to check which index is set and to
what.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-10-25 19:23:22 +02:00
Peng Huang
0322272c9f app/testpmd: fix Tx checksum when TSO enabled
This patch fixed the TX checksum value problem when enabled TSO in
tunnel packets, because outer UDP checksum calculation depend on
the TSO configuration.

Fixes: 0f62d63593 ("app/testpmd: support tunneled TSO in checksum engine")
Cc: stable@dpdk.org

Signed-off-by: Peng Huang <peng.huang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-10-25 19:23:22 +02:00
Flavia Musatescu
512d873ff1 net: add new header file for VXLAN
The VXLAN related definitions and structures are moved from
rte_ether.h to a new header file: rte_xvlan.h.

Also introducing a new define macro for VXLAN default port id:
RTE_VXLAN_DEFAULT_PORT

Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Raslan Darawsheh <rasland@mellanox.com>
2019-10-25 19:00:22 +02:00
Wisam Jaddo
6977f14517 app/testpmd: fix missing GENEVE item in raw encap
Fixes: 0f4203fe9d ("app/testpmd: support GENEVE pattern item in flow rules")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
2019-10-25 19:00:22 +02:00
Ting Xu
d8e5e69f3a app/testpmd: add GTP parsing and Tx checksum offload
Enable testpmd to forward GTP packet in csum fwd mode.

A GTP header structure (without optional fields and extension header)
is defined in new rte_gtp.h.
A parser function in testpmd is added.  GTPU and GTPC packets are both
supported, with respective UDP destination port and GTP message type.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-25 19:00:22 +02:00
Olivier Matz
4958ca3a44 mbuf: support dynamic fields and flags
Many features require to store data inside the mbuf. As the room in mbuf
structure is limited, it is not possible to have a field for each
feature. Also, changing fields in the mbuf structure can break the API
or ABI.

This commit addresses these issues, by enabling the dynamic registration
of fields or flags:

- a dynamic field is a named area in the rte_mbuf structure, with a
  given size (>= 1 byte) and alignment constraint.
- a dynamic flag is a named bit in the rte_mbuf structure.

The typical use case is a PMD that registers space for an offload
feature, when the application requests to enable this feature.  As
the space in mbuf is limited, the space should only be reserved if it
is going to be used (i.e when the application explicitly asks for it).

The registration can be done at any moment, but it is not possible
to unregister fields or flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-10-26 19:08:50 +02:00
Ferruh Yigit
d170527643 test: fix global variable multiple definitions
Multiple global variable are defined in multiple unit test files with
same name, but all unit test files are linked into single executable,
which means those variables share same storage which is not the
intention, fixed by making global variables 'static'.

Issue has been detected by '-fno-common' gcc flag.

Fixes: fdeb30fa71 ("test/bitrate: add unit tests for bitrate library")
Fixes: c3eabff124 ("distributor: add unit tests")
Fixes: 0e925aef27 ("app/test: add EFD functional and perf tests")
Fixes: 359e17bf08 ("app/test: improve hash unit tests")
Fixes: c7eb0972e7 ("test/hash: add lock-free r/w concurrency")
Fixes: 1e3676a06e ("test/latency: add unit tests for latencystats library")
Fixes: 0cc67a96e4 ("test/member: add functional and perf tests")
Fixes: e6a14121f4 ("test/rcu: remove arbitrary limit on max core count")
Fixes: 104dbec208 ("test/rcu: increase size of core numbers")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-25 23:16:23 +02:00
Ferruh Yigit
f6e63e59e7 app/testpmd: fix global variable multiple definitions
Some flow config related global variables are defined in a header file
which was causing multiple definitions of the variables, fixed it by
moving them to the .c file.

Issue has been detected by '-fno-common' gcc flag.

Also while being there,
removed duplicated 'ACTION_RAW_ENCAP_MAX_DAT definition,
moved 'vxlan_encap_conf' & 'nvgre_encap_conf' initialization to
  'cmdline_flow.c' which is better location than 'testpmd.c'
relocated 'action_raw_encap_data' & 'action_raw_decap_data' struct
   definitions slightly within the file

Fixes: 1960be7d32 ("app/testpmd: add VXLAN encap/decap")
Fixes: dcd962fc6b ("app/testpmd: add NVGRE encap/decap")
Fixes: a1191d39cb ("app/testpmd: add MPLSoUDP encapsulation")
Fixes: 3e77031be8 ("app/testpmd: add MPLSoGRE encapsulation")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-25 23:16:23 +02:00
Jasvinder Singh
7cb98976f2 test/sched: add subport config flexibility
Modify tests function to allow different subports of the same port
to have different configuration in terms of number of pipes, pipe
queue sizes, etc.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
2019-10-25 17:51:30 +02:00
Yahui Cao
8b79b03630 app/testpmd: increase RSS max queue size
Max queue indices ACTION_RSS_QUEUE_NUM , which limits testpmd actions
rss queue size, has worked for a long time.

As more powered PMD is merged, more RSS queues are supported(e.g. Intel
ice driver FDIR supports up to 128 RSS queue numbers).

The original max queue indices number doesn't satisfy PMD's requirement
and it needs to become bigger.

Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:10 +02:00
Kiran Kumar K
01b3156d33 ethdev: add HIGIG2 key field to flow API
Add new rte_flow_item_higig2_hdr in order to match higig2 header.
It is a layer 2.5 protocol and used in Broadcom switches.
Header format is based on the following document.
http://read.pudn.com/downloads558/doc/comm/2301468/HiGig_protocol.pdf

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-10-23 16:43:10 +02:00
Ciara Power
e71df49e08 app/testpmd: fix help for loop topology option
The testpmd --help option did not show all possible choices for port
topology previously. The loop topology option is now added.

Fixes: 3e2006d618 ("app/testpmd: add loopback topology")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:10 +02:00
Simei Su
15e67d41c0 app/testpmd: support extended RSS offload types
This patch adds cmdline support for extended rss types configuration.

Signed-off-by: Simei Su <simei.su@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2019-10-23 16:43:09 +02:00
Ting Xu
5e913bdb4f app/testpmd: fix CRC strip command
This patch fixed the bug that a failure appeared when config
rx_offload crc_strip using command "port config all crc-strip
on|off". The reason is that this command was removed in Commit
e5db17a1e5. The current command is "port config <port_id>
rx_offload keep_crc on|off" instead.

In this patch, some codes left over about 'crc_strip' are
removed to make the current command clearer.

Fixes: e5db17a1e5 ("app/testpmd: remove duplicated Rx offload commands")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-10-23 16:43:09 +02:00
Haiyue Wang
7fe108edcf app/testpmd: show Rx/Tx burst mode description
Add the 'Burst mode' section into command 'show rxq|txq info <port_id>
<queue_id>' to show the Rx/Tx burst mode description like:
  "Burst mode: Vector AVX2 Scattered"

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
2019-10-23 16:43:09 +02:00
Vivek Sharma
fb1a5a0fd6 app/testpmd: introduce Rx offloads option
Introduce boot time argument for configuring all rx offloads.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:09 +02:00
Vivek Sharma
b85778768a app/testpmd: introduce QinQ offload option
Introduce boot time argument for configuring QinQ strip
offload.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:09 +02:00
Vivek Sharma
2a0b41984c app/testpmd: support QinQ offload in VLAN set command
Segregate QinQ from Extend Offload and support QinQ offload
in vlan set command. Merge all port wise rx vlan offloads in
command line help and documentation for a cleaner structure.

Fix port info display to distinguish between qinq strip and
extend offloads. Flatten all VLAN offload info into a single
line to reduce info length.

Signed-off-by: Vivek Sharma <viveksharma@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:09 +02:00
Vamsi Attunuru
9e06e39b3c app/testpmd: show supported packet types
Patch adds a runtime function to display port supported ptypes
in different layers.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2019-10-23 16:43:08 +02:00
Krzysztof Kanas
7de47c3c23 test/bonding: fix LSC timeout unit
Fixes: 76d29903f5 ("bond: support link status interrupt")
Cc: stable@dpdk.org

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:08 +02:00
Krzysztof Kanas
88524d6b8b test/bonding: fix LSC related cases
On rare situation test_link_bonding test case fail due to timespec
tv_nsec overflow, which causes pthread_cond_timedwait to return EINVAL
and test to fail.

Fixes: 76d29903f5 ("bond: support link status interrupt")
Cc: stable@dpdk.org

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:08 +02:00
Matan Azrad
971a815b9e app/testpmd: add bits per second to statistics
Traffic bps statistics is very useful for performance testing.

Add bits per second statistics for Rx and Tx.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Moti Haimovsky <motih@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2019-10-23 16:43:08 +02:00
Ruifeng Wang
0a82b96e36 test/distributor: fix spurious failure
Sanity test could spuriously fail with reporting flush count error.
It was caused by worker stat coherent issue between distributor and
worker thread.
Fix this issue by using atomic operations to update worker stat.

Fixes: c3eabff124 ("distributor: add unit tests")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
2019-10-25 10:27:51 +02:00
Hemant Agrawal
b0b9116f72 app/procinfo: fix build without rte_security
This patch fixes the compilation issues when
RTE_LIBRTE_SECURITY is disabled.

Fixes: 8a37f37fc2 ("app/procinfo: add --show-port")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Hemant Agrawal
52dcc63d09 test/crypto: fix build without rte_security
This patch fixes the compilation issue in test_cryptodev.c
when RTE_LIBRTE_SECURITY is disabled.

Fixes: d883e6e713 ("test/crypto: add PDCP C-Plane encap cases")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Adam Dybkowski
e847fc5128 test/crypto: add encrypted digest case for AES-CTR-CMAC
This patch adds tests for encrypted digest AES-CTR + AES CMAC using
mixed auth-cipher algorithm functions. Tests allow easy
extending with new cases, check in-place and
out-of-place operations and use linear and sgl
buffers as input/output.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
2019-10-23 16:57:06 +02:00
Arek Kusztal
b480c5fd54 test/crypto: add RSA cases in QAT and openssl
This commit adds RSA tests to Intel QuickAssist Technology pmd
and OpenSSL pmd test suite for session and session-less cases
when PADDING_NONE selected

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2019-10-23 16:57:06 +02:00
Arek Kusztal
c07f19b36c test/crypto: add session-less cases in asym mod exp
This commit adds asymmetric sessionless tests to mod exp.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2019-10-23 16:57:06 +02:00
Vladimir Medvedkin
908be0651a app/test-sad: add test application for IPsec SAD
Introduce new application to provide user to evaluate and perform
custom functional and performance tests for IPsec SAD implementation.

According to our measurements on SKX for 1M entries average lookup
cost is ~80 cycles, average add cost ~500 cycles.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-10-23 16:57:06 +02:00
Vladimir Medvedkin
48083b4d67 test/ipsec: add SAD autotests
add unittests for ipsec SAD library

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-10-23 16:57:06 +02:00
Sunila Sahu
116e447a76 test/crypto: support asym cases for OCTEON TX2
This patch updates asymmetric crypto unit-test application to
validate asymmetric crypto operation supported by octeontx2 PMD.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Anoob Joseph
6995630e87 test/crypto: add OCTEON TX2
This patch adds the OCTEON TX2 crypto validation tests.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Artur Trybula
2437fbbc84 test/compress: add stateless overflow recovery case
Added unit test to check out-of-space recoverable feature.

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2019-10-23 16:57:06 +02:00
Sunila Sahu
88d664aa1c test/crypto: register octeontx to asym suite
Updated asymmetric crypto unit-test application to test
asymmetric crypto operations in octeontx PMD

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Kanaka Durga Kotamarthy <kkotamarthy@marvell.com>
Signed-off-by: Sunila Sahu <ssahu@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Hemant Agrawal
7bbe8faaa6 test/crypto: enable SNOW3G and ZUC for dpaa
This patch add the SNOW and ZUC cipher only
and auth only test cases.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Hemant Agrawal
699741912d test/crypto: add case for auth only trailer
This patch add support for case when there is auth only
header and auth only tailroom present simultaneously.
This simulates the case of IPSEC ESN.

This patch also enable the new test case for openssl and
NXP dpaa_sec and dpaa2_sec platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Hemant Agrawal
307fa2cd33 test/crypto: increase cases for dpaax
dpaa_sec and dpaa2_sec testsuite are added with more
cases which are valid.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Hemant Agrawal
73c1478d3a test/crypto: fix PDCP session create
session_priv_mpool should be used instead of session pool

Fixes: d883e6e713 ("test/crypto: add PDCP C-Plane encap cases")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2019-10-23 16:57:06 +02:00
Pallantla Poornima
923ceaeac1 test/mempool: add unit test cases
Added UT to cover below functions:
- rte_mempool_populate_anon(),
- rte_mempool_mem_iter(),

Those additions also cover mempool internals:
rte_mempool_memchunk_anon_free() and get_anon_size().

Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2019-10-24 13:35:44 +02:00
Honnappa Nagarahalli
c425fb6b9b test/lpm: fix measured cycles for delete
total_time needs to be reset to measure the cycles for delete API.

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

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Tested-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2019-10-24 10:00:27 +02:00
Harman Kalra
cddd879540 test/bpf: add new test cases
This patch implements following new test cases:
- test_call4: test case to verify if stack corruption occurs
across with multiple function calls.
- test_jump2: test case with a default packet in memory, parse
the packet and check if dest ip is part of a subnet.
- test_call5: test case with string data in the stack and
calling string comaprision.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2019-10-24 09:57:48 +02:00