Commit Graph

3127 Commits

Author SHA1 Message Date
David Marchand
6cff0deff1 app/testpmd: remove unneeded dependency on meter lib
testpmd depends on ethdev, which itself depends on meter.
No need for an explicit dependency, since no testpmd code directly calls
in the meter library.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-11-06 00:46:00 +01:00
Gregory Etelson
2d3d840135 app/testpmd: fix flex item flush
Testpmd provides 2 sets of flex item create and destroy functions
One for hosts with JSON library. These functions parse
flex item configuration stored in JSON file and create or destroy
flex item object. The second functions set is for hosts without JSON
library for compilation compatibility.

On hosts without JSON library, current implementation issues
"no JSON library" notification on port close.
The notification was triggered by port destructors that include
flex items flush routine.

The patch introduces single implementation for testpmd
flex item destroy.

Fixes: 59f3a8acbc ("app/testpmd: add flex item commands")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-11-05 22:19:38 +01:00
Naga Harish K S V
b7c71b4769 test/event: add unit test for Rx adapter
add unit test for rte_event_eth_rx_adapter_queue_stats_get() and
rte_event_eth_rx_adapter_queue_stats_reset() APIs.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-11-04 08:41:25 +01:00
Vidya Sagar Velumuri
6abbe13194 test/crypto: fix vectors for ZUC-256
Fix the test vectors added for ZUC 256-bit key
Add known vectors form ZUC 256 RFC.

Fixes: fa5bf9345d ("test/crypto: add ZUC cases with 256-bit keys")

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2021-11-04 19:46:27 +01:00
Pablo de Lara
1ab82cfe50 test/crypto: fix test vectors for ZUC-256
Fix the IV for ZUC-256 test vectors

Fixes: 216125c62d ("test/crypto: add ZUC-256 vectors")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2021-11-04 19:46:27 +01:00
Rebecca Troy
c1685e2f77 test/crypto: refactor DOCSIS to show hidden cases
In the current implementation, the DOCSIS test cases are running
and being reported as one test, despite the fact that multiple
test cases are hidden inside i.e. "test_DOCSIS_PROTO_all" runs
52 test cases. Each DOCSIS test case should be reported individually
instead.

This commit achieves this by removing the use of the
test_DOCSIS_PROTO_all function and statically listing the test cases
to run when building the test suite, which are then reported to the
user by description.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: David Coyle <david.coyle@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-11-04 19:46:27 +01:00
Jim Harris
1345c5baae test/compress-perf: remove unused variable
clang-13 rightfully complains that the total_deq_ops
variable in cperf_cyclecount_op_setup is set but not
used, since the final accumulated total_deq_ops
results isn't used anywhere. So just remove the
total_deq_ops variable.

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

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-11-04 19:46:27 +01:00
Kiran Kumar K
9603e432bd test/crypto-perf: fix memory allocation in asym case
While populating the crypto ops in case of asymmetric, result
is being allocated from stack. This is causing crash in the
application. And operation type is also not being initialized
properly. Adding a fix by allocating the result from global
memory and initialized the operation memory properly.

Fixes: ba588ce3f9 ("test/crypto-perf: test asymmetric crypto throughput")

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-11-04 19:46:27 +01:00
Kai Ji
6d4c594e46 test/crypto: fix max length for raw data path
Update the calculation of the max length needed when converting mbuf to
data vec in partial digest test case. This update make sure the enough
vec buffers are allocated for the appended digest in sgl op for raw
datapath api.

Fixes: 4868f6591c ("test/crypto: add cases for raw datapath API")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-11-04 19:43:14 +01:00
Junfeng Guo
deaa33c251 app/testpmd: increase max raw pattern size to 512
Update max size for pattern in struct rte_flow_item_raw to enable
protocol agnostic flow offloading.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2021-11-03 13:01:21 +01:00
Min Hu (Connor)
bd0241e2d5 bonding: show Tx policy for 802.3AD mode
As balance xmit policy is supported in bonding mode 4(802.3AD). This
patch adds balance xmit policy show in testpmd commands for mode 4. Like:
testpmd> show bonding config 2
        Bonding mode: 4
        Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER34
        IEEE802.3AD Aggregator Mode: stable
        Slaves (2): [0 1]
        Active Slaves (2): [1 0]
        Primary: [1]

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-11-02 18:12:18 +01:00
Maxime Coquelin
c28115d775 app/testpmd: add missing flow types in port info
This patch adds missing IPv6-Ex and GTPU flow types to port
info command. It also add the same definitions to
str2flowtype(), used to configure flow director.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-29 11:23:10 +02:00
Maxime Coquelin
88232b54ee app/testpmd: fix RSS type display
This patch fixes the display of the RSS hash types
configured in the port, which displayed "all" even
if only a single type was configured

Fixes: 3c90743dd3 ("app/testpmd: support more types for flow RSS")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2021-10-29 11:23:10 +02:00
Maxime Coquelin
8e1d0547d6 app/testpmd: fix RSS key length
port_rss_hash_key_update() initializes rss_conf with the
RSS key configuration provided  by the user, but it calls
rte_eth_dev_rss_hash_conf_get() before calling
rte_eth_dev_rss_hash_update(), which overrides the parsed
RSS config.

While the RSS key value is set again after, this is not
the case of the key length. It could cause out of bounds
access if the key length parsed is smaller than the one
read from rte_eth_dev_rss_hash_conf_get().

This patch restores the key length before the
rte_eth_dev_rss_hash_update() call to ensure the RSS key
value/length pair is consistent.

Fixes: 8205e241b2 ("app/testpmd: add missing type to RSS hash commands")
Cc: stable@dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2021-10-29 11:23:10 +02:00
Andrew Rybchenko
4c96e084fd app/testpmd: fix MTU configuration before device start
There is no point to do rte_eth_dev_mtu_set() before configure since
set MTU value is overwritten on configure anyway. So, setting of MTU
before configure is rejected now on ethdev level.

If testpmd is going to do configure (e.g. just after testpmd start
with disabled devices start up or any configuration changes in stopped
state which require reconfigure), just save requested MTU in device
config to be applied on reconfigure.

Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
Fixes: b26bee10ee ("ethdev: forbid MTU set before device configure")

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-28 20:21:30 +02:00
Jie Wang
684366134c app/testpmd: fix L2TPv2 message type
In "msg_type |= 0xc800", wider "51200" has high-order bits (0xc800)
that don't affect the narrower left-hand side.

This patch fixes coverity issue by changing the definition type of
"msg_type" from uint8_t to uint16_t.

Coverity issue: 373651
Fixes: 748530f035 ("app/testpmd: support L2TPv2 and PPP protocol pattern")

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-28 20:04:03 +02:00
Sean Zhang
80a3233197 app/flow-perf: add destination ports parameter
Add optional destination ports parameter for port-id action.
The parameter is not must, and the value is 1 by default as before
if the parameter not provided.

For example:

$ dpdk-test-flow-perf -w 08:00.0,representor=[0,1] -- --transfer \
  --ingress --transfer --ether --portmask=0x2 --vxlan-encap \
  --port-id=0

This command means the rule created on representor 0 with port 0
as destination, since the portmask is 0x2 and dst-ports is 0:

$ dpdk-test-flow-perf -w 08:00.0,representor=[0,1] \
  -w 08:00.1,representor=[0,1]-- --transfer --ingress --transfer \
  --ether --portmask=0x12 --vxlan-encap --port-id=0,3

This command means the rules created on both representor 0 of PF 0
and PF 1, the destination port for the first representor is PF 0,
and the destination port for the other one is PF 1.

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Reviewed-by: Wisam Jaddo <wisamm@nvidia.com>
2021-11-05 10:58:25 +01:00
Konstantin Ananyev
65d9b7c664 bpf: fix convert API when libpcap missing
rte_bpf_convert() implementation depends on libpcap.
Right now it is defined only when this library is installed and
RTE_PORT_PCAP is defined.
Fix that by providing for such case stub rte_bpf_convert()
implementation that will always return an error.
To draw user attention, if proper implementation is disabled,
warning will be thrown at meson configure stage.
Also move stub for another function (rte_bpf_elf_load) into
the same place (bpf_stub.c).

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

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-11-04 19:56:20 +01:00
Wojciech Liguzinski
44c730b0e3 sched: add PIE based congestion management
Implement PIE based congestion management based on rfc8033.

The Proportional Integral Controller Enhanced (PIE) algorithm works
by proactively dropping packets randomly.
PIE is implemented as more advanced queue management is required to
address the bufferbloat problem and provide desirable quality of
service to users.

Tests for PIE code added to test application.
Added PIE related information to documentation.

Signed-off-by: Wojciech Liguzinski <wojciechx.liguzinski@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
2021-11-04 15:41:49 +01:00
Vladimir Medvedkin
11c5b9b51a fib: add RIB extension size parameter
This patch adds a new parameter to the FIB configuration to specify
the size of the extension for internal RIB structure.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
2021-11-04 12:38:03 +01:00
Olivier Matz
7dc627426e test/mbuf: fix access to freed memory
Seen by ASan.

In the external buffer mbuf test, we check that the buffer is freed
by checking that its refcount is 0.
This is not a valid condition, because it accesses to an already
freed area.

Fix this by setting a boolean flag in the callback when rte_free()
is actually called, and check this flag instead.

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

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-11-04 11:19:26 +01:00
David Marchand
86e361cdeb test/cmdline: fix memory leak
Previous change wrongly removed cmdline_free().

Fixes: 6ad06203a5 ("cmdline: free on exit")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-11-04 11:19:26 +01:00
Vladimir Medvedkin
239fffe040 test/thash: add performance tests for Toeplitz hash
This patch adds performance tests for the following Toeplitz hash
function implementations:
  Scalar:
    - rte_softrss()
    - rte_softrss_be()
  Vector using gfni:
    - rte_thash_gfni()
    - rte_thash_gfni_bulk()

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2021-11-04 11:19:10 +01:00
Vladimir Medvedkin
31d7c06947 hash: add bulk Toeplitz hash implementation
This patch adds a bulk version for the Toeplitz hash implemented
with Galios Fields New Instructions (GFNI).

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-11-04 11:19:10 +01:00
Vladimir Medvedkin
4fd8c4cb0d hash: add new Toeplitz hash implementation
This patch add a new Toeplitz hash implementation using
Galios Fields New Instructions (GFNI).

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-11-04 11:19:10 +01:00
Dmitry Kozlyuk
5b08ac4e4a test/mempool: fix no-huge mode
Amount of locked memory for regular users is limited,
it is usually 64 KB by default.
Hitting this limit in rte_mempool_populate_anon()
resulted in not populating the mempool, and a test case failure:

    EAL: Test assert test_mempool_events line 585 failed: Failed to populate mempool empty1: Success
    test failed at test_mempool():1019
    Test Failed

Decrease the amount of mapped anonymous memory to fit the limit.
While there, make all function-local constants lowercase.

Fixes: 11541c5c81 ("mempool: add non-IO flag")

Reported-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
2021-11-03 18:32:19 +01:00
Dmitry Kozlyuk
89e94773cb test/mempool: fix test on FreeBSD
FreeBSD EAL does not implement rte_mem_virt2iova() causing an error:

    EAL: Test assert test_mempool_flag_non_io_unset_when_populated_with_valid_iova
    line 781 failed: Cannot get IOVA
    test failed at test_mempool():1030
    Test Failed

Change unit test to use rte_memzone_reserve() to allocate memory,
which allows to obtain IOVA directly.

Bugzilla ID: 863
Fixes: 11541c5c81 ("mempool: add non-IO flag")

Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
2021-11-03 18:32:19 +01:00
David Marchand
f88b0b8922 devtools: forbid indent with tabs in Meson
The rule for indentation in Meson in DPDK is 4 spaces.

Any tab should be flagged as an issue, let's extend the check and fix
existing offenders.

Fixes: 4ad4b20a79 ("drivers: change indentation in build files")
Fixes: 2457705e64 ("crypto/cnxk: add driver skeleton")
Fixes: 634b731044 ("app/testpmd: build on Windows")
Fixes: 3a6bfc37ea ("net/ice: support QoS config VF bandwidth in DCF")
Fixes: 8ef09fdc50 ("build: add optional NUMA and CPU counts detection")
Fixes: e1369718f5 ("common/octeontx: enable build only on 64-bit Linux")
Fixes: 2b504721bf ("app/bbdev: enable la12xx")
Fixes: 6cc51b1293 ("mem: instrument allocator for ASan")
Fixes: c75542ae42 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Fixes: 918fd2f146 ("crypto/ipsec_mb: move aesni_mb PMD")
Fixes: 746825e5c0 ("crypto/ipsec_mb: move aesni_gcm PMD")
Fixes: bc9ef81c42 ("crypto/ipsec_mb: move kasumi PMD")
Fixes: 4f1cfda59a ("crypto/ipsec_mb: move snow3g PMD")
Fixes: cde8df1bda ("crypto/ipsec_mb: move zuc PMD")
Fixes: f166628854 ("crypto/ipsec_mb: add chacha_poly PMD")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-11-02 19:25:30 +01:00
Konstantin Ananyev
b66412f24f test: fix ring PMD initialisation
(bitratestats_autotest|latencystats_autotest|pdump_autotest) tests
generate a log of error messages like that:

test_packet_forward() line 104: Error sending packet to port 0
Send pkts Failed

These tests use of app/test/sample_packet_forward.* code.
This code creates a portid from a ring, but doesn't properly
configure/start it.
The fix adds code to configure/start given port before usage.

Fixes: 7a0935239b ("ethdev: make fast-path functions to use new flat array")
Fixes: a52966cd48 ("test: add helpers using ring PMD Rx/Tx")
Cc: stable@dpdk.org

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
2021-10-26 19:59:26 +02:00
Wisam Jaddo
741bb850ee app/flow-perf: export some config as runtime options
Some options are needed in the runtime many times, so leaving
it during compilation is not correct. As a result some options
has been exported into command line options to be used at run
time.

The options exported are:
--txq=N
--rxq=N
--txd=N
--rxd=N
--mbuf-size=N
--mbuf-cache-size=N
--total-mbuf-count=N

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-10-25 22:31:53 +02:00
Honnappa Nagarahalli
f217fa71ac test: test control thread creation
Add a testcase to test launching of control threads.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-25 21:44:47 +02:00
Harman Kalra
db86bf263d test/interrupts: remove direct access to interrupt handle
Updating the interrupt testsuite to make use of interrupt
handle get set APIs.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Raslan Darawsheh <rasland@nvidia.com>
2021-10-25 21:20:12 +02:00
Honnappa Nagarahalli
505fc416e0 test/ring: relax memory ordering for stress test
wrk_cmd variable is used to signal the worker thread to start
or stop the stress test loop. Relaxed barriers are used
to achieve the same.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
2021-10-25 18:20:59 +02:00
Dmitry Kozlyuk
6fda3ff6f0 mempool: fix non-IO flag inference
When mempool had been created with RTE_MEMPOOL_F_NO_IOVA_CONTIG flag
but later populated with valid IOVA, RTE_MEMPOOL_F_NON_IO was unset,
while it should be kept. The unit test did not catch this
because rte_mempool_populate_default() it used was populating
with RTE_BAD_IOVA.

Keep setting RTE_MEMPOOL_NON_IO at an empty mempool creation
and add an assert for it in the unit test (remove the separate case).
Do not reset the flag if RTE_MEMPOOL_F_ON_IOVA_CONTIG is set.

Fixes: 11541c5c81 ("mempool: add non-IO flag")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-25 16:52:56 +02:00
Shijith Thotton
e6cb7e70df test/event: fix timer adapter creation test
Removed freeing of unallocated mempool in event timer adapter create
unit test.

Fixes: d1f3385d00 ("test: add event timer adapter auto-test")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2021-10-25 12:15:59 +02:00
Xueming Li
d05c2dcc49 test/devargs: fix memory leak
In layer argument test function, kvargs are parsed and checked without
free. This patch calls rte_kvargs_free() function to avoid memory leak.

