dpdk.git
2 years agoapp/testpmd: fix metering and policing command for RFC4115
Shun Hao [Fri, 13 May 2022 03:57:38 +0000 (06:57 +0300)]
app/testpmd: fix metering and policing command for RFC4115

Add CLI command support for metering and policing of trtcm_rfc4115.

Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agoapp/testpmd: replace hardcoded min mbuf number with macro
Mingxia Liu [Thu, 31 Mar 2022 02:33:33 +0000 (02:33 +0000)]
app/testpmd: replace hardcoded min mbuf number with macro

Add macro MIN_TOTAL_NUM_MBUFS (1024) to indicate
what the value of total-num-mbufs should bigger than.

Fixes: c87988187fdb ("app/testpmd: add --total-num-mbufs option")
Cc: stable@dpdk.org
Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2 years agonet/cnxk: fix possible null dereference in telemetry
Chengwen Feng [Fri, 13 May 2022 02:53:57 +0000 (10:53 +0800)]
net/cnxk: fix possible null dereference in telemetry

The return value of rte_tel_data_alloc() may be null pointer.
Add missing check vs null.

Fixes: 5ea354a1f2cc ("net/cnxk: support telemetry")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: fix possible null pointer access
Chengwen Feng [Fri, 13 May 2022 02:53:56 +0000 (10:53 +0800)]
ethdev: fix possible null pointer access

The rte_tel_data_alloc() may return NULL, so the caller should add
judgement for it.

Fixes: 083b0b310b19 ("ethdev: add common stats for telemetry")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: fix memory leak in xstats telemetry
Chengwen Feng [Fri, 13 May 2022 02:53:55 +0000 (10:53 +0800)]
ethdev: fix memory leak in xstats telemetry

The 'eth_xstats' should be freed after telemetry dictionary setup.

Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/axgbe: fix xstats get return if xstats is null
Chengwen Feng [Fri, 13 May 2022 02:53:54 +0000 (10:53 +0800)]
net/axgbe: fix xstats get return if xstats is null

Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0)
to retrieve the required number of elements, but currently axgbe PMD
returns zero when xstats is null.

Remove the logic of "return zero when xstats is NULL", and add the logic
of "return the required number of entries when n is lower than the
required number of entries".

Fixes: 9d1ef6b2e731 ("net/axgbe: add xstats")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/mvpp2: fix xstats get return if xstats is null
Chengwen Feng [Fri, 13 May 2022 02:53:53 +0000 (10:53 +0800)]
net/mvpp2: fix xstats get return if xstats is null

Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0)
to retrieve the required number of elements, but currently mvpp2 PMD
returns zero when xstats is null.

Remove the logic of "return zero when xstats is NULL", and add the logic
of "return the required number of entries when n is lower than the
required number of entries".

Fixes: a77b5378cd41 ("net/mrvl: add extended statistics")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/ipn3ke: fix xstats get return if xstats is null
Chengwen Feng [Fri, 13 May 2022 02:53:52 +0000 (10:53 +0800)]
net/ipn3ke: fix xstats get return if xstats is null

Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0)
to retrieve the required number of elements, but currently ipn3ke PMD
returns zero when xstats is null.

Dedicated check for xstats vs null is not required, since ethdev layer
guarantees that it may be null only if number of entries n is 0 (which
is definitely smaller than total xstats count).

Fixes: 5a6d883878db ("net/ipn3ke: implement statistics")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/hns3: fix xstats get return if xstats is null
Chengwen Feng [Fri, 13 May 2022 02:53:51 +0000 (10:53 +0800)]
net/hns3: fix xstats get return if xstats is null

Many user (e.g. telemetry) invokes rte_eth_xstats_get(port_id, NULL, 0)
to retrieve the required number of elements, but currently hns3 PMD
returns zero when xstats is null.

Dedicated check for xstats vs null is not required, since ethdev layer
guarantees that it may be null only if number of entries n is 0 (which
is definitely smaller than total xstats count).

Fixes: 8839c5e202f3 ("net/hns3: support device stats")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: simplify xstats get implementation
Chengwen Feng [Fri, 13 May 2022 02:53:50 +0000 (10:53 +0800)]
ethdev: simplify xstats get implementation

Use eth_dev_get_xstats_basic_count() to retrieve generic statistics count.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: clarify null location case in xstats get
Chengwen Feng [Fri, 13 May 2022 02:53:49 +0000 (10:53 +0800)]
ethdev: clarify null location case in xstats get

When xstats location is null in rte_eth_xstats_get() the return value
is not clearly specified.  Some PMDs (eg. hns3/ipn3ke/mvpp2/axgbe) return
zero while others return the required number of elements.

In this patch, special parameter combinations are restricted:
 1. highlight that xstats location may be null if and only if n is 0.
 2. amend n parameter description to specify that if n is lower than
    the required number of elements, the function returns the required
    number of elements.
 3. specify that if n is zero, the xstats must be NULL, the function
    returns the required number of elements (a duplicate which should
    help to not very attentive readers).

Add sanity check for null xstats and non-zero n case on API level to
make it unnecessary to care about it in drivers.

