dpdk.git
2 years agocrypto/dpaa_sec: support AEAD and proto with raw API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:30 +0000 (00:30 +0530)]
crypto/dpaa_sec: support AEAD and proto with raw API

This add support for AEAD and proto offload with raw APIs
for dpaa_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support authonly and chain with raw API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:29 +0000 (00:30 +0530)]
crypto/dpaa_sec: support authonly and chain with raw API

This patch improves the raw vector support in dpaa_sec driver
for authonly and chain usecase.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: support raw datapath API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:28 +0000 (00:30 +0530)]
crypto/dpaa_sec: support raw datapath API

This patch add raw vector API framework for dpaa_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: enhance error checks with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:27 +0000 (00:30 +0530)]
crypto/dpaa2_sec: enhance error checks with raw buffer API

This patch improves error conditions and support of
Wireless algos with raw buffers.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support OOP with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:26 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support OOP with raw buffer API

add support for out of order processing with raw vector APIs.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support AEAD with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:25 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support AEAD with raw buffer API

add raw vector API support for AEAD algos.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support authenc with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:24 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support authenc with raw buffer API

This patch supports AUTHENC with raw buufer APIs

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support auth only with raw buffer API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:23 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support auth only with raw buffer API

Auth only with raw buffer APIs has been supported in this patch.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support raw datapath API
Gagandeep Singh [Wed, 13 Oct 2021 19:00:22 +0000 (00:30 +0530)]
crypto/dpaa2_sec: support raw datapath API

This path add framework for raw API support.
The initial patch only test cipher only part.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: fix multi-segment raw vector processing
Gagandeep Singh [Wed, 13 Oct 2021 19:00:21 +0000 (00:30 +0530)]
cryptodev: fix multi-segment raw vector processing

If no next segment available the “for” loop will fail and it still
returns i+1 i.e. 2, which is wrong as it has filled only 1 buffer.

Fixes: 7adf992fb9bf ("cryptodev: introduce CPU crypto API")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: add field for out-of-place in raw vector
Hemant Agrawal [Wed, 13 Oct 2021 19:00:20 +0000 (00:30 +0530)]
cryptodev: add field for out-of-place in raw vector

The structure rte_crypto_sym_vec is updated to
add dest_sgl to support out of place processing.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2 years agocryptodev: add total raw buffer length
Gagandeep Singh [Wed, 13 Oct 2021 19:00:19 +0000 (00:30 +0530)]
cryptodev: add total raw buffer length

The current crypto raw data vectors is extended to support
rte_security usecases, where we need total data length to know
how much additional memory space is available in buffer other
than data length so that driver/HW can write expanded size
data after encryption.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2 years agocryptodev: rename field in vector struct
Hemant Agrawal [Wed, 13 Oct 2021 19:00:18 +0000 (00:30 +0530)]
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>
2 years agodoc: remove unneeded security structs extension notice
Radu Nicolau [Thu, 14 Oct 2021 16:03:29 +0000 (17:03 +0100)]
doc: remove unneeded security structs extension notice

The new fields regarding TSO support were not implemented following
feedback, it was decided to implement TSO support by using existing
mbuf fields.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agodoc: remove unneeded IPsec new field notice
Radu Nicolau [Thu, 14 Oct 2021 16:03:28 +0000 (17:03 +0100)]
doc: remove unneeded IPsec new field notice

The deprecation notice regarding extending rte_ipsec_sa_prm with a
new field hdr_l3_len is no longer applicable.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoipsec: support setting initial ESN value
Radu Nicolau [Thu, 14 Oct 2021 16:03:27 +0000 (17:03 +0100)]
ipsec: support setting initial ESN value

Update IPsec library to support initial ESN value.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoipsec: support SA telemetry
Radu Nicolau [Thu, 14 Oct 2021 16:03:26 +0000 (17:03 +0100)]
ipsec: support SA telemetry

