Commit Graph

3052 Commits

Author SHA1 Message Date
Huichao Cai
b50a14a853 ip_frag: add IPv4 options fragment
According to RFC791,the options may appear or not in datagrams.
They must be implemented by all IP modules (host and gateways).
What is optional is their transmission in any particular datagram,
not their implementation. So we have to deal with it during the
fragmenting process.
Add some test data for the IPv4 header optional field fragmenting.

Signed-off-by: Huichao Cai <chcchc88@163.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2022-06-01 08:58:27 +02:00
Konstantin Ananyev
60018ef4d3 app/acl: support different formats for IPv6 address
Within ACL rule IPv6 address can be represented in different ways:
either as 4x4B fields, or as 2x8B fields.
Till now, only first format was supported.
Extend test-acl to support both formats, mainly for testing and
demonstrating purposes.
To control desired behavior '--ipv6' command-line option is extended
to accept an optional argument:
To be more precise:
'--ipv6'    - use 4x4B fields format (default behavior)
'--ipv6=4B' - use 4x4B fields format (default behavior)
'--ipv6=8B' - use 2x8B fields format

Also replaced home brewed IPv4/IPv6 address parsing with inet_pton() calls.

Signed-off-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
2022-05-30 23:31:37 +02:00
Rakesh Kudurumalla
36edf3cc9b test: avoid hang if queues are full and Tx fails
Current pmd_perf_autotest() in continuous mode tries
to enqueue MAX_TRAFFIC_BURST completely before starting
the test. Some drivers cannot accept complete
MAX_TRAFFIC_BURST even though rx+tx desc count can fit it.
This patch changes behaviour to stop enqueuing after few
retries.