Fixes: ce757f5c9a4d ("ethdev: new method to retrieve extended statistics")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoapp/testpmd: remove useless pointer checks
David Marchand [Thu, 24 Mar 2022 16:15:03 +0000 (17:15 +0100)]
app/testpmd: remove useless pointer checks

Parameters to this static helper can't be NULL.
str has already been dereferenced in caller.
dst and size point to variable in stack.

Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
2 years agoapp/testpmd: perform SW IP checksum for GRO/GSO packets
Wenwu Ma [Thu, 12 May 2022 01:07:56 +0000 (01:07 +0000)]
app/testpmd: perform SW IP checksum for GRO/GSO packets

The GRO/GSO library doesn't re-calculate checksums for
merged/fragmented packets. If users want the packets to
have correct IP checksums, they should select HW IP
checksum calculation for the port which the packets are
transmitted to. But if the port doesn't support HW IP
checksum, users may perform a SW IP checksum.

Fixes: b7091f1dcfbc ("app/testpmd: enable the heavyweight mode TCP/IPv4 GRO")
Fixes: 52f38a2055ed ("app/testpmd: enable TCP/IPv4 VxLAN and GRE GSO")
Cc: stable@dpdk.org
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
2 years agonet/sfc: improve naming in flow tunnel offload support
Ivan Malov [Sun, 15 May 2022 15:28:35 +0000 (18:28 +0300)]
net/sfc: improve naming in flow tunnel offload support

Change ambiguous terms "jump rule" and "group rule" to
clearer "tunnel rule" and "switch rule". The new terms
reflect the purpose of these rules in virtual switches.

The module name, "flow tunnel", is replaced by "FT" in
function names to avoid the use of word "tunnel" twice.

Use term "FT context" when referring to tunnel entries.
Also, add "ctx" suffix to "ft" and "ft_id" occurrences.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoapp/testpmd: fix port status of bonding slave device
Huisong Li [Wed, 11 May 2022 02:14:34 +0000 (10:14 +0800)]
app/testpmd: fix port status of bonding slave device

Starting or stopping a bonded port also starts or stops all active slaves
under the bonded port. If this port is a bonded device, we need to modify
the port status of all slaves.

Fixes: 0e545d3047fe ("app/testpmd: check stopping port is not in bonding")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
2 years agonet/nfp: make sure MTU is never larger than mbuf size
Peng Zhang [Wed, 11 May 2022 01:15:53 +0000 (03:15 +0200)]
net/nfp: make sure MTU is never larger than mbuf size

Setting a MTU larger than mbuf size is not supported by the device but
not prohibited by the driver. This change adds a restriction to the
driver to prevent setting an MTU that is too large.

While at it define the minimum MTU in the device information to describe
the complete supported MTU range.

Fixes: d4a27a3 ("nfp: add basic features")
Cc: stable@dpdk.org
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Walter Heymans <walter.heymans@corigine.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: add protocol based meter input color selection
Jerin Jacob [Sun, 1 May 2022 14:46:37 +0000 (20:16 +0530)]
ethdev: add protocol based meter input color selection

Currently, meter object supports only DSCP based on input color table,
The patch enhance that to support VLAN based input color table,
color table based on inner field for the tunnel use case, and
support for fallback color per meter if packet based on a different field.

All of the above features are exposed through capability and added
additional capability to specify the implementation supports
more than one input color table per ethdev port.

Suggested-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/cxgbe: read firmware configuration file from filesystem
Rahul Lakkireddy [Mon, 16 May 2022 19:34:39 +0000 (01:04 +0530)]
net/cxgbe: read firmware configuration file from filesystem

Add support to read firmware configuration file from
/lib/firmware/cxgb4/ path in the filesystem. The firmware
config file is used to enable or disable NIC features before
firmware initialization to help retrieve better debug data to
analyze firmware init failures. The config file can also
be used to redistribute resources, like queues, TCAMs, etc.,
from disabled physical functions (PFs) to main PF, before
firmware init.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/cxgbe: track packets dropped by TP due to congestion
Rahul Lakkireddy [Fri, 6 May 2022 13:18:46 +0000 (18:48 +0530)]
net/cxgbe: track packets dropped by TP due to congestion

Transport Processor (TP) on the NIC delivers the incoming packets
from the wire to NIC's DMA engine to place the packets in Rx buffers.
TP sends signal towards the Multi-Port Switch (MPS) near the MAC when
the Rxqs run out of Rx buffers posted by driver. These MPS buffer drop
stats are already accounted for in imissed counters. However, if a
large number of Rxqs run out of Rx buffers simultaneously, then the
TP can start dropping packets by itself when there is heavy congestion
on the channel and hence could not inform to the MPS. So, track these
packets dropped by TP in imissed counters. Also add xstats for these
counters.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agoexamples/l3fwd_power: add configuration options
Kevin Laatz [Thu, 2 Jun 2022 15:13:39 +0000 (16:13 +0100)]
examples/l3fwd_power: add configuration options

Add CLI options to l3fwd_power to utilize the new power APIs introduced in
this patchset. These CLI options allow the user to configure the
heuritstics made available through the new API via the l3fwd_power
application options.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agopower: add get/set min/max scaling frequencies API
Kevin Laatz [Thu, 2 Jun 2022 15:13:38 +0000 (16:13 +0100)]
power: add get/set min/max scaling frequencies API

