dpdk.git
3 years agocompress/mlx5: support basic control operations
Matan Azrad [Wed, 20 Jan 2021 11:29:27 +0000 (11:29 +0000)]
compress/mlx5: support basic control operations

Add initial support for the next operations:
- dev_configure
- dev_close
- dev_infos_get

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocompress/mlx5: introduce PMD
Matan Azrad [Wed, 20 Jan 2021 11:29:26 +0000 (11:29 +0000)]
compress/mlx5: introduce PMD

Add a new compress PMD for Mellanox devices.

The MLX5 compress driver library provides support for Mellanox
BlueField 2 families of 25/50/100/200 Gb/s adapters.

GGAs (Generic Global Accelerators) are offload engines that can be used
to do memory to memory tasks on data.
These engines are part of the ARM complex of the BlueField 2 chip, and
as such they do not use NIC related resources (e.g. RX/TX bandwidth).
They do share the same PCI and memory bandwidth.

So, using the BlueField 2 device, the compress class operations can be
run in parallel to the net, vdpa, and regex class operations.

This driver is depending on rdma-core like the other mlx5 PMDs, also it
is going to use mlx5 DevX to create HW objects directly by the FW.

Add the probing functions, PCI bus connectivity, HW capabilities checks
and some basic objects preparations.

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocommon/mlx5: add DevX attributes for compress
Matan Azrad [Wed, 20 Jan 2021 11:29:25 +0000 (11:29 +0000)]
common/mlx5: add DevX attributes for compress

Add the DevX attributes for compress related engines:
- compress
- decompress
- dma

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agocrypto/qat: fix digest in buffer
Fan Zhang [Wed, 20 Jan 2021 17:33:51 +0000 (17:33 +0000)]
crypto/qat: fix digest in buffer

This patch fixes the missed digest in buffer support to
QAT symmetric raw API. Originally digest in buffer is
supported only for wireless algorithms