Coverity issue: 373631
Fixes: a4975cd20d ("test: add devargs test cases")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-10-25 09:42:38 +02:00
Olivier Matz
daa02b5cdd mbuf: add namespace to offload flags
Fix the mbuf offload flags namespace by adding an RTE_ prefix to the
name. The old flags remain usable, but a deprecation warning is issued
at compilation.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-10-24 13:37:43 +02:00
Olivier Matz
5b63493241 mbuf: mark old VLAN offload flags as deprecated
The flags PKT_TX_VLAN_PKT and PKT_TX_QINQ_PKT are
marked as deprecated since commit 380a7aab1a ("mbuf: rename deprecated
VLAN flags") (2017). But they were not using the RTE_DEPRECATED
macro, because it did not exist at this time. Add it, and replace
usage of these flags.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-10-24 13:30:40 +02:00
Kai Ji
418c1a5499 test/crypto: enable chacha_poly PMD
An autotest is added for the new chacha20_poly1305 PMD.
A new test case is also added for SGL test.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-20 15:33:16 +02:00
Pablo de Lara
216125c62d test/crypto: add ZUC-256 vectors
Add extra ZUC-EIA3-256 and ZUC-EEA3-256 test vectors.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-20 12:06:01 +02:00
Pablo de Lara
f93fce6de4 test/crypto: check auth parameters
Check for auth parameters in the transform to verify if a test case is
supported by the crypto device under test.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-20 12:06:01 +02:00
Pablo de Lara
27b7871324 test/crypto: check cipher parameters
Check for cipher parameters in the transform to verify if a test case
is supported by the crypto device under test.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-20 12:06:01 +02:00
Ferruh Yigit
295968d174 ethdev: add namespace
Add 'RTE_ETH' namespace to all enums & macros in a backward compatible
way. The macros for backward compatibility can be removed in next LTS.
Also updated some struct names to have 'rte_eth' prefix.

All internal components switched to using new names.

Syntax fixed on lines that this patch touches.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
2021-10-22 18:15:38 +02:00
Konstantin Ananyev
a136b08c10 test/bonding: fix after hiding ethdev internal structures
link bounding auto-test internally creates emulated ethdev.
Some tests change Rx/Tx functions of this emulated device on the fly:
by directly modifying rte_eth_dev fields and without doing stop/start
for these devices.
As now ethdev uses rte_eth_fp_ops[] for fast-path functions, these
direct changes doesn't make expected effect.
Fix the problem by guarding fast-path functions changes with
rte_eth_dev_stop()/rte_eth_dev_start().

Fixes: 7a0935239b ("ethdev: make fast-path functions to use new flat array")

Reported-by: Lewei Yang <leweix.yang@intel.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-22 17:55:39 +02:00
Eli Britstein
6a8b64fd5e app/testpmd: fix packet burst spreading stats
RX/TX functions (rte_eth_rx_burst/rte_eth_tx_burst) get 'nb_pkts'
argument, which specifies the maximum number to receive/transmit.
It can be 0..nb_pkts, meaning nb_pkts+1 options.
Testpmd can provide statistics of the burst sizes ('set
record-burst-stats on') by incrementing an array cell of index
<burst-size>. This array is mistakenly [MAX_PKT_BURST] size. Receiving
the maximum burst will cause out of bound write.
Enlarge the spread stats array by one cell to fix it.

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

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-22 04:23:15 +02:00
Xueming Li
5984037501 app/testpmd: add forwarding engine for shared Rx queue
To support shared Rx queue, this patch introduces dedicate forwarding
engine. The engine groups received packets by mbuf->port into sub-group,
updates stream statistics and simply frees packets.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
2021-10-22 00:09:19 +02:00
Xueming Li
6574483365 app/testpmd: force shared Rx queue polled on same core
Shared Rx queue must be polled on same core. This patch checks and stops
forwarding if shared RxQ being scheduled on multiple
cores.

It's suggested to use same number of Rx queues and polling cores.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-22 00:09:15 +02:00
Xueming Li
7fbf4a02eb app/testpmd: dump port info for shared Rx queue
In case of shared Rx queue, source port mbuf from polling result isn't
the Rx port of forwarding stream. To provide original port ID, this
patch dumps mbuf->port for each packet in verbose mode if shared Rx
queue enabled.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-10-22 00:09:11 +02:00
Xueming Li
f4d178c13b app/testpmd: add parameter for shared Rx queue
Adds "--rxq-share=X" parameter to enable shared RxQ.

Rx queue is shared if device supports, otherwise fallback to standard
RxQ.

Shared Rx queues are grouped per X ports. X defaults to UINT32_MAX,
implies all ports join share group 1. Queue ID is mapped equally with
shared Rx queue ID.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-10-22 00:09:07 +02:00
Xueming Li
0bacfaa0c7 app/testpmd: dump device capability and Rx domain info
Dump device capability and Rx domain ID if shared Rx queue is supported
by device.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-10-22 00:09:00 +02:00
Jie Wang
748530f035 app/testpmd: support L2TPv2 and PPP protocol pattern
Add support for test-pmd to parse protocol pattern L2TPv2 and PPP.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-21 14:15:59 +02:00
Zhihong Peng
6ad06203a5 cmdline: free on exit
Malloc cl in the cmdline_stdin_new function, so release in the
cmdline_stdin_exit function is logical, so that cl will not be
released alone.

Fixes: af75078fec ("first public release")

Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Zhihong Peng <zhihongx.peng@intel.com>
2021-10-22 23:32:00 +02:00
Dmitry Kozlyuk
f8f8dc2890 cmdline: make struct rdline opaque
Hide struct rdline definition and some RDLINE_* constants in order
to be able to change internal buffer sizes transparently to the user.
Add new functions:

* rdline_new(): allocate and initialize struct rdline.
  This function replaces rdline_init() and takes an extra parameter:
  opaque user data for the callbacks.
* rdline_free(): deallocate struct rdline.
* rdline_get_history_buffer_size(): for use in tests.
* rdline_get_opaque(): to obtain user data in callback functions.

Remove rdline_init() function from library headers and export list,
because using it requires the knowledge of sizeof(struct rdline).

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Narcisa Vasile <navasile@linux.microsoft.com>
2021-10-22 23:23:45 +02:00
Stephen Hemminger
cbb44143be app/dumpcap: add new packet capture application
This is a new packet capture application to replace existing pdump.
The new application works like Wireshark dumpcap program and supports
the pdump API features.

It is not complete yet some features such as filtering are not implemented.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2021-10-22 22:40:58 +02:00
Stephen Hemminger
2eccf6afbe bpf: add function to convert classic BPF to DPDK BPF
The pcap library emits classic BPF (32 bit) and is useful for
creating filter programs.  The DPDK BPF library only implements
extended BPF (eBPF).  Add an function to convert from old to
new.

The rte_bpf_convert function uses rte_malloc to put the resulting
program in hugepage shared memory so it can be passed from a
secondary process to a primary process.

The code to convert was originally done as part of the Linux
kernel implementation then converted to a userspace program.
See https://github.com/tklauser/filter2xdp

Both authors have agreed that it is allowable to create a modified
version of this code and license it with BSD license used by DPDK.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2021-10-22 17:19:13 +02:00
Stephen Hemminger
8dd1a4e4ff test/bpf: enable in fast tests
The BPF autotest is defined but not run automatically.
Since it is short, it should be added to the autotest suite.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-10-22 17:19:13 +02:00
Stephen Hemminger
7a944656b3 test/pcapng: test pcapng library
Simple unit test that created pcapng file using API.

To run this test you need to have at least one device.
For example:

DPDK_TEST=pcapng_autotest ./build/app/test/dpdk-test -l 0-15 \
    --no-huge -m 2048 --vdev=net_tap,iface=dummy

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2021-10-22 17:19:13 +02:00
Chengwen Feng
b916b1a993 test/dma: check DMA info query
This patch add check for rte_dma_info_get() API.

Fixes: 718f780484 ("test/dma: add basic dmadev instance tests")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>
2021-10-21 22:06:45 +02:00
David Marchand
c61c8282ef dmadev: hide devices array
No need to expose rte_dma_devices out of the dmadev library.
Existing helpers should be enough, and inlines make use of
rte_dma_fp_objs.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-21 22:01:37 +02:00
Harry van Haaren
5f94d10897 app/eventdev: add event port hints for perf mode
This commit adds producer, worker and consumer port hints for the
test-eventdev application performance tests.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-10-21 10:16:00 +02:00
Rashmi Shetty
20841a2551 app/eventdev: support burst enqueue
Introduce a new command line option prod_enq_burst_sz
to set burst size for eventdev enqueue at producer in perf_queue
test. The newly added function perf_producer_burst is called when
prod_enq_burst_sz is greater than 1.

Signed-off-by: Rashmi Shetty <rashmi.shetty@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-10-21 10:16:00 +02:00
Harry van Haaren
c0900d3344 app/eventdev: fix terminal colour after control-c exit
Before this commit, a Control^C exit of the test-eventdev application
would print the worker packet percentages, and leave the terminal with
a green colour despite the colour reset being issued after the newline.
By moving the colour reset command before the \n the issue is fixed.

Fixes: 6b1a14a83a ("app/eventdev: add packet distribution logs")
Cc: stable@dpdk.org

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-10-21 10:16:00 +02:00
Naga Harish K S V
b06bca69b7 eventdev/eth_rx: add per-queue event buffer
Added per queue buffer. To configure per queue event buffer size,
application sets rte_event_eth_rx_adapter_params::use_queue_event_buf
flag as true while using rte_event_eth_rx_adapter_create_with_params().

The per queue event buffer size is populated in
rte_event_eth_rx_adapter_queue_conf::event_buf_size and passed
to rte_event_eth_rx_adapter_queue_add().

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
2021-10-21 10:14:50 +02:00
Naga Harish K S V
bc0df25c83 eventdev/eth_rx: add event buffer size configurability
Currently event buffer is static array with a default size defined
internally.

To configure event buffer size from application,
rte_event_eth_rx_adapter_create_with_params() API is added which
takes struct rte_event_eth_rx_adapter_params to configure event
buffer size in addition other params. The event buffer size is
rounded up for better buffer utilization and performance. In case
of NULL params argument, default event buffer size is used.

Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-10-21 10:14:50 +02:00
Ganapati Kundapura
da781e6488 eventdev/eth_rx: support Rx queue config get
Added rte_event_eth_rx_adapter_queue_conf_get() API to get rx queue
information - event queue identifier, flags for handling received packets,
scheduler type, event priority, polling frequency of the receive queue
and flow identifier in rte_event_eth_rx_adapter_queue_conf structure

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-10-21 10:14:50 +02:00
Pavan Nikhilesh
929ebdd543 eventdev/eth_rx: simplify event vector config
Include vector configuration into the structure
``rte_event_eth_rx_adapter_queue_conf`` that is used to configure
Rx adapter ethernet device Rx queue parameters.
This simplifies event vector configuration as it avoids splitting
configuration per Rx queue.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-10-21 10:14:50 +02:00
Shijith Thotton
e3f128dbee eventdev/crypto: add cryptodev start in adapter spec
Event crypto adapter spec does not mention about cryptodev start and
stop. Cryptodev attached to the adapter should be started before calling
crypto adapter start. Added the same in spec and test application.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-21 10:14:50 +02:00
David Marchand
1752b08781 test: rely on EAL detection for core list
Cores count has a direct impact on the time needed to complete unit
tests.

Currently, the core list used for unit test is enforced to "all cores on
the system" with no way for (CI) users to adapt it.
On the other hand, EAL default behavior (when no -c/-l option gets passed)
is to start threads on as many cores available in the process cpu
affinity.

Remove logic from meson: users can then select where to run the tests by
either running meson with a custom cpu affinity (using taskset/cpuset
depending on OS) or by passing a --test-args option to meson.

Example:
$ sudo meson test -C build --suite fast-tests -t 3 --test-args "-l 0-3"

Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2021-10-21 17:48:04 +02:00
Xueming Li
a4975cd20d test: add devargs test cases
Initial version to test global devargs syntax.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Gaetan Rivet <grive@u256.net>
2021-10-21 11:32:44 +02:00
Olivier Matz
efc6f9104c mbuf: fix reset on mbuf free
m->nb_seg must be reset on mbuf free whatever the value of m->next,
because it can happen that m->nb_seg is != 1. For instance in this
case:

  m1 = rte_pktmbuf_alloc(mp);
  rte_pktmbuf_append(m1, 500);
  m2 = rte_pktmbuf_alloc(mp);
  rte_pktmbuf_append(m2, 500);
  rte_pktmbuf_chain(m1, m2);
  m0 = rte_pktmbuf_alloc(mp);
  rte_pktmbuf_append(m0, 500);
  rte_pktmbuf_chain(m0, m1);

As rte_pktmbuf_chain() does not reset nb_seg in the initial m1
segment (this is not required), after this code the mbuf chain
have 3 segments:
  - m0: next=m1, nb_seg=3
  - m1: next=m2, nb_seg=2
  - m2: next=NULL, nb_seg=1

Then split this chain between m1 and m2, it would result in 2 packets:
  - first packet
    - m0: next=m1, nb_seg=2
    - m1: next=NULL, nb_seg=2
  - second packet
    - m2: next=NULL, nb_seg=1

Freeing the first packet will not restore nb_seg=1 in the second
segment. This is an issue because it is expected that mbufs stored
in pool have their nb_seg field set to 1.

Fixes: 8f094a9ac5 ("mbuf: set mbuf fields while in pool")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
2021-10-21 11:18:54 +02:00
Vladimir Medvedkin
e30ef3a3a0 test/hash: fix buffer overflow with jhash
This patch fixes buffer overflow reported by ASAN,
please reference https://bugs.dpdk.org/show_bug.cgi?id=818

Some tests for the rte_hash table use the rte_jhash_32b() as
the hash function. This hash function interprets the length
argument in units of 4 bytes.

This patch adds a wrapper function around rte_jhash_32b()
to reflect API differences regarding the length argument,
effectively dividing it by 4.

For some tests rte_jhash() is used with keys of length not
a multiple of 4 bytes. From the rte_jhash() documentation:
If input key is not aligned to four byte boundaries or a
multiple of four bytes in length, the memory region just
after may be read (but not used in the computation).

This patch increases the size of the proto field of the
flow_key struct up to uint32_t.

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

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2021-10-21 09:42:40 +02:00
Gregory Etelson
59f3a8acbc app/testpmd: add flex item commands
Network port hardware is shipped with fixed number of
supported network protocols. If application must work with a
protocol that is not included in the port hardware by default, it
can try to add the new protocol to port hardware.

Flex item or flex parser is port infrastructure that allows
application to add support for a custom network header and
offload flows to match the header elements.

Application must complete the following tasks to create a flow
rule that matches custom header:

1. Create flow item object in port hardware.
Application must provide custom header configuration to PMD.
PMD will use that configuration to create flex item object in
port hardware.

2. Create flex patterns to match. Flex pattern has a spec and a mask
components, like a regular flow item. Combined together, spec and mask
can target unique data sequence or a number of data sequences in the
custom header.
Flex patterns of the same flex item can have different lengths.
Flex pattern is identified by unique handler value.

3. Create a flow rule with a flex flow item that references
flow pattern.

Testpmd flex CLI commands are:

testpmd> flow flex_item create <port> <flex_id> <filename>

testpmd> set flex_pattern <pattern_id> \
         spec <spec data> mask <mask data>

testpmd> set flex_pattern <pattern_id> is <spec_data>

testpmd> flow create <port> ... \
/ flex item is <flex_id> pattern is <pattern_id> / ...

The patch works with the jansson library API.
A new optional dependency on jansson library is added for
testpmd. If jansson not detected the flex item functionality
is disabled.
Jansson development files must be present:
jansson.pc, jansson.h libjansson.[a,so]

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-10-20 19:00:26 +02:00
Gregory Etelson
2566c33c71 app/testpmd: add flow command parsing routine
testpmd flow creation is constructed from these procedures:
  1. receive string with flow rule description;
  2. parse input string and build flow parameters: port_id value,
     flow attributes, items array, actions array;
  3. create a flow rule from flow rule parameters.

Flow rule creation procedures are built as a pipeline. A new
procedure starts immediately after successful predecessor completion.
Due to this we have no dedicated routines providing intermediate
results for step 1-3 above.

The patch adds `flow_parse()` function call. It parses input string
and provides a caller with parsed data. This is a preparation step
for introducing flex item command processing.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-10-20 18:58:56 +02:00
Eli Britstein
ad6a8a20cb app/testpmd: add tunnel types
Current testpmd implementation supports VXLAN only for tunnel offload.
Add GRE, NVGRE and GENEVE for tunnel offload flow matches.

For example:
testpmd> flow tunnel create 0 type vxlan
port 0: flow tunnel #1 type vxlan
testpmd> flow tunnel create 0 type nvgre
port 0: flow tunnel #2 type nvgre
testpmd> flow tunnel create 0 type gre
port 0: flow tunnel #3 type gre
testpmd> flow tunnel create 0 type geneve
port 0: flow tunnel #4 type geneve

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

Signed-off-by: Eli Britstein <elibr@nvidia.com>
Reviewed-by: Gregory Etelson <getelson@nvidia.com>
2021-10-19 23:51:10 +02:00
Sunil Kumar Kori
b314a4a664 app/testpmd: fix access to DSCP table entries
During parsing of DSCP entries, memory is allocated and assigned
to *dscp_table. Later on, same memory is accessed using
*dscp_table[i++].

Due to higher precedence for array subscript, dscp_table[i++] will
be executed first which actually does not point to the same memory
which was allocated previously for DSCP table entries.

Fixes: 459463ae6c ("app/testpmd: fix memory allocation for DSCP table")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-19 18:10:28 +02:00
Ferruh Yigit
b563c14212 ethdev: remove jumbo offload flag
Removing 'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag.

Instead of drivers announce this capability, application can deduct the
capability by checking reported 'dev_info.max_mtu' or
'dev_info.max_rx_pktlen'.

And instead of application setting this flag explicitly to enable jumbo
frames, this can be deduced by driver by comparing requested 'mtu' to
'RTE_ETHER_MTU'.

Removing this additional configuration for simplification.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2021-10-18 19:20:21 +02:00
Ferruh Yigit
1bb4a528c4 ethdev: fix max Rx packet length
There is a confusion on setting max Rx packet length, this patch aims to
clarify it.

'rte_eth_dev_configure()' API accepts max Rx packet size via
'uint32_t max_rx_pkt_len' field of the config struct 'struct
rte_eth_conf'.

Also 'rte_eth_dev_set_mtu()' API can be used to set the MTU, and result
stored into '(struct rte_eth_dev)->data->mtu'.

These two APIs are related but they work in a disconnected way, they
store the set values in different variables which makes hard to figure
out which one to use, also having two different method for a related
functionality is confusing for the users.

Other issues causing confusion is:
* maximum transmission unit (MTU) is payload of the Ethernet frame. And
  'max_rx_pkt_len' is the size of the Ethernet frame. Difference is
  Ethernet frame overhead, and this overhead may be different from
  device to device based on what device supports, like VLAN and QinQ.
* 'max_rx_pkt_len' is only valid when application requested jumbo frame,
  which adds additional confusion and some APIs and PMDs already
  discards this documented behavior.
* For the jumbo frame enabled case, 'max_rx_pkt_len' is an mandatory
  field, this adds configuration complexity for application.

As solution, both APIs gets MTU as parameter, and both saves the result
in same variable '(struct rte_eth_dev)->data->mtu'. For this
'max_rx_pkt_len' updated as 'mtu', and it is always valid independent
from jumbo frame.

For 'rte_eth_dev_configure()', 'dev->data->dev_conf.rxmode.mtu' is user
request and it should be used only within configure function and result
should be stored to '(struct rte_eth_dev)->data->mtu'. After that point
both application and PMD uses MTU from this variable.

When application doesn't provide an MTU during 'rte_eth_dev_configure()'
default 'RTE_ETHER_MTU' value is used.

Additional clarification done on scattered Rx configuration, in
relation to MTU and Rx buffer size.
MTU is used to configure the device for physical Rx/Tx size limitation,
Rx buffer is where to store Rx packets, many PMDs use mbuf data buffer
size as Rx buffer size.
PMDs compare MTU against Rx buffer size to decide enabling scattered Rx
or not. If scattered Rx is not supported by device, MTU bigger than Rx
buffer size should fail.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
2021-10-18 19:20:20 +02:00
Jie Wang
655eae01f9 app/testpmd: fix RSS hash offload display
The driver may change RSS hash offloads in dev->data->dev_conf
during dev_configure which may cause port->dev_conf and port->rx_conf
contain outdated values.
Since testpmd uses its configuration structures to display offloads
configuration, it doesn't display RSS hash offload.

This patch updates the testpmd offloads from device configuration
to fix this issue.

Fixes: ce8d561418 ("app/testpmd: add port configuration settings")

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-15 13:27:05 +02:00
Gregory Etelson
63f2bbfa82 net: introduce IPv4 IHL and version fields
RTE IPv4 header definition combines the `version' and `ihl'  fields
into a single structure member.
This patch introduces dedicated structure members for both `version'
and `ihl' IPv4 fields. Separated header fields definitions allow to
create simplified code to match on the IHL value in a flow rule.
The original `version_ihl' structure member is kept for backward
compatibility.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-10-14 23:00:45 +02:00
Ivan Ilchenko
63b7265717 app/testpmd: add option to display extended statistics
Add 'display-xstats' option for using in accompanying with Rx/Tx statistics
(i.e. 'stats-period' option or 'show port stats' interactive command) to
display specified list of extended statistics.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-14 14:40:51 +02:00
Viacheslav Ovsiienko
a2b97fb7f5 app/testpmd: fix hex string parser in flow commands
The hexadecimal string parser does not check the target
field buffer size, buffer overflow happens and might
cause the application failure (segmentation fault
is observed usually).

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

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-10-14 14:34:31 +02:00
Viacheslav Ovsiienko
06822012c0 app/testpmd: update modify field flow action support
The testpmd flow create command updates provided:

  - modify field action supports the updated actions
  - pointer type added for action source field
  - pointer and value source field takes hex string
    instead of unsigned int in host endianness

There are some examples of flow with update modified
field action:

1. IPv6 destination address bytes 4-7 assignment:
   0000::1111 - > 0000:xxxx:4455:6677::1111

   flow create 0 egress group 1
     pattern eth / ipv6 dst is 0000::1111 / udp / end
     actions modify_field op set
             dst_type ipv6_dst
	     dst_offset 32
             src_type value
             src_value 0011223344556677
	     width 32 / end

2. Copy second byte of IPv4 destination address to the
   third byte of source address:
     10.0.118.4 -> 192.168.100.1
     10.0.168.4 -> 192.168.100.1

   flow create 0 egress group 1
     pattern eth / ipv4 / udp / end
     actions modify_field op set
             dst_type ipv4_src
             dst_offset 16
	     src_type ipv4_dst
	     src_offset 8
	     width 8 / end

3. Assign METADATA value with 11223344 value from the
   hex string in the linear buffer. Please note, the value
   definition should follow host-endian, example is given
   for x86 (little-endian):

   flow create 0 egress group 1
     pattern eth / ipv4 / end
     actions modify_field op set
             dst_type meta
	     src_type pointer
	     src_ptr 44332211
	     width 32 / end

4. Assign destination MAC with EA:11:0B:AD:0B:ED value:

   flow create 0 egress group 1
     pattern eth / end
     actions modify_field op set
             dst_type mac_dst
	     src_type value
	     src_value EA110BAD0BED
	     width 48 / end

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-10-14 14:34:31 +02:00
Ivan Malov
1179f05cc9 ethdev: query proxy port to manage transfer flows
Not all DPDK ports in a given switching domain may have the
privilege to manage "transfer" flows. Add an API to find a
port with sufficient privileges by any port in the domain.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
2021-10-14 13:42:59 +02:00
Ivan Malov
88caad251c ethdev: add represented port action to flow API
For use in "transfer" flows. Supposed to send matching traffic to the
entity represented by the given ethdev, at embedded switch level.
Such an entity can be a network (via a network port), a guest
machine (via a VF) or another ethdev in the same application.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-13 22:59:26 +02:00
Ivan Malov
8edb6bc026 ethdev: add port representor action to flow API
For use in "transfer" flows. Supposed to send matching traffic to
the given ethdev (to the application), at embedded switch level.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-13 22:59:26 +02:00
Ivan Malov
49863ae2bf ethdev: add represented port item to flow API
For use in "transfer" flows. Supposed to match traffic entering the
embedded switch from the entity represented by the given ethdev.
Such an entity can be a network (via a network port), a guest
machine (via a VF) or another ethdev in the same application.

Must not be combined with direction attributes.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-13 22:59:26 +02:00
Ivan Malov
081e42dab1 ethdev: add port representor item to flow API
For use in "transfer" flows. Supposed to match traffic
entering the embedded switch from the given ethdev.

Must not be combined with direction attributes.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-13 22:59:25 +02:00
Konstantin Ananyev
27a300e6af ethdev: add API to retrieve multiple MAC addresses
Introduce rte_eth_macaddrs_get() to allow user to retrieve all ethernet
addresses assigned to given port.
Change testpmd to use this new function and avoid referencing directly
rte_eth_devices[].

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Feifei Wang <feifei.wang2@arm.com>
2021-10-13 22:14:59 +02:00
Ivan Malov
f6d8a6d3fa ethdev: negotiate delivery of packet metadata from HW to PMD
Provide an API to let the application control the NIC's ability
to deliver specific kinds of per-packet metadata to the PMD.

Checks for the NIC's ability to set these kinds of metadata
in the first place (support for the flow actions) belong in
flow API responsibility domain (flow validate mechanism).
This topic is out of scope of the new API in question.

The PMD's ability to deliver received metadata to the user
by virtue of mbuf fields should be covered by mbuf library.
It is also out of scope of the new API in question.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
2021-10-13 00:47:42 +02:00
Andrew Rybchenko
92ef4b8f16 ethdev: remove deprecated shared counter attribute
Indirect actions should be used to do shared counters.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-10-12 19:20:57 +02:00
Viacheslav Galaktionov
c4045f3455 app/testpmd: add command to print representor info
Make it simpler to debug configurations and code related to the representor
info API.

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-12 19:05:43 +02:00
Huisong Li
c1ba6c325c app/testpmd: retain all original dev conf when config DCB
When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
rte_port->dev_conf. But some configurations, such as the link_speed, were
not saved if they were set before configuring DCB.

Fixes: 1a572499be ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-11 17:26:30 +02:00
Chengchang Tang
1dc6665d36 app/testpmd: add command to show LACP bonding info
Add a new cmdline to help diagnostic the bonding mode 4 in testpmd.

Show the lacp information about the bonded device and its slaves:
show bonding lacp info <bonded device port_id>

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-11 15:37:53 +02:00
Alvin Zhang
02220e5305 app/testpmd: fix txonly forwarding
When random number of Tx segments is enabled, because the actual
number of segments may be only one, the first segment of the Tx
packets must accommodate a complete being sending Eth/IP/UDP packet.

Besides, if multiple flow is enabled, the forwarding will update
the IP and UDP header, these headers shouldn't cross segments.
This also requires the first Tx segment can accommodate a complete
Eth/IP/UDP packet.

In addition, if time stamp is enabled, the forwarding needs more
Tx segment space for time stamp information.

This patch adds checks in beginning of forward engine to make sure
all above conditions are met.

Bugzilla ID: 797
Fixes: 79bec05b32 ("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-08 18:57:48 +02:00
Alvin Zhang
a78040c990 app/testpmd: update forward engine beginning
For each forward engine, there may be some special conditions
must be met before the forwarding runs.

Adding checks for these conditions in configuring is not suitable,
because one condition may rely on multiple configurations, and the
conditions required by each forward engine is not general.

The best solution is each forward engine has a callback to check
whether these conditions are met, and then testpmd can call the
callback to determine whether the forwarding can be started.

There was a void callback 'port_fwd_begin' in forward engine,
it did some initialization for forwarding, this patch updates its
return value then we can add some checks in it to confirm whether
the forwarding can be started. In addition, this patch calls the
callback before the forwarding stats is reset and then launches the
forwarding engine.

Bugzilla ID: 797
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-10-08 18:57:48 +02:00
Konstantin Ananyev
3ac2dffae8 test/bpf: fix undefined behavior with clang
test_shift1_check() function fails with clang build.
The reason for that is that clang uses 64-bit shift instruction for
what expected to be 32-bit operation.
To be more specific, this C code:
r2 = (uint32_t)r2 >> r4;
With clang produces:
41a4eb:       48 d3 ef                shr    %cl,%rdi
In that particular case it is an allowed choice, as from one side
left-operand value is known to fit into 32 bits, from other side
according to 'C' standard:
"...if the value of the right operand is negative or is greater than
or equal to the width of the promoted left operand, the behavior is
undefined."
The problem is that on x86 behavior for 64-bit and 32-bit shift
operation might differ.
The fix avoids undefined behavior by making sure
that right operand will not exceed width of the promoted left operand.

Bugzilla ID: 811
Fixes: 9f8f9d91a7 ("test/bpf: introduce functional test")
Cc: stable@dpdk.org

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-10-20 21:07:47 +02:00
Akhil Goyal
28dde5da50 app/crypto-perf: support lookaside IPsec
Added support for lookaside IPsec protocol offload.
Supported cases:
-AEAD
-Cipher+auth

Command used for testing:
./dpdk-test-crypto-perf -c 0xf -- --devtype crypto_octeontx2 --ptest
throughput --optype ipsec --cipher-algo aes-cbc --pool-sz 16384
--cipher-op encrypt --cipher-key-sz 16 --cipher-iv-sz 16 --auth-algo
sha1-hmac --auth-op generate --digest-sz 16 --total-ops 10000000
--burst-sz 32 --buffer-sz 64,128,256,512,1024,1280,2048

./dpdk-test-crypto-perf -c 0xf -- --devtype crypto_octeontx2 --ptest
throughput --optype ipsec --aead-algo aes-gcm --pool-sz 16384
--aead-op encrypt --aead-key-sz 32 --aead-iv-sz 12 --aead-aad-sz 16
--digest-sz 16 --total-ops 10000000 --burst-sz 32
--buffer-sz 64,128,256,512,1024,1280,2048

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
2021-10-18 20:12:19 +02:00
Nipun Gupta
441ac2e07b app/bbdev: handle endianness of test data
With data input, output and harq also supported in big
endian format, this patch updates the testbbdev application
to handle the endianness conversion as directed by the
the driver being used.

The test vectors assumes the data in the little endian order, and
thus if the driver supports big endian data processing, conversion
from little endian to big is handled by the testbbdev application.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2021-10-18 20:12:15 +02:00
Hemant Agrawal
2b504721bf app/bbdev: enable la12xx
Enabled NXP la12xx bbdev driver in test bbdev app
for unit testing.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2021-10-18 20:12:11 +02:00
Hemant Agrawal
a16cbb9838 test/crypto: add raw API support in 5G algos
This patch add support for RAW API testing with ZUC
and SNOW test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-17 19:32:13 +02:00
Hemant Agrawal
cd8166c28c test/crypto: add raw API test for dpaax
This patch add support for raw API tests for
dpaa_sec and dpaa2_sec platforms.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-17 19:32:13 +02:00
Hemant Agrawal
10488d59ae cryptodev: rename field in vector struct
This patch renames the sgl to src_sgl in struct rte_crypto_sym_vec
to help differentiating between source and destination sgl.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-10-17 19:31:15 +02:00
Matan Azrad
cab0c8f3c0 cryptodev: extend data-unit length field
As described in [1] and as announced in [2], The field ``dataunit_len``
of the ``struct rte_crypto_cipher_xform`` moved to the end of the
structure and extended to ``uint32_t``.

In this way, sizes bigger than 64K bytes can be supported for data-unit
lengths.

[1] commit d014dddb2d ("cryptodev: support multiple cipher
data-units")
[2] commit 9a5c09211b ("doc: announce extension of crypto data-unit
length")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-16 16:24:43 +02:00
Przemyslaw Zegan
49c19c94dc app/crypto-perf: fix AAD template copy overrun
This patch fixes a possible buffer overrun problem in crypto perf test.
Previously when user configured AAD size is over 12 bytes the copy
of template AAD will cause a buffer overrun.
The problem is fixed by only copy up to 12 bytes of AAD template.

Fixes: 8a5b494a7f ("app/test-crypto-perf: add AEAD parameters")
Cc: stable@dpdk.org

Signed-off-by: Przemyslaw Zegan <przemyslawx.zegan@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2021-10-16 15:45:02 +02:00
David Marchand
afdaa60795 mempool: accept user flags only
As reported by Dmitry, RTE_MEMPOOL_F_POOL_CREATED is a flag only
manipulated internally.
This flag is not supposed to be requested from an application and would
probably result in an incorrect behavior if an application did pass it.

At least one other internal flag has been added recently and more may be
introduced later.

Rework the check and export a mask of valid user flags for use in the
unit test.

Fixes: b240af8b10 ("mempool: enforce valid flags at creation")

Reported-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-20 10:03:55 +02:00
Andrew Rybchenko
d720366184 mempool: make header size calculation internal
Add RTE_ prefix to helper macro to calculate mempool header size and
make it internal. Old macro is still available, but deprecated.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-20 10:00:18 +02:00
Andrew Rybchenko
c47d7b90a1 mempool: add namespace to flags
Fix the mempool flags namespace by adding an RTE_ prefix to the name.
The old flags remain usable, to be deprecated in the future.

Flag MEMPOOL_F_NON_IO added in the release is just renamed to have RTE_
prefix.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-20 10:00:16 +02:00
Dharmik Thakkar
ee8cee83fe test/hash: use compiler atomics for sync
Convert rte_atomic usages to compiler atomic built-ins
for stats sync.

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
2021-10-19 17:15:10 +02:00
Joyce Kong
4da0136096 stack: remove unneeded atomic header include
In stack module, remove the header file rte_atomic.h
as it is not being used.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-10-19 17:15:10 +02:00
Dmitry Kozlyuk
11541c5c81 mempool: add non-IO flag
Mempool is a generic allocator that is not necessarily used
for device IO operations and its memory for DMA.
Add MEMPOOL_F_NON_IO flag to mark such mempools automatically
a) if their objects are not contiguous;
b) if IOVA is not available for any object.
Other components can inspect this flag
in order to optimize their memory management.

Discussion: https://mails.dpdk.org/archives/dev/2021-August/216654.html

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-19 16:35:16 +02:00
Dmitry Kozlyuk
da2b9cb25e mempool: add event callbacks
Data path performance can benefit if the PMD knows which memory it will
need to handle in advance, before the first mbuf is sent to the PMD.
It is impractical, however, to consider all allocated memory for this
purpose. Most often mbuf memory comes from mempools that can come and
go. PMD can enumerate existing mempools on device start, but it also
needs to track creation and destruction of mempools after the forwarding
starts but before an mbuf from the new mempool is sent to the device.

Add an API to register callback for mempool life cycle events:
* rte_mempool_event_callback_register()
* rte_mempool_event_callback_unregister()
Currently tracked events are:
* RTE_MEMPOOL_EVENT_READY (after populating a mempool)
* RTE_MEMPOOL_EVENT_DESTROY (before freeing a mempool)
Provide a unit test for the new API.
The new API is internal, because it is primarily demanded by PMDs that
may need to deal with any mempools and do not control their creation,
while an application, on the other hand, knows which mempools it creates
and doesn't care about internal mempools PMDs might create.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-19 16:35:16 +02:00
Kevin Laatz
8fa5d26839 test/dma: add burst capacity test
Add a test case to validate the functionality of drivers' burst capacity
API implementations.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-18 11:19:27 +02:00
Kevin Laatz
e00fcb0f27 test/dma: add fill tests
For DMA devices which support the fill operation, run unit tests to
verify fill behaviour is correct.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-18 11:19:27 +02:00
Bruce Richardson
99d7ec4be2 test/dma: add failure handling tests
Add a series of tests to inject bad copy operations into a dmadev to
test the error handling and reporting capabilities. Various combinations
of errors in various positions in a burst are tested, as are errors in
bursts with fence flag set, and multiple errors in a single burst.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-18 11:19:27 +02:00
Bruce Richardson
1b86a66a30 test/dma: add more comprehensive copy tests
Add unit tests for various combinations of use for dmadev, copying
bursts of packets in various formats, e.g.

1. enqueuing two smaller bursts and completing them as one burst
2. enqueuing one burst and gathering completions in smaller bursts
3. using completed_status() function to gather completions rather than
   just completed()

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-18 11:19:27 +02:00
Bruce Richardson
7f69922985 test/dma: run test suite on skeleton driver
When running the dmadev_autotest, run the suite of copy tests on the
skeleton driver created for API testing too, rather than just destroying
the driver instances once the API tests are complete. This helps to
sanity check the tests themselves are reasonable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
2021-10-18 11:19:27 +02:00
Bruce Richardson
8febcbe1dc test/dma: add basic copy tests
For each dmadev instance, perform some basic copy tests to validate that
functionality.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-18 11:19:21 +02:00
Bruce Richardson
718f780484 test/dma: add basic dmadev instance tests
Run basic sanity tests for configuring, starting and stopping a dmadev
instance to help validate drivers. This also provides the framework for
future tests for data-path operation.

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>
2021-10-18 11:19:02 +02:00
Chengwen Feng
9942ebb9c6 test/dma: add dmadev API test
This patch add dmadev API test which based on 'dma_skeleton' vdev. The
test cases could be executed using 'dmadev_autotest' command in test
framework.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2021-10-17 20:49:58 +02:00
David Marchand
e9123c467d mbuf: enforce no option for dynamic fields and flags
As stated in the API, dynamic field and flags should be created with no
additional flag (simply in the API for future changes).

Fix the dynamic flag register helper which was not enforcing it and add
unit tests.

Fixes: 4958ca3a44 ("mbuf: support dynamic fields and flags")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2021-10-15 10:29:41 +02:00
David Marchand
bc1a35fb3f memzone: enforce valid flags when reserving
If we do not enforce valid flags are passed by an application, this
application might face issues in the future when we add more flags.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2021-10-15 10:29:21 +02:00
David Marchand
b240af8b10 mempool: enforce valid flags at creation
If we do not enforce valid flags are passed by an application, this
application might face issues in the future when we add more flags.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-10-15 10:24:43 +02:00
David Christensen
17a042376b test/atomic: fix 128-bit atomic test with many cores
When checking the results of the rte_atomic128_cmp_exchange() function,
current code compares the values of a uint32_t and a uint64_t variable.
If the number of lcores used by the test is large, or the value of the
iteration count N is increased, the variable size mismatch can cause a
false test failure.  Modify the comparison to compare uint64_t values.

Fixes: fa3253c534 ("test/atomic: add 128-bit atomic compare exchange test")
Cc: stable@dpdk.org

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-10-14 17:20:49 +02:00
John Levon
24d5a1ce6b eal/linux: allow hugetlbfs sub-directories
get_hugepage_dir() was implemented in such a way that a --huge-dir
option had to exactly match the mountpoint, but there's no reason for
this restriction: DPDK might not be the only user of hugepages, and
shouldn't assume it owns an entire mountpoint. For example, if I have
/dev/hugepages/myapp, and /dev/hugepages/dpdk, I should be able to
specify:

--huge-dir=/dev/hugepages/dpdk/

and have DPDK only use that sub-directory.

Fix the implementation to allow a sub-directory within a suitable
hugetlbfs mountpoint to be specified, preferring the closest match.

Signed-off-by: John Levon <john.levon@nutanix.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-10-12 21:07:46 +02:00
David Marchand
8c745bb623 test: remove autotest python wrapper
This tool was used in the past to execute unit tests with make.
Meson has its own list of unit test, and its own way of calling them.

Since the switch to meson only builds, there is nothing depending on the
script in DPDK itself.
No CI seems to call it, time to put it to rest.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2021-10-12 21:07:43 +02:00
David Marchand
4a985f4e84 test/service: fix race in attr check
The CI reported rare (and cryptic) failures like:

RTE>>service_autotest
 + ------------------------------------------------------- +
 + Test Suite : service core test suite
 + ------------------------------------------------------- +
 + TestCase [ 0] : unregister_all succeeded
 + TestCase [ 1] : service_name succeeded
 + TestCase [ 2] : service_get_by_name succeeded
Service dummy_service Summary
  dummy_service: stats 1	calls 0	cycles 0	avg: 0
Service dummy_service Summary
  dummy_service: stats 0	calls 0	cycles 0	avg: 0
 + TestCase [ 3] : service_dump succeeded
 + TestCase [ 4] : service_attr_get failed
 + TestCase [ 5] : service_lcore_attr_get succeeded
 + TestCase [ 6] : service_probe_capability succeeded
 + TestCase [ 7] : service_start_stop succeeded
 + TestCase [ 8] : service_lcore_add_del succeeded
 + TestCase [ 9] : service_lcore_start_stop succeeded
 + TestCase [10] : service_lcore_en_dis_able succeeded
 + TestCase [11] : service_mt_unsafe_poll succeeded
 + TestCase [12] : service_mt_safe_poll succeeded
perf test for MT Safe: 42.7 cycles per call
 + TestCase [13] : service_app_lcore_mt_safe succeeded
perf test for MT Unsafe: 73.3 cycles per call
 + TestCase [14] : service_app_lcore_mt_unsafe succeeded
 + TestCase [15] : service_may_be_active succeeded
 + TestCase [16] : service_active_two_cores succeeded
 + ------------------------------------------------------- +
 + Test Suite Summary : service core test suite
 + ------------------------------------------------------- +
 + Tests Total :       17
 + Tests Skipped :      0
 + Tests Executed :    17
 + Tests Unsupported:   0
 + Tests Passed :      16
 + Tests Failed :       1
 + ------------------------------------------------------- +
Test Failed
RTE>>
stderr:
EAL: Detected CPU lcores: 16
EAL: Detected NUMA nodes: 2
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/service_autotest/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available 1048576 kB hugepages reported
EAL: VFIO support initialized
EAL: Device 0000:03:00.0 is not NUMA-aware, defaulting socket to 0
APP: HPET is not enabled, using TSC as default timer
EAL: Test assert service_attr_get line 340 failed: attr_get() call didn't
 get call count (zero)

According to API, trying to stop a service lcore is not possible if this
lcore is the only one associated to a service.
Doing this will result in a -EBUSY return code from
rte_service_lcore_stop() which the service_attr_get subtest was not
checking.
This left the service lcore running, and a race existed with the main
lcore on checking the service attributes which triggered this CI
failure.

To fix this, dissociate the service lcore with current service.

Once fixed this first issue, a race still exists, because the
wait_slcore_inactive helper added in a previous fix was not
paired with a check that the service lcore _did_ stop.

Add missing check on rte_service_lcore_may_be_active.

Fixes: 4d55194d76 ("service: add attribute get function")
Fixes: 52bb6be259 ("test/service: fix race condition on stopping lcore")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2021-10-12 21:07:30 +02:00
Joyce Kong
79afbbfeea test/service: fix some comment
Change the inaccurate comment of 'set pass flag' to 'clear pass flag'
as the '*pass_test = 0' code actually implements clearing.

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

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2021-10-12 21:07:27 +02:00
Archana Muniganti
83243502ac test/crypto: add inner checksum cases
This patch adds tests for inner IP and inner L4 checksum
verification in IPsec mode.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-08 21:40:16 +02:00
Shijith Thotton
67c8baecae test/event_crypto: fix event crypto metadata write
Using memcpy to update event crypto metadata fields (request/response)
will result in one overwriting the other. To avoid this, fields of each
structure should be updated one by one.

Fixes: 3c2c535ecf ("test: add event crypto adapter auto-test")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2021-10-08 21:31:07 +02:00
Nicolas Chautru
10ea15e35f bbdev: add capability for 4G CB CRC drop
Adding option to drop CRC24B to align with existing
feature for 5G

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2021-10-08 21:31:07 +02:00
Nicolas Chautru
cc360fd3f2 bbdev: add capability for CRC16 check
Adding a missing operation when CRC16
is being used for TB CRC check.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2021-10-08 21:31:07 +02:00
Vidya Sagar Velumuri
fa5bf9345d test/crypto: add ZUC cases with 256-bit keys
Add test cases for zuc 256 bit key.
Add test case for zuc 8 and 16 byte digest with
256 bit key mode

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-08 21:31:07 +02:00
Tejasree Kondoj
9ec50a5253 test/crypto: add UDP encapsulation port verification
Added UDP encapsulation ports verification test cases for
IPsec inbound.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-10-08 21:31:07 +02:00
Andrew Rybchenko
b225783dda ethdev: remove legacy mirroring API
A more fine-grain flow API action RTE_FLOW_ACTION_TYPE_SAMPLE should
be used instead of it.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-10-07 13:02:26 +02:00
Xueming Li
49ed322469 ethdev: make queue release callback optional
Some drivers don't need Rx and Tx queue release callback, make them
optional. Clean up empty queue release callbacks for some drivers.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-10-06 19:16:03 +02:00
Dmitry Kozlyuk
04d43857ea net: rename Ethernet header fields
Definition of `rte_ether_addr` structure used a workaround allowing DPDK
and Windows SDK headers to be used in the same file, because Windows SDK
defines `s_addr` as a macro. Rename `s_addr` to `src_addr` and `d_addr`
to `dst_addr` to avoid the conflict and remove the workaround.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-10-08 14:58:11 +02:00
David Marchand
cb3dd14c77 test/latency: fix loop boundary
Caught running ASAN.

lat_stats_strings[] is an array containing NUM_STATS strings.

Fixes: 1e3676a06e ("test/latency: add unit tests for latencystats library")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2021-10-05 17:29:42 +02:00
Bruce Richardson
086d426406 test/mem: fix memory autotests on FreeBSD
The memory autotests were failing on FreeBSD, due to an incorrect errno
variable being checked for ENOTSUP. The test checked "errno" while the
DPDK API sets "rte_errno". Changing to check the right variable makes
the test behave properly.

Fixes: c3e35a0966 ("test/mem: check segment fd API")

Reported-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-10-02 16:40:20 +02:00
Pablo de Lara
8751a7e983 efd: allow more CPU sockets in table creation
rte_efd_create() function was using uint8_t for a socket bitmask,
for one of its parameters.
This limits the maximum of NUMA sockets to be 8.
Changing to uint64_t increases it to 64, which should be
more future-proof.

Coverity issue: 366390
Fixes: 56b6ef874f ("efd: new Elastic Flow Distributor library")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Tested-by: David Christensen <drc@linux.vnet.ibm.com>
2021-10-01 16:33:20 +02:00
Raslan Darawsheh
16b8e92d49 ethdev: use extension header for GTP PSC item
This updates the gtp_psc flow item to use the net header
definition of the gtp_psc to be based on RFC 38415-g30

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-09-28 12:34:58 +02:00
Alvin Zhang
81b0fbb85b ethdev: add IPv4 and L4 checksum RSS offload types
This patch defines new RSS offload types for IPv4 and
L4(TCP/UDP/SCTP) checksum, which are required when users want
to distribute packets based on the IPv4 or L4 checksum field.

For example "flow create 0 ingress pattern eth / ipv4 / end
actions rss types ipv4-chksum end queues end / end", this flow
causes all matching packets to be distributed to queues on
basis of IPv4 checksum.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-09-21 10:25:42 +02:00
Tejasree Kondoj
270470ee90 test/crypto: add tunnel header verification cases
Added test cases to verify tunnel header in IPsec inbound.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-28 17:57:39 +02:00
Anoob Joseph
6978f51ea7 test/crypto: add packet hard expiry cases
Add tests to validate packets hard expiry handling.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-28 14:15:56 +02:00
Anoob Joseph
4aa52f213c test/crypto: add packet soft expiry cases
Add tests to validate packets soft expiry handling.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-28 14:15:10 +02:00
Anoob Joseph
ad7515a39f security: add SA lifetime configuration
Add SA lifetime configuration to register soft and hard expiry limits.
Expiry can be in units of number of packets or bytes. Crypto op
status is also updated to include new field, aux_flags, which can be
used to indicate cases such as soft expiry in case of lookaside
protocol operations.

In case of soft expiry, the packets are successfully IPsec processed but
the soft expiry would indicate that SA needs to be reconfigured. For
inline protocol capable ethdev, this would result in an eth event while
for lookaside protocol capable cryptodev, this can be communicated via
`rte_crypto_op.aux_flags` field.

In case of hard expiry, the packets will not be IPsec processed and
would result in error.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-28 14:11:29 +02:00
Anoob Joseph
0532f50c0e test/crypto: add outbound known vector cases for IV
Added outbound known vector test cases for IV generated
by app. The tests would be skipped on PMDs which do not
support IV provided by application.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-28 13:36:07 +02:00
Tejasree Kondoj
c823434174 test/crypto: add UDP-encapsulated IPsec cases
Added tests to verify UDP encapsulation with IPsec.
The tests have IPsec packets generated from plain packets
and verifies that UDP header is added. Subsequently, the
packets are decapsulated and then resultant packet is
verified by comparing against original packet.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2021-09-28 09:47:20 +02:00
Tejasree Kondoj
cd928003d8 test/crypto: add IV gen cases for IPsec
Added cases to verify IV generated by PMD for lookaside IPsec.

The tests compare IV generated for a batch of packets and ensures that
IV is not getting repeated in the batch.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2021-09-28 09:43:01 +02:00
Tejasree Kondoj
0f4531903a test/crypto: add lookaside IPsec ICV corrupt case
Add negative test to validate IPsec inbound processing failure with ICV
corruption. The tests would first do IPsec encapsulation and corrupt
ICV of the generated IPsec packet. Then the packet is submitted to IPsec
outbound processing for decapsulation. Test case would validate that PMD
returns an error in such cases.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-09-28 09:41:46 +02:00
Anoob Joseph
6622d9c97e test/crypto: add combined mode IPsec cases
Add framework to test IPsec features with all supported
combinations of ciphers.

Combined mode tests are used to test all IPsec features against all
ciphers supported by the PMD. The framework is introduced to avoid
testing with any specific algo, thereby making it mandatory to be
supported. Also, testing with all supported combinations will help with
increasing coverage as well.

The tests would first do IPsec encapsulation and do sanity checks. Based
on flags, packet would be updated or additional checks are done,
followed by IPsec decapsulation. Since the encrypted packet is generated
by the test, known vectors are not required.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2021-09-28 09:40:18 +02:00
Anoob Joseph
474f12024d test/crypto: add lookaside IPsec cases
Added test case for lookaside IPsec. Inbound known vector
tests are added.

Cipher list: AES-GCM 128, 192 & 256

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-09-28 08:46:03 +02:00
Rebecca Troy
96fe84f42a test/compress: fix buffer overflow
Fixes stack buffer overflow bug in compressdev autotest, which
was caused by the use of buf_idx in the debug logs. Originally, buf_idx
was treated as an array instead of the reference of an integer.
This was fixed by replacing the use of buf_idx[priv_data->orig_idx] with
the variable i.

Fixes: 466a2c4bb5 ("test/compress: improve debug logs")
Fixes: 6bbc5a9236 ("test/compress: refactor unit tests")
Cc: stable@dpdk.org

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2021-09-28 08:43:57 +02:00
Kiran Kumar K
ba588ce3f9 test/crypto-perf: test asymmetric crypto throughput
Added support for asymmetric crypto perf throughput test.
Only modex is supported for now.

One new optype has been added.
	--optype modex

./dpdk-test-crypto-perf -c 0x3 -- --devtype crypto_cn9k --optype modex
 --ptest throughput

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-28 08:43:57 +02:00
Fan Zhang
b8a7a3d248 test/crypto: fix PDCP short MAC-I case
This patch fixes the PDCP short MAC-I test by removing them
from snow3g and kasumi test suite and move to PDCP test suite.
This is to prevent incorrect failure for crypto device not
support PDCP.

Fixes: c24489e479 ("test/crypto: support PDCP short MAC-I")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2021-09-28 08:43:57 +02:00
Shijith Thotton
a0a388a897 eal: add macro to swap two variables
Add a macro to swap two variables
and updat common autotest for the same.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-09-27 18:33:45 +02:00
Radu Nicolau
d2671e642a telemetry: support dict of dicts
Add support for dicts of dicts to telemetry library.
Increase the max string size to 128.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2021-09-23 14:15:29 +02:00
Joyce Kong
d5559ac589 test/func_reentrancy: free memzones after test
Function reentrancy test limits maximum number of iterations
simultaneously, however it doesn't free the 'fr_test_once'
memzones after the fact, so introduce freeing 'fr_test_once'
in ring/mempool/hash/fbk/lpm_clean.

Meanwhile, add the missing free for test case on main thread.

Fixes: 104a92bd02 ("app: add reentrancy tests")
Fixes: 995eec6190 ("test: clean up memory for function reentrancy test")
Cc: stable@dpdk.org

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-09-16 17:17:34 +02:00
Thomas Monjalon
9c8c806487 test/crypto: fix minsize build
Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

app/test/test_cryptodev_blockcipher.c:1133:45: error:
‘blk_tcs’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|         const struct blockcipher_test_case *blk_tcs;
|                                             ^~~~~~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-09-15 17:12:29 +02:00
Aman Deep Singh
a7db3afce7 net: add macro to extract MAC address bytes
Added macros to simplify print of MAC address.
The six bytes of a MAC address are extracted in
a macro here, to improve code readablity.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-09-07 19:08:05 +02:00
Aman Deep Singh
c2c4f87b12 net: add macro for MAC address print
Added macro to print six bytes of MAC address.
The MAC addresses will be printed in upper case
hexadecimal format.
In case there is a specific check for lower case
MAC address, the user may need to make a change in
such test case after this patch.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-09-07 19:07:46 +02:00
Min Hu (Connor)
a550baf24a app/testpmd: support multi-process
This patch adds multi-process support for testpmd.
For example the following commands run two testpmd
processes:

 * the primary process:

./dpdk-testpmd --proc-type=auto -l 0-1 -- -i \
   --rxq=4 --txq=4 --num-procs=2 --proc-id=0

 * the secondary process:

./dpdk-testpmd --proc-type=auto -l 2-3 -- -i \
   --rxq=4 --txq=4 --num-procs=2 --proc-id=1

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
2021-09-07 15:29:03 +02:00
Zhihong Wang
861e768459 app/testpmd: add option for number of flows in flowgen
Make number of flows in flowgen configurable by setting parameter
--flowgen-flows=N.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-08-31 17:14:03 +02:00
Gagandeep Singh
c24489e479 test/crypto: support PDCP short MAC-I
This patch add support to test the PDCP short MAC
packets in crypto.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-08 16:55:20 +02:00
Hemant Agrawal
864c1a40d7 security: support PDCP short MAC-I
This patch add support to handle PDCP short MAC-I domain
along with standard control and data domains as it has to
be treaty as special case with PDCP protocol offload support.

ShortMAC-I is the 16 least significant bits of calculated MAC-I. Usually
when a RRC message is exchanged between UE and eNodeB it is integrity &
ciphered protected.

MAC-I = f(key, varShortMAC-I, count, bearer, direction).
Here varShortMAC-I is prepared by using (current cellId, pci of source cell
and C-RNTI of old cell). Other parameters like count, bearer and
direction set to all 1.

crypto-perf app is updated to take short MAC as input mode.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-09-08 16:54:37 +02:00
Akhil Goyal
59c6646e6d test/crypto: remove illegal PMD header include
rte_cryptodev_pmd.h is an interface between
driver and library and it is mentioned in the
file that application cannot use it directly.
Hence, removing the include.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-09-08 09:11:19 +02:00
Rebecca Troy
9772dcf7c1 test/crypto: refactor scheduler workers init
Previously, the scheduler unit test only created and attached 1 or 2
AESNI-MB cryptodev PMDs as workers if less than 2 AESNI-MB PMDs had
already been initialized.

This commit changes this to always create and attach 2 new AESNI-MB
cryptodev PMDs, regardless of previously initialized AESNI-MB PMDs.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2021-09-06 21:49:19 +02:00
Nithin Dabilpuram
eeedef704c app/testpmd: fix dump of Tx offload flags
Fix verbose mode dump for Tx to dump tx offload flags instead of
Rx offload flags.

Fixes: d862c45b59 ("app/testpmd: move dumping packets to a separate function")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
2021-08-25 14:29:31 +02:00
Nithin Dabilpuram
4219d7670e app/testpmd: fix check without outer checksum
Donot use outer metadata when neither outer ip checksum nor
outer udp checksum is enabled. PMD's will ignore the
outer_l2_len and outer_l3_len in cases where none of
the outer checksum is enabled and hence only l2_len and
l3_len will be used to calculate the offsets for L2 or L3
header.

Fixes: 3c32113a1a ("app/testpmd: fix IPv6 tunnel checksum")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-08-25 14:29:30 +02:00
Zhihong Wang
08d4d507df app/testpmd: use per-core variable in flowgen
Use per-core variable for flow indexing to solve cache contention in
multi-core scenarios.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-08-24 18:54:18 +02:00
Zhihong Wang
fb15afa295 app/testpmd: record Rx and dropped stats in flowgen
Call inc_rx_burst_stats for rx operation, and record fwd_dropped.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-08-24 18:54:18 +02:00
Zhihong Wang
7f4d3d1242 app/testpmd: use existing checksum API in flowgen engine
Use the rte_ipv4_cksum API to replace local ip_sum implementation.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-08-24 18:54:18 +02:00
Zhihong Wang
ea275674a0 app/testpmd: fix Tx retry in flowgen engine
Fix tx_pkt number in tx retry logic.

Fixes: bf56fce1fb ("app/testpmd: add retry option")
Cc: stable@dpdk.org

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-08-24 18:54:18 +02:00
Gregory Etelson
de73c8ac50 app/testpmd: fix IPv4 checksum
UDP protocol reserves 0 checksum value for special purposes.
Other protocols, like IPv4, TCP and SCTP must calculate checksum value
in software or offload checksum calculation to hardware.

If IPv4 TX checksum offload was off and header checksum was set to 0,
testpmd csum engine did not calculate checksum value for IPv4, TCP and
SCTP.

The patch always calculates IPv4, TCP and SCTP TX checksums if it is
not offloaded.

Bugzilla ID: 768
Fixes: b2a9e4a855 ("app/testpmd: fix Tx checksum calculation for tunnel")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-08-04 11:45:50 +02:00
John Levon
b13da15ec2 test: quieten warning noise while forking
When closing file descriptors post-fork, ignore "." and ".." directory
entries, so the test log doesn't have distracting errors like:

Error converting name fd 0 .:
Error converting name fd 0 ..:

Signed-off-by: John Levon <john.levon@nutanix.com>
2021-08-02 13:21:02 +02:00
John Levon
b73c8eded7 test: flush stdout after forking
meson test was not capturing the intended output from the child
process; force a flush to ensure it reaches the test log.

Signed-off-by: John Levon <john.levon@nutanix.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-07-31 20:04:07 +02:00
Suanming Mou
0f678fdd8c test/crypto: increase mbuf data payload size to 4K
Currently, there is vendor which can support bigger crypto data size.
Increase the default mbuf data payload size to 4K as needed.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-30 20:57:23 +02:00
Joyce Kong
9f76c60286 test/rcu: use compiler atomics for data sync
Covert rte_atomic usages to compiler atomic built-ins in
rcu_perf testcases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 23:56:07 +02:00
Joyce Kong
8c816dc54d test/service: use compiler atomics for lock sync
Convert rte_atomic usages to compiler atomic built-ins for lock
sync in service_cores testcases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 23:56:03 +02:00
Joyce Kong
e9fea30314 test/mempool: use compiler atomics for lcores sync
Convert rte_atomic usages to compiler atomic built-ins for lcores
sync in mempool_perf testcases. Meanwhile, remove unnecessary
synchro init as it would be set to 0 when launching cores.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 23:55:36 +02:00
Joyce Kong
eb9ea11c97 test/mempool: remove unused variable for lcores sync
Remove the unused synchro variable as there is no lcores
sync in mempool function test.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 19:12:54 +02:00
Joyce Kong
8d08f7c9ae test/mcslock: use compiler atomics for lcores sync
Convert rte_atomic usages to compiler atomic built-ins for lcores
sync in mcslock testcases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 19:10:58 +02:00
Joyce Kong
fb2a9bd266 test/rwlock: use compiler atomics for lcores sync
Convert rte_atomic usages to compiler atomic built-ins for lcores
sync in rwlock testcases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 19:08:43 +02:00
Joyce Kong
d2794d6719 test/spinlock: use compile atomics for lcores sync
Convert rte_atomic usages to compiler atomic built-ins for lcores
sync in spinlock testcases.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 19:06:35 +02:00
Joyce Kong
f11bdb206a test/ticketlock: use compiler atomics for lcores sync
Convert rte_atomic usages to compiler atomic built-ins for lcores
sync in ticketlock testcases.

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>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2021-07-30 19:04:34 +02:00
Chengchang Tang
d3319ef938 app/procinfo: add device registers dump
This patch add support for dump the device registers from a running
application. It can help developers locate the problem.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2021-07-30 18:45:49 +02:00
Konstantin Ananyev
d6f638393f app/acl: add script to automate testing
The purpose of this script is to help automate ACL library functional
testing using test-acl app.
Sample input files are also provided.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-07-30 18:34:35 +02:00
Konstantin Ananyev
ca2183d3d6 app/acl: allow comment and empty line in input
Allow comment (lines starting with '#') and empty lines in input
(rules, traces) files. These lines will be just skipped and shouldn't
affect the result anyhow.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-07-30 18:33:55 +02:00
Paulis Gributs
e1d38504e1 app/testpmd: fix hotplug removal
After removing rte_eth_devices from testpmd the vm_hotplug no longer
recovered after removal of a device, because the port was closed
before querying it.

Fixes: 0a0821bcf3 ("app/testpmd: remove most uses of internal ethdev array")

Signed-off-by: Paulis Gributs <paulis.gributs@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-30 14:27:01 +02:00
Gregory Etelson
b2a9e4a855 app/testpmd: fix Tx checksum calculation for tunnel
csumonly engine calculates Tx checksum of a tunnelled packet
for outer headers only or separately for outer and inner headers.
The calculation method is determined by checksum configuration options.
If Tx checksum calculation is separated,
the inner headers are processed before outer headers.

Inner headers processing sets checksum values to 0 unconditionally.
If Tx configuration offloads inner checksums only, outer checksum
calculation in software will read 0 instead of real values
and produce wrong result.

The patch zeroes inner checksums only before software calculation.

Fixes: 6b520d54eb ("app/testpmd: use Tx preparation in checksum engine")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-07-30 14:01:35 +02:00
Andrew Rybchenko
61a3b0e5e7 app/testpmd: send failure logs to stderr
Running with stdout suppressed or redirected for further processing
is very confusing in the case of errors. Fix it by logging errors and
warnings to stderr.

Since lines with log messages are touched anyway concatenate split
format strings to make it easier to search using grep.

Fix indent of format string arguments.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-24 15:12:57 +02:00
Paulis Gributs
0a0821bcf3 app/testpmd: remove most uses of internal ethdev array
This patch removes most uses of the global variable rte_eth_devices
from testpmd. This was done to avoid using the object directly which
applications should not do.

Most uses have been replaced with standard function calls, however
the use of it in the show_macs function could not be replaced as no
function call exists to get all mac addresses of a given port.

Signed-off-by: Paulis Gributs <paulis.gributs@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-24 14:41:45 +02:00
Yuying Zhang
5ffc4a2aca app/testpmd: fix MAC address after port reset
MAC address of each port in global variable ports hasn't been updated
after resetting. It was the initial one after resetting VF MAC address.
This patch gets correct port MAC address when starting port.

Fixes: a5279d2561 ("app/testpmd: check status of getting MAC address")
Cc: stable@dpdk.org

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-24 13:28:13 +02:00
Ferruh Yigit
a2db845ccc app/testpmd: fix help string for port reset
Command help string is missing 'reset' keyword,
although description has it. Adding it.

Fixes: 97f1e19679 ("app/testpmd: add port reset command")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-07-24 11:06:07 +02:00
Adam Dybkowski
dfee779a09 test/crypto: check raw API support
This patch adds checking if RAW API is supported at the start
of the test command "cryptodev_qat_raw_api_autotest".

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-21 15:12:02 +02:00
Shiri Kuzin
40e91195d5 test/crypto: support mlx5 driver
In order to test the new mlx5 crypto PMD, the driver is added to the
crypto test application.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-20 22:27:00 +02:00
Shiri Kuzin
2692b02e03 test/crypto: add multi-segment out-of-place AES-XTS
The AES-XTS algorithm can supports wrapped key and data-unit.
The encryption/decryption can be done out of place and using multi
segments.

Add multi segment and out of place tests to the recently added AES-XTS
vectors, which support using data-unit and a wrapped key.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-20 22:27:00 +02:00
Shiri Kuzin
d5728a5a17 test/crypto: add AES-XTS vectors
The AES-XTS algorithm supports using a wrapped key.
In AES-XTS the data-unit defines the data block size to be
encrypted\decrypted.

Add AES-XTS vectors with a wrapped key.
Add a variable stating whether the key is wrapped or not.
Add the AES-XTS data-unit.

Signed-off-by: Shiri Kuzin <shirik@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-20 22:27:00 +02:00
Abhinandan Gujjar
b812567ef6 test/crypto: fix mempool size for session-less
Currently, private_data_offset for the sessionless is computed
wrongly which includes extra bytes added by
sizeof(struct rte_crypto_sym_xform) * 2. This causes buffer
overflow which leads to test application crash while freeing the
ops mempool. This patch provides fix for the same and also takes
care of increasing the length of ops to accommodate space for
rte_event_crypto_metadata while creating the crypto ops mempool.

Fixes: 3c2c535ecf ("test: add event crypto adapter auto-test")
Cc: stable@dpdk.org

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Reported-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-20 10:32:05 +02:00
Richael Zhuang
cf1e803508 test/power: fix CPU frequency check for intel_pstate
For acpi_cpufreq and cppc_cpufreq, both cpuinfo_cur_freq and
scaling_cur_freq exist. For pstate, only scaling_cur_freq exists.
And value in scaling_cur_freq and cpuinfo_cur_freq may not be the
same. For acpi_cpufreq and cppc_cpufreq, we should check
cpuinfo_cur_freq but not scaling_cur_freq. So here change the
check sequence to make sure it works for all cpufreq drivers.
Besides, add rounding for pstate driver.

Fixes: ff6dfb8e49 ("test/power: fix CPU frequency check")
Cc: stable@dpdk.org

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
2021-07-20 17:24:07 +02:00
Rongwei Liu
dbd8e4102d app/testpmd: support matching on VXLAN reserved field
Add a new testpmd pattern field 'last_rsvd' that supports the
last 8-bits matching of VXLAN header.

The examples for the "last_rsvd" pattern field are as below:

1. ...pattern eth / ipv4 / udp / vxlan last_rsvd is 0x80 / end ...

This flow will exactly match the last 8-bits to be 0x80.

2. ...pattern eth / ipv4 / udp / vxlan last_rsvd spec 0x80
vxlan mask 0x80 / end ...

This flow will only match the MSB of the last 8-bits to be 1.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Raslan Darawsheh <rasland@nvidia.com>
2021-07-13 15:06:43 +02:00
Gregory Etelson
730bf06652 app/testpmd: add flow matching on IPv4 version and IHL
The new flow item allows PMD to offload IPv4 IHL field for matching,
if hardware supports that operation.

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-07-13 13:15:14 +02:00
Viacheslav Ovsiienko
b6b8a1ebd4 app/testpmd: fix offloads for newly attached port
For the newly attached ports (with "port attach" command) the
default offloads settings, configured from application command
line, were not applied, causing port start failure following
the attach.

For example, if scattering offload was configured in command
line and rxpkts was configured for multiple segments, the newly
attached port start was failed due to missing scattering offload
enable in the new port settings. The missing code to apply
the offloads to the new device and its queues is added.

The new local routine init_config_port_offloads() is introduced,
embracing the shared part of port offloads initialization code.

Fixes: c9cce42876 ("ethdev: remove deprecated attach/detach functions")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-13 11:52:05 +02:00
Richael Zhuang
29343b9030 test/power: fix CPU frequency when turbo enabled
On arm platform, the value in "/sys/.../cpuinfo_cur_freq" may not
be exactly the same as what was set when using CPPC cpufreq driver.
For other cpufreq driver, no need to round it currently, or else
this check will fail with turbo enabled. For example, with acpi_cpufreq,
cpuinfo_cur_freq can be 2401000 which is equal to freqs[0].It should
not be rounded to 2400000.

Fixes: 606a234c6d ("test/power: round CPU frequency to check")
Cc: stable@dpdk.org

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
2021-07-09 16:04:48 +02:00
Richael Zhuang
ef1cc88f18 power: support cppc_cpufreq driver
Currently in DPDK only acpi_cpufreq and pstate_cpufreq drivers are
supported, which are both not available on arm64 platforms. Add
support for cppc_cpufreq driver which works on most arm64 platforms.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Acked-by: David Hunt <david.hunt@intel.com>
2021-07-09 16:04:46 +02:00
Rebecca Troy
6e90229e22 test/crypto: use formal array size macro
Replaces the use of local ARRAY_SIZE macro, which is not used
anywhere else, with the formal RTE_DIM macro for better
consistency in crypto unit test.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:39 +02:00
Rebecca Troy
5da550e440 test/crypto: fix typo in ESN case
Fixed typo in the crypto unit test ESN function name by
replacing the word 'encryt' with the correct word 'encrypt'.

test_authenticated_encryt_with_esn is now called
test_authenticated_encrypt_with_esn.

Fixes: 699741912d ("test/crypto: add case for auth only trailer")
Cc: stable@dpdk.org

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2021-07-07 21:28:39 +02:00
Rebecca Troy
9d33cad1f6 test/crypto: fix typo in AES case
Fixed typo in the testcase description for AES in the crypto
unit test suite by changing the word 'Scater' to 'Scatter'.

Fixes: c9c9c4ed87 ("app/test: check scatter-gather for crypto drivers")
Cc: stable@dpdk.org

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2021-07-07 21:28:39 +02:00
Rebecca Troy
28f5375d83 test/crypto: rename slave to worker
Modifies the scheduler tests in the crypto unit test suite
to replace the usage of the word 'slave' with the more
appropriate word 'worker'.

The scheduler test functions were modified as follows:
test_scheduler_attach_slave_op is now called
test_scheduler_attach_worker_op,
test_scheduler_detach_slave_op is
test_scheduler_detach_worker_op.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:39 +02:00
Rebecca Troy
4ea794318a test/crypto: fix autotest function parameters
Fixed parameters on autotest functions by removing comments.

Fixes: 202d375c60 ("app/test: add cryptodev unit and performance tests")
Fixes: 4ed1e79e78 ("test/crypto: add tests for virtio-crypto")
Fixes: 3aafc423cf ("snow3g: add driver for SNOW 3G library")
Fixes: 27a1c4714d ("app/test: add KASUMI crypto")
Fixes: 4c99481f49 ("app/test: add ZUC")
Fixes: c8e69fce70 ("crypto/scheduler: add unit test")
Fixes: ae002048bb ("test/crypto: add DPAA2 crypto functional test")
Fixes: b674d6d038 ("test/crypto: add dpaa crypto test cases")
Fixes: a8dbd44d6b ("test/crypto: add CAAM JR validation cases")
Fixes: 4868f6591c ("test/crypto: add cases for raw datapath API")
Cc: stable@dpdk.org

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:39 +02:00
Thierry Herbelot
2b81eb2c99 test/crypto: fix mbuf reset after null check
Use m only after it was checked not to be NULL.

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

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:39 +02:00
Kai Ji
c84e324e7c app/crypto-perf: fix out-of-place mempool allocation
Add missing rte_mbuf size in mempool allocation for
out-of-place operation.

Fixes: bf9d6702ec ("app/crypto-perf: use single mempool")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2021-07-07 21:28:39 +02:00
Kiran Kumar K
c7e6ab78f4 test/crypto: add cnxk for asymmetric cases
Registered cn9k and cn10k for asymmetric crypto
autotest. Documentation and release notes are also
updated.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:28:13 +02:00
Tejasree Kondoj
5db3d7d061 test/crypto: enable cnxk
Enable tests for cn9k & cn10k crypto PMDs.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-07-07 21:15:08 +02:00
Huisong Li
8ec87289e5 app/testpmd: change port link speed without stopping all
When we use the following cmd to modify the link speed of specified
port: "port config <port_id> speed xxx duplex xxx", we have to stop
all ports. It's not necessary.

Fixes: 82113036e4 ("ethdev: redesign link speed config")
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@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-07-02 19:03:03 +02:00
Jie Zhou
634b731044 app/testpmd: build on Windows
- Disable unsupported apps on Windows
- Enable building of testpmd on Windows

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-07-02 19:03:03 +02:00
Jie Zhou
15eb0fa116 app/testpmd: disable flow director functions if unneeded
Function print_fdir_mask and print_fdir_flex_payload are only called
when either i40e or ixgbe presents. Extend existing #if defined to
include these two functions, to remove "unused function" compilation
warning.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-07-02 19:03:03 +02:00
Jie Zhou
761f7ae130 app/testpmd: replace POSIX-specific code
- Make printf format OS independent
- Replace htons with RTE_BE16
- Replace POSIX specific inet_aton with OS independent inet_pton
- Replace sleep with rte_delay_us_sleep
- Replace random with rte_rand
- #ifndef mman related code for now
- Fix header inclusion
- Include rte_os_shim.h in testpmd.h
- Remove redundant headers

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-07-02 19:03:03 +02:00
Jie Zhou
ce0a4a1d5d app/testpmd: fix type of FEC mode parsing output
Passing an uint32_t pointer to an enum pointer parameter causes
pointer-sign warning on Windows (converts between pointers to
integer types with different sign), since enum is implicitly
converted to int on Windows.

And the current enum pointer parameter of that function is actually
misleading and should be fixed as an uint32_t pointer parameter.

Fixes: b19da32e31 ("app/testpmd: add FEC command")
Cc: stable@dpdk.org

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-07-02 19:03:03 +02:00
Jie Zhou
cdbbf1cee7 app/testpmd: resolve name collisions with Windows types
Resolve name collisions with Windows types.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
2021-07-02 19:03:03 +02:00
Olivier Matz
30a65c6cb7 test/cksum: add L3/L4 checksum API test
Add a simple unit test for checksum API.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-07-02 19:03:03 +02:00
Thierry Herbelot
355a3c9623 app/testpmd: move conntrack update after null check
Use out only after it was checked not to be null.

Fixes: 4d07cbefe3 ("app/testpmd: add commands for conntrack")
Cc: stable@dpdk.org

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
2021-07-02 19:03:03 +02:00
Pavan Nikhilesh
dbd4defea5 app/eventdev: add option to enable per port pool
Add option to configure unique mempool for each ethernet device
port. The new option available with `pipeline_atq` and
`pipeline_queue` tests.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-07-01 10:25:24 +02:00
Feifei Wang
d97428bfb9 app/eventdev: remove unnecessary barrier from order test
For "order_launch_lcores" function, wmb after that the main lcore
updates the variable "t->err", which represents the end of the test
signal, is unnecessary. Because after the main lcore updates this
signal variable, it will jump out of the launch function loop, and wait
other lcores stop or return error in the main function(evt_main.c).
During this time, there is no storing operation and thus no need for
wmb.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-06-30 08:48:55 +02:00
Olivier Matz
eb3fea3cde test/mbuf: fix virtual address conversion
Seen with address sanitizer.

rte_mempool_virt2iova() can only be used on mempool elements. In this case,
it is incorrect, and rte_mem_virt2iova() has to be used.

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

Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-07-06 16:41:13 +02:00
David Marchand
09e640e35e test: remove hack for private header inclusion
This hack was needed with the make build system.
With meson, any private header from a library is visible as long as a
dependency to this library is expressed.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2021-07-06 13:28:35 +02:00
Lance Richardson
a906371d27 app/test: fix IPv6 header initialization
Fix two issues found when writing PMD unit tests for HW ptype and
L4 checksum offload:

   - The version field in the IPv6 header was being set to zero,
     which prevented hardware from recognizing it as IPv6. The
     IP version field is now set to six.
   - The payload_len field was being initialized using host byte
     order, which (among other things) resulted in incorrect L4
     checksum computation. The payload_len field is now set using
     network (big-endian) byte order.

Fixes: 92073ef961 ("bond: unit tests")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-07-05 11:30:58 +02:00
Owen Hilyard
80731e4b5b tests/eal: fix memory leak
The directory steam was not closed when the hugepage action was
HUGEPAGE_CHECK_EXISTS. This caused a memory leak in some parts of
the unit tests.

Fixes: 45f1b6e868 ("app: add new tests on eal flags")
Cc: stable@dpdk.org

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-06-24 15:34:45 +02:00
Owen Hilyard
ca7204b921 tests/cmdline: fix memory leaks
Fixes for a few memory leaks in the cmdline_autotest unit test.

All of the leaks were related to not freeing the commandline struct
after testing had completed.

Fixes: dbb860e03e ("cmdline: tests")
Cc: stable@dpdk.org

Signed-off-by: Owen Hilyard <ohilyard@iol.unh.edu>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-06-24 15:34:45 +02:00
Aaron Conole
ee00af6017 test: remove strict timing requirements some tests
The tests 'alarm_autotest' and 'cycles_autotest' rely on the underlying
system having very accurate and precise timing.  On systems where the
timing isn't as rigid, or the load is particularly high, these tests are
unreliable since the wake latency from the scheduler can be high enough
to miss the timing window.

Remove the timing related tests from the test suites.  These tests now
ensure the add/remove callback infrastructure unit tests, but drop the
waits and reliance on system timing and load.

This avoids FAIL on various testing infrastructures.

Signed-off-by: Aaron Conole <aconole@redhat.com>
2021-06-03 18:08:57 +02:00
Kevin Traynor
50eea2bfa7 test: fix build with GCC 11
GCC 11 complains that 'a' is uninitialized.

../dpdk/app/test/test_prefetch.c: In function 'test_prefetch':
../dpdk/app/test/test_prefetch.c:25:9:
error: 'a' may be used uninitialized [-Werror=maybe-uninitialized]
   25 |         rte_prefetch0(&a);
      |         ^~~~~~~~~~~~~~~~~

Fix by initializing 'a'.

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

Reported-by: Ali Alnubani <alialnu@nvidia.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-05-20 23:10:22 +02:00
Kevin Traynor
8f73a72378 test/crypto: fix build with GCC 11
Fix the allocation for sessions, to prevent an array-bounds
warning with GCC 11. Set the not created session to NULL.

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

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-05-19 14:54:29 +02:00
Stephen Hemminger
9e9581b843 test/timer: remove license boilerplate
This file has redundant BSD license text that is already
replaced by the use of SPDX license id.
Having both is unnecessary and potentially confusing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2021-05-19 11:02:45 +02:00
Ciara Power
e287fc3a96 test/crypto: fix result when PMD is not loaded
The return value for a test when the required PMD is not loaded should
be TEST_SKIPPED, rather than TEST_FAILED.

Fixes: 8bfdd8a7f0 ("test/crypto: refactor to use sub test suites")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2021-05-19 10:10:13 +02:00
Min Hu (Connor)
07b3c7d8e3 test: fix division by zero
Variable i is used as a denominator which may be zero, and
this may result in segmentation fault.

This patch fixed it.

Fixes: 948bc3d6d0 ("test: add reciprocal based division")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2021-05-19 09:23:00 +02:00
Ferruh Yigit
33c12ac5ba test/table: fix build with GCC 11
Build error:
../app/test/test_table_tables.c: In function ‘test_table_stub’:
../app/test/test_table_tables.c:31:9:
	warning: ‘memset’ offset [0, 31] is out of the bounds [0, 0]
	[-Warray-bounds]
         memset((uint8_t *)mbuf + sizeof(struct rte_mbuf) + 32, 0, 32); \
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../app/test/test_table_tables.c:151:25:
	note: in expansion of macro ‘PREPARE_PACKET’
  151 |                         PREPARE_PACKET(mbufs[i], 0xadadadad);
      |                         ^~~~~~~~~~~~~~

'key' points to mbuf header + 32 bytes, and memset clears next 32 bytes
of 'key', so overall there needs to be 64 bytes after mbuf header.
Adding a mbuf size check before memset.

The original code has an assumption that mbuf data buffer follows mbuf
header, this patch accepts same assumption.

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

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-05-18 10:52:45 +02:00
David Hunt
5bb0409b44 test/power: fix turbo test
when turbo is enabled or disabled, the frequency is set to a low non-turbo
frequency, so we need to set to the frequency expected by the test before
checking.

Fixes: aeaeaf5f2d ("test/power: add cases for turbo feature")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
2021-05-12 22:04:13 +02:00
David Hunt
0745214e92 test/power: fix low frequency test when turbo enabled
With the intel_pstate driver and turbo enabled, indexing is slightly
different to normal, so to get the test to work properly, enable
turbo at the start.

Fixes: ed7c51a6a6 ("app/test: vm power management")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
2021-05-12 22:03:12 +02:00
David Hunt
6db92b3b9b test/power: add turbo mode to frequency check
With the intel_pstate driver and turbo enabled, the top frequency in
the frequency array is the P1+1, i.e. 2300001, whereas the frequency
shown in scaling_cur_freq could be a lot higher.

This patch adds a flag to the check_cur_freq function so that we can
specify if a frequency is greater than expected (turbo mode), in which
case the check should be successful.

Fixes: aeaeaf5f2d ("test/power: add cases for turbo feature")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
2021-05-12 22:02:09 +02:00
David Hunt
ff6dfb8e49 test/power: fix CPU frequency check
Different drivers present the current cpu core frequency in different
sysfs files. Some present it in cpuinfo_cur_freq, some in scaling_cur_freq,
and some actually present it in both.

This patch attempts to open one, if that fails, tries the other.

Fixes: d550a8cc31 ("app/test: enhance power manager unit tests")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
2021-05-12 22:00:45 +02:00
Min Hu (Connor)
705b04af1c test: check flow classifier creation
'cls->cls' will be NULL if flow classifier create has failed,
then segmentation fault will occur if the variable is used.

This patch fixed it.

Fixes: 9c9befea4f ("test: add flow classify unit tests")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
2021-05-12 21:46:05 +02:00
Min Hu (Connor)
37c0359bc5 app/crypto-perf: check memory allocation
Return value of a function 'rte_zmalloc' is dereferenced without
checking, and it may call segmentation fault.

This patch fixed it.

Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-05-12 18:14:19 +02:00
Ciara Power
e65da89c15 test/crypto: build block-cipher suite dynamically
In the existing implementation, the blockcipher test cases are being run
and reported as one test case per type, even though multiple test cases
are hidden in each. For example, "test_AES_chain_all" runs 46 test cases.
Each blockcipher type should have a testsuite instead.

The blockcipher testsuite is dynamically built, depending on the
blockcipher type chosen. The testcase struct is modified to allow
running a testcase with data, which is used for data required when
running each blockcipher testcase.

The blockcipher testsuites are added dynamically to parent testsuites
as sub-testsuites where needed.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Ciara Power
085f128aac test/crypto: fix return value of a skipped test
The blockcipher testcase return value TEST_SUCCESS was incorrect for
one conditional check, it should have been TEST_SKIPPED similar to the
other condition checks in this function when the testcase is skipped.

Fixes: 4868f6591c ("test/crypto: add cases for raw datapath API")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Ciara Power
da74df7d38 test/crypto: move test suite parameters to header file
The testsuite params struct and ut functions are now in the cryptodev
test header file. This will allow them be used outside of the
cryptodev_test.c file. They will be used in a subsequent patch by the
blockcipher test.

As a result of this change, slight renaming changes were necessary
for ipsec and asym tests, to avoid a clash in names.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Ciara Power
e68012f0fd test/crypto: replace unsupported with skipped
Testcases were previously using -ENOTSUP and TEST_SKIPPED return
statuses interchangeably. Both resulted in the testcase not being run.

These return statuses are now standardised to TEST_SKIPPED.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Ciara Power
8bfdd8a7f0 test/crypto: refactor to use sub test suites
The existing implementation runs a giant cryptodev testsuite for most
autotests, which in turns runs one setup function regardless of device.

This is now broken down into multiple testsuites,
that are used as sub-testsuites. Each autotest runs a general crypto
parent test suite, to which the sub-testsuites are added.

For example, the AESNI_MB test runs "Cryptodev Unit Test Suite",
which has a setup function only to configure testsuite params.
Creation of vdevs in the setup function is no longer supported,
it is expected the user does this when running the app.
This autotest previously just ran the cryptodev_testsuite,
but now has the smaller sub-testsuites added to the parent suite instead.
The same test cases are being run as before.

The scheduler autotest creates its own parent testsuite with nested
sub-testsuites, rather than using the cryptodev testsuite mentioned above.
This is due to it being more complex in execution,
by requiring setting different modes before running tests.
The scheduler autotest no longer requires the extra test cases to
attach/set mode/detach when running the blockcipher test cases for
each mode. The attach/set mode/detach functionality is now tested in a
sub-testsuite. When running the sub-testsuites for each mode,
the attach/set mode/detach happens in the setup and teardown functions
for that sub-testsuite.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Ciara Power
fbc5367550 test: introduce parent test suite format
The current structure for unit testing only allows for running a
test suite with nested test cases. This means all test cases for an
autotest must be in one suite, which is not ideal.
For example, in some cases we may want to run multiple lists of test
cases that each require different setup, so should be in separate suites.

The unit test suite struct is modified to hold a pointer to a list of
sub-testsuite pointers, along with the list of testcases as before.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Ciara Power
caa817f057 test: refactor unit test suite runner
Some small changes were made to the unit test suite runner for
readability and to enable reuse of some of the function in a later patch.

On test suite setup skip/fail, the loop to count testcases as
skipped/failed has been moved to another function.
This will allow for recursion in a later patch when nested sub-testsuites
are used.

The unit test suite runner accessed the list of testcases in the suite
structure every time the testcase was used. This is now replaced by a
testcase variable which improves readability.

A macro has been introduced for readability, instead of using open
coded loops.

Rather than keep local variable status counts for testcases,
these are added to the test suite structure.

The summary output now prints the suite name, this will be useful later
when multiple nested sub-testsuites are being run.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
2021-05-12 16:17:07 +02:00
Haifei Luo
c5c507100e app/testpmd: support action meter color
Currently action RTE_FLOW_ACTION_TYPE_METER_COLOR is defined.
Add the CLI for this action:  color type (types)
There are three types: green, yellow and red.

Example for the new policy meter CLIs:
   add port meter policy 0 1 g_actions color type green / end y_actions
     color type yellow / end r_actions color type red / end

In the above command, the action type is
RTE_FLOW_ACTION_TYPE_METER_COLOR, the meter policy action list:
green -> green, yellow -> yellow, red -> red.

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-05-12 14:06:27 +02:00
Gregory Etelson
99fc79b37a app/testpmd: fix tunnel offload flows cleanup
Tunnel offload model requires application to obtain PMD related flow
items or actions to construct a flow rule. These elements acquire
internal PMD flow resources that must be explicitly released.

The patch destroys tunnel offload PMD resources after flow creation
failure.

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

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-05-11 21:08:41 +02:00
Shijith Thotton
5d28b66055 test/event: fix result of unsupported periodic timer
Test case setup should return -ENOTSUP, if it is not supported.

Fixes: 7d761b07fc ("test/event: add unit tests for periodic timer")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-05-09 18:06:03 +02:00
Pavan Nikhilesh
ca90f20fea app/eventdev: fix lcore parsing skipping last core
The last lcore declared in the list is also a valid lcore in the list.

Fixes: 32d7dbf269 ("app/eventdev: fix overflow in lcore list parsing")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-05-09 18:00:18 +02:00
Min Hu (Connor)
fb9b862e7c test/timer: check memzone allocation
Segmentation fault may occur without checking if memzone
reserves succeed or not.

Fixes: 50247fe03f ("test/timer: exercise new APIs in secondary process")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2021-05-12 16:52:20 +02:00
Kai Ji
e19deb5af6 test/crypto: copy offset data to OOP destination buffer
Copy over the offset data required for auth in out-of-place op
when auth offset and cipher offset are not aligned.

Fixes: e847fc5128 ("test/crypto: add encrypted digest case for AES-CTR-CMAC")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
2021-05-05 17:21:06 +02:00
Kai Ji
91317c0155 test/crypto: fix auth-cipher compare length in OOP
For out-of-place operations, comparing expected ciphertext with
the operation result should skip cipher_offset bytes, as those
will not be copied from source to the destination buffer, making
the tests fail.

Fixes: 02ed7b3871 ("test/crypto: add SNOW3G test cases for auth-cipher")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2021-05-05 17:08:14 +02:00
Min Hu (Connor)
49ca9e5a25 app/bbdev: fix HARQ error messages
The logging should show context by printing the two variables which
compared to each other. 'nb_harq_inputs', not 'nb_hard_outputs';
'nb_harq_outputs', not 'nb_hard_outputs'.

This patch corrected misused variable.

Fixes: d819c08327 ("app/bbdev: update for 5GNR")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2021-05-05 15:57:59 +02:00
Min Hu (Connor)
bc4c9418ee app/bbdev: check memory allocation
Return value of a function 'rte_malloc' is dereferenced without
checking, and may result in segmentation fault.

This patch fixed it.

Fixes: 31a7853d1e ("baseband/turbo_sw: support large size code block")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Nicolas Chautru <nicolas.chautru@intel.com>
2021-05-05 15:31:50 +02:00
Stanislaw Kardach
6cda39af86 test/distributor: fix burst flush on worker quit
While working on RISC-V port I have encountered a situation where worker
threads get stuck in the rte_distributor_return_pkt() function in the
burst test.
Investigation showed some of the threads enter this function with
flag RTE_DISTRIB_GET_BUF set in the d->retptr64[0]. At the same time the
main thread has already passed rte_distributor_process() so nobody will
clear this flag and hence workers can't return.

What I've noticed is that adding a flush just after the last _process(),
similarly to how quit_workers() function is written in the
test_distributor.c fixes the issue.
Lukasz Wojciechowski reproduced the same issue on x86 using a VM with 32
emulated CPU cores to force some lcores not to be woken up.

Fixes: 7c3287a105 ("test/distributor: add performance test for burst mode")
Cc: stable@dpdk.org

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: David Hunt <david.hunt@intel.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2021-05-05 18:21:26 +02:00
Stanislaw Kardach
00dac9a99c test/distributor: fix worker notification in burst mode
Because a single worker can process more than one packet from the
distributor, the final set of notifications in burst mode should be
sent one-by-one to ensure that each worker has a chance to wake up.

This fix mirrors the change done in the functional test by
commit f72bff0ec2 ("test/distributor: fix quitting workers in burst
mode").

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

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: David Hunt <david.hunt@intel.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
2021-05-05 18:21:26 +02:00
Michael Baum
cc492aa595 app/testpmd: support indirect counter action query
Counter action query was implemented as part of flow query, but was not
implemented as part of indirect action query.

This patch adds the required implementation.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-30 12:41:07 +02:00
Michael Baum
0f6beb151f app/testpmd: remove indirect RSS action query
The port_action_handle_query function supports query operation for
indirect RSS action.

No driver currently supports this operation, and this support is
unnecessary.

Remove it.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-30 12:41:07 +02:00
Huisong Li
50db4db578 app/testpmd: remove redundant forwarding initialization
The fwd_config_setup() is called after init_fwd_streams().
The fwd_config_setup() will reinitialize forwarding streams.
This patch removes init_fwd_streams() from init_config().

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Huisong Li
4b6b06d2eb app/testpmd: add forwarding configuration to DCB config
This patch adds fwd_config_setup() at the end of cmd_config_dcb_parsed()
to update "cur_fwd_config", so that the actual forwarding streams can be
queried by the "show config fwd" cmd.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Huisong Li
43f1f82611 app/testpmd: verify DCB config during forward config
Currently, the check for doing DCB test is assigned to
start_packet_forwarding(), which will be called when
run "start" cmd. But fwd_config_setup() is used in many
scenarios, such as, "port config all rxq".

This patch moves the check from start_packet_forwarding()
to fwd_config_setup().

Fixes: 7741e4cf16 ("app/testpmd: VMDq and DCB updates")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Huisong Li
cffb3d66a8 app/testpmd: check DCB info support for configuration
Currently, '.get_dcb_info' must be supported for the port doing DCB
test, or all information in 'rte_eth_dcb_info' are zero. It should be
prevented when user run cmd "port config 0 dcb vt off 4 pfc off".

This patch adds the check for support of reporting dcb info.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Huisong Li
5cbbcbad65 app/testpmd: fix DCB re-configuration
After DCB mode is configured, if we decrease the number of RX and TX
queues, fwd_config_setup() will be called to setup the DCB forwarding
configuration. And forwarding streams are updated based on new queue
numbers in fwd_config_setup(), but the mapping between the TC and
queues obtained by rte_eth_dev_get_dcb_info() is still old queue
numbers (old queue numbers are greater than new queue numbers).
In this case, the segment fault happens. So rte_eth_dev_configure()
should be called again to update the mapping between the TC and
queues before rte_eth_dev_get_dcb_info().

Like:
set nbcore 4
port stop all
port config 0 dcb vt off 4 pfc on
port start all
port stop all
port config all rxq 8
port config all txq 8

Fixes: 900550de04 ("app/testpmd: add dcb support")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Huisong Li
a690a070a4 app/testpmd: fix DCB forwarding configuration
After DCB mode is configured, the operations of port stop and port start
change the value of the global variable "dcb_test", As a result, the
forwarding configuration from DCB to RSS mode, namely,
“dcb_fwd_config_setup()” to "rss_fwd_config_setup()".

Currently, the 'dcb_flag' field in struct 'rte_port' indicates whether
the port is configured with DCB. And it is sufficient to have
'dcb_config' as a global variable to control the DCB test status. So
this patch deletes the "dcb_test".

In addition, setting 'dcb_config' at the end of init_port_dcb_config()
in case that ports fail to enter DCB mode.

Fixes: 900550de04 ("app/testpmd: add dcb support")
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")
Fixes: 7741e4cf16 ("app/testpmd: VMDq and DCB updates")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Huisong Li
9ee7d02ad4 app/testpmd: fix forward lcores number for DCB
For the DCB forwarding test, each core is assigned to each traffic class.
Number of forwarding cores for DCB test must be equal or less than number
of total TC. Otherwise, the following problems may occur:
1/ Redundant polling threads will be created when forwarding cores number
   is greater than total TC number.
2/ Two cores would try to use a same queue on a port when Rx/Tx queue
   number is greater than the used TC number, which is not allowed.

Fixes: 900550de04 ("app/testpmd: add dcb support")
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-29 18:10:14 +02:00
Min Hu (Connor)
a767951e59 app/testpmd: fix division by zero on socket memory dump
Variable total, which may be zero and result in segmentation fault.

This patch fixed it.

Fixes: 9b1249d9ff ("app/testpmd: support dumping socket memory")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-29 15:34:39 +02:00
Viacheslav Ovsiienko
3f47c017ee app/testpmd: fix segment number check
The --txpkts command line parameter was silently ignored due to
application was unable to check the Tx queue ring sizes for non
configured ports.

The "set txpkts <len0[,len1]*>" was also rejected if there
was some stopped or /unconfigured port.

This provides the following:

  - If fails to get ring size from the port, this can be because port is
    not initialized yet, ignore the check and just be sure segment size
    won't cause an out of bound access. The port descriptor check will
    be done during Tx setup.

  - The capability to send single packet is supposed to be very basic
    and always supported, the setting segment number to 1 is always
    allowed, no check performed

  - At the moment of Tx queue setup the descriptor number is checked
    against configured segment number

Bugzilla ID: 584
Fixes: 8dae835d88 ("app/testpmd: remove restriction on Tx segments set")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-27 13:41:25 +02:00
Chengchang Tang
0ca0c47397 app/testpmd: fix max queue number for Tx offloads
When txq offload is configured, max rxq is used as the max queue. This
patch fixes it.

Fixes: 74453ac9ef ("app/testpmd: fix queue offload configuration")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-26 16:20:31 +02:00
Min Hu (Connor)
381dfcf047 test/kni: check init result
Return value 'rte_kni_init' of a function is not checked. If
it fails, error handling (logging and return) should be done.

This patch fixed it.

Fixes: 0c6bc8ef70 ("kni: memzone pool for alloc and release")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-26 15:33:07 +02:00
Min Hu (Connor)
71a7e32247 test/kni: fix a comment
This patch changed 'subsytem' to 'subsystem'.

Fixes: 0c6bc8ef70 ("kni: memzone pool for alloc and release")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-26 15:33:07 +02:00
Pavan Nikhilesh
2351506401 event/cnxk: add SSO selftest and dump
Add selftest to verify sanity of SSO and also add function to
dump internal state of SSO.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-05-04 06:59:52 +02:00
Min Hu (Connor)
32d7dbf269 app/eventdev: fix overflow in lcore list parsing
Tainted and unvalidated integer 'idx' used as an index, which may
lead to buffer overflow.

This patch fixed it.

Fixes: 89e5eb1180 ("app/testeventdev: add string parsing helpers")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-04-29 09:23:20 +02:00
Olivier Matz
e1064f80b6 test/mempool: fix object initializer
The function rte_pktmbuf_init() expects that the mempool private area is
large enough and was previously initialized by rte_pktmbuf_pool_init(),
which is not the case.

This causes the function rte_pktmbuf_priv_size() to return an
unpredictable value, and this value is used as a size in a memset.

Replace the mempool object initializer by my_obj_init(), which does not
have this constraint, and fits the needs for this test.

Fixes: 923ceaeac1 ("test/mempool: add unit test cases")
Cc: stable@dpdk.org

Reported-by: Wenwu Ma <wenwux.ma@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2021-05-04 22:41:31 +02:00
Bruce Richardson
7d5cfaa750 build: fix formatting of Meson lists
Running "./devtools/check-meson.py --fix" on the DPDK repo fixes a
number of issues with whitespace and formatting of files:

* indentation of lists
* missing trailing commas on final list element
* multiple list entries per line when list is not all single-line

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-05-04 15:01:47 +02:00
Stanislaw Kardach
1abb185d6c stack: allow lock-free only on relevant architectures
Since commit 7911ba0473 ("stack: enable lock-free implementation for
aarch64"), lock-free stack is supported on arm64 but this description was
missing from the doxygen for the flag.

Currently it is impossible to detect programmatically whether lock-free
implementation of rte_stack is supported. One could check whether the
header guard for lock-free stubs is defined (_RTE_STACK_LF_STUBS_H_) but
that's an unstable implementation detail. Because of that currently all
lock-free ring creations silently succeed (as long as the stack header
is 16B long) which later leads to push and pop operations being NOPs.
The observable effect is that stack_lf_autotest fails on platforms not
supporting the lock-free. Instead it should just skip the lock-free test
altogether.

This commit adds a new errno value (ENOTSUP) that may be returned by
rte_stack_create() to indicate that a given combination of flags is not
supported on a current platform.
This is detected by checking a compile-time flag in the include logic in
rte_stack_lf.h which may be used by applications to check the lock-free
support at compile time.

Use the added RTE_STACK_LF_SUPPORTED flag to disable the lock-free stack
tests at the compile time.
Perf test doesn't fail because rte_ring_create() succeeds, however
marking this test as skipped gives a better indication of what actually
was tested.

Fixes: 7911ba0473 ("stack: enable lock-free implementation for aarch64")

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2021-05-03 18:46:15 +02:00
Chengwen Feng
b37ddc636c app/testpmd: support display queue state
This patch supports display queue state in "show rxq/txq" commands.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-21 14:07:51 +02:00
Huisong Li
f4367c0b97 app/testpmd: show link flow control info
This patch supports the query of the link flow control parameter
on a port.

The command format is as follows:
show port <port_id> flow_ctrl

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2021-04-21 13:43:41 +02:00
Chengwen Feng
bafe8a68f0 app/testpmd: support cleanup Tx queue mbufs
This patch supports cleanup txq mbufs command:
port cleanup (port_id) txq (queue_id) (free_cnt)

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-21 13:25:19 +02:00
Haifei Luo
f29fa2c59b app/testpmd: support policy actions per color
Add the create/del policy CLIs to support actions per color.
The CLIs are:
Create:  add port meter policy (port_id) (policy_id) g_actions (actions)
y_actions (actions) r_actions (actions)
Delete:  del port meter policy (port_id) (policy_id)

Examples:
testpmd> add port meter policy 0 1 g_actions rss / end y_actions end
r_actions drop / end
testpmd> del port meter policy 0 1

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-04-21 12:22:18 +02:00
Li Zhang
5f0d54f372 ethdev: add pre-defined meter policy API
Currently, the flow meter policy does not support multiple actions
per color; also the allowed action types per color are very limited.
In addition, the policy cannot be pre-defined.

Due to the growing in flow actions offload abilities there is a potential
for the user to use variety of actions per color differently.
This new meter policy API comes to allow this potential in the most ethdev
common way using rte_flow action definition.
A list of rte_flow actions will be provided by the user per color
in order to create a meter policy.
In addition, the API forces to pre-define the policy before
the meters creation in order to allow sharing of single policy
with multiple meters efficiently.

meter_policy_id is added into struct rte_mtr_params.
So that it can get the policy during the meters creation.

Allow coloring the packet using a new rte_flow_action_color
as could be done by the old policy API.

Add two common policy template as macros in the head file.

The next API function were added:
- rte_mtr_meter_policy_add
- rte_mtr_meter_policy_delete
- rte_mtr_meter_policy_update
- rte_mtr_meter_policy_validate
The next struct was changed:
- rte_mtr_params
- rte_mtr_capabilities
The next API was deleted:
- rte_mtr_policer_actions_update

To support this API the following app were changed:
app/test-flow-perf: clean meter policer
app/testpmd: clean meter policer

To support this API the following drivers were changed:
net/softnic: support meter policy API
1. Cleans meter rte_mtr_policer_action.
2. Supports policy API to get color action as policer action did.
   The color action will be mapped into rte_table_action_policer.

net/mlx5: clean meter creation management
Cleans and breaks part of the current meter management
in order to allow better design with policy API.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-04-21 12:22:17 +02:00
Bing Zhao
4d07cbefe3 app/testpmd: add commands for conntrack
The command line for testing connection tracking is added. To create
a conntrack object, 3 parts are needed.
  set conntrack com peer ...
  set conntrack orig scale ...
  set conntrack rply scale ...
This will create a full conntrack action structure for the indirect
action. After the indirect action handle of "conntrack" created, it
could be used in the flow creation. Before updating, the same
structure is also needed together with the update command
"conntrack_update" to update the "dir" or "ctx".

After the flow with conntrack action created, the packet should jump
to the next flow for the result checking with conntrack item. The
state is defined with bits and a valid combination could be
supported.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-20 01:24:57 +02:00
Jeff Guo
dc7b3bfcf8 app/testpmd: add packet ID for IP fragment
Add the new items to support the flow configuration for IP fragment
packets.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-20 00:59:41 +02:00
Ori Kam
0797fa6ccf app/testpmd: support integrity flow item
The integrity item allows the application to match
on the integrity of a packet.

Usage example:
match that packet integrity checks are OK. The checks depend on
packet layers. For example ICMP packet will not check L4 level.
flow create 0 ingress pattern integrity value mask 0x01 value spec 0x01

Match that L4 packet is OK - check L2 & L3 & L4 layers:
flow create 0 ingress pattern integrity value mask 0xfe value spec 0xfe

Signed-off-by: Ori Kam <orika@nvidia.com>
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-04-19 19:05:17 +02:00
Huisong Li
8df3e058bf app/testpmd: add link autoneg status display
This patch adds link autoneg status display in port_infos_display().

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-04-19 18:25:42 +02:00
Bing Zhao
4b61b8774b ethdev: introduce indirect flow action
Right now, rte_flow_shared_action_* APIs are used for some shared
actions, like RSS, count. The shared action should be created before
using it inside a flow. These shared actions sometimes are not
really shared but just some indirect actions decoupled from a flow.

The new functions rte_flow_action_handle_* are added to replace
the current shared functions rte_flow_shared_action_*.

There are two types of flow actions:
1. the direct (normal) actions that could be created and stored
   within a flow rule. Such action is tied to its flow rule and
   cannot be reused.
2. the indirect action, in the past, named shared_action. It is
   created from a direct actioni, like count or rss, and then used
   in the flow rules with an object handle. The PMD will take care
   of the retrieve from indirect action to the direct action
   when it is referenced.

The indirect action is accessed (update / query) w/o any flow rule,
just via the action object handle. For example, when querying or
resetting a counter, it could be done out of any flow using this
counter, but only the handle of the counter action object is
required.
The indirect action object could be shared by different flows or
used by a single flow, depending on the direct action type and
the real-life requirements.
The handle of an indirect action object is opaque and defined in
each driver and possibly different per direct action type.

The old name "shared" is improper in a sense and should be replaced.

Since the APIs are changed from "rte_flow_shared_action*" to the new
"rte_flow_action_handle*", the testpmd application code and command
line interfaces also need to be updated to do the adaption.
The testpmd application user guide is also updated. All the "shared
action" related parts are replaced with "indirect action" to have a
correct explanation.

The parameter of "update" interface is also changed. A general
pointer will replace the rte_flow_action struct pointer due to the
facts:
1. Some action may not support fields updating. In the example of a
   counter, the only "update" supported should be the reset. So
   passing a rte_flow_action struct pointer is meaningless and
   there is even no such corresponding action struct. What's more,
   if more than one operations should be supported, for some other
   action, such pointer parameter may not meet the need.
2. Some action may need conditional or partial update, the current
   parameter will not provide the ability to indicate which part(s)
   to update.
   For different types of indirect action objects, the pointer could
   either be the same of rte_flow_action* struct - in order not to
   break the current driver implementation, or some wrapper
   structures with bits as masks to indicate which part to be
   updated, depending on real needs of the corresponding direct
   action. For different direct actions, the structures of indirect
   action objects updating will be different.

All the underlayer PMD callbacks will be moved to these new APIs.

The RTE_FLOW_ACTION_TYPE_SHARED is kept for now in order not to
break the ABI. All the implementations are changed by using
RTE_FLOW_ACTION_TYPE_INDIRECT.

Since the APIs are changed from "rte_flow_shared_action*" to the new
"rte_flow_action_handle*" and the "update" interface's 3rd input
parameter is changed to generic pointer, the mlx5 PMD that uses these
APIs needs to do the adaption to the new APIs as well.

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Andrey Vesnovaty <andreyv@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-04-19 18:25:42 +02:00
Richael Zhuang
606a234c6d test/power: round CPU frequency to check
The value in "/sys/.../cpuinfo_cur_freq" may not be exactly the
same as what was set. For example, if "2400000" is written to
"/sys/.../cpufreq/scaling_setspeed" to set the frequency, then the
value in "/sys/.../cpuinfo_cur_freq" may be "2401222". So need to
round the value.

Fixes: ed7c51a6a6 ("app/test: vm power management")
Cc: stable@dpdk.org

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
2021-04-21 19:19:58 +02:00
Richael Zhuang
00456850be test/power: add delay before checking CPU frequency
For some platforms the newly-set frequency may not be effective
immediately. If we didn't get the right value from cpuinfo_cur_freq
immediately, add 10ms delay each time before rechecking until
timeout.

From our test, for some arm platforms, it requires up to 700ms when
going from a minimum to a maximum frequency. And it's not the
driver/software issue.

Fixes: ed7c51a6a6 ("app/test: vm power management")
Cc: stable@dpdk.org

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
2021-04-21 18:16:15 +02:00
Min Hu (Connor)
7eff355b69 test/bpf: fix error message
This patch fixed wrong error variable in logging message.

Fixes: 83633ba230 ("test/bpf: fix few small issues")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-04-21 17:08:02 +02:00
Chengwen Feng
a20cb9d027 test: check thread creation
There was a call for thread create function without result check.
Add result check and message print out after failure.

Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
2021-04-21 16:29:20 +02:00
Bruce Richardson
99a2dd955f lib: remove librte_ prefix from directory names
There is no reason for the DPDK libraries to all have 'librte_' prefix on
the directory names. This prefix makes the directory names longer and also
makes it awkward to add features referring to individual libraries in the
build - should the lib names be specified with or without the prefix.
Therefore, we can just remove the library prefix and use the library's
unique name as the directory name, i.e. 'eal' rather than 'librte_eal'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-04-21 14:04:09 +02:00
Bruce Richardson
23bd8128d6 app: reduce indentation in build files
As with the lib and drivers directories, we can use "continue" keyword to
reduce the indentation level of the majority of the foreach block. At the
same time, we can also replace tab indentation with spaces.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2021-04-21 14:04:09 +02:00
Kevin Traynor
5ac070cfed test/cmdline: silence clang 12 warning
clang 12 gives a warning about string concatenation in arrays.
In this case, as it is a long string test the strings are concatenated.
Add parentheses to indicate this.

$ clang --version
clang version 12.0.0 (Fedora 12.0.0-0.3.rc1.fc34)

../app/test/test_cmdline_num.c:204:5: warning:
suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma?
[-Wstring-concatenation]
"1111000011110000111100001111000011110000111100001111000011110000",
^
../app/test/test_cmdline_num.c:203:3: note:
place parentheses around the string literal to silence warning
"0b1111000011110000111100001111000011110000111100001111000011110000"
^

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2021-04-21 00:44:24 +02:00
Kevin Traynor
414245bbc5 test/cmdline: fix inputs array
clang 12 gives a warning about string concatenation in arrays.
In this case it looks like it was unintentional to concatenate
the strings. Separate with a comma.

$ clang --version
clang version 12.0.0 (Fedora 12.0.0-0.3.rc1.fc34)

../app/test/test_cmdline_ipaddr.c:259:3: warning:
suspicious concatenation of string literals in an array initialization;
did you mean to separate the elements with a comma?
[-Wstring-concatenation]
"random invalid text",
^
../app/test/test_cmdline_ipaddr.c:258:3: note:
place parentheses around the string literal to silence warning
"1234🔢1234🔢1234🔢1234🔢1234🔢1234"
^

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
2021-04-21 00:40:52 +02:00
Vladimir Medvedkin
28ebff11c2 hash: add predictable RSS
This patch adds predictable RSS API.
It is based on the idea of searching partial Toeplitz hash collisions.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
2021-04-20 23:13:23 +02:00
Shijith Thotton
b8ebe14659 test/event_crypto: use crypto adapter enqueue API
Use rte_event_crypto_adapter_enqueue() API to enqueue events to crypto
adapter if forward mode is supported in driver.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2021-04-17 18:50:06 +02:00
Huisong Li
312312e928 app/testpmd: fix bitmap of link speeds when force speed
Currently, when the user sets force link speed through 'link_speeds',
bit(0) of 'link_speeds' is not set to 1(ETH_LINK_SPEED_FIXED),
which conflicts with the definition.

Fixes: 88fbedcd5e ("app/testpmd: move speed and duplex parsing in a function")
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@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-04-14 13:54:44 +02:00
Haifei Luo
bf085dcba1 app/testpmd: add command for single flow dump
Add support for single flow dump.
The CLIs to dump one rule: flow dump PORT rule ID
to dump all: flow dump PORT all
Examples:
testpmd> flow dump 0 all
testpmd> flow dump 0 rule 0

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-04-14 13:19:55 +02:00
Haifei Luo
50c383793b ethdev: dump single flow rule
Previous implementations support dump all the flows. Add new arg
rte_flow in rte_flow_dev_dump to dump one flow.

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-14 13:19:55 +02:00
Li Zhang
c5a3860f36 app/testpmd: add meter profile packet mode option
add meter profile packet_mode to the ethernet device.
One example:
add port meter profile rfc2697 (port_id) (profile_id)
(cir) (cbs) (ebs) (packet_mode)

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-04-13 18:40:58 +02:00
Lance Richardson
9fdba32788 test: fix TCP header initialization
Initialize TCP data offset field with TCP header length, this
field is used to derive L4 header length and by hardware to
validate a TCP header.

Fixes: 41f72ec940 ("test: add packet burst generator functions")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-09 12:43:25 +02:00
Hemant Agrawal
d2df6e2cc5 app/testpmd: fix missing MPLS tokens for RSS
This patch adds missing MPLS tokens in for RSS config.

Fixes: d810252857 ("ethdev: add MPLS RSS offload type")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-09 11:58:03 +02:00
Fan Zhang
c21574edc5 cryptodev: add dequeue count parameter in raw API
This patch changes the experimental raw data path dequeue burst API.
Originally the API enforces the user to provide callback function
to get maximum dequeue count. This change gives the user one more
option to pass directly the expected dequeue count.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-04-16 12:43:33 +02:00
Adam Dybkowski
abc64f1075 app/crypto-perf: close device after benchmark run
This patch adds closing of the PMD after running the benchmark.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-04-16 12:43:33 +02:00
Adam Dybkowski
97f13c97eb test/crypto: close device after tests
This patch adds closing of the PMD after running the tests.

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-04-16 12:43:33 +02:00
Tejasree Kondoj
6356c28642 test/crypto: add cases for block cipher encrypted digest
Add test cases for block cipher DIGEST_ENCRYPTED mode.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2021-04-16 12:43:33 +02:00
Nicolas Chautru
48fc315f02 bbdev: add explicit enum for code block mode
Using explicit enum instead of ambiguous integer value

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Reviewed-by: Tom Rix <trix@redhat.com>
2021-04-16 12:43:33 +02:00
Xueming Li
64051bb1f1 devargs: unify scratch buffer storage
In current design, legacy parser rte_devargs_parse() saved scratch
buffer to devargs.args while new parser rte_devargs_layers_parse() saved
to devargs.data. Code using devargs had to know the difference and
cleaned up memory accordingly - error prone.

This patch unifies scratch buffer to data field, introduces
rte_devargs_reset() function to wrap the memory clean up logic.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Reviewed-by: Gaetan Rivet <grive@u256.net>
2021-04-14 22:25:08 +02:00
Stephen Hemminger
9667d97c25 pflock: add phase-fair reader writer locks
This is a new type of reader-writer lock that provides better fairness
guarantees which better suited for typical DPDK applications.
A pflock has two ticket pools, one for readers and one
for writers.

Phase-fair reader writer locks ensure that neither reader nor writer will
be starved.
Neither reader or writer are preferred, they execute in alternating
phases.
All operations of the same type (reader or writer) that acquire the lock
are handled in FIFO order.
Write operations are exclusive, and multiple read operations can be run
together (until a write arrives).

A similar implementation is in Concurrency Kit package in FreeBSD.
For more information see:
   "Reader-Writer Synchronization for Shared-Memory Multiprocessor
    Real-Time Systems",
    http://www.cs.unc.edu/~anderson/papers/ecrts09b.pdf

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-04-14 21:59:47 +02:00
Feifei Wang
dda66e716c test/trace: fix race on collected perf data
The measure_perf function should be executed after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.

In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.

Fixes: 16a277a24c ("test/trace: add performance test cases")
Cc: stable@dpdk.org

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-14 16:12:44 +02:00
Bruce Richardson
ace2f054ed test: take test names from command line
While having the ability to run a test based off the DPDK_TEST
environment variable is useful, it's sometimes more convenient to
specify the test name as a commandline parameter to a test binary.
This patch adds support for checking all parameters after the EAL ones, and
running all valid autotests requested - either from DPDK_TEST or on the
commandline. This also allows multiple tests to be run in a single
automated session, which is useful for working with components which have
multiple test suites.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2021-04-14 15:14:56 +02:00
Pavan Nikhilesh
2eaa37b866 app/eventdev: add vector mode in pipeline test
Add event vector support in pipeline tests. By default this mode
is disabled, it can be enabled by using the option --enable_vector.
example:
	dpdk-test-eventdev -l 7-23 -s 0xff00 -- --prod_type_ethdev
	--nb_pkts=0 --verbose 2 --test=pipeline_atq --stlist=a
	--wlcores=20-23  --enable_vector

Additional options to configure vector size and vector timeout are
also implemented and can be used by specifying --vector_size and
--vector_tmo_ns

This patch also adds a new option to set the number of Rx queues
configured per event eth rx adapter.
example:
	dpdk-test-eventdev -l 7-23 -s 0xff00 -- --prod_type_ethdev
	--nb_pkts=0 --verbose 2 --test=pipeline_atq --stlist=a
	--wlcores=20-23  --nb_eth_queues 4

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-12 09:23:34 +02:00
Shijith Thotton
7d761b07fc test/event: add unit tests for periodic timer
Add tests to arm and cancel periodic timer.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-04-12 09:23:34 +02:00
Pavan Nikhilesh
626b12a8d3 app/eventdev: fix timeout accuracy
Round timeout ticks when converting from nanoseconds, this prevents
loss of accuracy and deviation from requested timeout value.

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

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2021-04-12 09:23:34 +02:00
Timothy McDaniel
698fa82941 event/dlb: remove driver
Remove event/dlb driver from DPDK code base.
Updated release note's removal section to reflect the same.

Also updated doc/guides/rel_notes/release_20_11.rst to fix the
the missing link issue due to removal of doc/guides/eventdevs/dlb.rst

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
2021-04-12 09:21:30 +02:00
Pavan Nikhilesh
41f27795bb test/event: fix timeout accuracy
Round timeout ticks when converting from nanoseconds, this prevents
loss of accuracy and deviation from requested timeout value.

Fixes: d1f3385d00 ("test: add event timer adapter auto-test")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
2021-04-12 09:19:02 +02:00
Wisam Jaddo
83f9be10f2 app/flow-perf: fix encap/decap actions
When using decap actions it's been set to the data to decap
into the encap_data instead of decap_data, as a results we end
up with bad encap and decap data in many cases.

Fixes: 0c8f1f4ab9 ("app/flow-perf: support raw encap/decap actions")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:30:50 +02:00
Wisam Jaddo
96923debef app/flow-perf: report first flow latency
Starting from this commit the app will always
report the first flow latency.

This is useful in debugging to check the first
flow insertion before any caching effect.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:29:59 +02:00
Wisam Jaddo
f2cb939365 app/flow-perf: fix IPv6 source address increment
Currently the memset() will not set a correct src ip that represent
the incremental value of the counter.

This commit will fix this and each flow will have correct IPv6.src
that it's incremental from previous flow and equal to the decimal
values.

Fixes: bf3688f1e8 ("app/flow-perf: add insertion rate calculation")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:26:25 +02:00
Wisam Jaddo
b22a5a1e56 app/flow-perf: skip dumps for masked ports
Take into consideration that the user may call portmask for
any run, thus the app should always check if port is needed
to collect and report or not.

Fixes: 070316d01d ("app/flow-perf: add multi-core rule insertion and deletion")
Fixes: d8099d7ecb ("app/flow-perf: split dump functions")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 16:22:50 +02:00
Wisam Jaddo
c304358e9d app/flow-perf: rename records of used CPU time
create_flow and create_meter are not correct names since those
are records that contain creation and deletion, which makes
them more of a record for such data.

Fixes: d8099d7ecb ("app/flow-perf: split dump functions")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 15:54:18 +02:00
Wisam Jaddo
eb4df25f53 app/flow-perf: add runtime option to use unique data
Current support for unique data is to compile with config.h
var FIXED_VALUES as 0, and this is only supported on
compilation time, as a result the user may use only single
mode for each compilation.

Starting with this commit the user will have the ability to
use this feature on the fly by using this new option:
--unique-data

Example of unique data usage:
Insert many rules with different encap data for a flows that
have encap action in it.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 15:51:04 +02:00
Wisam Jaddo
b611605b05 app/flow-perf: use more generic wrapper to get cycles
rdtsc() is x86 related, while this might fail for other archs,
so it's better to use more generic API for cycles measurement.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-04-12 15:50:36 +02:00
Salem Sol
3b622711bc app/testpmd: support NVGRE encap as sample action
Add support for rte_flow_action_nvge_encap as a sample action.

The example of test-pmd command:

1.  set nvgre ip-version ... tni ... ip-src ... ip-dst ...
    set raw_encap 1 eth src... / ipv4... /...
    set sample_actions 2 nvgre / port_id id 0 / end
    flow create 0 ... pattern eth / end actions
       sample ratio 1 index 2 / raw_encap index 1 / port_id id 0...

    The flow will result in all the matched egress packets will be
    encapsulated and sent to wire, and also mirrored the packets
    using NVGRE encapsulation data and sent to wire.

Signed-off-by: Salem Sol <salems@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-08 01:09:24 +02:00
Salem Sol
a1f20f1abc app/testpmd: support VXLAN encap as sample action
Add support for rte_flow_action_vxlan_encap as a sample action.

The example of test-pmd command:

1.  set vxlan ip-version ... vni ... udp-src ...
    set raw_encap 1 eth src.../ ipv4.../...
    set sample_actions 2 vxlan_encap / port_id id 0 / end
    flow create 0 ... pattern eth / end actions
       sample ratio 1 index 2 / raw_encap index 1 / port_id id 0...

    The flow will result in all the matched egress packets will be
    encapsulated and sent to wire, and also mirrored the packets
    using VXLAN encapsulation data and sent to wire.

Signed-off-by: Salem Sol <salems@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-08 01:09:24 +02:00
Jiawei Wang
d51bd274b0 app/testpmd: store VXLAN/NVGRE encap data globally
With the current code the VXLAN/NVGRE parsing routine
stored the configuration of the header on stack, this
might lead to overwriting the data on the stack.

Currently having VXLAN/NVGRE encap as sample actions
is done using RAW_ENCAP, for example:
1. set raw_encap 1 eth src.../ vxlan vni.../ ipv4.../ ...
   set sample_actions 0 raw_encap / port_id id 0 / end
   flow create 0 ... pattern eth / end actions
      sample ration 1 index 0 / jump group 1 / end

The goal is to utilize the rte_flow_action_vxlan_encap
and rte_flow_action_nvgre_encap for sample actions.

This patch prepares storing the external data of vxlan and
nvgre encap into global data as a pre-step to supporting
vxlan and nvgre encap as a sample actions.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-04-08 01:09:24 +02:00
Thomas Monjalon
c6d527a1c8 app/testpmd: fix usage text
The options help text was including an incomplete and redundant
summary of the options before explaining each. The summary is dropped.

The details of the option --hairpin-mode had an extra space,
breaking the alignment with the next line.

There were some mismatches between options in the usage text
	sed -rn 's/.*\(" *--([a-z-]*)[=: ].*/\1/p' app/test-pmd/parameters.c
and the options declared in lgopts array
	sed -rn 's/.*\{.*"(.*)",.*,.*,.*},.*/\1/p' app/test-pmd/parameters.c
The misses were:
	--no-numa
	--enable-scatter
	--tx-ip
	--tx-udp
	--noisy-lkup-num-reads-writes
The option --ports was not implemented.

Fixes: 01817b10d2 ("app/testpmd: change hairpin queues setup")
Fixes: 3c156061b9 ("app/testpmd: add noisy neighbour forwarding mode")
Fixes: bf5b2126bf ("app/testpmd: add ability to set Tx IP and UDP parameters")
Fixes: 0499793854 ("app/testpmd: add scatter enabling option")
Fixes: 999b2ee0fe ("app/testpmd: enable NUMA support by default")
Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-04-09 14:31:43 +02:00
Thomas Monjalon
e0512833d4 app/regex: fix usage text
The usage syntax help includes the program name which was fake.
It is replaced with the real name from argv.

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

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-04-09 14:31:41 +02:00
Thomas Monjalon
487cfc2437 app: fix exit messages
Some applications were printing useless messages with rte_exit()
after showing the help. Using exit() is enough in this case.

Some applications were using a redundant printf or fprintf() before
calling rte_exit(). The messages are unified in a single rte_exit().

Some rte_exit() calls were missing a line feed or returning a wrong code.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-04-09 14:31:29 +02:00
David Marchand
39b5717999 test/log: check levels
Add checks on log levels:
- default values for rte_log_register and RTE_LOG_REGISTER,
- level changes with rte_log_set_level and consorts

Signed-off-by: David Marchand <david.marchand@redhat.com>
2021-04-09 14:01:07 +02:00
Stanislaw Kardach
3dd7d693ff test: proceed if timer subsystem already initialized
rte_timer_subsystem_init() may return -EALREADY if the timer subsystem
was already initialized. This can happen i.e. in PMD code (see
eth_ena_dev_init). This is not an error, rather a notification as the
initialization function simply returns without any action taken.

Fixes: 50247fe03f ("test/timer: exercise new APIs in secondary process")
Cc: stable@dpdk.org

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Reviewed-by: Michal Krawczyk <mk@semihalf.com>
2021-04-08 23:13:25 +02:00
Suanming Mou
cace2d7ef2 app/test-regex: add scattered mbuf input
This commits adds the scattered mbuf input support.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-04-08 22:52:55 +02:00
Hongbo Zheng
0e8f348994 app/testpmd: fix Tx/Rx descriptor query error log
This patch adds more err info for Tx/Rx descriptor query command.

Fixes: fae9aa717d ("app/testpmd: support checking descriptor status")
Cc: stable@dpdk.org

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-03-30 16:34:48 +02:00
Jiawei Wang
9b0da816bd app/testpmd: fix NVGRE encap configuration
For NVGRE protocol, the default value of 'c_k_s_rsvd0_ver'
must be 0x2000, and protocol type must be 0x6558 in the NVGRE
header.

This patch updates these two configurations while parsing the nvgre
encap.

Fixes: dcd962fc6b ("app/testpmd: add NVGRE encap/decap")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-03-23 14:54:16 +01:00
Thinh Tran
c8c3cfd699 test: fix autotest handling of skipped tests
- When running the default configuration of autotest of the make test
  it'd take 900 seconds (15 minutes) for the script TIMEOUT and marks
  Failed for a specific device test that is not supported on the
  system under test.
- Adding the checking for those tests, print out as "Skipped [Not Run]"
  quickly return and continue for next test

Fixes: da0af48a67 ("test: add skipped return result")
Cc: stable@dpdk.org

Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
2021-03-25 16:24:27 +01:00
Natanael Copa
3529e8f3a5 app/testpmd: fix build with musl
1/ Improve portability by avoiding use of non-standard 'uint'.
Use uint8_t for hash_key_len as rss_key_len is a uint8_t type.
This solves following build error when building with musl libc:
    app/test-pmd/testpmd.h:813:29: error: unknown type name 'uint'

2/ In musl libc, stdout is of type (FILE * const).
Because of the const qualifier, a dark magic cast
must be achieved through uintptr_t.

Fixes: 8205e241b2 ("app/testpmd: add missing type to RSS hash commands")
Fixes: e977e4199a ("app/testpmd: add commands to load/unload BPF filters")
Cc: stable@dpdk.org

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-03-23 08:41:05 +01:00
Thomas Monjalon
e0ae50c687 build: remove redundant _GNU_SOURCE definitions
The feature macro _GNU_SOURCE is defined globally,
but there was some remaining useless settings.

The internal definition in config/meson.build is kept,
all other internal definitions of _GNU_SOURCE are removed,
except in examples, which can be built as external applications.
Note: external applications do not inherit of _GNU_SOURCE.

Fixes: 5d7b673d5f ("mk: build with _GNU_SOURCE defined by default")
Fixes: 28188cee2a ("build: enable BSD features visibility for FreeBSD")
Fixes: e6cdc54cc0 ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-03-23 08:41:05 +01:00
Thomas Monjalon
1cd512b2f5 build: detect execinfo library on Linux
The library execinfo and its header file can be installed on Alpine Linux
where the backtrace feature is not part of musl libc:
	apk add libexecinfo-dev

As a consequence, this library should not be restricted to BSD only.

At the same time, the library and header are detected once and added
globally to be linked with any application, internal or external.

Fixes: 9065b1fac6 ("build: fix dependency on execinfo for BSD meson builds")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
2021-03-23 08:41:05 +01:00
Xueming Li
9be46b4308 kvargs: support multiple lists
This patch updates kvargs parser to support value of multiple lists or
ranges:
  k1=v[1,2]v[3-5]

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-03-16 20:15:29 +01:00
Kalesh AP
2382a60759 app/testpmd: check MAC address query
This patch checks return value for rte_eth_dev_info_get() in show_macs().

Coverity issue: 353629
Fixes: e1d44d0ad6 ("app/testpmd: show MAC addresses added to a port")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2021-03-16 11:17:09 +01:00
Andrew Rybchenko
52f2c6f259 app/testpmd: log reason of port start failure
Provide a bit more diagnostics information when port start fails.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-03-12 15:14:56 +01:00
Ajit Khaparde
b7b78a089c app/testpmd: support forced ethernet speed
Add support for forced ethernet speed setting.
Currently testpmd tries to configure the Ethernet port in autoneg mode.
It is not possible to set the Ethernet port to a specific speed while
starting testpmd. In some cases capability to configure a forced speed
for the Ethernet port during initialization may be necessary. This patch
tries to add this support.

The patch assumes full duplex setting and does not attempt to change that.
So speeds like 10M, 100M are not configurable using this method.

The command line to configure a forced speed of 10G:
dpdk-testpmd -c 0xff  -- -i  --eth-link-speed  10000

The command line to configure a forced speed of 50G:
dpdk-testpmd -c 0xff  -- -i  --eth-link-speed  50000

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-03-08 12:44:01 +01:00
Lance Richardson
e8a419d6de mbuf: rename outer IP checksum macro
Rename PKT_RX_EIP_CKSUM_BAD to PKT_RX_OUTER_IP_CKSUM_BAD and
deprecate the original name. The new name is better aligned
with existing PKT_RX_OUTER_* flags, which should help reduce
confusion about its use.

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-03-02 10:57:28 +01:00
Xiaoyun Li
9d32f448ea app/testpmd: remove unnecessary UDP tunnel check
cmd_tunnel_udp_config checked 'cmd' to set prot_type but this cmd is
only for rx_vxlan_port. The unnecessary cmd check will cause uninit
coverity issue. So remove it and rename 'cmd' to 'rx_vxlan_port'.

Coverity issue: 366155
Fixes: bd948f20d6 ("app/testpmd: VXLAN packet identification")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-02-25 17:53:40 +01:00
Ferruh Yigit
ecf86ccb4b app/testpmd: remove duplicated offload display
"show port cap all|<port_id>" was to display offload configuration of
port(s).

But later two other commands added to show same information in more
accurate way:
 show port (port_id) rx_offload configuration
 show port (port_id) tx_offload configuration

These new commands can both show port and queue level configuration,
also with their capabilities counterparts easier to see offload
capability and configuration of the port in similar syntax.

So the functionality is duplicated and removing this version, to favor
the new commands.

Another problem with this command is it requires each new offload to be
added into the function to display them, and there were missing offloads
that are not displayed, this requirement for sure will create gaps by
time as new offloads added.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-02-24 13:28:30 +01:00
Lance Richardson
d139cf231b app/testpmd: count outer IP checksum errors
Count and display outer IP checksum errors in the checksum
forwarder.

Example forwarder stats output:
  RX-packets: 158            RX-dropped: 0             RX-total: 158
  Bad-ipcsum: 48             Bad-l4csum: 48            Bad-outer-l4csum: 6
  Bad-outer-ipcsum: 40
  TX-packets: 0              TX-dropped: 0             TX-total: 0

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-02-23 19:22:34 +01:00
Kathleen Capella
28bbeaa23b app/testpmd: remove unused struct member
The tx_queue member of the fwd_lcore struct is unused as it is already
part of the fwd_stream structure. Deleting helps improve code readability.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2021-02-22 19:17:58 +01:00
Lance Richardson
6f04fa4521 app/testpmd: display Rx queue used descriptor count
Add support for displaying the count of used (filled by hardware
but not yet processed by the driver) descriptors on a receive
queue in order to allow the rte_eth_dev rx_queue_count() API to
be exercised and tested.

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-02-22 12:16:14 +01:00
David Marchand
3cd7290c16 ci: catch coredumps
Parts of the unit tests code rely on forked/secondary processes
(expectedly) failing.
A crash in those situations could be missed so add a check on coredumps
presence after unit tests have run.
When unit tests fail, it can also help checking for coredumps as it
could give more insights on what happened.

In some situations (like explicit call to rte_panic), coredump generation
must be disabled to avoid false positives.

Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Aaron Conole <aconole@redhat.com>
2021-03-03 10:05:23 +01:00
Nithin Dabilpuram
52db57db05 test/mem: fix page size for external memory
Currently external memory test uses 4K page size.
VFIO DMA mapping works only with system page granularity.

Earlier it was working because all the contiguous mappings
were coalesced and mapped in one-go which ended up becoming
a lot bigger page. Now that VFIO DMA mappings both in IOVA as VA
and IOVA as PA mode, are being done at memseg list granularity,
we need to use system page size.

Fixes: b270daa43b ("test: support external memory")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2021-03-01 11:58:28 +01:00
Ferruh Yigit
618f0f4ac6 app/testpmd: fix help of metering commands
Helps strings syntax is "command : description", the 'command' part was
missing, updated command help strings.

Fixes: 281eeb8afc ("app/testpmd: add commands for metering and policing")
Fixes: 30ffb4e67e ("app/testpmd: add commands traffic metering and policing")
Fixes: e63b50162a ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-02-10 22:27:03 +01:00
Ciara Power
5ba31a4e2e app/crypto-perf: fix handling of config parameters
The crypto perf graphing script did not handle parsing parameters
from the JSON config files correctly.
A common parsing function is used for both EAL and app parameters,
to ensure they are handled the same way and to reduce code duplication.
Short parameters are now passed with the value being a second argument,
rather than as one argument with dividing space.
Long parameters with no expected value are supported for EAL now also.
e.g. "--no-huge" can be added to config as "no-huge": true

Fixes: f400e0b82b ("app/crypto-perf: add script to graph perf results")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
2021-02-04 19:21:27 +01:00
Gagandeep Singh
f7ea970110 test/crypto: add check in decryption with digest case
Some platforms may not support operations on encrypted digest,
So in this patch adding a check for such test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2021-02-04 19:06:25 +01:00
Dekel Peled
dec7c4bd90 app/testpmd: support shared age action query
Shared age action query was implemented as part of flow query,
but was not implemented as part of shared action query.

This patch adds the required implementation.

Fixes: 2f622174bf ("app/testpmd: support query of age action")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-02-04 18:19:37 +01:00
Satheesh Paul
5f94de1b3a app/testpmd: add PF and VF targets to sample flow action
Add support to specify PF or VF as targets in "set sample_actions"
command.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-02-03 00:48:11 +01:00
Viacheslav Ovsiienko
293ca0aaaf app/testpmd: fix queue reconfig request on Rx split update
There is the "set rxpkts" command in the testpmd interactive mode,
it configures the segment sizes to split the packet on receiving.
The mentioned segment sizes are provided on the Rx queue setup
as part of queue configuration. Hence, to take the rxpkts command
into effect the Rx queues must be explicitly reconfigured.

The explained above is related to the "set rxoffs" as well.

The patch sets the queue reconfiguration request flag for
all devices once Rx split settings are updated, to take
the changes into effect the port(s) should be restarted.

Fixes: 0f2096d7ab ("app/testpmd: add rxpkts commands and parameters")
Fixes: 91c78e090e ("app/testpmd: add rxoffs commands and parameters")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:12 +01:00
Dapeng Yu
b3e3d602a5 app/testpmd: avoid exit without terminal restore
In interactive mode, if testpmd exit by calling rte_exit without
restore terminal attributes, terminal will not echo keyboard input.

register a function with atexit() in prompt(), when exit() in
rte_exit() is called, the registered function restores terminal
attributes.

Fixes: 5a8fb55c48 ("app/testpmd: support unidirectional configuration")
Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2021-01-29 18:16:12 +01:00
Igor Russkikh
6c02043e99 app/testpmd: support sending cloned packets in flowgen
When testing high performance numbers, it is often that CPU performance
limits the max values device can reach (both in pps and in gbps)

Here instead of recreating each packet separately, we use clones counter
to resend the same mbuf to the line multiple times.

PMDs handle that transparently due to reference counting inside of mbuf.

Reaching max PPS on small packet sizes helps here:
Some data from our 2 port x 50G device. Using 2*6 tx queues, 64b packets,
PowerEdge R7525, AMD EPYC 7452:

./build/app/dpdk-testpmd -l 32-63  -- --forward-mode=flowgen \
  --rxq=6 --txq=6  --disable-crc-strip --burst=512 \
  --flowgen-clones=0 --txd=4096 --stats-period=1 --txpkts=64

Gives ~46MPPS TX output:

  Tx-pps:     22926849          Tx-bps:  11738590176
  Tx-pps:     23642629          Tx-bps:  12105024112

Setting flowgen-clones to 512 pushes TX almost to our device
physical limit (68MPPS) using same 2*6 queues(cores):

  Tx-pps:     34357556          Tx-bps:  17591073696
  Tx-pps:     34353211          Tx-bps:  17588802640

Doing similar measurements per core, I see one core can do
6.9MPPS (without clones) vs 11MPPS (with clones)

Verified on Marvell qede and atlantic PMDs.

Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:12 +01:00
Steve Yang
0c4abd3688 app/testpmd: fix setting maximum packet length
"port config all max-pkt-len" command fails because it doesn't set the
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag properly.

Commit in the fixes line moved the 'DEV_RX_OFFLOAD_JUMBO_FRAME' offload
flag update from 'cmd_config_max_pkt_len_parsed()' to 'init_config()'.
'init_config()' function is only called during testpmd startup, but the
flag status needs to be calculated whenever 'max_rx_pkt_len' changes.

The issue can be reproduced as [1], where the 'max-pkt-len' reduced and
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag should be cleared but it
didn't.

Adding the 'update_jumbo_frame_offload()' helper function to update
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag and 'max_rx_pkt_len'. This
function is called both by 'init_config()' and
'cmd_config_max_pkt_len_parsed()'.

Default 'max-pkt-len' value set to zero, 'update_jumbo_frame_offload()'
updates it to "RTE_ETHER_MTU + PMD specific Ethernet overhead" when it
is zero.
If '--max-pkt-len=N' argument provided, it will be used instead.
And with each "port config all max-pkt-len" command, the
'DEV_RX_OFFLOAD_JUMBO_FRAME' offload flag, 'max-pkt-len' and MTU is
updated.

[1]
--------------------------------------------------------------------------
dpdk-testpmd -c 0xf -n 4 -- -i --max-pkt-len=9000 --tx-offloads=0x8000
	--rxq=4 --txq=4 --disable-rss
testpmd>  set verbose 3
testpmd>  port stop all
testpmd>  port config all max-pkt-len 1518
testpmd>  port start all

// Got fail error info without this patch
Configuring Port 0 (socket 1)
Ethdev port_id=0 rx_queue_id=0, new added offloads 0x800 must be
within per-queue offload capabilities 0x0 in rte_eth_rx_queue_setup()
Fail to configure port 0 rx queues //<-- Fail error info;
--------------------------------------------------------------------------

Bugzilla ID: 625
Fixes: 761c4d6690 ("app/testpmd: fix max Rx packet length for VLAN packets")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Tested-by: Bo Chen <box.c.chen@intel.com>
2021-01-29 18:16:12 +01:00
Jiawei Wang
b665487e0b app/testpmd: fix sample action for RSS with no key
When the RSS with null key was set in sample actions list, it
caused the segmentation fault since the RSS key pointer was
NULL while did the memory copy.

This patch adds the RSS key NULL pointer checking before copying
to fix the segmentation fault issue.

Fixes: 11b1b0edda ("app/testpmd: support RSS in sample action")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:11 +01:00
Hemant Agrawal
d810252857 ethdev: add MPLS RSS offload type
This patch defines new RSS offload types for MPLS. The distribution
will on the basis of MPLS tag.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:08 +01:00
Alexander Kozyrev
8d00e4698e ethdev: add IPv6 DSCP option for modify field action
IPv6 DSCP field ID is missing from the original list of Field IDs
for MODIFY_FIELD action. Add it to support IPv6 header fully.
Add ipv6_dscp option for the corresponding header field in testpmd.

Fixes: 73b68f4c54 ("ethdev: introduce generic modify flow action")

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:08 +01:00
Alvin Zhang
b57927702a app/testpmd: fix key for RSS flow rule
Since the patch '1848b117' has initialized the variable 'key' in
'struct rte_flow_action_rss' with 'NULL', the PMD cannot get the
RSS key now. Details as bellow:

testpmd> flow create 0 ingress pattern eth / ipv4 / end actions
         rss types ipv4-other end key
         1234567890123456789012345678901234567890FFFFFFFFFFFF123
         4567890123456789012345678901234567890FFFFFFFFFFFF
         queues end / end
Flow rule #1 created
testpmd> show port 0 rss-hash key
RSS functions:
         all ipv4-other ip
RSS key:
         4439796BB54C5023B675EA5B124F9F30B8A2C03DDFDC4D02A08C9B3
         34AF64A4C05C6FA343958D8557D99583AE138C92E81150366

This patch sets offset and size of the 'key' variable as the first
parameter of the token 'key'. Later, the address of the RSS key will
be copied to 'key' variable.

Fixes: 1848b117cc ("app/testpmd: fix RSS key for flow API RSS rule")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:08 +01:00
Jiawei Wang
2ce964954b app/testpmd: fix packets dump overlapping
When testpmd enabled the verbosity for the received packets, if two
packets were received at the same time, for example, sampling packet and
normal packet, the dump output of these packets may be overlapping due
to multiple core handling the multiple queues simultaneously.

The patch uses one string buffer that collects all the packet dump
output into this buffer and then printouts it at last, that guarantees
to printout separately the dump output per packet.

Fixes: d862c45b59 ("app/testpmd: move dumping packets to a separate function")
Cc: stable@dpdk.org

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-29 18:16:07 +01:00
Bruce Richardson
df96fd0d73 ethdev: make driver-only headers private
The rte_ethdev_driver.h, rte_ethdev_vdev.h and rte_ethdev_pci.h files are
for drivers only and should be a private to DPDK and not installed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Steven Webster <steven.webster@windriver.com>
2021-01-29 20:59:09 +01:00
Gagandeep Singh
8dda080a09 test/ipsec: fix result code for not supported
During SA creation, if the required algorithm is not supported,
drivers can return ENOTSUP. But in most of the IPsec test cases,
if the SA creation does not success, it just returns
TEST_FAILED.

This patch fixes this issue by returning the actual return values
from the driver to the application, so that it can make decisions
whether the test case is passed, failed or unsupported.

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

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2021-01-27 20:58:14 +01:00
Ciara Power
f400e0b82b app/crypto-perf: add script to graph perf results
The python script introduced in this patch runs the crypto performance
test application for various test cases, and graphs the results.

Test cases are defined in config JSON files, this is where parameters
are specified for each test. Currently there are various test cases for
devices crypto_qat, crypto_aesni_mb and crypto_gcm. Tests for the
ptest types Throughput and Latency are supported for each.

The results of each test case are graphed and saved in PDFs (one PDF for
each test suite graph type, with all test cases).
The graphs output include various grouped barcharts for throughput
tests, and histogram and boxplot graphs are used for latency tests.

Documentation is added to outline the configuration and usage for the
script.

Usage:
A JSON config file must be specified when running the script,
	"./dpdk-graph-crypto-perf <config_file>"

The script uses the installed app by default (from ninja install).
Alternatively we can pass path to app by
	"-f <rel_path>/<build_dir>/app/dpdk-test-crypto-perf"

All device test suites are run by default.
Alternatively we can specify by adding arguments,
	"-t latency" - to run latency test suite only
	"-t throughput latency"
		- to run both throughput and latency test suites

A directory can be specified for all output files,
or the script directory is used by default.
	"-o <output_dir>"

To see the output from the dpdk-test-crypto-perf app,
use the verbose option "-v".

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
2021-01-27 19:03:52 +01:00
Ciara Power
c6ddab873d app/crypto-perf: fix CSV output format
The csv output for each ptest type used ";" instead of ",".
This has now been fixed to use the comma format that is used in the csv
headers.

Fixes: f6cefe253c ("app/crypto-perf: add range/list of sizes")
Fixes: 96dfeb609b ("app/crypto-perf: add new PMD benchmarking mode")
Fixes: da40ebd6d3 ("app/crypto-perf: display results in test runner")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
2021-01-27 19:03:52 +01:00
Ciara Power
2f04e8248a app/crypto-perf: fix latency CSV output
The csv output for the latency performance test had an extra header,
"Packet Size", which is a duplicate of "Buffer Size", and had no
corresponding value in the output. This is now removed.

Fixes: f6cefe253c ("app/crypto-perf: add range/list of sizes")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
2021-01-27 19:03:52 +01:00
Ankur Dwivedi
61ecfb0240 test/event_crypto: set cipher operation in transform
The symmetric session configure callback function in OCTEON TX2 crypto
PMD returns error if the cipher operation is not set to either encrypt
or decrypt. This patch sets the cipher operation for the null cipher
to encrypt.

Fixes: 7444937523 ("test/event_crypto_adapter: fix configuration")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
2021-01-26 20:30:41 +01:00
Feifei Wang
7fdc5ce88d app/eventdev: remove unnecessary barriers in order test
For the wmb in order_process_stage_1 and order_process_stage_invalid in
the order test, they can be removed. This is because when the test results
are wrong, the worker core writes 'true' to t->err. Then other worker
cores, producer cores and the main core will load the 'error' index and
stop testing. So, for the worker cores, no other storing operation needs
to be guaranteed after this when errors happen.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-01-26 15:32:18 +01:00
Feifei Wang
c56563f19a app/eventdev: remove unnecessary barrier in pipeline test
For "processed_pkts" function, no operations should keep the order that
being executed before loading "worker[i].processed_pkts".

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-01-26 15:19:12 +01:00
Feifei Wang
37f60fd638 app/eventdev: replace a barrier with thread fence
Simply replace rte_smp barrier with atomic threand fence.

Signed-off-by: Phil Yang <phil.yang@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-01-26 15:06:03 +01:00
Feifei Wang
9e9cf349fa app/eventdev: remove unnecessary barriers in perf test
For "processed_pkts" and "total_latency" functions, no operations should
keep the order that being executed before loading
"worker[i].processed_pkts". Thus rmb is unnecessary before loading.

For "perf_launch_lcores" function, wmb after that the main lcore
updates the variable "t->done", which represents the end of the test
signal, is unnecessary. Because after the main lcore updates this
siginal variable, it will jump out of the launch function loop, and wait
other lcores stop or return error in the main function(evt_main.c).
During this time, there is no important storing operation and thus no
need for wmb.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-01-26 14:52:56 +01:00
Feifei Wang
c7c033d173 app/eventdev: fix SMP barrier in performance test
This patch fixes RTE SMP barrier bugs for the perf test of eventdev.

For the "perf_process_last_stage" function, wmb after storing
processed_pkts should be moved before it. This is because the worker
lcore should ensure it has really finished data processing, e.g. event
stored into buffers, before the shared variables "w->processed_pkts"are
stored.

For the "perf_process_last_stage_latency", on the one hand, the wmb
should be moved before storing into "w->processed_pkts". The reason is
the same as above. But on the other hand, for "w->latency", wmb is
unnecessary due to data dependency.

Fixes: 2369f73329 ("app/testeventdev: add perf queue worker functions")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2021-01-26 14:39:08 +01:00
Feifei Wang
21b1ca4843 app/eventdev: remove redundant enqueue in burst Tx
For eventdev pipeline test, in burst_tx cases, there is no needed to
set ev.op as RTE_EVENT_OP_RELEASE and call pipeline_event_enqueue_burst
to release events. This is because for tx mode(internal_port=true),
the capability "implicit_release" of dev is enabled, and the app can
release events by "rte_event_dequeue_burst" rather than enqueue.

Fixes: 314bcf58ca ("app/eventdev: add pipeline queue worker functions")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-01-26 12:00:29 +01:00
Feifei Wang
e0c0573783 app/eventdev: adjust event count order for pipeline test
For the fwd mode (internal_port = false) in pipeline test,
processed-pkts increment should after enqueue. However, in
multi_stage_fwd and multi_stage_burst_fwd, "w->processed_pkts" is
increased before enqueue.

To fix this, move "w->processed_pkts" increment after enqueue, and then
the main core can load the correct number of processed packets.

Fixes: 314bcf58ca ("app/eventdev: add pipeline queue worker functions")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-01-26 12:00:17 +01:00
Feifei Wang
d310d64271 test/ring: reduce duration of performance tests
When testing ring performance in the case that multiple lcores are mapped
to the same physical core, e.g. --lcores '(0-3)@10', it takes a very long
time to wait for the "enqueue_dequeue_bulk_helper" to finish.
This is because too much iteration numbers and extremely low efficiency
for enqueue and dequeue with this kind of core mapping. Following are the
test results to show the above phenomenon:

x86-Intel(R) Xeon(R) Gold 6240:
$sudo ./app/test/dpdk-test --lcores '(0-1)@25'
Testing using two hyperthreads(bulk (size: 8):)
iter_shift:         3     5     7     9     11     13    *15     17     19     21      23
run time:           7s    7s    7s    8s    9s     16s    47s    170s   660s   >0.5h   >1h
legacy APIs: SP/SC: 37    11    6     40525 40525  40209  40367  40407  40541  NoData  NoData
legacy APIs: MP/MC: 56    14    11    50657 40526  40526  40526  40625  40585  NoData  NoData

aarch64-n1sdp:
$sudo ./app/test/dpdk-test --lcore '(0-1)@1'
Testing using two hyperthreads(bulk (size: 8):)
iter_shift:         3     5     7     9     11     13    *15     17     19     21      23
run time:           8s    8s    8s    9s    9s     14s    34s    111s   418s   25min   >1h
legacy APIs: SP/SC: 0.4   0.2   0.1   488   488    488    488    488    489    489     NoData
legacy APIs: MP/MC: 0.4   0.3   0.2   488   488    488    488    490    489    489     NoData

As the number of iterations increases, so does the time which is required
to run the program. Currently (iter_shift = 23), it will take more than
1 hour to wait for the test to finish. To fix this, the "iter_shift" should
decrease and ensure enough iterations to keep the test data stable.
In order to achieve this, we also test with "-l" EAL argument:

x86-Intel(R) Xeon(R) Gold 6240:
$sudo ./app/test/dpdk-test -l 25-26
Testing using two NUMA nodes(bulk (size: 8):)
iter_shift:         3     5     7     9     11     13    *15     17     19     21      23
run time:           6s    6s    6s    6s    6s     6s     6s     7s     8s     11s     27s
legacy APIs: SP/SC: 47    20    13    22    54     83     91     73     81     75      95
legacy APIs: MP/MC: 44    18    18    240   245    270    250    249    252    250     253

aarch64-n1sdp:
$sudo ./app/test/dpdk-test -l 1-2
Testing using two physical cores(bulk (size: 8):)
iter_shift:         3     5     7     9     11     13    *15     17     19     21      23
run time:           8s    8s    8s    8s    8s     8s     8s     9s     9s     11s     23s
legacy APIs: SP/SC: 0.7   0.4   1.2   1.8   2.0    2.0    2.0    2.0    2.0    2.0     2.0
legacy APIs: MP/MC: 0.3   0.4   1.3   1.9   2.9    2.9    2.9    2.9    2.9    2.9     2.9

According to above test data, when "iter_shift" is set as "15", the test
run time is reduced to less than 1 minute and the test result can keep
stable in x86 and aarch64 servers.

Fixes: 1fa5d0099e ("test/ring: add custom element size performance tests")
Cc: stable@dpdk.org

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-01-29 11:37:01 +01:00
Lukasz Wojciechowski
95bb247702 test/distributor: fix return buffer queue overload
The distributor library implementation uses a cyclic queue to store
packets returned from workers. These packets can be later collected
with rte_distributor_returned_pkts() call.
However the queue has limited capacity. It is able to contain only
127 packets (RTE_DISTRIB_RETURNS_MASK).

Big burst tests sent 1024 packets in 32 packets bursts without waiting
until they are processed by the distributor. In case when tests were
run with big number of worker threads, it happened that more than
127 packets were returned from workers and put into cyclic queue.
This caused packets to be dropped by the queue, making them impossible
to be collected later with rte_distributor_returned_pkts() calls.
However the test waited for all packets to be returned infinitely.

This patch fixes the big burst test by not allowing more than
queue capacity packets to be processed at the same time, making
impossible to drop any packets.
It also cleans up duplicated code in the same test.

Bugzilla ID: 612
Fixes: c0de0eb82e ("distributor: switch over to new API")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
2021-01-29 08:48:45 +01:00
Dong Zhou
6a2cf58a04 app/flow-perf: support meter action
Currently, test-flow-perf app cannot generate flows with meter action.
This patch introduces new parameter "--meter" to generate flows
with meter action.

Signed-off-by: Dong Zhou <dongzhou@nvidia.com>
Reviewed-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-01-26 18:39:37 +01:00
Dong Zhou
d8099d7ecb app/flow-perf: split dump functions
The app will calculate and output used CPU time for flow insertion rate.
It's also needed for some new insertion items, such as meter.
It's better to split this calculation and output part to a single function,
so that all new insertion items can use it.

Signed-off-by: Dong Zhou <dongzhou@nvidia.com>
Reviewed-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Alexander Kozyrev <akozyrev@nvidia.com>
2021-01-26 16:52:17 +01:00
Hemant Agrawal
026a546a22 app/procinfo: fix security context info
We need to differentiate between crypto and ethernet security
context as they belong to different devices.

Fixes: d82d6ac643 ("app/procinfo: add crypto security context info")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2021-01-26 14:07:24 +01:00
Bruce Richardson
7be7dc6dea build: force pkg-config for dependency detection
Meson can use cmake as a fallback for detecting packages, and this can
lead to picking up 64-libs for 32-bit builds. To work around this, force
the use of pkg-config only for detecting libcrypto, zlib, jansson and
other package dependencies.

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Liron Himi <lironh@marvell.com>
Tested-by: Lee Daly <lee.daly@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Martin Spinler <spinler@cesnet.cz>
2021-01-26 00:43:59 +01:00
Bruce Richardson
64fd212430 app: fix build with extra include paths
The "includes" variable in the app/meson.build file was ignored when
building the executable, meaning that apps couldn't pass additional
include paths directly back. Fix this to align with drivers and libs.

Fixes: fa036e70d7 ("app: generalize meson build")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2021-01-21 10:27:47 +01:00
Jiawei Wang
11b1b0edda app/testpmd: support RSS in sample action
Support rss action in the sample sub-actions list.

The examples for the sample flow use case and result as below:
set sample_actions 0 mark id  0x12 / rss queues  0 1 2 3 end  / end
flow create 0 ingress group 1 pattern eth / end actions
sample ratio 1 index 0 / jump group 2 / end

This flow will result in all the matched ingress packets will be
jumped to next table, and the each packet will be marked with 0x12
and duplicated to rss queues of the control application.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2021-01-19 03:30:32 +01:00
Alexander Kozyrev
24e1a5e39d app/testpmd: support modify field flow action
Add support for the RTE_FLOW_ACTION_MODIFY_FIELD to the testpmd.
Implement CLI to create the modify_field action and supply all the
needed parameters to modify an arbitrary packet field (as well as
mark, tag or metadata) with data from another field or immediate
value.

Example of the flow is the following:
flow create 0 egress group 1 pattern eth / ipv4 / udp / end
  actions modify_field op set dst_type tag dst_level 2 dst_offset 8
          src_type gtp_teid src_level 0 src_offset 0 width 16 / end

This flow copies 16 bits from the second Tag in the Tags array
into the outermost GTP TEID packet header field. 8 bits of the
Tag are skipped as indicated by the dst_offset action parameter.

op, dst_type, src_type and width are the mandatory parameters to
specify. Levels and offset are 0 by default if they are not
overridden by a user. The operation can be set, add or sub.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2021-01-19 03:30:32 +01:00
George Prekas
d841ef857d app/testpmd: fix IP checksum calculation
Strict-aliasing rules are violated by cast to uint16_t* in flowgen.c and
the calculated IP checksum is wrong. Use attribute __may_alias__ to fix
the problem.

Fixes: e9e23a617e ("app/testpmd: add flowgen forwarding engine")
Cc: stable@dpdk.org

Signed-off-by: George Prekas <prekageo@amazon.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-19 03:30:32 +01:00
Viacheslav Ovsiienko
c68ad62f76 app/testpmd: support GENEVE header option length
The patch adds the GENEVE rte flow option length support to
command line interpreter. The flow command with GENEVE
option items looks like:

    flow create 0 ingress pattern eth / ipv4 / udp / geneve vni
    is 100 optlen is 2 / end actions drop / end

The option length should be specified in 32-bit words, this
value specifies the all options length in the GENEVE header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-19 03:30:15 +01:00
Viacheslav Ovsiienko
55c074f3ba app/testpmd: support GENEVE option item
The patch adds the GENEVE option rte flow item support to
command line interpreter. The flow command with GENEVE
option items looks like:

  flow create 0 ingress pattern eth / ipv4 / udp / geneve vni is 100 /
       geneve-opt class is 99 length is 1 type is 0 data is 0x669988 /
       end actions drop / end

The option length should be specified in 32-bit words, this
value specifies the length of the data pattern/mask arrays (should be
multiplied by sizeof(uint32_t) to be expressed in bytes. If match
on the length itself is not needed the mask should be set to zero, in
this case length is used to specify the pattern/mask array lengths only.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-19 03:30:15 +01:00
Steve Yang
761c4d6690 app/testpmd: fix max Rx packet length for VLAN packets
When the max rx packet length is smaller than the sum of mtu size and
ether overhead size, it should be enlarged, otherwise the VLAN packets
will be dropped.

Removed the rx_offloads assignment for jumbo frame during command line
parsing, and set the correct jumbo frame flag if MTU size is larger than
the default value 'RTE_ETHER_MTU' within 'init_config()'.

Fixes: 384161e006 ("app/testpmd: adjust on the fly VLAN configuration")
Fixes: 35b2d13fd6 ("net: add rte prefix to ether defines")
Fixes: ce17eddefc ("ethdev: introduce Rx queue offloads API")
Fixes: 150c9ac2df ("app/testpmd: update Rx offload after setting MTU")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-19 03:30:14 +01:00
Karra Satwik
e53562d7ab app/testpmd: allocate FEC capability array dynamically
Request the driver for number of entries in the FEC caps
array and then dynamically allocate the array.

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-19 03:30:14 +01:00
Karra Satwik
3de0881210 app/testpmd: fix start index for showing FEC array
Start from index 0 when going through the FEC array. This will allow
"off" to get printed for RTE_ETH_FEC_NOFEC mode.

Fixes: b19da32e31 ("app/testpmd: add FEC command")
Cc: stable@dpdk.org

Signed-off-by: Karra Satwik <kaara.satwik@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-19 03:30:13 +01:00
Jeff Guo
934f36b54e app/testpmd: add UDP tunnel port for eCPRI
Add new UDP tunnel port params for eCPRI configuration, the command
as below:

testpmd> port config 0 udp_tunnel_port add ecpri 6789
testpmd> port config 0 udp_tunnel_port rm ecpri 6789

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2021-01-19 03:30:13 +01:00
Viacheslav Ovsiienko
9213c50e36 app/testpmd: support GTP PSC option in raw sets
This patch add support for generating GTP PDU container
session option for the raw encap and raw decap sets.
The generated options is single 32-bit word with
minimal length specified as 4, no extra fields in the
option are supported. The option item must be preceded
with the GTP item itself, and GTP item flags must be
set accordingly:

  - E flag must be set, we are going to provide extension
  - S flag must be reset, because GTP item does not
    provide the value for SQN field, we can't fill this one
  - PN flag must be reset, no N-PDU value provided by
    GTP item either

The raw set example:

  set raw_encap 2 eth / ipv4 / udp /
                  gtp v_pt_rsv_flags is 0x34 / gtp_psc / end_set

Please, note - value 0x34 provides the required flag combination.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2021-01-19 03:30:13 +01:00
Ciara Power
7d3046ed73 app/crypto-perf: fix spelling in output
Fixes some spelling errors in app logs and help text.

Fixes: 7da018731c ("app/crypto-perf: add help option")
Fixes: f8be1786b1 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
2021-01-19 18:33:29 +01:00
Hemant Agrawal
04977da04d test/crypto: add AES-XCBC hash only test case
This patch adds test case for AES-XCBC hash only for
Digest and Digest-verify

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2021-01-19 18:05:45 +01:00
Abhinandan Gujjar
5523a75af5 test/crypto: add case for enqueue/dequeue callbacks
This patch adds test cases for testing functionality of
enqueue and dequeue callback mechanism.

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2021-01-19 18:05:44 +01:00
Stephen Hemminger
f82067c4d5 pdump: free mbuf in bulk
Use rte_pktmbuf_free_bulk instead of loop when freeing
packets.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
2021-01-19 15:24:46 +01:00