Add new get/set API to allow the user or application to set the minimum
and maximum frequencies to use when scaling.
Previously, the frequency range was determined by the HW capabilities of
the CPU. With this new API, the user or application can constrain this
if required.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
2 years agopower: add get/set pause duration API
Kevin Laatz [Thu, 2 Jun 2022 15:13:37 +0000 (16:13 +0100)]
power: add get/set pause duration API

Add new get/set API for configuring 'pause_duration' which used to adjust
the pause mode callback duration.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
2 years agopower: add get/set empty-poll maximum API
Kevin Laatz [Thu, 2 Jun 2022 15:13:36 +0000 (16:13 +0100)]
power: add get/set empty-poll maximum API

Add new get/set APIs to configure emptypoll max which is used to
determine when a queue can go into sleep state.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Tested-by: David Hunt <david.hunt@intel.com>
2 years agolpm: add scalar version of lookupx4
Michal Mazurek [Wed, 1 Jun 2022 11:15:42 +0000 (13:15 +0200)]
lpm: add scalar version of lookupx4

Add an implementation of the rte_lpm_lookupx4() function for platforms
without support for vector operations.

This will be useful in the upcoming RISC-V port as well as any platform
which may want to start with a basic level of LPM support.

Signed-off-by: Michal Mazurek <maz@semihalf.com>
Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
2 years agolpm: add const to lookup parameter
Stanislaw Kardach [Wed, 1 Jun 2022 11:15:41 +0000 (13:15 +0200)]
lpm: add const to lookup parameter

All other rte_lpm_lookup* functions take lpm argument as a const. As the
basic rte_lpm_lookup() performs the same function, it should also do
that.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agocryptodev: add RSA padding salt length and label
Arek Kusztal [Wed, 1 Jun 2022 09:02:49 +0000 (10:02 +0100)]
cryptodev: add RSA padding salt length and label

- Added salt length and optional label.
Common parameters to PSS and OAEP padding for RSA.
- Changed RSA hash padding fields names.
Now it corresponds to the RSA documents.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: clarify RSA verify with none padding
Arek Kusztal [Wed, 1 Jun 2022 09:02:48 +0000 (10:02 +0100)]
cryptodev: clarify RSA verify with none padding

- Clarified where should output be stored of signature
decryption with padding none.
PMD is not able to know what padding algorithm was used,
therefore decrypted signature should be returned to the user.
- Removed incorrect big-endian constraints.
Not all data in RSA can be treated as big endian integer,
therefore some of the constraints were lifted.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: move RSA padding into separate struct
Arek Kusztal [Wed, 1 Jun 2022 09:02:47 +0000 (10:02 +0100)]
cryptodev: move RSA padding into separate struct

- move RSA padding into separate struct.
More padding members should be added into padding,
therefore having separate struct for padding parameters will
make this more readable.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: clarify usage of RSA padding hash
Arek Kusztal [Wed, 1 Jun 2022 09:02:46 +0000 (10:02 +0100)]
cryptodev: clarify usage of RSA padding hash

- Clarified usage of RSA padding hash.
It was not specified how to use hash for PKCS1_5
padding. This could lead to incorrect implementation.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: add asym operation flags
Arek Kusztal [Wed, 1 Jun 2022 09:02:45 +0000 (10:02 +0100)]
cryptodev: add asym operation flags

- Added flags to rte_crypto_asym_op struct.
It may be shared between different algorithms.
- Added Diffie-Hellman padding flags.
Diffie-Hellman padding is used in certain protocols,
in others, leading zero bytes need to be stripped.
Even same protocol may use a different approach - most
glaring example is TLS1.2 - TLS1.3.
For ease of use, and to avoid additional copy
on certain occasions, driver should be able to return both.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: add public key verify option
Arek Kusztal [Wed, 1 Jun 2022 09:02:44 +0000 (10:02 +0100)]
cryptodev: add public key verify option

- Added key exchange public key verify option.
For some elliptic curves public point in DH exchange
needs to be checked, if it lays on the curve.
Modular exponentiation needs certain checks as well,
though mathematically much easier.
This commit adds verify option to asym_op operations.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: add elliptic curve Diffie-Hellman
Arek Kusztal [Wed, 1 Jun 2022 09:02:43 +0000 (10:02 +0100)]
cryptodev: add elliptic curve Diffie-Hellman

- Added elliptic curve Diffie-Hellman parameters.
Point multiplication allows the user to process every phase of
ECDH, but for phase 1, user should not really care about the generator.
The user does not even need to know what the generator looks like,
therefore setting ec xform would make this work.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: move DH type from xform to DH op
Arek Kusztal [Wed, 1 Jun 2022 09:02:42 +0000 (10:02 +0100)]
cryptodev: move DH type from xform to DH op

- Moved DH operation type to DH operation struct.
Operation type (PUBLIC_KEY_GENERATION, SHARED_SECRET) should
be free to choose for any operation. One xform/session should
be enough to perform both DH operations, if op_type would be xform
member, session would have to be created twice for the same
group. Similar problem would be observed in sessionless case.
Additionally, it will help extend DH to support Elliptic Curves.
- Changed order of Diffie-Hellman operation phases.
Now it corresponds with the order of operations.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: clarify usage of private key in DH
Arek Kusztal [Wed, 1 Jun 2022 09:02:41 +0000 (10:02 +0100)]
cryptodev: clarify usage of private key in DH

