Sean Morrissey [Tue, 15 Feb 2022 12:29:48 +0000 (12:29 +0000)]
devtools: add IWYU script to remove unused includes
This script can be used for removing headers flagged for removal by the
include-what-you-use (IWYU) tool. The script has the ability to remove
headers from specified sub-directories or dpdk as a whole and tests the
build after each removal by calling meson compile.
Tomasz Duszynski [Thu, 17 Feb 2022 11:09:22 +0000 (12:09 +0100)]
raw/cnxk_gpio: add custom IRQ handlers
Add support for custom interrupt handlers. Custom interrupt
handlers bypass kernel completely and are meant for fast
and low latency access to GPIO state.
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Tomasz Duszynski [Thu, 17 Feb 2022 11:09:14 +0000 (12:09 +0100)]
raw/cnxk_gpio: add GPIO driver skeleton
Add initial support for PMD that allows to control particular pins form
userspace. Moreover PMD allows to attach custom interrupt handlers to
controllable GPIOs.
Main users of this PMD are dataplain applications requiring fast and low
latency access to pin state.
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
The internal function txa_service_queue_add() is returning 0
in case of error, correct this logic to return a negative value
to indicate failure.
Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation") Cc: stable@dpdk.org Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com> Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
Radu Nicolau [Thu, 2 Dec 2021 12:50:40 +0000 (12:50 +0000)]
dma/idxd: support allow/block list
Add support for allow or block list for devices bound
to the kernel driver.
When used the allow or block list applies as an additional
condition to the name prefix.
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
The regular tables, selector tables and learner tables are all sharing
the table state array. The locations in this array were computed
incorrectly, leading to memory corruption issues.
Fixes: 4f59d3726147 ("pipeline: support learner tables") Cc: stable@dpdk.org Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com> Signed-off-by: Harshad Narayane <harshad.suresh.narayane@intel.com> Signed-off-by: Kamalakannan R <kamalakannan.r@intel.com> Signed-off-by: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
The checks for the table-only and default-only annotations were
incorrect, as they were using the pipeline action ID instead of the
table action ID for retrieving the table action info. These checks are
now corrected and pushed into the internal table_entry_check()
function.
Detect when a jump instruction, either conditional or unconditional,
is jumping to itself, thus creating a loop, which is not allowed in
data plane code.
An additional output port is now implicitly created for every pipeline
to serve as the packet drop port. Up to now, the drop port had to be
explicitly created for each pipeline.
The output port to be used as the drop port is now determined when the
drop instruction is executed as opposed to being statically determined
at instruction translation time and hardcoded in the opcode.
Junfeng Guo [Thu, 10 Feb 2022 07:06:34 +0000 (15:06 +0800)]
raw/ntb: clear all valid doorbell bits on init
Before registering the doorbell interrupt handler callback function,
all the valid doorbell bits within the NTB private data struct should
be cleared to avoid the confusion of the handshake timing sequence
diagram when setting up the NTB connection in back-to-back mode.
Fan Zhang [Mon, 24 Jan 2022 10:41:58 +0000 (10:41 +0000)]
maintainers: update for crypto api/crypto perf/sw crypto pmds using ipsec-mb
Add myself as Crypto API, QAT, SW PMDs based on ipsec-mb,
NULL PMD, and crypto perf test maintainer. Also remove
Declan, Deepak, and John from the maintainers of these
areas.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Declan Doherty <declan.doherty@intel.com> Acked-by: Fiona Trahe <fiona.trahe@intel.com> Acked-by: John Griffin <john.griffin@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Franck Lenormand [Thu, 10 Feb 2022 10:58:46 +0000 (16:28 +0530)]
common/dpaax: remove outdated caamflib code
DPAA1 and DPAA2 platforms use SEC ERA 8 and 10 only.
Hence, code related to old SEC-ERA (1-7) is removed.
This patch removes code in SDAP and PDCP header related to these
ERA to simplify the codebase:
- Simplify logic using RTA_SEC_ERA_<> macro
- Remove era_2_sw_hfn_ovrd dedicated to RTA_SEC_ERA_2
Arek Kusztal [Fri, 11 Feb 2022 16:02:36 +0000 (16:02 +0000)]
cryptodev: clarify usage of random numbers in asym
This commit clarifies usage of random numbers in asymmetric
crypto API.
The user is now allowed to provide information to the PMD if random
number should be generated or should be read from user input.
If PMD does not support random number generation user should
always provide it, if PMD does not support user random,
rte_crypto_param.data accordingly should be set to NULL.
Ciara Power [Fri, 11 Feb 2022 09:29:09 +0000 (09:29 +0000)]
cryptodev: modify return value for asym session create
Rather than the asym session create function returning a session on
success, and a NULL value on error, it is modified to now return int
values - 0 on success or -EINVAL/-ENOTSUP/-ENOMEM on failure.
The session to be used is passed as input.
This adds clarity on the failure of the create function, which enables
treating the -ENOTSUP return as TEST_SKIPPED in test apps.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Ciara Power [Fri, 11 Feb 2022 09:29:07 +0000 (09:29 +0000)]
cryptodev: hide asymmetric session structure
The rte_cryptodev_asym_session structure is now moved to an internal
header. This will no longer be used directly by apps,
private session data can be accessed via get API.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Ciara Power [Fri, 11 Feb 2022 09:29:06 +0000 (09:29 +0000)]
cryptodev: use single mempool for asymmetric session
Rather than using a session buffer that contains pointers to private
session data elsewhere, have a single session buffer.
This session is created for a driver ID, and the mempool element
contains space for the max session private data needed for any driver.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Ciara Power [Fri, 11 Feb 2022 09:29:05 +0000 (09:29 +0000)]
doc: replace asym crypto code with literal includes
The programmer's guide for cryptodev included sample code for using
Asymmetric crypto. This is now replaced with direct code from the test
application, using literal includes. It is broken into snippets as the
test application didn't have all of the required code in one function.
Signed-off-by: Ciara Power <ciara.power@intel.com> Acked-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Anoob Joseph [Mon, 31 Jan 2022 12:30:28 +0000 (18:00 +0530)]
crypto/cnxk: use unique cache line per inst
CPT inflight request is used to track a request that is enqueued to
cryptodev. Having more than one inst use the same cacheline can result
in serialization of CPT result memory writes causing perf degradations.
Align inflight request to ROC cache line to ensure only one result would
be written per cache line..
Signed-off-by: Anoob Joseph <anoobj@marvell.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Kai Ji [Fri, 21 Jan 2022 10:38:30 +0000 (10:38 +0000)]
crypto/qat: fix GEN4 AEAD job in raw data path
This patch fix the cipher params configuration in AEAD job if
QAT GEN4 unified cipher slice(UCS) enabled.
Fixes: 328d690d2f60 ("crypto/qat: update raw data path") Cc: stable@dpdk.org Signed-off-by: Kai Ji <kai.ji@intel.com> Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Pablo de Lara [Thu, 20 Jan 2022 17:04:55 +0000 (17:04 +0000)]
crypto/ipsec_mb: fix buffer overrun
Memory for ZUC cipher/auth key in session had to be expanded to 32 bytes,
instead of 16 bytes, when adding ZUC-256 support.
However, impact is low as this memory is part of a union
with bigger size than 32 bytes.
Coverity issue: 374374
Coverity issue: 374379 Fixes: 8c835018de84 ("crypto/ipsec_mb: support ZUC-256 for aesni_mb") Cc: stable@dpdk.org Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Ciara Power <ciara.power@intel.com>
Kai Ji [Fri, 7 Jan 2022 15:06:04 +0000 (15:06 +0000)]
test/crypto: fix out-of-place SGL in raw datapath
Fix out of place scatter gather list in sym raw datapath unit test.
Fixes: cd8166c28cd1 ("test/crypto: add raw API test for dpaax") Cc: stable@dpdk.org Signed-off-by: Kai Ji <kai.ji@intel.com> Acked-by: Akhil Goyal <gakhil@marvell.com>
Ferruh Yigit [Fri, 11 Feb 2022 19:11:43 +0000 (19:11 +0000)]
ethdev: move driver interface functions to its own file
ethdev has two interfaces, one interface between applications and
library, these APIs are declared in the rte_ethdev.h public header.
Other interface is between drivers and library, these functions are
declared in ethdev_driver.h and marked as internal.
But all functions are defined in rte_ethdev.c file. This patch moves
functions for drivers to its own file, ethdev_driver.c for cleanup, no
functional change in functions.
Some public APIs and driver helpers call common internal functions,
which were mostly static since both were in same file. To be able to
move driver helpers, common functions are moved to ethdev_private.c.
(ethdev_private.c is used for functions that are internal to the library
and shared by multiple .c files in the ethdev library.)
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Ferruh Yigit [Fri, 11 Feb 2022 19:11:42 +0000 (19:11 +0000)]
ethdev: introduce generic dummy packet burst function
Multiple PMDs have dummy/noop Rx/Tx packet burst functions.
These dummy functions are very simple, introduce a common function in
the ethdev and update drivers to use it instead of each driver having
its own functions.
Robert Sanford [Tue, 21 Dec 2021 19:57:29 +0000 (14:57 -0500)]
net/ring: support promisc and allmulticast
Add promiscuous_enable, promiscuous_disable, allmulticast_enable,
and allmulticast_disable API stubs.
This helps clean up errors in dpdk-test link_bonding_mode4_autotest.
Signed-off-by: Robert Sanford <rsanford@akamai.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Pavan Nikhilesh [Thu, 10 Feb 2022 13:15:26 +0000 (18:45 +0530)]
net/cnxk: avoid command copy from Tx queue
Tx command is prepared based on offloads enabled and stored in
Tx queue structure at tx_queue_setup phase.
In fastpath the command is copied from Tx queue to LMT line for
all the packets.
Since, the command contents are mostly constants we can move the
command preparation to fastpath and avoid accessing Tx queue
memory.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Ghalem Boudour [Thu, 10 Feb 2022 10:49:14 +0000 (11:49 +0100)]
net/iavf: initialize large VF setting at startup
lv_enabled is used to remember if large VF setting is configured, but
its value is not initialized at startup. This can lead to a different
configuration regarding the initial configuration of the PF.
For example, a first start is done with 8 rx and 8 tx queues. Large VF
is not needed and reta size is 64.
A second start is done with 20 rx and tx queues. Large VF is required
and reta size is 256.
A third start is done with 2 rx and tx queues. Large VF is not needed
but reta size is 256 as the PF has been configured during the second
start.
In order to have a consistent behavior regarding reta size whatever
the configuration of the PF (may be changed by a previous boot) the
lv_enabled must be set properly at the init phase.
Ciara Loftus [Fri, 11 Feb 2022 15:03:05 +0000 (15:03 +0000)]
doc: update libxdp usage in af_xdp guide
When libxdp is used, the LIBXDP_OBJECT_PATH environment variable must be
set to the location of where libxdp placed its bpf object files. This is
usually in /usr/local/lib/bpf or /usr/local/lib64/bpf. Failure to do so
will result in the PMD not initialising correctly as the bpf program is
not found. Document this requirement.
Also, mention that the following logs which are generated on application
launch can be ignored:
libbpf: elf: skipping unrecognized data section(7) .xdp_run_config
libbpf: elf: skipping unrecognized data section(8) xdp_metadata
Sean Zhang [Fri, 11 Feb 2022 01:45:29 +0000 (03:45 +0200)]
app/testpmd: support GRE option flow item
Add gre_option command for matching optional fields
(checksum/key/sequence) in GRE header. The item must follow gre item,
and the item does not change the flags in gre item, the application
should set the flags in gre item correspondingly.
Application can still use gre_key item 'gre_key value is xx' for key
matching, the effect is the same with using 'gre_option key is xx'.
The examples for gre_option are as follows:
To match on checksum field with value 0x11:
testpmd> ... pattern / eth / gre c_bit is 1 / gre_option checksum is
0x11 / end ..
To match on checksum field with value 0x11 and any value of key:
testpmd> ... pattern / eth / gre c_bit is 1 k_bit is 1 / gre_option
checksum is 0x11 / end ..
To match on checksum field with value 0x11 and no key field in packet:
testpmd> ... pattern / eth / gre c_bit is 1 k_bit is 0 / gre_option
checksum is 0x11 / end ..
The invalid patterns for gre_option are as follows:
testpmd> ... pattern / eth / gre / gre_option checksum is 0x11 / end ..
(c_bit in gre item not present)
testpmd> ... pattern / eth / gre c_bit is 0 / gre_option checksum is 0x11 /
end .. (c_bit is unset for gre item, but checksum is
specified by gre_option item)
Signed-off-by: Sean Zhang <xiazhang@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
Sean Zhang [Fri, 11 Feb 2022 01:45:28 +0000 (03:45 +0200)]
ethdev: support GRE optional fields
Add flow pattern items and header format for matching optional fields
(checksum/key/sequence) in GRE header. And the flags in gre item should
be correspondingly set with the new added items.
Signed-off-by: Sean Zhang <xiazhang@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
Ciara Loftus [Wed, 9 Feb 2022 09:48:08 +0000 (09:48 +0000)]
net/af_xdp: re-enable secondary process support
Secondary process support had been disabled for the AF_XDP PMD because
there was no logic in place to share the AF_XDP socket file descriptors
between the processes. This commit introduces this logic using the IPC
APIs.
Rx and Tx are disabled in the secondary process due to memory mapping of
the AF_XDP rings being assigned by the kernel in the primary process only.
However other operations including retrieval of stats are permitted.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Jiawen Wu [Wed, 9 Feb 2022 10:42:08 +0000 (18:42 +0800)]
net/ngbe: support OEM customized LED
Support to get OEM customized LED configuration information from firmware.
And driver needs to adjust the process of PHY setup link, based on this
LED configuration.
Jiawen Wu [Wed, 9 Feb 2022 10:42:04 +0000 (18:42 +0800)]
net/ngbe: fix Tx hang on queue disable
Add commands requesting firmware to enable or disable PCIe bus master.
Disable PCIe master access to clear BME when stop hardware, and verify
there are no pending requests.
Move disabling Tx queue after disabling PCIe bus master, to ensure that
there are no packets left to cause Tx hang.
Jiawen Wu [Wed, 9 Feb 2022 10:42:03 +0000 (18:42 +0800)]
net/ngbe: fix missed link interrupt
When the port is started and stopped continuously and quickly, one
interrupt cannot be handled in time, which will cause subsequent
interrupts to be lost, so that link status will cannot be updated.
Fixes: b9246b8fa280 ("net/ngbe: support link update") Cc: stable@dpdk.org Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Min Hu (Connor) [Fri, 11 Feb 2022 04:49:22 +0000 (12:49 +0800)]
ethdev: introduce dump API
Added the ethdev dump API which provides querying private info from device.
There exists many private properties in different PMD drivers, such as
adapter state, Rx/Tx func algorithm in hns3 PMD. The information of these
properties is important for debug. As the information is private, the new
API is introduced.
Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Ray Kinsella <mdr@ashroe.eu> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Ajit Khaparde [Wed, 26 Jan 2022 18:13:26 +0000 (10:13 -0800)]
net/bnxt: fix ring calculation for representors
Currently the Tx and Rx ring count for representors is fixed.
It does not consider the number of rings created for the parent
function. And that can cause issues not only during initialization
but while running traffic.
Instead check the number of rings created for the parent function
while configuring the ring resources for representors.
In some cases VF rep ring init may happen before the parent function's
rings have been setup. And this can cause representor ring count to be
configured as 0. In such cases, initialize the VF representor
ring count to 8.
This patch removes a redundant assert in mlx5_tx_packet_multi_tso().
That assert assured that the amount of bytes requested to be inlined
is greater than or equal to the minimum amount of bytes required
to be inlined. This requirement is either derived from the NIC
inlining mode or configured through devargs. When using TSO this
requirement can be disregarded, because on all NICs it is satisfied by
TSO inlining requirements, since TSO requires L2, L3, and L4 headers to
be inlined.
Meter capabilities reporting is not up to date.
Mellanox NICs support RFC2698 and RFC4115 as well as RFC2697.
Add these marker operations to the capabilities list.
Fixes: 6bc327b94fe8 ("net/mlx5: fill meter capabilities using DevX") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Committed Bucket Size calculation tries to fit into 8-bit wide
mantissa field by setting 256 as a maximum value for it.
To compensate for this increase in the mantissa value the exponent
value has to be reduced by 8. But it gives a negative exponent
value for CBS less than 128. And negative exponent value is not
supported by the NIC. Adjust CSB calculation only for values
bigger than 128 to allow both small and big bucket sizes.
Fixes: 3bd26b23cefc ("net/mlx5: support meter profile operations") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>