Fixes: 728c76b0e50f ("crypto/qat: support raw datapath API")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
3 years agoapp/crypto-perf: add script to graph perf results
Ciara Power [Wed, 20 Jan 2021 17:29:30 +0000 (17:29 +0000)]
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>
3 years agoapp/crypto-perf: fix CSV output format
Ciara Power [Wed, 20 Jan 2021 17:29:29 +0000 (17:29 +0000)]
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: f6cefe253cc8 ("app/crypto-perf: add range/list of sizes")
Fixes: 96dfeb609be1 ("app/crypto-perf: add new PMD benchmarking mode")
Fixes: da40ebd6d383 ("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>
3 years agoapp/crypto-perf: fix latency CSV output
Ciara Power [Wed, 20 Jan 2021 17:29:28 +0000 (17:29 +0000)]
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: f6cefe253cc8 ("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>
3 years agotest/event_crypto: set cipher operation in transform
Ankur Dwivedi [Mon, 18 Jan 2021 16:19:40 +0000 (21:49 +0530)]
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: 74449375237f ("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>
3 years agoapp/eventdev: remove unnecessary barriers in order test
Feifei Wang [Thu, 14 Jan 2021 07:08:30 +0000 (15:08 +0800)]
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>
3 years agoapp/eventdev: remove unnecessary barrier in pipeline test
Feifei Wang [Thu, 14 Jan 2021 07:08:29 +0000 (15:08 +0800)]
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>
3 years agoapp/eventdev: replace a barrier with thread fence
Feifei Wang [Thu, 14 Jan 2021 07:08:28 +0000 (15:08 +0800)]
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>
3 years agoapp/eventdev: remove unnecessary barriers in perf test
Feifei Wang [Thu, 14 Jan 2021 07:08:27 +0000 (15:08 +0800)]
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>
3 years agoapp/eventdev: fix SMP barrier in performance test
Feifei Wang [Thu, 14 Jan 2021 07:08:26 +0000 (15:08 +0800)]
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: 2369f73329f8 ("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>
3 years agoexamples/eventdev: move ethdev stop to the end
Feifei Wang [Thu, 14 Jan 2021 10:31:01 +0000 (18:31 +0800)]
examples/eventdev: move ethdev stop to the end

Move eth stop code from "signal_handler" function to the end of "main"
function. There are two reasons for this:

First, this improves code maintenance and makes code look simple and
clear. Based on this change, after receiving the interrupt signal,
"fdata->done" is set as 1. Then the main thread will wait all worker
lcores to jump out of the loop. Finally, the main thread will stop and
then close eth dev port.

Second, for older version, the main thread first stops eth dev port and
then waits the end of worker lcore. This may cause errors because it may
stop the eth dev port which worker lcores are using. This moving change
can fix this by waiting all worker threads to exit and then stop the
eth dev port.

In the meanwhile, remove wmb in signal_handler.

This is because when the main lcore receive the stop signal, it stores 1
into fdata->done. And then the worker lcores load "fdata->done" and jump
out of the loop to stop running. Nothing should be stored after updating
fdata->done, so the wmb is unnecessary.

Fixes: 085edac2ca38 ("examples/eventdev_pipeline: support Tx adapter")
Cc: stable@dpdk.org
Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
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: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoexamples/eventdev: add info output for main core
Feifei Wang [Thu, 14 Jan 2021 10:31:00 +0000 (18:31 +0800)]
examples/eventdev: add info output for main core

When the main core is set as tx/rx/sched/worker core, it also needs to
print some information to show this. Thus, add info output for the main
core, and add a "dump" function to print core information for the sake
of code simplicity and easy maintenance.

In the meanwhile, fix the count error. For the variable "worker_idx", it
should be incremented when the core is set as worker core. However, when
the main core is set as rx/tx/sched core, the worker_idx is also
incremented. Though this error may not have a substantial impact due to
that the main core is the last launched core, but it should be corrected
from the perspective of code correctness.

Fixes: 1094ca96689c ("doc: add SW eventdev pipeline to sample app guide")
Cc: stable@dpdk.org
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agoexamples/eventdev: check CPU core enabling
Feifei Wang [Thu, 14 Jan 2021 10:30:59 +0000 (18:30 +0800)]
examples/eventdev: check CPU core enabling

In the case that the cores are isolated, if "-l" or "-c" parameter is not
added, the cores will not be enabled and can not launch worker function
correctly. In the meanwhile, no error information is reported.

For example:
totally CPUs:16
isolated CPUs:1-8
command: sudo gdb -args ./dpdk-eventdev_pipeline --vdev event_sw0 \
        -- -r1 -t1 -e4 -w F00 -s4 -n0 -c32 -W1000 -D

cores information:
rte_config->lcore_role = {ROLE_RTE, ROLE_OFF, ROLE_OFF, ROLE_OFF,
                          ROLE_OFF, ROLE_OFF, ROLE_OFF, ROLE_OFF,
                          ROLE_OFF, ROLE_RTE, ROLE_RTE, ROLE_RTE,
                          ROLE_RTE, ROLE_RTE, ROLE_RTE, ROLE_RTE}

output information:
...
[main()] lcore 9 executing worker, using eventdev port 0
[main()] lcore 10 executing worker, using eventdev port 1
[main()] lcore 11 executing worker, using eventdev port 2

This is because "RTE_LCORE_FOREACH_WORKER" chooses the enabled core. In
the case that the cores are isolated, "the lcore_role" flag of isolated
cores are set as "ROLE_OFF" by default(not enabled). So if we choose
these isolated cores as workers, "RTE_LCORE_FOREACH_WORKER" will ignore
these cores and not launch worker functions on them.

To fix this, add "-l" parameters to doc and add lcore enabled check.

Fixes: 1094ca96689c ("doc: add SW eventdev pipeline to sample app guide")
Cc: stable@dpdk.org
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agoapp/eventdev: remove redundant enqueue in burst Tx
Feifei Wang [Fri, 22 Jan 2021 05:19:16 +0000 (13:19 +0800)]
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: 314bcf58ca8f ("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>
3 years agoapp/eventdev: adjust event count order for pipeline test
Feifei Wang [Fri, 22 Jan 2021 05:19:15 +0000 (13:19 +0800)]
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: 314bcf58ca8f ("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>
3 years agoevent/octeontx2: enhance Tx path cache locality
Pavan Nikhilesh [Tue, 12 Jan 2021 08:39:38 +0000 (14:09 +0530)]
event/octeontx2: enhance Tx path cache locality

Enhance Tx path cache locality, remove current tag type and group
stores from datapath to conserve store buffers.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoexamples/pipeline: fix CLI parsing crash
Cristian Dumitrescu [Thu, 28 Jan 2021 19:12:39 +0000 (19:12 +0000)]
examples/pipeline: fix CLI parsing crash

Cannot dereference pointer for token[1] unless valid.

Fixes: 5074e1d551 ("examples/pipeline: add configuration commands")
Cc: stable@dpdk.org
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agolib: fix doxygen for parameters of function pointers
Thomas Monjalon [Thu, 21 Jan 2021 21:52:37 +0000 (22:52 +0100)]
lib: fix doxygen for parameters of function pointers

Some parameters of typedef'ed function pointers were not properly listed
in the doxygen comments.
The error is seen with doxygen 1.9 which added this specific check:
https://github.com/doxygen/doxygen/commit/d34236ba4037

Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoexamples/l3fwd-power: add ethdev power management
Liang Ma [Fri, 22 Jan 2021 17:12:17 +0000 (17:12 +0000)]
examples/l3fwd-power: add ethdev power management

Add PMD power management feature support to l3fwd-power sample app.

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
3 years agopower: add ethdev power management
Liang Ma [Fri, 22 Jan 2021 17:12:16 +0000 (17:12 +0000)]
power: add ethdev power management

Add a simple on/off switch that will enable saving power when no
packets are arriving. It is based on counting the number of empty
polls and, when the number reaches a certain threshold, entering an
architecture-defined optimized power state that will either wait
until a TSC timestamp expires, or when packets arrive.

This API mandates a core-to-single-queue mapping (that is, multiple
queued per device are supported, but they have to be polled on different
cores).

This design is using PMD RX callbacks.

1. UMWAIT/UMONITOR:

   When a certain threshold of empty polls is reached, the core will go
   into a power optimized sleep while waiting on an address of next RX
   descriptor to be written to.

2. TPAUSE/Pause instruction

   This method uses the pause (or TPAUSE, if available) instruction to
   avoid busy polling.

3. Frequency scaling
   Reuse existing DPDK power library to scale up/down core frequency
   depending on traffic volume.

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
3 years agoeal: improve power monitor API comments
Anatoly Burakov [Fri, 22 Jan 2021 17:12:15 +0000 (17:12 +0000)]
eal: improve power monitor API comments

Currently, the API documentation is ambiguous as to what happens when
certain conditions are met. Document the behavior explicitly, as well as
fix some typos and outdated comments.

Fixes: 6a17919b0e2a ("eal: change power intrinsics API")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoeal: rename power monitor condition member
Anatoly Burakov [Fri, 22 Jan 2021 17:12:14 +0000 (17:12 +0000)]
eal: rename power monitor condition member

The `data_sz` name is fine, but it looks out of place because nothing
else has "data" prefix in that structure. Rename it to "size", as well
as add more clarity to the comments around each struct member.

Fixes: 6a17919b0e2a ("eal: change power intrinsics API")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoring: refactor exported headers
Feifei Wang [Fri, 29 Jan 2021 05:59:05 +0000 (13:59 +0800)]
ring: refactor exported headers

For legacy modes, rename ring_generic/c11 to ring_generic/c11_pvt.
Furthermore, add new file ring_elem_pvt.h which includes ring_do_eq/deq
and ring element copy/delete APIs.

The update_tail internal helper has been prefixed with the library prefix.

For other modes, rename xx_c11_mem to xx_elem_pvt. Move all private APIs
into these new header files.

Finally, the external APIs and internal APIs will be separated from each
other. This can remind users not to use internal APIs and make ring
library easier to maintain.

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: Konstantin Ananyev <konstantin.ananyev@intel.com>
3 years agotest/ring: reduce duration of performance tests
Feifei Wang [Fri, 29 Jan 2021 05:59:03 +0000 (13:59 +0800)]
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: 1fa5d0099efc ("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>
3 years agopower: clean up includes
Bruce Richardson [Thu, 21 Jan 2021 17:22:01 +0000 (17:22 +0000)]
power: clean up includes

re-organise the including of the new public header file and
remove un-needed includes

Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agopower: export guest channel header file
Bruce Richardson [Thu, 21 Jan 2021 17:22:00 +0000 (17:22 +0000)]
power: export guest channel header file

Adjust meson.build so that 'ninja install' copies the new header
file into the installation directory.

Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agopower: rename constants
Bruce Richardson [Thu, 21 Jan 2021 17:21:59 +0000 (17:21 +0000)]
power: rename constants

Rename the #defines to have an RTE_POWER_ prefix

Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agopower: rename public structs
Bruce Richardson [Thu, 21 Jan 2021 17:21:58 +0000 (17:21 +0000)]
power: rename public structs

Rename the public structs to have an rte_power_ prefix.

Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agopower: make channel message functions public
Bruce Richardson [Thu, 21 Jan 2021 17:21:57 +0000 (17:21 +0000)]
power: make channel message functions public

Move the 2 public functions into rte_power_guest_channel.h

Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agopower: create guest channel public header file
Bruce Richardson [Thu, 21 Jan 2021 17:21:56 +0000 (17:21 +0000)]
power: create guest channel public header file

In preparation for making the header file public, we first rename
channel_commands.h as rte_power_guest_channel.h.

Fixes: 210c383e247b ("power: packet format for vm power management")
Fixes: cd0d5547e873 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agotest/distributor: fix return buffer queue overload
Lukasz Wojciechowski [Tue, 19 Jan 2021 03:59:10 +0000 (04:59 +0100)]
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: c0de0eb82e40 ("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>
3 years agoexamples/vm_power: respect core mask
David Hunt [Fri, 15 Jan 2021 12:52:50 +0000 (12:52 +0000)]
examples/vm_power: respect core mask

When vm_power_manager is started, it takes over power management on
all cores. This should be limited to cores defined in the core mask.

When initialising, if a core is not on the coremask, skip it.
Applies to both initialisation and exit.

Signed-off-by: David Hunt <david.hunt@intel.com>
3 years agobuildtools: fix archive extraction for LLVM 8
Dmitry Kozlyuk [Thu, 28 Jan 2021 19:05:15 +0000 (22:05 +0300)]
buildtools: fix archive extraction for LLVM 8

"llvm-ar xv lib.a" from LLVM 8 doesn't print extracted object file
names. The effect of "v" is not formally specified either.
Use "llvm-ar t" to get archive member names.

Reported-by: Xueming Zhang <xuemingx.zhang@intel.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agonet/i40e: disable AVX512 with MinGW
Leyi Rong [Wed, 27 Jan 2021 14:27:06 +0000 (22:27 +0800)]
net/i40e: disable AVX512 with MinGW

Disable i40e AVX512 code path for Windows build to
avoid the MinGW build error:
Error: invalid register for .seh_savexmm

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
3 years agoconfig: disable AVX512 with MinGW
Leyi Rong [Wed, 27 Jan 2021 14:27:05 +0000 (22:27 +0800)]
config: disable AVX512 with MinGW

Disable AVX512 when on MinGW cross build, as .seh_savexmm
build error reports if AVX512 is enabled:
Error: invalid register for .seh_savexmm

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
3 years agomem: improve parameter checking on memory hotplug
Anatoly Burakov [Fri, 22 Jan 2021 17:17:15 +0000 (17:17 +0000)]
mem: improve parameter checking on memory hotplug

Currently, we don't check anything that comes in through memory hotplug
subsystem using the IPC, because we always assume the data is correct.
This is okay as anyone having access to the IPC socket would also have
rights to crash the DPDK process through other means, but it's still a
good practice to do parameter checking, so fix the code to do that.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
3 years agoraw/ioat: fix driver name in secondary process
Radu Nicolau [Tue, 19 Jan 2021 15:38:41 +0000 (15:38 +0000)]
raw/ioat: fix driver name in secondary process

Update ioat probe function to set the driver name for
secondary process.

Fixes: bc230b569e7f ("raw/ioat: support secondary process")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
3 years agoeal/arm: fix debug build with gcc for 128-bit atomics
Joyce Kong [Fri, 15 Jan 2021 09:58:21 +0000 (17:58 +0800)]
eal/arm: fix debug build with gcc for 128-bit atomics

Compiling with "meson build -Dbuildtype=debug --cross-file
config/arm/arm64_thunderx2_linux_gcc" shows the warnings
"function returns an aggregate [-Waggregate-return]":
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In
function â€˜__cas_128_relaxed’:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20:
error: function returns an aggregate [-Werror=aggregate-return]
 __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
                    ^~~~~~~~~~~~~~~~~

Fix the compiling issue by defining __ATOMIC128_CAS_OP as a void
function and passing the address pointer into it.

Fixes: 7e2c3e17fe2c ("eal/arm64: add 128-bit atomic compare exchange")
Cc: stable@dpdk.org
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agoapp/flow-perf: support meter action
Dong Zhou [Tue, 19 Jan 2021 03:39:40 +0000 (05:39 +0200)]
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>
3 years agoapp/flow-perf: split dump functions
Dong Zhou [Tue, 19 Jan 2021 03:39:39 +0000 (05:39 +0200)]
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>
3 years agodoc: fix build
Thomas Monjalon [Tue, 26 Jan 2021 14:59:01 +0000 (15:59 +0100)]
doc: fix build

When removing the label "arm_cross_build_getting_the_prerequisite_library"
in the rework of cross_build_dpdk_for_arm64.rst,
the reference to this section got broken.
It went unnoticed because "ninja -C doc" does not regenerate the file
which is referencing the changed file.

The fix is a reword not mentioning the "not so relevant" example
from cross_build_dpdk_for_arm64.rst.

Fixes: eb0e12c0c299 ("doc: add clang to aarch64 cross build guide")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoapp/procinfo: fix security context info
Hemant Agrawal [Wed, 20 Jan 2021 05:17:11 +0000 (10:47 +0530)]
app/procinfo: fix security context info

We need to differentiate between crypto and ethernet security
context as they belong to different devices.

Fixes: d82d6ac64338 ("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>
3 years agodevtools: fix cryptodev ABI suppress rule
Ray Kinsella [Wed, 20 Jan 2021 14:25:57 +0000 (14:25 +0000)]
devtools: fix cryptodev ABI suppress rule

Update the ignore entry for crytodev to use named fields
instead of bit positions.
It is allowing changes between the last field (attached) in ABI 21.0,
and the end of the padded struct in ABI 21.

Fixes: 1c3ffb95595e ("cryptodev: add enqueue and dequeue callbacks")

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agodoc: add clang to aarch64 cross build guide
Juraj Linkeš [Thu, 21 Jan 2021 15:51:44 +0000 (16:51 +0100)]
doc: add clang to aarch64 cross build guide

Reorganize and update the aarch64 cross guide with clang cross
compilation. Update the GNU toolchain version which clang also uses.
Reorganize into common part, GNU part and clang part.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agoci: add aarch64 clang cross-compilation Travis builds
Juraj Linkeš [Thu, 21 Jan 2021 15:51:43 +0000 (16:51 +0100)]
ci: add aarch64 clang cross-compilation Travis builds

Mirror the existing gcc jobs - build static and shared libs.
Use arm64_armv8_linux_clang_ubuntu1804 meson cross file.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
3 years agoconfig: add aarch64 clang for Ubuntu 18.04
Juraj Linkeš [Thu, 21 Jan 2021 15:51:42 +0000 (16:51 +0100)]
config: add aarch64 clang for Ubuntu 18.04

Create distribution specific meson cross-file
arm64_armv8_linux_clang_ubuntu1804. The file is distribution specific
because it contains paths to headers and libs specific to the
distribution. The clang/LLVM toolchain does not provide its own c stdlib
so the paths must be supplied in some manner.

In the current version of meson, v0.47.1, the only place
where the paths can be specified is the cross-file. Other possibilities
do not work:
* setting CFLAGS, LDFLAGS only sets these for non-cross builds.
* setting -Dc_args, -Dc_link_args on the command line also only sets
these for non-cross builds. Support for specifying these for
cross builds was added in v0.51.0 [0].
* the cross-file can't be split into generic clang cross config and
distribution specific config. Support added in v0.52.0 [1].

[0] https://mesonbuild.com/Builtin-options.html#specifying-options-per-machine
[1] https://mesonbuild.com/Machine-files.html#loading-multiple-machine-files

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
3 years agobuild: force pkg-config for dependency detection
Bruce Richardson [Mon, 18 Jan 2021 14:29:57 +0000 (14:29 +0000)]
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>
3 years agobuildtools: use build directory for temporary files
Dmitry Kozlyuk [Mon, 25 Jan 2021 22:12:50 +0000 (01:12 +0300)]
buildtools: use build directory for temporary files

Use current build directory as base for temporary directories,
so that all build files are isolated there.

Fixes: e6e9730c7066 ("buildtools: support object file extraction for Windows")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agobuildtools: fix archive extraction for Python 3.5
Dmitry Kozlyuk [Mon, 25 Jan 2021 22:12:49 +0000 (01:12 +0300)]
buildtools: fix archive extraction for Python 3.5

Python 3.5 subprocess.run() has no capture_output parameter.
Use subprocess.PIPE available in all versions.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agobuildtools: fix pmdinfogen with pyelftools < 0.24
Dmitry Kozlyuk [Mon, 25 Jan 2021 22:12:48 +0000 (01:12 +0300)]
buildtools: fix pmdinfogen with pyelftools < 0.24

pyelftools had some breaking changes [1] and API enhancements [2]
between 0.23 (used in Ubuntu 16.04) and 0.24. Ensure compatibility with
both legacy and modern versions.

[1]: https://github.com/eliben/pyelftools/pull/76
[2]: https://github.com/eliben/pyelftools/pull/56

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agobuild: enable pmdinfogen for Windows
Dmitry Kozlyuk [Fri, 8 Jan 2021 02:47:23 +0000 (05:47 +0300)]
build: enable pmdinfogen for Windows

Remove platform restriction when building drivers.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
3 years agobuildtools: support object file extraction for Windows
Dmitry Kozlyuk [Fri, 8 Jan 2021 02:47:22 +0000 (05:47 +0300)]
buildtools: support object file extraction for Windows

clang archiver tool is llvm-ar on Windows and ar on other platforms.
MinGW always uses ar. Replace shell script (Unix-only) that calls ar
with a Python script (OS-independent) that calls an appropriate archiver
tool selected at configuration time. Move the logic not to generate
empty sources into pmdinfogen.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agobuildtools: allow multiple input files in pmdinfogen
Dmitry Kozlyuk [Fri, 8 Jan 2021 02:47:21 +0000 (05:47 +0300)]
buildtools: allow multiple input files in pmdinfogen

Process any number of input object files and write a unified output.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agobuildtools: support COFF in pmdinfogen
Dmitry Kozlyuk [Fri, 8 Jan 2021 02:47:20 +0000 (05:47 +0300)]
buildtools: support COFF in pmdinfogen

Common Object File Format (COFF) is used on Windows in place of ELF.

Add COFF parser to pmdinfogen. Also add an argument to specify input
file format, which is selected at configure time based on the target.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agobuildtools: remove C implementation of pmdinfogen
Dmitry Kozlyuk [Sun, 24 Jan 2021 20:51:57 +0000 (23:51 +0300)]
buildtools: remove C implementation of pmdinfogen

Delete the files no longer used in build process.
Add myself as maintainer of new implementation.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
3 years agobuildtools: use Python pmdinfogen
Dmitry Kozlyuk [Sun, 24 Jan 2021 20:51:56 +0000 (23:51 +0300)]
buildtools: use Python pmdinfogen

Use the same interpreter to run pmdinfogen as for other build scripts.
Adjust wrapper script accordingly and also don't suppress stderr from ar
and pmdinfogen. Add configure-time check for elftools Python module for
Unix hosts.

Add pyelftools to CI configuration and build requirements for Linux and
FreeBSD. Windows targets are not currently using pmdinfogen.

Suppress ABI warnings about generated PMD information strings.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
3 years agobuildtools: add Python pmdinfogen
Dmitry Kozlyuk [Sun, 24 Jan 2021 20:51:55 +0000 (23:51 +0300)]
buildtools: add Python pmdinfogen

Using a high-level, interpreted language simplifies maintenance and
build process. Furthermore, ELF handling is delegated to pyelftools
package. Original logic is kept, the copyright recognizes that.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
3 years agoexamples/pipeline: fix VXLAN script permission
David Marchand [Fri, 22 Jan 2021 09:30:37 +0000 (10:30 +0100)]
examples/pipeline: fix VXLAN script permission

This python script provides a shebang that only makes sense if the
script has the executable bit set.

Fixes: fde7a772701a ("examples/pipeline: add VXLAN encapsulation example")
Cc: stable@dpdk.org
Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
3 years agodoc: simplify OS support in features matrix
Thomas Monjalon [Wed, 20 Jan 2021 21:57:47 +0000 (22:57 +0100)]
doc: simplify OS support in features matrix

The networking drivers features matrix had rows to show
OS and kernel modules support:
- BSD nic_uio
- Linux UIO
- Linux VFIO
- Other kdrv
- Windows

The kernel modules details are removed to keep only OS support:
- FreeBSD
- Linux
- Windows

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoapp: fix build with extra include paths
Bruce Richardson [Fri, 15 Jan 2021 11:10:47 +0000 (11:10 +0000)]
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: fa036e70d794 ("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>
3 years agonode: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:46 +0000 (11:10 +0000)]
node: fix missing header include

The rte_compat header file is needed for the '__rte_experimental' macro.

Fixes: f00708c2aa53 ("node: add IPv4 rewrite and lookup control")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agometrics: fix variable declaration in header
Bruce Richardson [Fri, 15 Jan 2021 11:10:45 +0000 (11:10 +0000)]
metrics: fix variable declaration in header

The global variable "tel_met_data" was declared in a header file, rather
than in a C file, leading to duplicate definitions if more than one C
file included the header.

Fixes: c5b7197f662e ("telemetry: move some functions to metrics library")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agopipeline: fix missing header includes
Bruce Richardson [Fri, 15 Jan 2021 11:10:44 +0000 (11:10 +0000)]
pipeline: fix missing header includes

The stdio.h header needs to be included to get the definition of the
FILE type.

Fixes: b32c0a2c5e4c ("pipeline: add SWX table update high level API")
Fixes: 3ca60ceed79a ("pipeline: add SWX pipeline specification file")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agotable: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:43 +0000 (11:10 +0000)]
table: fix missing header include

The rte_lru_x86.h header, included from the main rte_lru.h header, uses
the RTE_CC_IS_GNU macro from rte_common.h but fails to include that
header file.

Fixes: 0c9a5735a947 ("eal: fix compiler detection in public headers")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agofib: fix missing header includes
Bruce Richardson [Fri, 15 Jan 2021 11:10:42 +0000 (11:10 +0000)]
fib: fix missing header includes

Add stdint.h to get definitions of standard integer types

Fixes: 39e927248416 ("fib: add FIB library")
Fixes: 40d41a8a7b34 ("fib: support IPv6")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoipsec: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:41 +0000 (11:10 +0000)]
ipsec: fix missing header include

The rte_ipsec_sad.h header used the standard uintXX_t types, but did not
include stdint.h header for them.

Fixes: 401633d9c112 ("ipsec: add inbound SAD API")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agovhost: fix missing header includes
Bruce Richardson [Fri, 15 Jan 2021 11:10:40 +0000 (11:10 +0000)]
vhost: fix missing header includes

The vhost header files were missing definitions from headers to allow
them to be compiled up individually.

Fixes: d7280c9fffcb ("vhost: support selective datapath")
Fixes: a49f758d1170 ("vhost: split vDPA header file")
Fixes: 939066d96563 ("vhost/crypto: add public function implementation")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agorib: fix missing header includes
Bruce Richardson [Fri, 15 Jan 2021 11:10:39 +0000 (11:10 +0000)]
rib: fix missing header includes

The standard integer types, and the size_t types are missing their
required header includes in the rib header file.

Fixes: 5a5793a5ffa2 ("rib: add RIB library")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agobitrate: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:38 +0000 (11:10 +0000)]
bitrate: fix missing header include

The rte_compat.h header file must be included to get the definition of
__rte_experimental.

Fixes: f030bff72f81 ("bitrate: add free function")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agombuf: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:37 +0000 (11:10 +0000)]
mbuf: fix missing header include

The rte_mbuf_dyn.h header file uses a number of types and macros without
including the required header files to get the definitions of those
macros/types.  Similarly, the rte_mbuf_core.h file was missing an
include for rte_byteorder.h header.

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
Fixes: 3eb860b08eb7 ("mbuf: move definitions into a separate file")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agonet: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:36 +0000 (11:10 +0000)]
net: fix missing header include

The Geneve protocol header file is missing the rte_byteorder.h header.

Fixes: ea0e711b8ae0 ("app/testpmd: add GENEVE parsing")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ophir Munk <ophirmu@nvidia.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoethdev: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:35 +0000 (11:10 +0000)]
ethdev: fix missing header include

The define for RTE_ETH_FLOW_MAX is defined in rte_ethdev.h, so that
header should be included in rte_eth_ctrl.h to allow it to be compiled
independently.

Fixes: 7fa96d696f2c ("ethdev: unification of flow types")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agotelemetry: fix missing header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:34 +0000 (11:10 +0000)]
telemetry: fix missing header include

The telemetry header file uses the rte_cpuset_t type, but does not
include any header providing that type. Include rte_os.h to provide the
necessary type.

Fixes: febbebf7f255 ("telemetry: keep threads separate from data plane")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoeal: fix reciprocal header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:33 +0000 (11:10 +0000)]
eal: fix reciprocal header include

The rte_reciprocal header file used standard __rte_always_inline from
rte_common.h but does not include that header file, leading to compiler
errors when the reciprocal header is included alone.

Fixes: 6d45659eacb8 ("eal: add u64-bit variant for reciprocal divide")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoeal: fix thread header include
Bruce Richardson [Fri, 15 Jan 2021 11:10:33 +0000 (12:10 +0100)]
eal: fix thread header include

rte_thread.h was missing the compat header to get the __rte_experimental
macro definition.

Fixes: b1fd151267e6 ("eal: add generic thread-local-storage functions")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agoversion: 21.02-rc1
Thomas Monjalon [Wed, 20 Jan 2021 01:58:16 +0000 (02:58 +0100)]
version: 21.02-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agobuild: provide suitable error for "both" libraries option
Bruce Richardson [Mon, 11 Jan 2021 13:55:59 +0000 (13:55 +0000)]
build: provide suitable error for "both" libraries option

Rather than having the DPDK configuration error out when linking apps
and examples when "both" is select for "default_library" option, we can
detect that setting earlier in the build config and provide a suitable
error message to the user.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Andrew Boyer <aboyer@pensando.io>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
3 years agoconfig: remove compatibility build defines
Bruce Richardson [Wed, 9 Dec 2020 17:14:20 +0000 (17:14 +0000)]
config: remove compatibility build defines

As announced in the deprecation note, remove all compatibility build
defines from previous make/meson versions and use only the standardized
ones - RTE_LIB_<name> for libraries, and RTE_<CLASS>_<NAME> for drivers.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
3 years agonet/ice: fix flow rule checking
Jeff Guo [Tue, 19 Jan 2021 08:07:31 +0000 (16:07 +0800)]
net/ice: fix flow rule checking

Add empty item into the pattern mapping list when checking the ptype is
supported or not, since we do support the NUll pattern for rte flow in
ice pmd.

Fixes: 68b6240ee9f0 ("net/ice: refactor packet type parsing")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agodoc: add known issue with RSS in ixgbe guide
Beilei Xing [Tue, 19 Jan 2021 07:01:52 +0000 (15:01 +0800)]
doc: add known issue with RSS in ixgbe guide

Currently, IXGBE doesn't support RSS when double VLAN
is enabled due to FW limitation.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/ixgbe: fix configuration of max frame size
Alvin Zhang [Tue, 19 Jan 2021 05:25:51 +0000 (13:25 +0800)]
net/ixgbe: fix configuration of max frame size

For some types of NIC, jumbo frame is not supported in IOV mode,
so if a VF requests to configure the frame size to not bigger
than IXGBE_ETH_MAX_LEN, the kernel driver returns 0, but the DPDK
ixgbe PMD returns -1, this will cause the VF to fail to start
when the PF driven by DPDK ixgbe PMD.

This patch keeps ixgbe PMD's handling mode consistent with kernel
driver in above situation.

In addition, the value set by the command IXGBE_VF_SET_LPE
represents the max frame size, not the mtu.

Fixes: 1b9ea09c067b ("ixgbe: support X550")
Fixes: 95a27b3ba5f5 ("net/ixgbe: enable jumbo frame for VF")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
3 years agonet/ice: refactor DCF VLAN handling
Haiyue Wang [Mon, 18 Jan 2021 11:38:29 +0000 (19:38 +0800)]
net/ice: refactor DCF VLAN handling

Since DCF always configure the outer VLAN offloads for the target AVF,
so rename the related variables to align with this design.

Also, the DCF needs to trace the AVF reset status to re-apply the VLAN
offload setting, refactor the reset event handling to support this.

Change the VF representor API 'ethdev' parameter to 'vf_rep_eth_dev' to
avoid introducing confusion with VF representor eth_dev ops name.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix out of scope variable
Alvin Zhang [Fri, 15 Jan 2021 08:34:11 +0000 (16:34 +0800)]
net/i40e: fix out of scope variable

Using "key", which points to an out-of-scope variable "rss_key_default".

Coverity issue: 365293
Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/iavf: workaround RSS cleanup failure handling
Xuan Ding [Mon, 18 Jan 2021 08:28:26 +0000 (08:28 +0000)]
net/iavf: workaround RSS cleanup failure handling

Allow to ignore error returned from virtual channel command
 VIRTCHNL_OP_SET_RSS_HENA with hena = 0 due to some legacy
kernel driver does not support this. Add warning message when
this happen.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: enable QinQ filter for switch
Junfeng Guo [Mon, 18 Jan 2021 14:07:41 +0000 (14:07 +0000)]
net/ice: enable QinQ filter for switch

Enable the double VLAN support for switch QinQ filtering.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/mlx5: handle RSS action in sample
Jiawei Wang [Thu, 14 Jan 2021 07:24:47 +0000 (09:24 +0200)]
net/mlx5: handle RSS action in sample

PMD validates the rss action in the sample sub-actions list,
then translates into rdma-core action and it will be used for sample
path destination.

If the RSS action is in both sample sub-actions list and original flow,
the rss level and rss type in the sample sub-actions list should be
consistent with the original flow list, since the expanding items
for RSS should be the same for both actions.

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix unnecessary checking for RSS action
Jiawei Wang [Thu, 14 Jan 2021 07:24:46 +0000 (09:24 +0200)]
net/mlx5: fix unnecessary checking for RSS action

RSS action is valid only in NIC-RX domain, this fix bypass
the function that getting RSS action from the flow action list
under no NIC-RX domain.

Fixes: e745f900072e ("net/mlx5: optimize flow RSS struct")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agoapp/testpmd: support RSS in sample action
Jiawei Wang [Thu, 14 Jan 2021 07:24:45 +0000 (09:24 +0200)]
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>
3 years agocommon/sfc_efx/base: apply mask to value on match field set
Ivan Malov [Sun, 17 Jan 2021 22:21:11 +0000 (01:21 +0300)]
common/sfc_efx/base: apply mask to value on match field set

An application may submit all-zeros masks for a given field
to be used in two given specifications and, in the meantime,
use different unmasked values. Later on, when compared, the
two specifications will prove unequal, and, if the rules in
question are outer, the client driver will have to allocate
a separate rule for the second specification. Provided that
all other match criteria are the same, the HW will deem the
two outer rules being duplicates, which is in fact the case.

Apply masks to values in efx_mae_match_spec_field_set() API
to fix the issue and avoid duplicate outer rule allocations.

Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec")
Cc: stable@dpdk.org
Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
3 years agoapp/testpmd: support modify field flow action
Alexander Kozyrev [Mon, 18 Jan 2021 21:40:26 +0000 (21:40 +0000)]
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>
3 years agoethdev: introduce generic modify flow action
Alexander Kozyrev [Mon, 18 Jan 2021 21:40:25 +0000 (21:40 +0000)]
ethdev: introduce generic modify flow action

Implement the generic modify flow API to allow manipulations on
an arbitrary header field (as well as mark, metadata or tag) using
data from another field or a user-specified value.
This generic modify mechanism removes the necessity to implement
a separate RTE Flow action every time we need to modify a new packet
field in the future.

Supported operation are:
- set: copy data from source to destination.
- add: integer addition, stores the result in destination.
- sub: integer subtraction, stores the result in destination.

The field ID is used to specify the desired source/destination packet
field in order to simplify the API for various encapsulation models.
Specifying the packet field ID with the needed encapsulation level
is able to quickly get a packet field for any inner packet header.

Alternatively, the special ID (ITEM_START) can be used to point to
the very beginning of a packet. This ID in conjunction with the
offset parameter provides great flexibility to copy/modify any part of
a packet as needed.

The number of bits to use from a source as well as the offset can be
be specified to allow a partial copy or dividing a big packet field
into multiple small fields (e.g. copying 128 bits of IPv6 to 4 tags).

An immediate value (or a pointer to it) can be specified instead of the
level and the offset for the special FIELD_VALUE ID (or FIELD_POINTER).
Can be used as a source only.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/hns3: remove unused assignment for RSS key
Lijun Ou [Thu, 14 Jan 2021 13:33:37 +0000 (21:33 +0800)]
net/hns3: remove unused assignment for RSS key

The default RSS key does not need to be configured repeatedly
when call hns3_dev_configure function with the NULL RSS key
because the default RSS key has been configured when the PMD
driver run hns3_do_start function with starting device.

Besides, it will not overwrite the initialized key if
rte_eth_dev_configure API will be called directly and RSS key is NULL
after init PMD driver.

Therefore, the assignment for RSS key in hns3_dev_configure
function is unnecessary.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix dump register out of range
Chengchang Tang [Thu, 14 Jan 2021 13:33:36 +0000 (21:33 +0800)]
net/hns3: fix dump register out of range

Currently, when dump the queue interrupt registers, the number of
registers that should be dumped is calculated from num_msi. But the
value of num_msi includes the number of misc interrupts. So, for some
hardware version, like kupeng930, it will lead to an illegal access.

This patch replace num_msi with intr_tqps_num which indicate the
number of interrupts used by the tqps.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix data overwriting during register dump
Chengchang Tang [Thu, 14 Jan 2021 13:33:35 +0000 (21:33 +0800)]
net/hns3: fix data overwriting during register dump

The data pointer has not moved after BAR register dumped. This causes
the later register to overwrite the previous data.

This patch fix the overwriting by move the pointer after every dump
function. And the missing separator between 32-bit register and the
64-bit register is also added to avoid a parsing error.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix register length when dumping registers
Chengchang Tang [Thu, 14 Jan 2021 13:33:34 +0000 (21:33 +0800)]
net/hns3: fix register length when dumping registers

Currently, the reg length return by HNS3 is the total length of all the
registers. But for upper layer user, the total register length is the
length multiplied by width. This can lead to a waste of memory and print
some invalid information.

This patch corrects the length and width of the register.

Fixes: 936eda25e8da ("net/hns3: support dump register")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: use new opcode for clearing hardware resource
Hongbo Zheng [Thu, 14 Jan 2021 13:33:33 +0000 (21:33 +0800)]
net/hns3: use new opcode for clearing hardware resource

The original command opcode '0x700A' may cause firmware error,
so '0x700A' is deserted, now use '0x700B' to replace it.

Fixes: 223d9eceaeee ("net/hns3: clear residual hardware configurations on init")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
3 years agonet/hns3: fix VF query link status in dev init
Chengwen Feng [Thu, 14 Jan 2021 13:33:32 +0000 (21:33 +0800)]
net/hns3: fix VF query link status in dev init

Current hns3vf queried link status in dev init stage, but the link
status should be maintained in dev start stage, this patch fix this.

Also, in the dev start stage, we use quick query instead of delayed
query to make sure update the link status soon.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Fixes: 958edf6627d5 ("net/hns3: fix VF link status")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>