- Clarified usage of private key in Diffie-Hellman.
CSRNG capable device should generate private key and then
use it for public key generation.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: remove DSA ephemeral key usage comment
Arek Kusztal [Wed, 1 Jun 2022 09:02:40 +0000 (10:02 +0100)]
cryptodev: remove DSA ephemeral key usage comment

Removed comment that stated DSA can be used with Diffie
Hellman ephemeral key.
DH and DSA integration allowed to use ephemeral keys for
random integer, but not for private keys.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: separate key exchange operation enum
Arek Kusztal [Wed, 1 Jun 2022 09:02:39 +0000 (10:02 +0100)]
cryptodev: separate key exchange operation enum

- Separated key exchange enum from asym op type.
Key exchange and asymmetric crypto operations like signatures,
encryption/decryption should not share same operation enum as
its use cases are unrelated and mutually exclusive.
Therefore op_type was separate into:
1) operation type
2) key exchange operation type

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocryptodev: redefine elliptic curve group enum
Arek Kusztal [Wed, 1 Jun 2022 09:02:38 +0000 (10:02 +0100)]
cryptodev: redefine elliptic curve group enum

- EC enum was renamed to rte_crypto_curve_id.
Elliptic curve enum name was incorrectly associated
with a group (it comes from the current tls registry name).
- Clarified comments about TLS deprecation.
Some curves included are deprecated with TLS 1.3.
Comments to address it were added.
- Clarified FFDH groups usage.
Elliptic curves IDs in TLS are placed in the same registry
as FFDH. Cryptodev does not assign specific groups, and
if specific groups would be assigned by DPDK, it cannot be
TLS SupportedGroups registry, as it would conflict with
other protocols like IPSec.
- Added IANA reference.
Only few selected curves are included in previously
referenced rfc8422. IANA reference is added instead.
- Removed UNKNOWN ec group.
There is no default value, and there is no UNKNOWN
elliptic curve.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoapp/crypto-perf: allow auth generate followed by encryption
Tejasree Kondoj [Tue, 10 May 2022 12:40:45 +0000 (18:10 +0530)]
app/crypto-perf: allow auth generate followed by encryption

Allowing auth generation followed by encryption mode.
--optype auth-then-cipher can take cipher-op as encrypt
and auth-op as generate now.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agobaseband/fpga_5gnr_fec: remove filler from HARQ
Hernan Vargas [Fri, 20 May 2022 03:05:56 +0000 (22:05 -0500)]
baseband/fpga_5gnr_fec: remove filler from HARQ

Removed filler bits from HARQ calculation on the N3000 FPGA since these
are already taken out by the deratematching step.
The change is only an optimization with no functional impact, no change
required on stable branches.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/fpga_5gnr_fec: validate LDPC enc/dec
Hernan Vargas [Fri, 20 May 2022 03:05:55 +0000 (22:05 -0500)]
baseband/fpga_5gnr_fec: validate LDPC enc/dec

Enable functions to validate LDPC encoder and decoder parameters

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/fpga_5gnr_fec: check HARQ input length
Hernan Vargas [Fri, 20 May 2022 03:05:54 +0000 (22:05 -0500)]
baseband/fpga_5gnr_fec: check HARQ input length

Add new case DESC_ERR_HARQ_INPUT_LEN to check for valid HARQ input
length.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/fpga_5gnr_fec: add FPGA mutex
Hernan Vargas [Fri, 20 May 2022 03:05:53 +0000 (22:05 -0500)]
baseband/fpga_5gnr_fec: add FPGA mutex

Explicit FPGA mutex added when using the register interface for HARQ
memory preloading to prevent multiple threads from using the same
interface in parallel.
This featured is implemented through MMIO exposed per VF and common to
all queues.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agobaseband/fpga_5gnr_fec: remove FLR timeout
Hernan Vargas [Fri, 20 May 2022 03:05:52 +0000 (22:05 -0500)]
baseband/fpga_5gnr_fec: remove FLR timeout

FLR timeout register is not used in 5GNR FPGA.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Nicolas Chautru <nicolas.chautru@intel.com>
2 years agodoc: add missing auth algo for IPsec example
Gagandeep Singh [Fri, 20 May 2022 04:21:04 +0000 (09:51 +0530)]
doc: add missing auth algo for IPsec example

Adding the missing SHA256-HMAC authentication algorithm
in ipsec-secgw guide.

Fixes: b5350285ce6e ("examples/ipsec-secgw: support SHA256 HMAC")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: add short MAC-I test vector for ZUC
Gagandeep Singh [Fri, 20 May 2022 04:21:03 +0000 (09:51 +0530)]
test/crypto: add short MAC-I test vector for ZUC

Add a ZUC based short MAC-I test vector.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: support raw buffer API for PDCP
Gagandeep Singh [Fri, 20 May 2022 04:21:02 +0000 (09:51 +0530)]
test/crypto: support raw buffer API for PDCP