Fixes: 002ade70e9 ("app/test: measure cycles per packet in Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
2022-05-25 10:01:05 +02:00
Stanislaw Kardach
981a025741 test/ring: remove excessive inlining
Forcing inlining in test_ring_enqueue and test_ring_dequeue can cause
the compiled code to grow extensively when compiled with no optimization
(-O0 or -Og). This is default in the meson's debug configuration. This
can collide with compiler bugs and cause issues during linking of unit
tests where the api_type or esize are non-const variables causing
inlining cascade. In perf tests this is not the case in perf-tests as
esize and api_type are const values.

One such case was discovered when porting DPDK to RISC-V. GCC 11.2 (and
no fix still in 12.1) is generating a short relative jump instruction
(J <offset>) for goto and for loops. When loop body grows extensively in
ring test, the target offset goes beyond supported offfset of +/- 1MB
from PC. This is an obvious bug in the GCC as RISC-V has a
two-instruction construct to jump to any absolute address (AUIPC+JALR).

However there is no reason to force inlining as the test code works
perfectly fine without it.

GCC has a bug report for a similar case (with conditionals):
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93062

Fixes: a9fe152363 ("test/ring: add custom element size functional tests")

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
2022-05-23 15:29:39 +02:00
Tyler Retzlaff
04e53de9e5 test/threads: add unit test
Establish unit test for testing thread api. Initial unit tests
for rte_thread_{get,set}_affinity_by_id().

Signed-off-by: Narcisa Vasile <navasile@linux.microsoft.com>
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2022-05-19 16:45:07 +02:00
Shijith Thotton
deb450c456 test/event: set queue attributes at runtime
Added test cases to test changing of queue QoS attributes priority,
weight and affinity at runtime.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:43:48 +02:00
Pavan Nikhilesh
7da008df0c app/eventdev: use port quiescing
Quiesce event ports used by the workers core on exit to free up
any outstanding resources.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:43:30 +02:00
Pavan Nikhilesh
f0b68c0b2a app/eventdev: clean up worker state before exit
Event ports are configured to implicitly release the scheduler contexts
currently held in the next call to rte_event_dequeue_burst().
A worker core might still hold a scheduling context during exit, as the
next call to rte_event_dequeue_burst() is never made.
This might lead to deadlock based on the worker exit timing and when
there are very less number of flows.

Add clean up function to release any scheduling contexts held by the
worker by using RTE_EVENT_OP_RELEASE.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:43:12 +02:00
Pavan Nikhilesh
a734e7388d app/eventdev: simplify signal handling and teardown
Remove rte_*_dev calls from signal handler callback as signal handlers
are supposed to be light weight.

Split ethdev teardown into Rx and Tx sections, wait for
workers to finish processing after disabling Rx to allow workers
to complete processing currently held packets.

Verified SW event device on ARM64 using the following command:

./build/app/dpdk-test-eventdev -l 7-23 -s 0xf00 --vdev=event_sw0
 -a 0002:02:00.0 -- --prod_type_ethdev --nb_pkts=0 --verbose 2
 --test=pipeline_queue --stlist=o --wlcores 16-23

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:43:04 +02:00
Huisong Li
f0b3966a50 app/testpmd: fix MTU verification
The macro RTE_ETHER_MIN_LEN isn't the minimum value of MTU. But testpmd
used it when execute 'port config mtu 0 xx' cmd. This patch fixes it.

Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2022-05-12 18:29:04 +02:00
Min Hu (Connor)
baef6bbfad app/testpmd: check statistics query before printing
In function 'fwd_stats_display', if function 'rte_eth_stats_get' fails,
'stats' is uncertainty value. The display result will be abnormal.

This patch check the return value of 'rte_eth_stats_get' to avoid
display abnormal stats.

Fixes: 53324971a1 ("app/testpmd: display/clear forwarding stats on demand")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2022-05-12 18:29:04 +02:00
David Marchand
c0c305ee9e ci: build some job with ASan
Enable ASan, this can greatly help identify leaks and buffer overflows.
Running unit tests relying on multiprocess is unreliable with ASan
enabled, so skip them.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2022-05-11 14:05:57 +02:00
David Marchand
48ff13ef37 test/mem: disable ASan when accessing unallocated memory
As described in bugzilla, ASan reports accesses to all memory segment as
invalid, since those parts have not been allocated with rte_malloc.
Move __rte_no_asan to rte_common.h and disable ASan on a part of the test.

Bugzilla ID: 880
Fixes: 6cc51b1293 ("mem: instrument allocator for ASan")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2022-05-11 14:05:30 +02:00
Stanislaw Kardach
af0892af42 test/hash: report non HTM numbers for single thread
In hash_readwrite_perf_autotest a single read and write operation is
benchmarked for both HTM and non HTM cases. However the result summary
only shows the HTM value. Therefore add the non HTM value for
completeness.

Fixes: 0eb3726ebc ("test/hash: add test for read/write concurrency")

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2022-05-11 14:01:03 +02:00
Archana Muniganti
e689abaf8b test/crypto-perf: add vector file for AES-GCM
Added test vector file for AES-128-GCM for
64B and 512B length buffers.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-29 11:31:40 +02:00
Archana Muniganti
14864c4217 test/crypto-perf: populate mbuf in latency test
For decrypt, ICV mismatch can come as data is dummy and
latency will be calculated for error path. Hence populate
mbuf with test vector data.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-29 11:31:39 +02:00
Kiran Kumar K
a538d1d2d0 test/crypto-perf: extend asymmetric crypto throughput test
Extended support for asymmetric crypto perf throughput test.
Added support for new modulus lengths.
Added new parameter --modex-len.
Supported lengths are 60, 128, 255, 448. Default length is 128.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-29 11:01:45 +02:00
Archana Muniganti
0e4cc24456 test/crypto: add AH AES-GMAC test vectors
Added AES_GMAC test vectors along with combined mode support.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-28 08:54:50 +02:00
Archana Muniganti
77f46cda07 test/crypto: add AH test vectors
Added tunnel and transport AH known test vectors for
SHA256 HMAC.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-28 08:54:50 +02:00
Archana Muniganti
663d78bec1 test/crypto: add AH under combined mode
Added auth only and null cipher + auth under combined mode
for following combinations.
1. Tunnel IPv4
2. Transport IPv4

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-28 08:54:50 +02:00
Vladimir Medvedkin
a6699a6eb2 test/table: fix buffer overflow on lpm entry
This patch fixes stack buffer overflow reported by ASan.

Bugzilla ID: 820
Fixes: 5205954791 ("app/test: packet framework unit tests")
Cc: stable@dpdk.org

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2022-04-28 12:39:11 +02:00
Tyler Retzlaff
55ae8965bf test/bpf: skip test if libpcap is unavailable
test_bpf_convert is being conditionally registered depending on the
presence of RTE_HAS_LIBPCAP except the UT unconditionally lists it as a
test to run.

When the UT runs test_bpf_convert test-dpdk can't find the registration
and assumes the DPDK_TEST environment variable hasn't been defined
resulting in test-dpdk dropping to interactive mode and subsequently
waiting for the remainder of the UT fast-test timeout period before
reporting the test as having timed out.

* unconditionally register test_bpf_convert,
* if ! RTE_HAS_LIBPCAP provide a stub test_bpf_convert that reports the
  test is skipped similar to that done with the test_bpf test.

Fixes: 2eccf6afbe ("bpf: add function to convert classic BPF to DPDK BPF")
Cc: stable@dpdk.org

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2022-04-26 09:31:52 +02:00
Gregory Etelson
fc547a92cf app/testpmd: fix flow rule with flex input link
Testpmd reads flex item configuration from a JSON file.
Flex item input link description is stored in testpmd
flow item format. For example, `eth type is 0x0800`.
The item description is placed into a general testpmd CLI
flow rule command template and parsed to convert string into
flow item object.

The patch adds the `actions` section to the flow rule template.

Fixes: 59f3a8acbc ("app/testpmd: add flex item commands")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-03-14 22:21:07 +01:00
Gregory Etelson
a058de216c app/testpmd: fix GTP header parsing in checksum engine
GTP header can be followed by an optional 32 bits extension.
GTP notifies about the extension presence through the E, S or PN
header bits.

Csum GTP header parser did not check the extension bits value.

The patch updates GTP header length if at-least one of the
extension bits is set.

Fixes: d8e5e69f3a ("app/testpmd: add GTP parsing and Tx checksum offload")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2022-03-14 21:50:47 +01:00
Adham Masarwah
5aae2723cd app/testpmd: fix show RSS RETA on Windows
Replaced using strtoul with strtoull when converting to
64-bit mask field.
In Windows strtoul returns 32-bit values which cause an
issue with show RSS RETA.

Fixes: 66c594904a ("ethdev: support multiple sizes of redirection table")
Cc: stable@dpdk.org

Signed-off-by: Adham Masarwah <adham@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2022-03-14 21:38:48 +01:00
Kevin Liu
7dc92d1729 app/testpmd: fix L4 checksum in multi-segments
Testpmd forwards packets in checksum mode that it needs to calculate
the checksum of each layer's protocol.

In process_inner_cksums, when parsing tunnel packets, inner L4 offset
should be outer_l2_len + outer_l3_len + l2_len + l3_len.

In process_outer_cksums, when parsing tunnel packets, outer L4 offset
should be outer_l2_len + outer_l3_len.

Fixes: e6b9d6411e ("app/testpmd: add SW L4 checksum in multi-segments")
Cc: stable@dpdk.org

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2022-03-14 21:23:26 +01:00
Gerry Gribbon
c1d1b94eec app/regex: fix number of matches
Depending on number of jobs specified on command line, part of the
data buffer may not get searched, resulting in incorrect number of
matches being reported.

Additional change to ensure the "All Matches" summary outputs the
correct match start locations in the supplied data buffer.

Fixes: de06137cb2 ("app/regex: add RegEx test application")
Cc: stable@dpdk.org

Signed-off-by: Gerry Gribbon <ggribbon@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-03-14 12:15:29 +01:00
Ben Magistro
a8dde09f97 app/dumpcap: allow help/version without primary process
Currently dumpcap tries to initialize dpdk before parsing command line
arguments, this makes it impossible to check version or help without
having the primary process running already.

Signed-off-by: Ben Magistro <koncept1@gmail.com>
2022-03-08 09:32:59 +01:00
Stephen Hemminger
499b1cbcf9 app/dumpcap: check for failure to set promiscuous
If the rte_eth_promiscuous_enable() fails, then log the error
and continue.

Coverity issue: 373662
Fixes: cbb44143be ("app/dumpcap: add new packet capture application")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-03-08 09:19:46 +01:00
Stephen Hemminger
78e7b29ff1 test/bpf: skip dump if conversion fails
If conversion of cBPF to eBPF fails (in rte_bpf_convert)
then the test should not try and print the result.

Coverity issue: 373661
Fixes: 2eccf6afbe ("bpf: add function to convert classic BPF to DPDK BPF")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2022-03-08 09:19:41 +01:00
Tianli Lai
a8a1c40bda app/pdump: free mempool at resources cleanup
The mempool should be free when cleanup resources.

Signed-off-by: Tianli Lai <laitianli@tom.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2022-03-08 00:19:31 +01:00
Reshma Pattan
3ee04ebc91 app/pdump: abort on multi-core capture limit
Check lcore id value is not the maximum core supported.
Using lcore id without this check might cause
out of bound access inside the rte_eal_wait_lcore.

Coverity issue: 375841
Fixes: b2854d5317 ("app/pdump: support multi-core capture")
Cc: stable@dpdk.org

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2022-03-08 00:00:21 +01:00
Haiyue Wang
6eccb0c9ee graph: remove useless duplicate name check
The node clone API parameter 'name' is the new node's postfix name, not
the final node name, so it makes no sense to check it. And the new name
will be checked duplicate when calling API '__rte_node_register'.

And update the test case to call clone API twice to check the real name
duplicate.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-03-07 20:31:14 +01:00
Alexander Kozyrev
e2b1848455 app/testpmd: fix flow rule creation parsing
A pattern template creation shares the parsing mechanism with
a simple flow creation. The pattern template creation only consists
of pattern items while the flow creation continues with actions.
The parsing mechanism now accommodates both cases and allows to stop
at the item end token, which should not happen for the flow creation.
Fix parsing mechanism to differentiate between these two cases.

Bugzilla ID: 941
Fixes: 04cc665fab ("app/testpmd: add flow template management")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
2022-03-03 14:30:21 +01:00
Anoob Joseph
fa609d9426 app/crypto-perf: add IPsec operations population routine
Ops population functions are called in datapath. Keeping it common for
PDCP & DOCSIS would mean ops population would have additional
conditional checks causing the throughput reported to be lower than what
the PMD is capable of.

Separate out routine for IPsec cases and split vector population and op
preparation into two loops to allow 2 rte_rdtsc_precise() calls to
capture cycles consumed for memcpying the vector. Checking the cycle
count from the loop would mean more calls to the same API.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-03-04 11:55:08 +01:00
Raja Zidane
e77e8b66d1 app/compress-perf: fix number of queue pairs to setup
The number of QPs is limited by the number of cores, such that in
case the user requests more QPs than possible, the number of QPs
actually configured on the device is equal to the number of cores,
but the app tries to setup the original number of QPs.

Align the number of QPs setup'ed to the limited number.

Fixes: 424dd6c8c1 ("app/compress-perf: add weak functions for multicore test")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-03-04 10:53:09 +01:00
Raja Zidane
220b51f78b app/compress-perf: fix socket ID type during init
Socket ID is obtained by function rte_compressdev_socket_id, which
returns it as integer, but is interpreted as unsigned byte integer.

change type from uint8_t to int.

Fixes: ed7dd94f7f ("compressdev: add basic device management")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-03-04 10:49:14 +01:00
Raja Zidane
68d3287f4e app/compress-perf: optimize operations pool allocation
An array of the size of total operations needed for the de/compression is
reserved for ops while enqueueing, although only first burst_size entries
of the array are used.

Reduce the size of the array allocated.

Fixes: b68a82425d ("app/compress-perf: add performance measurement")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-03-04 10:28:21 +01:00
Raja Zidane
81353ea4dc app/compress-perf: fix cycle count operations allocation
In cyclecount main_loop function, each iteration it tries to
enqueue X ops, in case Y<X ops were enqueued, the rest of the
X-Y ops are moved to the beginning of the ops array, to preserve
ops order, and next Y ops are allocated for the next enqueue
action, the allocation of the ops occurs on the first Y entries
in the array, when it should have skipped the first X-Y
array entries and allocate the following Y entries.

Fix the allocation by adding the correct offset.

Fixes: 2695db95a1 ("test/compress: add cycle-count mode to perf tool")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-03-04 08:32:09 +01:00
Pablo de Lara
3b0e34e80b test/efd: fix sockets mask size
Constant value 1 has a size of 32 bits, and shifting it more than 32 bits
to the left overflows. 1ULL is needed to be able to get a 64-bit value.

Coverity ID: 375846
Fixes: 8751a7e983 ("efd: allow more CPU sockets in table creation")
Cc: stable@dpdk.org

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2022-02-27 18:57:45 +01:00
Thomas Monjalon
1a2eaefa47 app/testpmd: fix build without drivers
When ixgbe and bnxt are disabled, compilation was failing:

app/test-pmd/cmdline.c:9396:11: error:
	variable 'vf_rxmode' set but not used

Fixes: 4cfe399f65 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2022-02-25 18:32:17 +01:00
Bing Zhao
d9e597141f app/testpmd: fix raw encap of GENEVE option
The structure "rte_flow_item_geneve_opt" is not a protocol header of
geneve tunnel option from rfc8926. The field "data" is a pointer
which points to the actual variable-length option data. So the
structure is not packed.

There is 4 bytes hole before the pointer in a 64-bit system. The
option header is just 4 bytes. When using offsetof() to get the
fixed part's size of option header, the wrong value 8 was got. When
constructing the encap header, a wrong size and offset was used due
to this hole.

With this commit, the fixed part's size is calculated explicitly
based on all fields.

Fixes: 55c074f3ba ("app/testpmd: support GENEVE option item")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-02-25 15:48:07 +01:00
Alexander Kozyrev
d906fff518 app/testpmd: add async indirect actions operations
Add testpmd support for the rte_flow_async_action_handle API.
Provide the command line interface for operations dequeue.
Usage example:
  flow queue 0 indirect_action 0 create action_id 9
    ingress postpone yes action rss / end
  flow queue 0 indirect_action 0 update action_id 9
    action queue index 0 / end
flow queue 0 indirect_action 0 destroy action_id 9

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Alexander Kozyrev
f9bf7dff5d app/testpmd: add flow queue pull operation
Add testpmd support for the rte_flow_pull API.
Provide the command line interface for pulling operations results.
Usage example: flow pull 0 queue 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Alexander Kozyrev
9cbbee1451 app/testpmd: add flow queue push operation
Add testpmd support for the rte_flow_push API.
Provide the command line interface for pushing operations.
Usage example: flow queue 0 push 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Alexander Kozyrev
ecdc927b99 app/testpmd: add async flow create/destroy operations
Add testpmd support for the rte_flow_q_create/rte_flow_q_destroy API.
Provide the command line interface for enqueueing flow
creation/destruction operations. Usage example:
  testpmd> flow queue 0 create 0 postpone no
           template_table 6 pattern_template 0 actions_template 0
           pattern eth dst is 00:16:3e:31:15:c3 / end actions drop / end
  testpmd> flow queue 0 destroy 0 postpone yes rule 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Alexander Kozyrev
c4b3887334 app/testpmd: add flow table management
Add testpmd support for the rte_flow_table API.
Provide the command line interface for the flow
table creation/destruction. Usage example:
  testpmd> flow template_table 0 create table_id 6
    group 9 priority 4 ingress mode 1
    rules_number 64 pattern_template 2 actions_template 4
  testpmd> flow template_table 0 destroy table 6

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Alexander Kozyrev
04cc665fab app/testpmd: add flow template management
Add testpmd support for the rte_flow_pattern_template and
rte_flow_actions_template APIs. Provide the command line interface
for the template creation/destruction. Usage example:
  testpmd> flow pattern_template 0 create pattern_template_id 2
           template eth dst is 00:16:3e:31:15:c3 / end
  testpmd> flow actions_template 0 create actions_template_id 4
           template drop / end mask drop / end
  testpmd> flow actions_template 0 destroy actions_template 4
  testpmd> flow pattern_template 0 destroy pattern_template 2

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Alexander Kozyrev
9ad3a41ab2 app/testpmd: add flow engine configuration
Add testpmd support for the rte_flow_configure API.
Provide the command line interface for the Flow management.
Usage example: flow configure 0 queues_number 8 queues_size 256

Implement rte_flow_info_get API to get available resources:
Usage example: flow info 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-24 14:04:48 +01:00
Raja Zidane
993677affe app/testpmd: fix GENEVE parsing in checksum mode
The csum FWD mode parses any received packet to set mbuf offloads for
the transmitting burst, mainly in the checksum/TSO areas.
In the case of a tunnel header, the csum FWD tries to detect known
tunnels by the standard definition using the header's data and fallback
to check the packet type in the mbuf to see if the Rx port driver
already sign the packet as a tunnel.
In the fallback case, the csum assumes the tunnel is VXLAN and parses
the tunnel as VXLAN.
When the GENEVE tunnel was added to the known tunnels in csum, its
parsing trial was wrongly located after the pkt type detection, causing
the csum to parse the GENEVE header as VXLAN when the Rx port set the
tunnel packet type.

Remove the fall back case to VXLAN.
Log error of unrecognized tunnel if no tunnel was parsed successfully.

Fixes: c10a026c3b ("app/testpmd: introduce vxlan parsing function in csum fwd engine")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-21 18:36:06 +01:00
Min Hu (Connor)
d8c079a572 app/testpmd: check starting port is not in bonding
In bond, start or stop slave port should be operated by bonding port.
This patch add port_is_bonding_slave in start_port function.

Fixes: 0e545d3047 ("app/testpmd: check stopping port is not in bonding")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-17 13:35:31 +01:00
Junjie Wan
b3eaaf1d08 net/bonding: fix slaves initializing on MTU setting
If a initial process for the bonding device is like:
rte_eth_dev_configure
rte_eth_dev_set_mtu
queue setup and start, etc.

Pass the vdev args to application, and init bonding device only.
-a 0000:af:00.0 --vdev="net_bonding0,mode=2,slave=0000:af:00.0"

It will fail and complain for the slave device
"Port 0 must be configured before MTU set"

Test can be reproduced with ovs.

Fixes: b26bee10ee ("ethdev: forbid MTU set before device configure")
Cc: stable@dpdk.org

Signed-off-by: Junjie Wan <wanjunjie@bytedance.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2022-02-17 12:55:21 +01:00
Volodymyr Fialko
5816147901 test/crypto: add L4 checksum case for transport mode
Added test case to verify L4 checksum offload in IPsec transport mode.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2022-02-23 11:43:41 +01:00
Volodymyr Fialko
42902e810d test/crypto: add TTL and hop limit decrement cases
Add test cases to verify TTL and hop limit decrement with lookaside
IPsec offload.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2022-02-23 11:43:41 +01:00
Arek Kusztal
3387912f5c cryptodev: fix RSA key type name
This patch fixes misspelled RTE_RSA_KEY_TYPE_QT,
this will prevent checkpach from complaining wherever
change to RSA is being made.

Fixes: 26008aaed1 ("cryptodev: add asymmetric xform and op definitions")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-22 20:21:20 +01:00
Tejasree Kondoj
d02c6bfcb9 test/crypto: add ESN and antireplay cases
Added test cases for IPsec ESN and Antireplay.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-22 19:05:12 +01:00
Anoob Joseph
70c60cfd93 test/crypto: add copy and set DSCP cases
Add test cases to verify copy and set DSCP with
IPv4 and IPv6 tunnels.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-22 19:05:11 +01:00
Shijith Thotton
de2bc16e1b app/eventdev: add crypto producer mode
In crypto producer mode, producer core enqueues cryptodev with software
generated crypto ops and worker core dequeues crypto completion events
from the eventdev. Event crypto metadata used for above processing is
pre-populated in each crypto session.

Parameter --prod_type_cryptodev can be used to enable crypto producer
mode. Parameter --crypto_adptr_mode can be set to select the crypto
adapter mode, 0 for OP_NEW and 1 for OP_FORWARD.

This mode can be used to measure the performance of crypto adapter.

Example:
  ./dpdk-test-eventdev -l 0-2 -w <EVENTDEV> -w <CRYPTODEV> -- \
  --prod_type_cryptodev --crypto_adptr_mode 1 --test=perf_atq \
  --stlist=a --wlcores 1 --plcores 2

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2022-02-24 08:58:43 +01:00
Bruce Richardson
727e6b7840 test/dma: fix missing checks for device capacity
For some DMA HW devices, e.g. those using the idxd driver, the maximum
burst size is configurable, which can lead to test failures if the value
is set too small. Add explicit check for this to give reasonable error
messages for devices which need their config adjusted.

Fixes: 1b86a66a30 ("test/dma: add more comprehensive copy tests")
Fixes: 8fa5d26839 ("test/dma: add burst capacity test")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2022-02-23 16:30:18 +01:00
Elena Agostini
9b8cae4d99 gpudev: use CPU mapping in communication list
rte_gpu_mem_cpu_map() exposes a GPU memory area to the CPU.
In gpudev communication list this is useful to store the
status flag.

A communication list status flag allocated on GPU memory
and mapped for CPU visibility can be updated by CPU and polled
by a GPU workload.

The polling operation is more frequent than the CPU update operation.
Having the status flag in GPU memory reduces the GPU workload polling
latency.

If CPU mapping feature is not enabled, status flag resides in
CPU memory registered so it's visible from the GPU.

To facilitate the interaction with the status flag, this patch
provides also the set/get functions for it.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-22 20:08:52 +01:00
Elena Agostini
77f40e04d7 gpudev: use device memory pointer for CPU unmap
Update rte_gpu_mem_cpu_unmap() header documentation
and the test application to use GPU pointer when unmapping.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-22 20:04:39 +01:00
Ciara Power
757f40e28e cryptodev: modify return value for asym session create
Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.

This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:39 +01:00
Ciara Power
92d55afe0f cryptodev: add asymmetric session user data API
A user data field is added to the asymmetric session structure.
Relevant API added to get/set the field.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:39 +01:00
Ciara Power
a29bb24898 cryptodev: hide asymmetric session structure
The rte_cryptodev_asym_session structure is now moved to an internal
header. This will no longer be used directly by apps,
private session data can be accessed via get API.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:39 +01:00
Ciara Power
1f1e4b7cba cryptodev: use single mempool for asymmetric session
Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:39 +01:00
Ciara Power
0438b7dff3 doc: replace asym crypto code with literal includes
The programmer's guide for cryptodev included sample code for using
Asymmetric crypto. This is now replaced with direct code from the test
application, using literal includes. It is broken into snippets as the
test application didn't have all of the required code in one function.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:39 +01:00
Kai Ji
845ec48ce0 test/crypto: fix out-of-place SGL in raw datapath
Fix out of place scatter gather list in sym raw datapath unit test.

Fixes: cd8166c28c ("test/crypto: add raw API test for dpaax")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:38 +01:00
Sean Zhang
26b7259a79 app/testpmd: support GRE option flow item
Add gre_option command for matching optional fields
(checksum/key/sequence) in GRE header. The item must follow gre item,
and the item does not change the flags in gre item, the application
should set the flags in gre item correspondingly.
Application can still use gre_key item 'gre_key value is xx' for key
matching, the effect is the same with using 'gre_option key is xx'.

The examples for gre_option are as follows:

To match on checksum field with value 0x11:
testpmd> ... pattern / eth / gre c_bit is 1 / gre_option checksum is
		0x11 / end ..

To match on checksum field with value 0x11 and any value of key:
testpmd> ... pattern / eth / gre c_bit is 1 k_bit is 1 / gre_option
		checksum is 0x11 / end ..

To match on checksum field with value 0x11 and no key field in packet:
testpmd> ... pattern / eth / gre c_bit is 1 k_bit is 0 / gre_option
		checksum is 0x11 / end ..

The invalid patterns for gre_option are as follows:

testpmd> ... pattern / eth / gre / gre_option checksum is 0x11 / end ..
		(c_bit in gre item not present)
testpmd> ... pattern / eth / gre c_bit is 0 / gre_option checksum is 0x11 /
		end .. (c_bit is unset for gre item, but checksum is
		specified by gre_option item)

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-11 16:51:59 +01:00
Jie Wang
988cd040ee app/testpmd: add 6 types of L2TPv2 message
This patch adds L2TPv2 control message and 5 types of data message
support for testpmd.

The added L2TPv2 message types are listed below:
1. L2TPv2 control
2. L2TPv2
3. L2TPv2 + length option
4. L2TPv2 + sequence option
5. L2TPv2 + offset option
6. L2TPv2 + length option + sequence option

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
2022-02-09 21:30:14 +01:00
Jie Wang
f840cf7713 ethdev: add L2TPv2 RSS offload type
This patch defines new RSS offload type for L2TPv2, which
is required when users want to distribute packets based on
the L2TPv2 session ID field.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-09 21:30:14 +01:00
Stephen Hemminger
06c047b680 remove unnecessary null checks
Functions like free, rte_free, and rte_mempool_free
already handle NULL pointer so the checks here are not necessary.

Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-02-12 12:07:48 +01:00
David Marchand
985571b6b4 test/mbuf: fix mbuf data content check
When allocating a mbuf, its data content is most of the time zero'd but
nothing ensures this. This is especially wrong when building with
RTE_MALLOC_DEBUG, where data is poisoned to 0x6b on free.

This test reserves MBUF_TEST_DATA_LEN2 bytes in the mbuf data segment,
and sets this data to 0xcc.
Calling strlen(), the test may try to read more than MBUF_TEST_DATA_LEN2
which has been noticed when memory had been poisoned.

The mbuf data content is checked right after, so we can simply remove
strlen().

Fixes: 7b295dceea ("test/mbuf: add unit test cases")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-02-11 08:50:13 +01:00
Vladimir Medvedkin
a01070dac9 app/fib: fix division by zero
This patch fixes the division by 0, which occurs if the number of
routes is less than 10.
Can be triggered by passing -n argument with value < 10:

./dpdk-test-fib -- -n 9
...
Floating point exception (core dumped)

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

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2022-02-11 08:50:13 +01:00
Elena Agostini
d69bb47d21 gpudev: expose GPU memory to CPU
Enable the possibility to expose a GPU memory area and make it
accessible from the CPU.

GPU memory has to be allocated via rte_gpu_mem_alloc().

This patch allows the gpudev library to map (and unmap),
through the GPU driver, a chunk of GPU memory and to return
a memory pointer usable by the CPU to access the GPU memory area.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-02-10 10:06:56 +01:00
Sunil Kumar Kori
a5e579f4b4 app/testpmd: add queue based priority flow control command
Patch adds command line options to configure queue based
priority flow control.

- Syntax command is given as below:

set pfc_queue_ctrl <port_id> rx <on|off> <tx_qid> <tx_tc> \
	tx <on|off> <rx_qid> <rx_tc> <pause_time>

- Example command to configure queue based priority flow control
  on rx and tx side for port 0, Rx queue 0, Tx queue 0 with pause
  time 2047

testpmd> set pfc_queue_ctrl 0 rx on 0 0 tx on 0 0 2047

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-08 14:02:28 +01:00
Xiaoyun Li
e6b9d6411e app/testpmd: add SW L4 checksum in multi-segments
Csum forwarding mode only supports software UDP/TCP csum calculation
for single segment packets when hardware offload is not enabled.
This patch enables software UDP/TCP csum calculation over multiple
segments.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-04 13:44:55 +01:00
Nipun Gupta
cb43641e73 app/testpmd: update raw flow to take hex input
This patch enables method to provide key and mask for raw rules
to be provided as hexadecimal values. There is new parameter
pattern_mask added to support this.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-03 15:12:05 +01:00
Steve Yang
ff6db88296 app/testpmd: fix stack overflow for EEPROM display
When the size of EEPROM exceeds the default thread stack size(8MB),
e.g.: 10MB size, it will crash due to stack overflow.

Allocate the data of EPPROM information on the heap.

Fixes: 6b67721dee ("app/testpmd: add EEPROM command")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-02-03 14:13:32 +01:00
Min Hu (Connor)
39ddd5d189 app/testpmd: fix bonding mode set
when start testpmd, and type command like this, it will lead to
Segmentation fault, like:

testpmd> create bonded device 4 0
testpmd> add bonding slave 0 2
testpmd> add bonding slave 1 2
testpmd> port start 2
testpmd> set bonding mode 0 2
testpmd> quit
Stopping port 0...
Stopping ports...
...
Bye...
Segmentation fault

The reason to the bug is that rte timer do not be cancelled when quit.
That is, in 'bond_ethdev_start', resources are allocated according to
different bonding mode. In 'bond_ethdev_stop', resources are free by
the corresponding mode.

For example, 'bond_ethdev_start' start bond_mode_8023ad_ext_periodic_cb
timer for bonding mode 4. and 'bond_ethdev_stop' cancel the timer only
when the current bonding mode is 4. If the bonding mode is changed,
and directly quit the process, the timer will still on, and freed memory
will be accessed, then segmentation fault.

'bonding mode' changed means resources changed, reallocate resources for
different mode should be done, that is, device should be restarted.

Fixes: 2950a76931 ("bond: testpmd support")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-31 17:13:06 +01:00
Dmitry Kozlyuk
0dff3f26d6 eal: extend --huge-unlink for hugepage file reuse
Expose Linux EAL ability to reuse existing hugepage files
via --huge-unlink=never switch.
Default behavior is unchanged, it can also be specified
using --huge-unlink=existing for consistency.
Old --huge-unlink switch is kept,
it is an alias for --huge-unlink=always.
Add a test case for the --huge-unlink=never mode.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2022-02-08 21:32:53 +01:00
Dmitry Kozlyuk
c62b318a9f app/test: add allocator performance benchmark
Memory allocator performance is crucial to applications that deal
with large amount of memory or allocate frequently. DPDK allocator
performance is affected by EAL options, API used and, at least,
allocation size. New autotest is intended to be run with different
EAL options. It measures performance with a range of sizes
for dirrerent APIs: rte_malloc, rte_zmalloc, and rte_memzone_reserve.

Work distribution between allocation and deallocation depends on EAL
options. The test prints both times and total time to ease comparison.

Memory can be filled with zeroes at different points of allocation path,
but it always takes considerable fraction of overall timing. This is why
the test measures filling speed and prints how long clearing takes
for each size as a reference (for rte_memzone_reserve estimations
are printed).

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2022-02-08 21:32:53 +01:00
Jie Zhou
0edc1f408a test: enable subset of tests on Windows
Enable a subset of unit tests for Windows CI

- For driver tests, driver owners should enable corresponding tests when
  enabling driver for Windows.
- For dump tests, currently the tests hang on Windows which require
  further investigation.
- For telemetry tests, it has POSIX socket specific codes which require
  replacement for Windows. Will investigate and work on a separate patch.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
9713eae1d8 test: replace shell script with Python
- Add python script to check if system supports hugepages
- Remove corresponding .sh script
- Replace calling of .sh with corresponding .py in meson.build

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
3c60274c09 test: skip unsupported tests on Windows
Skip tests which are not yet supported for Windows:
- The libraries that tests depend on are not enabled on Windows yet
- The tests can compile but with issue still under investigation
    * test_func_reentrancy:
      Windows EAL has no protection against repeated calls.
    * test_lcores:
      Execution enters an infinite loops, requires investigation.
    * test_rcu_qsbr_perf:
      Execution hangs on Windows, requires investigation.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
f684672947 test: resolve name collision on Windows
Add prefix to resolve name collision on Windows.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
a089d32033 test/alarm: disable bad time cases on Windows
Remove two alarm_autotest test cases which do bogus range check
on Windows.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
e14f1744d6 eal: differentiate strerror message on Windows
On Windows, strerror returns just "Unknown error" for errnum greater
than MAX_ERRNO, while linux and freebsd returns "Unknown error <num>",
which is the current expectation for errno_autotest. Differentiate
the error string on Windows to remove a "duplicate error code" failure.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
1570ab1129 test/log: skip regex on Windows
DPDK logs_autotest on Windows failed at "dynamic log types" tests.
The failures are on 2 test cases for rte_log_set_level_regexp API,
due to regular expression is not supported on Windows in DPDK yet
and regcomp/regexec are just stubs on Windows (in regex.h).

In app/test/test_logs.c, ifndef these two test cases, and for the
rte_log_set_level_pattern validation case following these two cases,
differentiate the expected log level passed into macro CHECK_LEVELS

Now logs_autotest completes for all dynamic log types and static log types.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
d18eb79740 test/interrupts: skip on Windows
Even though test_interrupts.c can compile on Windows, skip interrupt
tests for now since majority of eal_interrupt on Windows are stubs.
Will remove the skip after interrupt being fully enabled on Windows.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
068cdfae1f test/mem: fix error check
Fix incorrect errno variable used in memory autotest.
Use rte_errno instead.

Fixes: 086d426406 ("test/mem: fix memory autotests on FreeBSD")
Cc: stable@dpdk.org

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2022-02-08 14:19:40 +01:00
Jie Zhou
987d40a057 test: remove POSIX-specific code
- Replace POSIX-specific code with DPDK equivalents or
  conditionally disable it on Windows
- Use NUL on Windows as /dev/null for Unix
- Exclude tests not supported on Windows yet
  * multi-process
  * PMD performance statistics display on signal

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2022-02-08 14:19:40 +01:00
Morten Brørup
ed579e50c6 mempool: test performance with constant n
"What gets measured gets done."

This patch adds mempool performance tests where the number of objects to
put and get is constant at compile time, which may significantly improve
the performance of these functions. [*]

Also, it is ensured that the array holding the object used for testing
is cache line aligned, for maximum performance.

And finally, the following entries are added to the list of tests:
- Number of kept objects: 512
- Number of objects to get and to put: The number of pointers fitting
  into a cache line, i.e. 8 or 16

[*] Some example performance test (with cache) results:

get_bulk=4 put_bulk=4 keep=128 constant_n=false rate_persec=280480972
get_bulk=4 put_bulk=4 keep=128 constant_n=true  rate_persec=622159462

get_bulk=8 put_bulk=8 keep=128 constant_n=false rate_persec=477967155
get_bulk=8 put_bulk=8 keep=128 constant_n=true  rate_persec=917582643

get_bulk=32 put_bulk=32 keep=32 constant_n=false rate_persec=871248691
get_bulk=32 put_bulk=32 keep=32 constant_n=true rate_persec=1134021836

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2022-02-02 22:06:14 +01:00
Bruce Richardson
ecb904cc45 build: fix warnings when running external commands
Meson 0.61.1 is giving warnings that the calls to run_command do not
always explicitly specify if the result is to be checked or not, i.e.
there is a missing "check" parameter. This is because the default
behaviour without the parameter is due to change in the future.

We can fix these warnings by explicitly adding into each call whether
the result should be checked by meson or not. This patch therefore
adds in "check: false" to each run_command call where the result is
being checked by the DPDK meson.build code afterwards, and adds in
"check: true" to any calls where the result is currently unchecked.

Bugzilla ID: 921
Cc: stable@dpdk.org

Reported-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2022-02-02 15:44:12 +01:00
Dmitry Kozlyuk
13b196425c app/testpmd: fix external buffer allocation
External pinned buffer memory (--mp-alloc=xbuf)
was allocated as multiple IOVA-contiguous memzones
of 2M size and 2M alignment.
Due to the malloc overhead and the alignment requirement,
each 2M memzone consumed 4M of hugepage memory:
2M of usable memory + X of malloc overhead + (2M-X) padding.
The allocation often failed with 2M hugepages and IOVA-as-PA
if a PA-contiguous span of 2 hugepages could not be found.
Also, with any hugepage size and IOVA mode
memory consumption was almost 2x of the usable amount.

Alignment requirement of 2M for external buffers is redundant.
It was an attempt to ensure IOVA-contiguity
by forcing memzones to start at hugepage boundaries,
while 2M size intended to leave no unused space on the page.
As shown above, this in fact caused excessive memory consumption
and decreased the chance of a successful allocation.
RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.

Remove the alignment requirement.
Reduce the memzone size by the malloc overhead size (4 cache lines),
so that memory consumption for each memzone is
(2M-X) of usable memory + X of malloc overhead = 2M.
This also means that whenever there are free 2M hugepages,
an IOVA-contiguous memzone can always be allocated.

Fixes: 72512e1897 ("app/testpmd: add mempool with external data buffers")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-01-18 14:22:15 +01:00
Sean Morrissey
f924a8d3bb app/testpmd: fix dereference before null check
Assign 'left' variable only after null check on 'size'
as function returns if 'size' is null.

Coverity issue: 374381
Fixes: 169a9fed1f ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-18 14:02:48 +01:00
Viacheslav Ovsiienko
9fac5ca8ed app/testpmd: fix Tx scheduling interval
The first "set txtimes" command parameter specifies the time
interval between scheduled send bursts for single queue. This
interval should be the same for all the forwarding ports.
It requires to maintain the timing related variables on per
queue basis instead of per core, as currently implemented.
This resulted in wrong burst intervals if two or more cores
were generating the scheduled traffic for two or more ports
in txonly mode.

This patch moves the timing variable to the fstream structure.
Only txonly forwarding mode with enabled send scheduling is
affected.

Fixes: 4940344dab ("app/testpmd: add Tx scheduling command")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-14 18:02:30 +01:00
Anoob Joseph
e2cbb38450 test/crypto: add copy/set DF cases in IPsec
Add test cases to verify copy DF and set DF options
with lookaside IPsec offload.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Anoob Joseph
67b5428db3 test/crypto: add AES-XCBC known vectors
Add known vector test cases for NULL cipher + AES-XCBC.
Also add both algos to the combined mode list of algos.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Tejasree Kondoj
50b592bcde test/crypto: skip null auth in ICV corrupt case
Skipping NULL authentication in ICV corruption test case
for lookaside IPsec testsuite.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Tejasree Kondoj
825ab5c31a test/crypto: add fragmented packet case
Add fragmented plain packet test case in combined mode.
The test case leverages combined mode framework to generate
IPsec packet from a fragment and verify that headers are formed
correctly. The IPsec packet would be decapsulated and the plain
packet is compared against the original packet.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Tejasree Kondoj
1567deea83 test/crypto: add IPsec AES-CTR cases
Add IPsec AES-CTR test case for combined mode
in lookaside IPsec testsuite.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Ankur Dwivedi
2c85598c53 test/crypto: add IPsec security stats cases
Add security stats test cases in IPSEC protocol testsuite.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Anoob Joseph
65d68c7cd7 test/crypto: add IPsec transport mode cases
Added IPsec transport mode test cases for IPv4 packets
in the test app.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Tejasree Kondoj
b7986bde8e test/crypto: add IPsec fragmented packet known vectors
Added fragmented plain packet known vector test case in
IPsec outbound. The test case sends a fragmented packet
and ensures that the IPsec packet generated has correct
fragmentation fields (ie, the IPsec packet is not fragmented)
by comparing against the known vector.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:55:12 +01:00
Tejasree Kondoj
50069f3cd4 test/crypto: add IPsec HMAC-SHA384/512 known vectors
Test app is updated with lookaside IPsec HMAC-SHA384/512
known vectors test cases.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 11:54:48 +01:00
Tejasree Kondoj
9fb87fbfe9 test/crypto: add IPv6 tunnel mode cases
Added IPv6 known vector and combined mode tests.
Following modes are added:
Tunnel IPv6 in IPv6
Tunnel IPv4 in IPv4
Tunnel IPv4 in IPv6
Tunnel IPv6 in IPv4

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 10:46:17 +01:00
Anoob Joseph
8d2905236c test/crypto: add chained operations in combined cases
Extend lookaside IPsec combined mode cases to cover chained
operations also.

Currently covering combinations of Ciphers(AES-128-CBC)
and Auth(NULL, SHA2-256 [16B ICV]).

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 10:44:09 +01:00
Tejasree Kondoj
178a12fb0d test/crypto: add IPsec AES-CBC-HMAC-SHA256 known vectors
Test app for lookaside IPsec is added with
AES-CBC-HMAC-SHA256 test cases.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 10:42:45 +01:00
Anoob Joseph
67d2a1880b test/crypto: add IPsec AES-CBC known vectors
Extend IPsec lookaside test framework to support chained
operations and add AES-CBC 128 known vector tests.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-01-21 10:41:37 +01:00
Bruce Richardson
a7d53af2ec build: make "packet framework" optional
Add port, table and pipeline libraries - collectively often known as
the "packet framework" -  to the list of optional libraries, and
ensure tests can build with them disabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2022-01-21 06:09:00 -05:00
Bruce Richardson
6a9145ca4b build: make flow classification optional
Add the flow_classify library to the list of optional libraries, and
ensure tests can build with it disabled.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2022-01-21 12:05:14 +01:00
Bruce Richardson
df17828b61 test: link against all enabled libs
Rather than maintaining a list of the libraries the unit tests need, and
having to conditionally include/omit optional libs from the list, we can
just link against all available libraries, simplifying the code
considerably.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2022-01-21 12:05:14 +01:00
Elena Agostini
c8557ed434 gpudev: add alignment for memory allocation
Similarly to rte_malloc, rte_gpu_mem_alloc accepts as
input the memory alignment size.

GPU driver should return GPU memory address aligned
with the input value.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2022-01-21 11:33:25 +01:00
Bruce Richardson
98a54d0ae6 test/dma: increase iterations of capacity test case
To ensure we catch any bugs in calculation due to wrap-around of the id
values, increase the number of iterations of the burst_capacity test.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2022-01-20 14:05:47 +01:00
Jerin Jacob
33e71acf3d drivers: remove octeontx2 drivers
As per the deprecation notice,  In the view of enabling unified driver
for octeontx2(cn9k)/octeontx3(cn10k), removing drivers/octeontx2
drivers and replace with drivers/cnxk/ which
supports both octeontx2(cn9k) and octeontx3(cn10k) SoCs.

This patch does the following

- Replace drivers/common/octeontx2/ with drivers/common/cnxk/
- Replace drivers/mempool/octeontx2/ with drivers/mempool/cnxk/
- Replace drivers/net/octeontx2/ with drivers/net/cnxk/
- Replace drivers/event/octeontx2/ with drivers/event/cnxk/
- Replace drivers/crypto/octeontx2/ with drivers/crypto/cnxk/
- Rename config/arm/arm64_octeontx2_linux_gcc as
  config/arm/arm64_cn9k_linux_gcc
- Update the documentation and MAINTAINERS to reflect the same.
- Change the reference to OCTEONTX2 as OCTEON 9. Old release notes and
the kernel related documentation is not accounted for this change.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
2022-01-12 15:36:32 +01:00
Josh Soref
7be78d0279 fix spelling in comments and strings
The tool comes from https://github.com/jsoref

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2022-01-11 12:16:53 +01:00
Elena Agostini
6399acaded app/gpudev: remove memory leaks
Remove all memory leaks in case of errors in
test-gpudev application.

Fixes: e818c4e2bf ("gpudev: add memory API")
Fixes: c7ebd65c13 ("gpudev: add communication list")

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-26 13:15:04 +01:00
Sean Morrissey
f8dbaebbf1 fix PMD wording
Removing the use of driver following PMD as its unnecessary.

Cc: stable@dpdk.org

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-11-26 11:28:34 +01:00
Sean Morrissey
b53d106d34 remove repeated 'the' in the code
Remove the use of double "the" as it does not make sense.

Cc: stable@dpdk.org

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-11-26 11:28:34 +01:00
Gregory Etelson
ea1da434c0 app/testpmd: fix hexadecimal parser with odd length
Current hex string parser assumes input has even characters number.
The parser fails input string with odd length.

The patch parses hex strings with even and odd length.
Parse result of an input with odd length will match result of
even length input, that has `0` as MSB, following by the original
sequence.
For example:
"0x1" results in *dst={0x01, 0x00}, *size=1
"0xabc" results in *dst={0x0a, 0xbc, 0x00}, *size=2

Fixes: 169a9fed1f ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-11-24 17:34:38 +01:00
Xueming Li
926629e3f3 bus: fix device iterator match from arguments
Device iterator RTE_DEV_FOREACH() failed to return devices from
classifier like "class=vdpa", because matching name from empty kvargs
returns no result. If device name not specified in kvargs, the function
should iterate all devices.

This patch allows empty devargs or devargs without name specified.

Fixes: 6aebb94290 ("kvargs: add function to get from key and value")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
2021-11-24 15:11:42 +01:00
Gagandeep Singh
8e3c55386f app/crypto-perf: increase segment size for IPsec
Application calculates segment size based on buffer size plus
digest size only, But if the operation mode is IPsec then
packet length can be increased by some more bytes depending on
the algorithm.

In this patch, increasing segment size with RTE_PKTMBUF_HEADROOM
when there is no user given segment size.

Fixes: 28dde5da50 ("app/crypto-perf: support lookaside IPsec")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-11-23 20:48:04 +01:00
Gregory Etelson
849e6ddc6a app/testpmd: fix tunnel offload validation
Tunnel offload API allows application to restore packet to
its original form if chain of flows missed after DECAP action.
The main idea of the tunnel offload API was to query port PMD
to provide flow elements - actions or items.
Flow elements supplied by PMD are merged with original flow rule
elements provided by testpmd operator to create a new flow rule,
optimal for PMD, to implement the tunnel offload API.
That flow rule transformation is hidden form testpmd operator and uses
internal testpmd resources.

Current testpmd did not release tunnel offload resources if flow rule
validation failed.

The patch always releases tunnel offload resources after flow rule
validation returns.

Fixes: 1b9f274623 ("app/testpmd: add commands for tunnel offload")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2021-11-17 13:12:56 +01:00
Ivan Malov
2490bb8971 app/testpmd: fix flow transfer proxy port handling
The current approach detects the proxy port on each port (re-)plug and
may spam the log with error messages if the PMD does not support flows.
As testpmd is a debug tool, it must not do such implicit port handling.
Instead, the new API should be called only when the user requests that.

Revoke the existing code. Implement an explicit command-line primitive
to let the user find the proxy port themselves. Provide relevant hints.

Fixes: 1179f05cc9 ("ethdev: query proxy port to manage transfer flows")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-11-17 11:26:27 +01:00
Raslan Darawsheh
edbe962fa1 app/testpmd: fix GTP PSC extension header length
Current implementation for raw encap sets the length to be in bytes,
but, GTP 'extension' header length is an 8-bit field in 4-octet units.

This fixes the length calculation of the header length.

Fixes: 9213c50e36 ("app/testpmd: support GTP PSC option in raw sets")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-11-16 15:24:24 +01:00
David Marchand
cbff4d8dc9 build: make pdump optional
This library can be made optional.
dumpcap and pdump applications depend on this library, check for
dependencies like what we have for examples.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-11-17 12:49:19 +01:00
David Marchand
bb9be9a45e build: make metrics libraries optional
metrics, bitratestats, jobstats and latencystats libraries can be made
optional as they provide standalone features.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-11-17 12:48:33 +01:00
David Marchand
6970401e97 build: make GRO/GSO libraries optional
GRO and GSO integration in testpmd is relatively self contained and easy
to extract.
Those libraries can be made optional as they provide standalone
features.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-11-17 12:48:22 +01:00
Joyce Kong
1f8cc1a388 app: remove unneeded atomic header include
Remove the unnecessary rte_atomic.h included in app modules.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
eac341d387 app/testpmd: remove atomic operations for port status
The port_status changes do not need to be handled
atomically, as they are modified during initialization
or through the testpmd prompt instead of multiple
threads.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
5109487205 app/eventdev: use compiler atomics for shared data sync
Convert rte_atomic usages to compiler atomic built-ins
for shared data sync in eventdev cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
45f838d60a app/crypto: use compiler atomic builtins for display sync
Convert rte_atomic_test_and_set usage to compiler atomic
CAS operation for display sync in crypto cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
d3fcd87c23 app/compress: use compiler atomic builtins for display sync
Convert rte_atomic_test_and_set usage to compiler atomic
CAS operation for display sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
f83f314741 app/bbdev: use compiler atomics for shared data sync
Convert rte_atomic usages to compiler atomic built-ins
for shared data sync in bbdev cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
827aa9c6af test/timer: use compiler atomic builtins for sync
Convert rte_atomic usages to compiler atomic
built-ins for lcore_state and collisions sync.

Also, move 'main_init_workers' outside of
'timer_stress2_main_loop' to guarantee lcore_state
initialized correctly before the threads launched.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
e64f423b12 test/stack_perf: use compiler atomics for lcore sync
Convert rte_atomic usages to compiler atomic built-ins
for lcore sync in stack_perf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
4c6b0e9b45 test/ring_perf: use compiler atomic builtins for lcores sync
Convert rte_atomic usages to compiler atomic built-ins
for lcores sync in ring_perf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
a598afba59 test/pmd_perf: use compiler atomic builtins for polling sync
Convert rte_atomic usages to compiler atomic built-ins
for polling sync in pmd_perf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
3dd8b5b389 test/func_reentrancy: use compiler atomics for data sync
Convert rte_atomic usages to compiler atomic built-ins
for shared data sync in func_reentrancy test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
2021-11-17 11:07:06 +01:00
Joyce Kong
7e6533c1b6 test/bpf: use compiler atomics for calculation
Convert rte_atomic usages to compiler atomic built-ins
for calculation in bpf test cases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-11-17 11:07:06 +01:00
Raslan Darawsheh
22ffcce31b app/flow-perf: fix parsing of invalid option
Currently, if an invalid parameter is passed to the application
it will cause a crash due to missing default in options.

For example:
        ./dpdk-test-flow-perf -a 01:00.0 -- --invalid

This adds missing default for options, and prints the
invalid option.

Fixes: 3344cf2e30 ("app/flow-perf: add flow performance skeleton")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2021-11-17 10:47:55 +01:00
Elena Agostini
329f73eb35 app/gpudev: improve output
Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2021-11-16 21:04:33 +01:00
Stephen Hemminger
4a6672c2d3 fix spelling in comments and doxygen
Fix spelling errors in comments including doxygen found using codespell.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
2021-11-16 17:57:09 +01:00
David Marchand
1b13f95b03 test: move RED to extra tests list
This test gives random failures, move it to extra until we have a fix.
See: https://bugs.dpdk.org/show_bug.cgi?id=826

Signed-off-by: David Marchand <david.marchand@redhat.com>
2021-11-16 16:33:30 +01:00
David Marchand
74822233bd test: create a list of extra tests
We removed some tests from the "CI" (fast-tests) list because they
were not reliable enough or did not make sense as non regression tests.
Since we still build those tests code, leave an option for users to call
them.
This list can also serve as a point where to document why test X is not
suitable for the "CI" list.

Signed-off-by: David Marchand <david.marchand@redhat.com>
2021-11-16 16:30:01 +01:00
David Marchand
81169a01ff test: remove unnecessary test commands
EAL and rwlock tests have been split into smaller unit tests now listed
in meson.
Nothing is referencing eal_flags_autotest and rwlock_autotest anymore,
since we dropped the python wrapper.

Fixes: 8c745bb623 ("test: remove autotest python wrapper")

Signed-off-by: David Marchand <david.marchand@redhat.com>
2021-11-16 16:28:53 +01:00
Stephen Hemminger
79b3275ada test/bpf: do not require DNS lookup
These tests were using strings with hostname (dpdk.org) and this makes
test code do a DNS lookup. In container environment used for OpenSuse
build, DNS is unavailable. Replace dpdk.org with an IPv4 address
reserved for documentation (RFC5737) and use IPv6 in one example
(RFC3849). Actual addresses don't matter for this test which is
validating that code generated in classic BPF can be successfully
converted to eBPF.

Fixes: 2eccf6afbe ("bpf: add function to convert classic BPF to DPDK BPF")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Luca Boccassi <bluca@debian.org>
2021-11-16 16:22:26 +01:00
Gagandeep Singh
0e51e342ac test/crypto: fix output buffer length
Input buffer length is getting appended with
padding length when the test case is encrypted
digest, but output buffer length is appended
with padding length for all the cases.

This patch fixes the output buffer length
by appending the padding length only when the
test case is of encrypted digest type.

Fixes: 6356c28642 ("test/crypto: add cases for block cipher encrypted digest")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-11-16 08:24:39 +01:00
Ciara Power
c0daf3bd4b test/crypto: remove unnecessary stats retrieval
The device stats are retrieved in the testcase teardown function,
but are not being used afterwards. Remove this unnecessary call.
The stats retrieval for the device is being tested already by a
dedicated stats testcase.

Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2021-11-16 07:38:07 +01:00
Anoob Joseph
0015b149bc test/crypto: fix missing return checks
The API could return errors. Add error checking for the same.

Fixes: b3bbd9e5f2 ("cryptodev: support device independent sessions")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-11-16 07:38:07 +01:00