Add telemetry support for ipsec SAs.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agombuf: add IPsec ESP tunnel type
Radu Nicolau [Thu, 14 Oct 2021 16:03:25 +0000 (17:03 +0100)]
mbuf: add IPsec ESP tunnel type

Add ESP tunnel type to the tunnel types list that can be specified
for TSO or checksum on the inner part of tunnel packets.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agoipsec: support NAT-T
Radu Nicolau [Thu, 14 Oct 2021 16:03:24 +0000 (17:03 +0100)]
ipsec: support NAT-T

Add support for the IPsec NAT-Traversal use case for Tunnel mode
packets.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agosecurity: add UDP parameters for IPsec NAT-T
Radu Nicolau [Thu, 14 Oct 2021 16:03:23 +0000 (17:03 +0100)]
security: add UDP parameters for IPsec NAT-T

Add support for specifying UDP port params for UDP encapsulation option.
RFC3948 section-2.1 does not enforce using specific the UDP ports for
UDP-Encapsulated ESP Header

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoipsec: support more AEAD algorithms
Radu Nicolau [Thu, 14 Oct 2021 16:03:22 +0000 (17:03 +0100)]
ipsec: support more AEAD algorithms

Added support for AES_CCM, CHACHA20_POLY1305 and AES_GMAC.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agosecurity: add ESN field to IPsec xform
Radu Nicolau [Thu, 14 Oct 2021 16:03:21 +0000 (17:03 +0100)]
security: add ESN field to IPsec xform