This patch supports raw buffer APIs testing for
PDCP test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: fix driver name for DPAA raw API test
Gagandeep Singh [Fri, 20 May 2022 04:21:01 +0000 (09:51 +0530)]
test/crypto: fix driver name for DPAA raw API test

PMD name for DPAA raw buffer crypto driver test cases is
updated with correct name.

Fixes: cd8166c28cd1 ("test/crypto: add raw API test for dpaax")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/l2fwd-crypto: add signal handler for exit
Gagandeep Singh [Fri, 20 May 2022 04:21:00 +0000 (09:51 +0530)]
examples/l2fwd-crypto: add signal handler for exit

Handle SIGINT and SIGTERM signals.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: support XCBC-MAC/DES-CBC
Gagandeep Singh [Fri, 20 May 2022 04:20:59 +0000 (09:50 +0530)]
examples/ipsec-secgw: support XCBC-MAC/DES-CBC

ipsec-secgw application is updated to support
DES-CBC ciphering and XCBC-MAC authentication
based IPsec functionality.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agodoc: add notes for ACVP FIPS validation support
Gowrishankar Muthukrishnan [Mon, 30 May 2022 15:52:44 +0000 (21:22 +0530)]
doc: add notes for ACVP FIPS validation support

Add notes on list of algorithms supported for ACVP FIPS validation.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add parsing for AES-CBC
Gowrishankar Muthukrishnan [Mon, 30 May 2022 15:52:43 +0000 (21:22 +0530)]
examples/fips_validation: add parsing for AES-CBC

Added function to parse algorithm for AES_CBC test.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add parsing for CMAC
Brandon Lo [Mon, 30 May 2022 15:52:42 +0000 (21:22 +0530)]
examples/fips_validation: add parsing for CMAC

Added function to parse algorithm for CMAC test.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: implement JSON CMAC test
Brandon Lo [Mon, 30 May 2022 15:52:41 +0000 (21:22 +0530)]
examples/fips_validation: implement JSON CMAC test

Implemented JSON support for the CMAC test.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add JSON for HMAC
Brandon Lo [Mon, 30 May 2022 15:52:40 +0000 (21:22 +0530)]
examples/fips_validation: add JSON for HMAC

Added JSON support for the HMAC algorithm.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add JSON to GCM test
Brandon Lo [Mon, 30 May 2022 15:52:39 +0000 (21:22 +0530)]
examples/fips_validation: add JSON to GCM test

Added JSON-specific testing and writeback functions which allows
the user to test AES-GCM vector sets.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: allow JSON file as input
Brandon Lo [Mon, 30 May 2022 15:52:38 +0000 (21:22 +0530)]
examples/fips_validation: allow JSON file as input

Added the ability to use the JSON format as the input
and output of the example application.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add JSON parsing
Brandon Lo [Mon, 30 May 2022 15:52:37 +0000 (21:22 +0530)]
examples/fips_validation: add JSON parsing

Added functions to parse the required information from a vector set
given in the new JSON format.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add JSON info to header
Brandon Lo [Mon, 30 May 2022 15:52:36 +0000 (21:22 +0530)]
examples/fips_validation: add JSON info to header

Added JSON-specific functions and other information needed to
test the new FIPS test vectors.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agoexamples/fips_validation: add jansson dependency
Brandon Lo [Mon, 30 May 2022 15:52:35 +0000 (21:22 +0530)]
examples/fips_validation: add jansson dependency

Added a check for RTE_HAS_JANSSON into the meson
configuration file for JSON support.

Signed-off-by: Brandon Lo <blo@iol.unh.edu>
Acked-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Tested-by: Jakub Poczatek <jakub.poczatek@intel.com>
2 years agocrypto/qat: add secp384r1 curve
Arek Kusztal [Fri, 22 Apr 2022 09:33:55 +0000 (10:33 +0100)]
crypto/qat: add secp384r1 curve

This commit adds secp384r1 (P-384) elliptic
curve to Intel QuickAssist Technology crypto PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agocrypto/qat: refactor asym algorithm macros and logs
Arek Kusztal [Fri, 22 Apr 2022 09:33:54 +0000 (10:33 +0100)]
crypto/qat: refactor asym algorithm macros and logs

This commit unifies macros for asymmetric parameters,
therefore making code easier to maintain.
It additionally changes some of PMD output logs that
right now can only be seen in debug mode.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agocrypto/qat: enable asymmetric crypto on GEN4 device
Arek Kusztal [Thu, 7 Apr 2022 09:47:14 +0000 (10:47 +0100)]
crypto/qat: enable asymmetric crypto on GEN4 device

This commit enables asymmetric crypto in generation four
devices (4xxx).

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2 years agocrypto/qat: fix offset and length assignment
Kai Ji [Wed, 6 Apr 2022 13:45:27 +0000 (21:45 +0800)]
crypto/qat: fix offset and length assignment

This patch fix the cipher & auth offset and length values when convert
mbuf to vector chain for QAT build op.

Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request")
Cc: stable@dpdk.org
Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2 years agodrivers/crypto: fix warnings for OpenSSL version
Heinrich Schuchardt [Tue, 10 May 2022 15:06:35 +0000 (17:06 +0200)]
drivers/crypto: fix warnings for OpenSSL version

The API of the OpenSSL library has changed with version 3.0. This results
in a lot of compiler warnings like

    ../dpdk/drivers/crypto/ccp/ccp_crypto.c:182:9:
    warning: ‘SHA256_Transform’ is deprecated:
    Since OpenSSL 3.0 [-Wdeprecated-declarations]

As many Linux distributions still use elder OpenSSL libraries we cannot
change the used API now. Instead define OPENSSL_API_COMPAT to indicate
that we are using the OpenSSL 1.1.0 API.

OPENSSL_API_COMPAT is introduced in *.c files and not in *.h files as some
*.c files directly include OpenSSL headers.

Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2 years agocrypto/ipsec_mb: support ChaChaPoly SGL to aesni_mb
Ciara Power [Wed, 11 May 2022 12:30:45 +0000 (12:30 +0000)]
crypto/ipsec_mb: support ChaChaPoly SGL to aesni_mb

Add SGL support for chacha20_poly1305 algorithm through JOB API.

Supports IN-PLACE SGL, OOP SGL IN and LB OUT,
and OOP SGL IN and SGL OUT.

Feature flags not added, as the PMD does not support SGL for all
other algorithms.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2 years agocrypto/ipsec_mb: support GCM SGL to aesni_mb
Ciara Power [Wed, 11 May 2022 12:30:44 +0000 (12:30 +0000)]
crypto/ipsec_mb: support GCM SGL to aesni_mb

Add SGL support for GCM algorithm through JOB API.

This change supports IN-PLACE SGL, OOP SGL IN and LB OUT,
and OOP SGL IN and SGL OUT.

Feature flags are not added, as the PMD does not yet support SGL for
all other algorithms.
If an SGL op for an unsupported algorithm is being processed,
a NULL job is submitted instead.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2 years agotest/security: add inline IPsec IPv6 flow label cases
Vamsi Attunuru [Tue, 24 May 2022 07:22:16 +0000 (12:52 +0530)]
test/security: add inline IPsec IPv6 flow label cases

Patch adds unit tests for IPv6 flow label set & copy
operations.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/security: add ESN and anti-replay for inline IPsec
Akhil Goyal [Tue, 24 May 2022 07:22:15 +0000 (12:52 +0530)]
test/security: add ESN and anti-replay for inline IPsec

Added cases to test anti replay for inline IPsec processing
with and without extended sequence number support.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/security: add more inline IPsec functional cases
Akhil Goyal [Tue, 24 May 2022 07:22:14 +0000 (12:52 +0530)]
test/security: add more inline IPsec functional cases

Added more inline IPsec functional verification cases.
These cases do not have known vectors but are verified
using encap + decap test for all the algo combinations.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/security: add inline IPsec reassembly cases
Akhil Goyal [Tue, 24 May 2022 07:22:13 +0000 (12:52 +0530)]
test/security: add inline IPsec reassembly cases

Added unit test cases for IP reassembly of inline IPsec
inbound scenarios.
In these cases, known test vectors of fragments are first
processed for inline outbound processing and then received
back on loopback interface for inbound processing along with
IP reassembly of the corresponding decrypted packets.
The resultant plain text reassembled packet is compared with
original unfragmented packet.

In this patch, cases are added for 2/4/5 fragments for both
IPv4 and IPv6 packets. A few negative test cases are also added
like incomplete fragments, out of place fragments, duplicate
fragments.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/security: add combined mode inline IPsec cases
Akhil Goyal [Tue, 24 May 2022 07:22:12 +0000 (12:52 +0530)]
test/security: add combined mode inline IPsec cases

Added combined encap and decap test cases for various algorithm
combinations

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/security: add inline inbound IPsec cases
Akhil Goyal [Tue, 24 May 2022 07:22:11 +0000 (12:52 +0530)]
test/security: add inline inbound IPsec cases

Added test cases for inline Inbound protocol offload
verification with known test vectors from Lookaside mode.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/security: add cases for inline IPsec offload
Akhil Goyal [Tue, 24 May 2022 07:22:10 +0000 (12:52 +0530)]
test/security: add cases for inline IPsec offload

A new test suite is added in test app to test inline IPsec protocol
offload. In this patch, predefined vectors from Lookaside IPsec test
are used to verify the IPsec functionality without the need of
external traffic generators. The sent packet is loopbacked onto the same
interface which is received and matched with the expected output.
The test suite can be updated further with other functional test cases.
In this patch encap only cases are added.
The testsuite can be run using:
RTE> inline_ipsec_autotest

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agoapp/eventdev: support asym ops for crypto adapter
Akhil Goyal [Thu, 12 May 2022 12:45:27 +0000 (18:15 +0530)]
app/eventdev: support asym ops for crypto adapter

Test eventdev app is updated to add new option for asymmetric
crypto ops for event crypto adapter.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/event: add asymmetric cases for crypto adapter
Akhil Goyal [Thu, 12 May 2022 12:45:26 +0000 (18:15 +0530)]
test/event: add asymmetric cases for crypto adapter