Update ipsec_xform definition to include ESN field.
This allows the application to control the ESN starting value.

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: extend data-unit length field
Matan Azrad [Mon, 4 Oct 2021 06:36:38 +0000 (09:36 +0300)]
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 d014dddb2d69 ("cryptodev: support multiple cipher
data-units")
[2] commit 9a5c09211b3a ("doc: announce extension of crypto data-unit
length")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoapp/crypto-perf: fix AAD template copy overrun
Przemyslaw Zegan [Tue, 12 Oct 2021 12:56:11 +0000 (12:56 +0000)]
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: 8a5b494a7f99 ("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>
2 years agoexamples/ipsec-secgw: accept inline packet in single SA
Nithin Dabilpuram [Wed, 6 Oct 2021 07:20:16 +0000 (12:50 +0530)]
examples/ipsec-secgw: accept inline packet in single SA

In inline protocol inbound SA's, plain IPv4 and IPv6 packets are
delivered to application unlike inline crypto or lookaside.
Hence fix the application to not drop them when working in
single SA mode.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: add max queue pairs limit option
Ankur Dwivedi [Thu, 30 Sep 2021 13:20:43 +0000 (18:50 +0530)]
crypto/cnxk: add max queue pairs limit option

Adds max queue pairs limit devargs for crypto cnxk driver. This
can be used to set a limit on the number of maximum queue pairs
supported by the device. The default value is 63.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agomempool: accept user flags only
David Marchand [Mon, 18 Oct 2021 08:26:35 +0000 (10:26 +0200)]
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: b240af8b10f9 ("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>
2 years agomempool: deprecate unused physical page defines
Andrew Rybchenko [Tue, 19 Oct 2021 17:40:22 +0000 (20:40 +0300)]
mempool: deprecate unused physical page defines

MEMPOOL_PG_NUM_DEFAULT and MEMPOOL_PG_SHIFT_MAX are not used.

Fixes: fd943c764a63 ("mempool: deprecate xmem functions")

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agomempool: add namespace to driver register macro
Andrew Rybchenko [Tue, 19 Oct 2021 17:40:21 +0000 (20:40 +0300)]
mempool: add namespace to driver register macro

Add RTE_ prefix to macro used to register mempool driver.
The old one is still available but deprecated.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agomempool: make header size calculation internal
Andrew Rybchenko [Tue, 19 Oct 2021 17:40:20 +0000 (20:40 +0300)]
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>
2 years agomempool: add namespace to internal helpers
Andrew Rybchenko [Tue, 19 Oct 2021 17:40:19 +0000 (20:40 +0300)]
mempool: add namespace to internal helpers

Add RTE_ prefix to internal API defined in public header.
Use the prefix instead of double underscore.
Use uppercase for macros in the case of name conflict.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agomempool: add namespace to flags
Andrew Rybchenko [Tue, 19 Oct 2021 17:40:18 +0000 (20:40 +0300)]
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>
2 years agomempool: enhance flags documentation readability
Andrew Rybchenko [Tue, 19 Oct 2021 17:40:17 +0000 (20:40 +0300)]
mempool: enhance flags documentation readability

Move documentation into a separate line just before define.
Prepare to have a bit longer flag name because of namespace prefix.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agomcslock: use WFE in lock for aarch64
Feifei Wang [Wed, 20 Oct 2021 03:03:35 +0000 (11:03 +0800)]
mcslock: use WFE in lock for aarch64

Instead of polling for previous lock holder unlocking, use
wait_until_equal API.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agomem: use WFE for init sync on aarch64
Feifei Wang [Wed, 20 Oct 2021 03:03:34 +0000 (11:03 +0800)]
mem: use WFE for init sync on aarch64

Instead of polling for mcfg->magic to be updated, use wait_until_equal
API.

Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples: remove unneeded atomic header include
Joyce Kong [Wed, 13 Oct 2021 18:54:07 +0000 (13:54 -0500)]
examples: remove unneeded atomic header include

Remove the unnecessary header file rte_atomic.h
included in example module.

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>
2 years agoexamples/server_node_efd: use compiler atomics for sync
Joyce Kong [Wed, 13 Oct 2021 18:54:06 +0000 (13:54 -0500)]
examples/server_node_efd: use compiler atomics for sync

Convert rte_atomic32_test_and_set to compiler CAS atomic
operation for display_stats sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/vm_power: use compiler atomics for sync
Joyce Kong [Wed, 13 Oct 2021 18:54:05 +0000 (13:54 -0500)]
examples/vm_power: use compiler atomics for sync

Convert rte_atomic32_cmpset to compiler atomic CAS
operation for channel status sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/l2fwd-jobstats: use compiler atomics for stats sync
Joyce Kong [Wed, 13 Oct 2021 18:54:04 +0000 (13:54 -0500)]
examples/l2fwd-jobstats: use compiler atomics for stats sync

Convert rte_atomic usages to compiler atomic built-ins
for stats_read_pending sync in l2fwd_jobstats module.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/performance-thread: use compiler atomics for sync
Joyce Kong [Wed, 13 Oct 2021 18:54:03 +0000 (13:54 -0500)]
examples/performance-thread: use compiler atomics for sync

Convert rte_atomic usages to compiler atomic built-ins
for thread sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/kni: use compiler atomics for status sync
Joyce Kong [Wed, 13 Oct 2021 18:54:02 +0000 (13:54 -0500)]
examples/kni: use compiler atomics for status sync

Convert rte_atomic usages to compiler atomic builit-ins
for kni_stop and kni_pause sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/multi_process: use compiler atomics for sync
Joyce Kong [Wed, 13 Oct 2021 18:54:01 +0000 (13:54 -0500)]
examples/multi_process: use compiler atomics for sync

Convert rte_atomic32_test_and_set usage to compiler atomic
CAS operation for display_stats sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoexamples/bbdev: use compiler atomics for flag sync
Joyce Kong [Wed, 13 Oct 2021 18:54:00 +0000 (13:54 -0500)]
examples/bbdev: use compiler atomics for flag sync

Convert rte_atomic usages to compiler atomic built-ins
for global_exit_flag sync.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agotest/hash: use compiler atomics for sync
Dharmik Thakkar [Wed, 22 Sep 2021 21:52:05 +0000 (16:52 -0500)]
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>
2 years agostack: remove unneeded atomic header include
Joyce Kong [Wed, 13 Oct 2021 20:48:12 +0000 (15:48 -0500)]
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>
2 years agousertools/telemetry: list file-prefixes
Conor Walsh [Mon, 18 Oct 2021 10:09:52 +0000 (10:09 +0000)]
usertools/telemetry: list file-prefixes

This patch adds the option --list (-l) to dpdk-telemetry.py which will
print all of the available file-prefixes for DPDK processes that have
telemetry enabled.
The prefixes will also be printed if the user passes an incorrect prefix
in the --file-prefix (-f) option.

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2 years agousertools/telemetry: fix instance option help
Conor Walsh [Mon, 18 Oct 2021 10:39:29 +0000 (10:39 +0000)]
usertools/telemetry: fix instance option help

The instance option help text was incorrect, this patch corrects it.

Fixes: 11435aae2089 ("usertools/telemetry: connect to separate instances")

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agonet/mlx5: support mempool registration
Dmitry Kozlyuk [Mon, 18 Oct 2021 22:43:53 +0000 (01:43 +0300)]
net/mlx5: support mempool registration

When the first port in a given protection domain (PD) starts,
install a mempool event callback for this PD and register all existing
memory regions (MR) for it. When the last port in a PD closes,
remove the callback and unregister all mempools for this PD.
This behavior can be switched off with a new devarg: mr_mempool_reg_en.

On TX slow path, i.e. when an MR key for the address of the buffer
to send is not in the local cache, first try to retrieve it from
the database of registered mempools. Supported are direct and indirect
mbufs, as well as externally-attached ones from MLX5 MPRQ feature.
Lookup in the database of non-mempool memory is used as the last resort.

RX mempools are registered regardless of the devarg value.
On RX data path only the local cache and the mempool database is used.
If implicit mempool registration is disabled, these mempools
are unregistered at port stop, releasing the MRs.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: add mempool registration facilities
Dmitry Kozlyuk [Mon, 18 Oct 2021 22:43:52 +0000 (01:43 +0300)]
common/mlx5: add mempool registration facilities

Add internal API to register mempools, that is, to create memory
regions (MR) for their memory and store them in a separate database.
Implementation deals with multi-process, so that class drivers don't
need to. Each protection domain has its own database. Memory regions
can be shared within a database if they represent a single hugepage
covering one or more mempools entirely.

Add internal API to lookup an MR key for an address that belongs
to a known mempool. It is a responsibility of a class driver
to extract the mempool from an mbuf.

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agomempool: add non-IO flag
Dmitry Kozlyuk [Mon, 18 Oct 2021 22:43:51 +0000 (01:43 +0300)]
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>
2 years agomempool: add event callbacks
Dmitry Kozlyuk [Mon, 18 Oct 2021 22:43:50 +0000 (01:43 +0300)]
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>
2 years agodoc: fix spelling in cnxk guide
Stephen Hemminger [Fri, 15 Oct 2021 19:19:44 +0000 (12:19 -0700)]
doc: fix spelling in cnxk guide

Fix spelling error which is causing reports of other patches failing.

Fixes: 69daa9e5022b ("net/cnxk: support inline security setup for cn10k")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agoraw/octeontx2_ep: remove driver
Radha Mohan Chintakuntla [Thu, 26 Aug 2021 10:50:21 +0000 (03:50 -0700)]
raw/octeontx2_ep: remove driver

Removing the rawdev based octeontx2-ep driver as the dependent
common/octeontx2 will soon be going away. Moreover this driver is no
longer required as the net/octeontx_ep driver is sufficient.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2 years agoraw/octeontx2_dma: remove driver
Radha Mohan Chintakuntla [Thu, 26 Aug 2021 10:50:20 +0000 (03:50 -0700)]
raw/octeontx2_dma: remove driver

Removing the rawdev based octeontx2-dma driver as the dependent
common/octeontx2 will be soon be going away. Also a new DMA driver will
be coming in this place once the rte_dmadev library is in.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2 years agotest/dma: add burst capacity test
Kevin Laatz [Wed, 13 Oct 2021 15:17:36 +0000 (16:17 +0100)]
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>
2 years agotest/dma: add fill tests
Kevin Laatz [Wed, 13 Oct 2021 15:17:35 +0000 (16:17 +0100)]
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>
2 years agotest/dma: add failure handling tests
Bruce Richardson [Wed, 13 Oct 2021 15:17:34 +0000 (16:17 +0100)]
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>
2 years agodmadev: add flag for error handling support
Bruce Richardson [Wed, 13 Oct 2021 15:17:33 +0000 (16:17 +0100)]
dmadev: add flag for error handling support

Due to HW or driver limitations, not all dmadevs may support full error
handling e.g. safely managing and reporting an invalid address to a copy
operation. The skeleton dmadev, for example, being pure software will
always seg-fault if passed an invalid address. To indicate the
availability of safe error handling by a device, we add a capability
flag for it.

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>
2 years agotest/dma: add more comprehensive copy tests
Bruce Richardson [Wed, 13 Oct 2021 15:17:32 +0000 (16:17 +0100)]
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>
2 years agotest/dma: run test suite on skeleton driver
Bruce Richardson [Wed, 13 Oct 2021 15:17:31 +0000 (16:17 +0100)]
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>
2 years agotest/dma: add basic copy tests
Bruce Richardson [Wed, 13 Oct 2021 15:17:30 +0000 (16:17 +0100)]
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>
2 years agotest/dma: add basic dmadev instance tests
Bruce Richardson [Wed, 13 Oct 2021 15:17:29 +0000 (16:17 +0100)]
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>
2 years agodmadev: add device iterator
Bruce Richardson [Wed, 13 Oct 2021 15:17:28 +0000 (16:17 +0100)]
dmadev: add device iterator

Add a function and wrapper macro to iterate over all DMA devices.

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>
2 years agodmadev: add burst capacity API
Kevin Laatz [Wed, 13 Oct 2021 15:17:26 +0000 (16:17 +0100)]
dmadev: add burst capacity API

Add a burst capacity check API to the dmadev library. This API is useful to
applications which need to how many descriptors can be enqueued in the
current batch. For example, it could be used to determine whether all
segments of a multi-segment packet can be enqueued in the same batch or not
(to avoid half-offload of the packet).

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agodmadev: add channel status check for testing use
Bruce Richardson [Wed, 13 Oct 2021 15:17:24 +0000 (16:17 +0100)]
dmadev: add channel status check for testing use

Add in a function to check if a device or vchan has completed all jobs
assigned to it, without gathering in the results. This is primarily for
use in testing, to allow the hardware to be in a known-state prior to
gathering completions.

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>
2 years agotest/dma: add dmadev API test
Chengwen Feng [Wed, 13 Oct 2021 12:25:00 +0000 (20:25 +0800)]
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>
2 years agodma/skeleton: introduce skeleton driver
Chengwen Feng [Wed, 13 Oct 2021 12:24:59 +0000 (20:24 +0800)]
dma/skeleton: introduce skeleton driver

Skeleton dmadevice driver, on the lines of rawdev skeleton, is for
showcasing of the dmadev library.

Design of skeleton involves a virtual device which is plugged into VDEV
bus on initialization.

Also, enable compilation of dmadev skeleton drivers.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agodmadev: support multi-process
Chengwen Feng [Wed, 13 Oct 2021 12:24:58 +0000 (20:24 +0800)]
dmadev: support multi-process

This patch add multi-process support for dmadev.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agodmadev: add data plane API
Chengwen Feng [Wed, 13 Oct 2021 12:24:57 +0000 (20:24 +0800)]
dmadev: add data plane API

This patch add data plane API for dmadev.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agodmadev: add control plane API
Chengwen Feng [Wed, 13 Oct 2021 12:24:56 +0000 (20:24 +0800)]
dmadev: add control plane API

This patch add control plane API for dmadev.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agodmadev: introduce DMA device library
Chengwen Feng [Wed, 13 Oct 2021 12:24:55 +0000 (20:24 +0800)]
dmadev: introduce DMA device library

The 'dmadev' is a generic type of DMA device.

This patch introduce the 'dmadev' device allocation functions.

The infrastructure is prepared to welcome drivers in drivers/dma/

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agombuf: enforce no option for dynamic fields and flags
David Marchand [Tue, 12 Oct 2021 19:39:57 +0000 (21:39 +0200)]
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: 4958ca3a443a ("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>
2 years agomemzone: enforce valid flags when reserving
David Marchand [Tue, 12 Oct 2021 19:39:26 +0000 (21:39 +0200)]
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>
2 years agomempool: enforce valid flags at creation
David Marchand [Thu, 14 Oct 2021 19:29:16 +0000 (21:29 +0200)]
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>
2 years agousertools/telemetry: provide info on available sockets
Bruce Richardson [Thu, 14 Oct 2021 10:49:07 +0000 (11:49 +0100)]
usertools/telemetry: provide info on available sockets

When a user runs the dpdk-telemetry script and fails to connect because
the socket path does not exist, run a scan for possible sockets that
could be connected to and inform the user of the command needed to
connect to those.

For example:

  $ ./dpdk-telemetry.py -i4
  Connecting to /run/user/1000/dpdk/rte/dpdk_telemetry.v2:4
  Error connecting to /run/user/1000/dpdk/rte/dpdk_telemetry.v2:4

  Other DPDK telemetry sockets found:
  - dpdk_telemetry.v2  # Connect with './dpdk-telemetry.py'
  - dpdk_telemetry.v2:2  # Connect with './dpdk-telemetry.py -i 2'
  - dpdk_telemetry.v2:1  # Connect with './dpdk-telemetry.py -i 1'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
2 years agousertools/telemetry: connect to separate instances
Bruce Richardson [Thu, 14 Oct 2021 10:49:06 +0000 (11:49 +0100)]
usertools/telemetry: connect to separate instances

For processes run using "in-memory" mode sharing the same runtime dir,
we add support for connecting to the separate instance sockets created
using ":1", ":2" etc. via new "-i" or "--instance" argument. Add details
on connecting to separate instances to the telemetry howto document.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
2 years agotelemetry: fix socket path conflicts for in-memory mode
Bruce Richardson [Thu, 14 Oct 2021 10:49:05 +0000 (11:49 +0100)]
telemetry: fix socket path conflicts for in-memory mode

When running using in-memory mode, multiple processes can use the same
runtime dir, leading to conflicts with the telemetry sockets in that
directory. We can resolve this by appending a suffix to each socket
beyond the first, with the suffix being an increasing counter value.
Each process uses the first unused socket counter value.

Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
2 years agoeal: limit telemetry to primary processes
Bruce Richardson [Thu, 14 Oct 2021 10:49:04 +0000 (11:49 +0100)]
eal: limit telemetry to primary processes

Telemetry interface should be exposed for primary processes only, since
secondary processes will conflict on socket creation, and since all
data in secondary process is generally available to primary. For
example, all device stats for ethdevs, cryptodevs, etc. will all be
common across processes.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
Tested-by: Conor Walsh <conor.walsh@intel.com>
2 years agoconfig/ppc: select instruction set for IBM Power10
Thinh Tran [Tue, 12 Oct 2021 18:54:32 +0000 (18:54 +0000)]
config/ppc: select instruction set for IBM Power10

For native build, enabling building the highest cpu_instruction_set
supported by the build host, including the new POWER10.

For cross compile, verifying that the compiler supports the
cpu_instruction_set specified in the cross-file

Signed-off-by: Thinh Tran <thinhtr@linux.vnet.ibm.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
2 years agotest/atomic: fix 128-bit atomic test with many cores
David Christensen [Wed, 8 Sep 2021 17:48:20 +0000 (10:48 -0700)]
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: fa3253c534b1 ("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>
2 years agoeal/ppc: use compiler builtins for atomics
David Christensen [Thu, 9 Sep 2021 19:42:43 +0000 (12:42 -0700)]
eal/ppc: use compiler builtins for atomics

Replace existing PPC assembly code for rte_atomicXX ops with compiler
atomic builtins as previously adopted by DPDK (see [1] and [2]).  This
has the additional benefit of resolving a POWER10 build failure due to an
outstanding gcc issue which fails on the existing PPC assembly code [3].

[1] https://www.dpdk.org/blog/2021/03/26/dpdk-adopts-the-c11-memory-model/
[2] https://doc.dpdk.org/guides/rel_notes/deprecation.html
[3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98519

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
2 years agoip_frag: fix fragmenting IPv4 fragment
Huichao Cai [Sat, 9 Oct 2021 07:27:04 +0000 (15:27 +0800)]
ip_frag: fix fragmenting IPv4 fragment

Current implementation of rte_ipv4_fragment_packet() doesn’t take
into account offset and flag values of the given packet, but blindly
assumes they are always zero (original packet is not fragmented).
According to RFC791, fragment and flag values for new fragment
should take into account values provided in the original IPv4 packet.

Fixes: 4c38e5532a07 ("ip_frag: refactor IPv4 fragmentation into a proper library")
Cc: stable@dpdk.org
Signed-off-by: Huichao Cai <chcchc88@163.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2 years agombuf: remove deprecated flag for bad outer IPv4 checksum
Andrew Rybchenko [Mon, 11 Oct 2021 14:28:53 +0000 (17:28 +0300)]
mbuf: remove deprecated flag for bad outer IPv4 checksum

Removed offload flag PKT_RX_EIP_CKSUM_BAD. PKT_RX_OUTER_IP_CKSUM_BAD
should be used as a replacement.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agomempool: fix name size in mempool structure
Andrew Rybchenko [Wed, 13 Oct 2021 08:57:23 +0000 (11:57 +0300)]
mempool: fix name size in mempool structure

Use correct define as a name array size.

The change breaks ABI and therefore cannot be backported to
stable branches.

Fixes: 38c9817ee1d8 ("mempool: adjust name size in related data types")

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agombuf: fix typo in comment
Stephen Hemminger [Wed, 1 Sep 2021 23:49:44 +0000 (16:49 -0700)]
mbuf: fix typo in comment

Misspelling of 'copied'

Fixes: c3a90c381daa ("mbuf: add a copy routine")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agoexamples/ptpclient: enable Rx queue configuration
Simei Su [Thu, 19 Aug 2021 08:58:34 +0000 (16:58 +0800)]
examples/ptpclient: enable Rx queue configuration

This patch adds support to enable per-queue Rx offloads so that
it can convey the configuration to PMD.

Signed-off-by: Simei Su <simei.su@intel.com>
2 years agotelemetry: fix JSON output buffer length
Gowrishankar Muthukrishnan [Mon, 11 Oct 2021 10:54:43 +0000 (16:24 +0530)]
telemetry: fix JSON output buffer length

Earlier, JSON message length was limited to 1024 which would not
allow data more than this size. Removed this limitation by creating
output buffer based on requested data length.

Fixes: 52af6ccb2b39 ("telemetry: add utility functions for creating JSON")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2 years agoeal/freebsd: ignore in-memory option
Bruce Richardson [Mon, 13 Sep 2021 14:34:24 +0000 (15:34 +0100)]
eal/freebsd: ignore in-memory option

The in-memory option is not supported on FreeBSD so print a warning and
ignore the flag when it is specified for BSD apps. The lack of support
is due to the different way in which memory is managed on FreeBSD using
the contigmem driver rather than via a hugetlbfs filesystem.

Fixes: 14de8734c401 ("eal: add --in-memory option")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agobus/vmbus: fix ring buffer mapping in secondary process
Long Li [Wed, 29 Sep 2021 20:46:10 +0000 (13:46 -0700)]
bus/vmbus: fix ring buffer mapping in secondary process

The driver code had wrong assumption that all the addresses to ring buffers
in the secondary process are the same as those in the primary process. This
is not always correct as the channels could be mapped to different
addresses in the secondary process.

Fix this by keeping track of all the mapped addresses from the primary
process in the shared uio_res, and have second process map to the same
addresses.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Reported-by: Jonathan Erb <jonathan.erb@banduracyber.com>
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <sthemmin@microsoft.com>
2 years agonet: promote IPv6 external headers skip API as stable
Olivier Matz [Fri, 24 Sep 2021 13:01:10 +0000 (15:01 +0200)]
net: promote IPv6 external headers skip API as stable

This function is public since commit 8f0e4d6a78a5 ("net: export IPv6
header extensions skip function") (2018), and is used by vmxnet3 driver.
Promote it as stable.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agodoc: remove web references to internal guides
Thomas Monjalon [Thu, 7 Oct 2021 12:21:49 +0000 (14:21 +0200)]
doc: remove web references to internal guides

The guides should be referenced locally with RST syntax
:doc: (beginning of page) or :ref: (specific chapter).
The links to doc.dpdk.org/guides/ are removed.

The links to the doc.dpdk.org/api/ are acceptable,
but should not point to a specific version, so one is fixed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agoeal/x86: sort CPU extended features definitions
David Marchand [Fri, 8 Oct 2021 12:07:15 +0000 (14:07 +0200)]
eal/x86: sort CPU extended features definitions

Sort the definitions for extended features (leaf 0) to enhance
readability.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoeal/x86: fix some CPU extended features definitions
David Marchand [Fri, 8 Oct 2021 12:07:14 +0000 (14:07 +0200)]
eal/x86: fix some CPU extended features definitions

Caught while checking CPUID related stuff in OVS.

According to [1], for Structured Extended Feature Flags Enumeration Leaf
(EAX = 0x07H, ECX = 0):

- BMI1 is associated to EBX, bit 3 (was incorrectly 2),
- SMEP is associated to EBX, bit 7 (was incorrectly 6),
- BMI2 is associated to EBX, bit 8 (was incorrectly 7),
- ERMS is associated to EBX, bit 9 (was incorrectly 8),

1: https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoeal/linux: allow hugetlbfs sub-directories
John Levon [Tue, 12 Oct 2021 16:05:20 +0000 (17:05 +0100)]
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>
2 years agotest: remove autotest python wrapper
David Marchand [Fri, 8 Oct 2021 12:24:37 +0000 (14:24 +0200)]
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>
2 years agotest/service: fix race in attr check
David Marchand [Mon, 11 Oct 2021 14:54:30 +0000 (16:54 +0200)]
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: 4d55194d76a4 ("service: add attribute get function")
Fixes: 52bb6be259ff ("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>
2 years agotest/service: fix some comment
Joyce Kong [Thu, 19 Aug 2021 06:11:25 +0000 (01:11 -0500)]
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: f038a81e1c56 ("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>
2 years agotest/crypto: add inner checksum cases
Archana Muniganti [Thu, 30 Sep 2021 12:58:32 +0000 (18:28 +0530)]
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>
2 years agocrypto/cnxk: support inner checksum
Archana Muniganti [Thu, 30 Sep 2021 12:58:31 +0000 (18:28 +0530)]
crypto/cnxk: support inner checksum

Add inner checksum support for cn10k.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agosecurity: add SA config option for inner checksum
Archana Muniganti [Thu, 30 Sep 2021 12:58:30 +0000 (18:28 +0530)]
security: add SA config option for inner checksum

Add inner packet IPv4 hdr and L4 checksum enable options
in conf. These will be used in case of protocol offload.
Per SA, application could specify whether the
checksum(compute/verify) can be offloaded to security device.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>