Test app is updated to add cases for asymmetric crypto
sessions for event crypto adapter.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agoeventdev: use new API to get event crypto metadata
Akhil Goyal [Thu, 12 May 2022 12:45:25 +0000 (18:15 +0530)]
eventdev: use new API to get event crypto metadata

For getting event crypto metadata from crypto_op,
the new API rte_cryptodev_get_session_event_mdata is used
instead of getting userdata inside PMD.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/event: use new API to set event crypto metadata
Akhil Goyal [Thu, 12 May 2022 12:45:24 +0000 (18:15 +0530)]
test/event: use new API to set event crypto metadata

Used the new API rte_cryptodev_set_session_event_mdata to set
event crypto metadata from the applications (app/test and
app/test-eventdev) instead of using session userdata.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/octeontx: use new API for event metadata
Akhil Goyal [Thu, 12 May 2022 12:45:23 +0000 (18:15 +0530)]
crypto/octeontx: use new API for event metadata

For getting event crypto metadata from crypto_op,
the new API rte_cryptodev_get_session_event_mdata can be used
directly instead of getting userdata inside PMD.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: add event metadata set operation
Volodymyr Fialko [Thu, 12 May 2022 12:45:22 +0000 (18:15 +0530)]
crypto/cnxk: add event metadata set operation

Added cryptodev operation for setting event crypto
metadata for all supported sessions - sym/asym/security.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocryptodev: add API to get/set event metadata
Volodymyr Fialko [Thu, 12 May 2022 12:45:21 +0000 (18:15 +0530)]
cryptodev: add API to get/set event metadata

Currently, crypto session userdata is used to set event crypto
metadata from the application and the driver is dereferencing it
in driver which is not correct. User data is meant to be opaque
to the driver.
To support this, new API is added to get and set event crypto
metadata. The new API, rte_cryptodev_set_session_event_mdata,
allows setting event metadata in session private data which is
filled inside PMD using a new cryptodev op. This operation
can be performed on any of the PMD supported sessions
(sym/asym/security).
For SW abstraction of event crypto adapter to be used by
eventdev library, a new field is added in asymmetric crypto
session for now and for symmetric case, current implementation
of using userdata is used. Symmetric cases cannot be fixed now,
as it will be ABI breakage which will be resolved in DPDK 22.11.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agotest/crypto: fix null check for ZUC authentication
Ciara Power [Wed, 11 May 2022 13:29:24 +0000 (13:29 +0000)]
test/crypto: fix null check for ZUC authentication

Check if the returned op is NULL because of failure,
before using it and causing a segmentation fault.

Fixes: 4c99481f49c4 ("app/test: add ZUC")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2 years agocrypto/cnxk: enable 3DES-CBC secure capability
Vamsi Attunuru [Mon, 2 May 2022 08:20:58 +0000 (13:50 +0530)]
crypto/cnxk: enable 3DES-CBC secure capability

Patch enables 3DES-CBC secure capability of crypto device.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/mlx5: support plain text keys
Raja Zidane [Sun, 1 May 2022 12:13:11 +0000 (15:13 +0300)]
crypto/mlx5: support plain text keys

Using crypto devs requires the user to log in and the supplied DEK to be
encrypted with a KEK (keys encryption key).
KEK is burned once on the nic, along with credentials for users,
and for a user to log in, he is needed to supply his creds wrapped with
the KEK.
A device comes out of the Mellanox factory with a pre-defined import
method for each algorithm. The defined method could be wrapped
mode, so the device can be used as described above, or
plaintext mode, without the need to log in and wrap supplied DEKs.

Support crypto operations with the plaintext import method.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoexamples/ipsec-secgw: fix promiscuous mode option
Nithin Dabilpuram [Thu, 28 Apr 2022 15:18:30 +0000 (20:48 +0530)]
examples/ipsec-secgw: fix promiscuous mode option

Currently default value of promiscuous mode flag is true and
even there is command line argument to set it to true.
So it never is in non-promiscuous mode. Fix it by
changing default value to false.

Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: create lookaside sessions at init
Volodymyr Fialko [Wed, 27 Apr 2022 09:20:20 +0000 (11:20 +0200)]
examples/ipsec-secgw: create lookaside sessions at init

In event lookaside mode same session could be handled with multiple
cores, and session creation in datapath will cause situation where
multiple cores will try to create same session simultaneously.
To avoid such case and enable event lookaside mode in future, lookaside
sessions are now created at initialization in sa_add_rules().

All sessions(inline and lookaside) now created during init process, so
session pool information was removed from ipsec context. Core id was
added to obtain correct crypto device queue pair for the current core.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: destroy lookaside sessions
Volodymyr Fialko [Mon, 28 Mar 2022 10:50:47 +0000 (12:50 +0200)]
examples/ipsec-secgw: destroy lookaside sessions

Lookaside mode also creates security and crypto sessions that needs to
be destroyed after they are no longer used.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: fix uninitialized memory access
Volodymyr Fialko [Fri, 25 Mar 2022 11:29:42 +0000 (12:29 +0100)]
examples/ipsec-secgw: fix uninitialized memory access

rte_flow_validate and rte_flow_create not always initialize flow error.
Using error.message in some error cases will cause read from
uninitialized memory.

Fixes: 6738c0a9569 ("examples/ipsec-secgw: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: add poll mode worker for inline proto
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:16 +0000 (02:14 +0530)]
examples/ipsec-secgw: add poll mode worker for inline proto

Add separate worker thread when all SA's are of type
inline protocol offload and librte_ipsec is enabled
in order to make it more optimal for that case.
Current default worker supports all kinds of SA leading
to doing lot of per-packet checks and branching based on
SA type which can be of 5 types of SA's.

Also make a provision for choosing different poll mode workers
for different combinations of SA types with default being
existing poll mode worker that supports all kinds of SA's.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: update eth header during route lookup
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:15 +0000 (02:14 +0530)]
examples/ipsec-secgw: update eth header during route lookup

Update ethernet header during route lookup instead of doing
way later while performing Tx burst. Advantages to doing
is at route lookup is that no additional IP version checks
based on packet data are needed and packet data is already
in cache as route lookup is already consuming that data.

This is also useful for inline protocol offload cases
of v4inv6 or v6inv4 outbound tunnel operations as
packet data will not have any info about what is the tunnel
protocol.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: get security context from lcore conf
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:14 +0000 (02:14 +0530)]
examples/ipsec-secgw: get security context from lcore conf

Store security context pointer in lcore Rx queue config and
get it from there in fast path for better performance.
Currently rte_eth_dev_get_sec_ctx() which is meant to be control
path API is called per packet basis. For every call to that
API, ethdev port status is checked.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: allow larger burst size for vectors
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:13 +0000 (02:14 +0530)]
examples/ipsec-secgw: allow larger burst size for vectors

Allow larger burst size of vector event mode instead of restricting
to 32. Also restructure traffic type struct to have num pkts first
so that it is always in first cacheline. Also cache align
traffic type struct. Since MAX_PKT_BURST is not used by
vector event mode worker, define another macro for its burst
size so that poll mode perf is not effected.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: use HW parsed packet type in poll mode
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:12 +0000 (02:14 +0530)]
examples/ipsec-secgw: use HW parsed packet type in poll mode

Use HW parsed packet type when ethdev supports necessary protocols.
If packet type is not supported, then register ethdev callbacks
for parse packet in SW. This is better for performance as it
effects fast path.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoexamples/ipsec-secgw: disable Tx checksum for inline
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:11 +0000 (02:14 +0530)]
examples/ipsec-secgw: disable Tx checksum for inline

Enable Tx IPv4 checksum offload only when Tx inline crypto, lookaside
crypto/protocol or cpu crypto is needed.
For Tx Inline protocol offload, checksum computation
is implicitly taken care by HW.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
2 years agoexamples/ipsec-secgw: move fast path helper functions
Nithin Dabilpuram [Fri, 29 Apr 2022 20:44:10 +0000 (02:14 +0530)]
examples/ipsec-secgw: move fast path helper functions

Move fast path helper functions to header file for easy access.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoconfig/arm: disable SVE ACLE for CN10K
Rahul Bhansali [Thu, 19 May 2022 13:28:30 +0000 (18:58 +0530)]
config/arm: disable SVE ACLE for CN10K

This disable the sve_acle flag for cn10k.

For native build, -Dplatform=cn10k will require to
get sve_acle flag parameter in the build.

Performance impact:-
With l3fwd example, lpm lookup performance increased
by ~21% if Neon is used instead of SVE. Hence, disabled
sve_acle flag for cn10k.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoconfig/arm: add SVE ACLE control flag
Rahul Bhansali [Thu, 19 May 2022 13:28:29 +0000 (18:58 +0530)]
config/arm: add SVE ACLE control flag

An additional check of control flag sve_acle for
RTE_HAS_SVE_ACLE macro to be part of the build.
If any SoC config doesn't have sve_acle flag parameter
then default it will be considered as true.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoconfig/arm: add ThunderX T83
Harman Kalra [Mon, 23 May 2022 13:34:29 +0000 (19:04 +0530)]
config/arm: add ThunderX T83

Adding support for Marvell ThunderX T83 platform.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agocommon/cnxk: support CNF950_A0
Tomasz Duszynski [Tue, 19 Apr 2022 08:25:47 +0000 (10:25 +0200)]
common/cnxk: support CNF950_A0

Add PCI IDs which match CNF95O_A0 SoC.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
2 years agocommon/cnxk: support CN103XX platform
Rahul Bhansali [Mon, 2 May 2022 11:31:11 +0000 (17:01 +0530)]
common/cnxk: support CN103XX platform

Added support for CN103XX (cn10kb) platform.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agoeal/ppc: undefine AltiVec keyword vector
Thomas Monjalon [Wed, 25 May 2022 09:53:07 +0000 (11:53 +0200)]
eal/ppc: undefine AltiVec keyword vector

The AltiVec header file is defining "vector", except in C++ build.
The keyword "vector" may conflict easily.
As a rule, it is better to use the alternative keyword "__vector".

The DPDK header file rte_altivec.h takes care of undefining "vector",
so the applications and dependencies are free to define the name "vector".

This is a compatibility breakage for applications which were using
the keyword "vector" for its AltiVec meaning.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>