dpdk.git
4 years agoexamples: remove extra new line after link duplex
Ivan Dyukov [Thu, 7 May 2020 18:26:02 +0000 (21:26 +0300)]
examples: remove extra new line after link duplex

This patch removes extra 'new line' in few app examples.

Fixes: d3641ae863 ("examples: update link status checks")
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Fixes: 4ff457986f ("examples/l2fwd-event: add default poll mode routines")
Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")
Fixes: 204896f8d6 ("examples/l2fwd-jobstats: add new example")
Fixes: c8e6ceeceb ("examples/ioat: add new sample app for ioat driver")
Fixes: cc8f4d020c ("examples/ip_reassembly: initial import")
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Fixes: 39aad0e88c ("examples/flow_distributor: new example to demonstrate EFD")
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Fixes: 20c78ac9ee ("examples/vm_power_mgr: add port initialisation")
Fixes: 361b2e9559 ("acl: new sample l3fwd-acl")
Fixes: de3cfa2c98 ("sched: initial import")
Fixes: d7937e2e3d ("power: initial import")
Fixes: 3fc5ca2f63 ("kni: initial import")
Cc: stable@dpdk.org
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
4 years agoapp: remove extra new line after link duplex
Ivan Dyukov [Thu, 7 May 2020 18:26:01 +0000 (21:26 +0300)]
app: remove extra new line after link duplex

This is testpmd part of new line cleanup.

Fixes: 002ade70e9 ("app/test: measure cycles per packet in Rx/Tx")
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")
Cc: stable@dpdk.org
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/virtio: fix AVX512 datapath selection
Maxime Coquelin [Mon, 11 May 2020 14:47:20 +0000 (16:47 +0200)]
net/virtio: fix AVX512 datapath selection

The AVX512 packed ring datapath selection was only done
at build time, but it should also be checked at runtime
that the CPU supports it.

This patch add a CPU flags check so that non-vectorized
path is selected at runtime if AVX512 is not supported.

Also in meson build enable vectorization only for relevant file, not for
all driver.

Fixes: ccb10995c2ad ("net/virtio: add election for vectorized path")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/hinic/base: support IPv6 flow rules
Xiaoyun Wang [Sat, 9 May 2020 04:04:16 +0000 (12:04 +0800)]
net/hinic/base: support IPv6 flow rules

The patch supports ipv6 flow rules for BGP or ICMP packets.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: fail initialization for not supported device
Xiaoyun Wang [Sat, 9 May 2020 04:04:15 +0000 (12:04 +0800)]
net/hinic: fail initialization for not supported device

If hardware mode for this card does not support nic,
the network features for this card will not be supported
and driver will be initialized failed.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: set jumbo frame offload flag
Xiaoyun Wang [Sat, 9 May 2020 04:04:14 +0000 (12:04 +0800)]
net/hinic: set jumbo frame offload flag

The patch adds DEV_RX_OFFLOAD_JUMBO_FRAME flag for jumbo when set mtu.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/mlx5: support match on GTP flags
Dekel Peled [Wed, 6 May 2020 17:13:38 +0000 (20:13 +0300)]
net/mlx5: support match on GTP flags

This patch adds to MLX5 PMD the support of matching on
GTP header item v_pt_rsv_flags.

This item is contained in 1 byte of the format:
-------------------------------------------
| bit   | 0 - 2   | 3  | 4   | 5 | 6 | 7  |
|-----------------------------------------|
| value | Version | PT | Res | E | S | PN |
-------------------------------------------

Matching is supported only for GTP flags E, S, PN.
Therefore values 0 to 7 are supported.

Mask must be set accordingly:
... gtp v_pt_rsv_flags is 1 v_pt_rsv_flags mask 0x07 ...

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix Tx queue release debug log timing
Alexander Kozyrev [Wed, 6 May 2020 18:10:59 +0000 (18:10 +0000)]
net/mlx5: fix Tx queue release debug log timing

Program received signal SIGSEGV, Segmentation fault.
0x00000000008ef7c4 in mlx5_tx_queue_release (dpdk_txq=0x17ce01680) at
drivers/net/mlx5/mlx5_txq.c:302
301 mlx5_txq_release(ETH_DEV(priv), i);
302 DRV_LOG(DEBUG, "port %u removing Tx queue %u from list",
303         PORT_ID(priv), txq->idx);
The problem is txq is freed inside the mlx5_txq_release() function
and no longer valid in the debug log right after this invocation.
Move the debug log before the mlx5_txq_release() function to fix this.

Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx4: fix drop queue error handling
Michael Baum [Wed, 6 May 2020 16:27:54 +0000 (16:27 +0000)]
net/mlx4: fix drop queue error handling

The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
if needed allocates by rte_malloc.

If the allocation is failed the function goes to label “error”, and
there does dereference to a null pointer.

Skip resources cleaning when the memory allocation is failed.

Coverity issue: 146206
Coverity issue: 146146
Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix meter color register consideration
Michael Baum [Wed, 6 May 2020 16:24:06 +0000 (16:24 +0000)]
net/mlx5: fix meter color register consideration

The mlx5_flow_get_reg_id() function translates tag ID to register
from the registers that are supported and available for use. The
user does not know which register is available at a time and therefore
there is an array that represents mapping to the available registers.
Usually the free registers are continuous in the flow_mreg_c array but
sometimes the mtr_color_reg register is between them and it must be
skipped and the next register returned, in which case the function
returns the mapping of the next entity in the array.

When the function reads from the next entity in the array, it does not
check whether such an entity exists and in some situation invalid access
to memory occurs beyond the array boundaries.

So, when all the registers are valid from HW perspective and the meter
color register is not the default, the tag id 5 causes an out of bound
access.

Validate registers availability when meter color register is not the
default.

Coverity issue: 146355
Fixes: 792e749e92d5 ("net/mlx5: fix register usage in meter")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix matching for UDP tunnels with Verbs
Raslan Darawsheh [Wed, 6 May 2020 06:57:56 +0000 (09:57 +0300)]
net/mlx5: fix matching for UDP tunnels with Verbs

When creating flow rule with zero specs it will cause
matching all UDP packets like following:
 eth / ipv4 / udp / vxlan / end
Such rule will match all udp packets.

This change the behavior to match the dv flow engine
which will automatically set the match on relative
outer UDP port if the user didn't specify any.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix match on empty VLAN item in DV mode
Dekel Peled [Tue, 5 May 2020 12:57:54 +0000 (15:57 +0300)]
net/mlx5: fix match on empty VLAN item in DV mode

In existing implementation, using wild card VLAN item is not allowed.
A VLAN item in flow pattern must include VLAN ID (vid) value.
This obligation contradict the flow API specification [1].

This patch updates the VLAN item validation and translation, to allow
wild card VLAN item, without VLAN ID value.
User guide and release notes are updated accordingly.

[1]
commit 40513808b165 ("doc: refine ethernet and VLAN flow rule items")

Fixes: 00f75a40576b ("net/mlx5: fix VLAN match for DV mode")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agodoc: remove Intel PMD examples in flow bifurcation guide
Xiaolong Ye [Fri, 8 May 2020 08:48:23 +0000 (16:48 +0800)]
doc: remove Intel PMD examples in flow bifurcation guide

Now this feature is no longer supported by kernel side, (i40e kernel
driver doesn't support it from v2.3.2 and ixgbe kernel driver isn't
guaranteed to support this feature as well in the future), so remove the
Intel PMD examples to avoid confusion.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ring: fix device pointer on allocation
Gaetan Rivet [Wed, 6 May 2020 18:09:49 +0000 (20:09 +0200)]
net/ring: fix device pointer on allocation

When a net_ring device is allocated, its device pointer is not set
before calling rte_eth_dev_probing_finish, which is incorrect.

The following:
  commit 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
  commit a6992e961050 ("net/ring: set ethernet device field")

already fixed the same issue in 17.08, which was fine at the time.
Adding the hook rte_eth_dev_probing_finish() however created this bug,
as the eth_dev exposed when this hook is executed is expected to be
complete.

Remove the prior attempts to fix the issue in rte_pmd_ring_probe() and
write the pointer properly in do_eth_dev_ring_create().

Fixes: fbe90cdd776c ("ethdev: add probing finish function")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <grive@u256.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/tap: fix build for glibc < 2.24
Raslan Darawsheh [Sun, 10 May 2020 12:23:47 +0000 (15:23 +0300)]
net/tap: fix build for glibc < 2.24

When trying to compile with glibc < 2.24 that doesn't
support SOL_NETLINK it will cause compilation failure:

drivers/net/tap/tap_netlink.c:70:17: error:
 'SOL_NETLINK' undeclared (first use in this function)
  setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one));

The glibc commits adds the SOL_NETLINK support:
https://github.com/bminor/glibc/commit/f9b437d5efce93800b51ad2a437c8b1c9

Fixes: 647909bcf34b ("net/tap: use netlink extended ack support")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/octeontx2: fix minimum length to SMQ config
Sunil Kumar Kori [Mon, 11 May 2020 06:21:56 +0000 (11:51 +0530)]
net/octeontx2: fix minimum length to SMQ config

NIX exposes NIX_AF_SMQ(0..511)_CFG to configure minimum length
of the packet which is being used for zero padding if packet is
less than configured value.

Setting it to default minimum length i.e. 60 bytes.

Fixes: ec8ddd4fb1be ("net/octeontx2: restructure TM helper functions")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agocommon/octeontx2: upgrade mbox definition to version 7
Jerin Jacob [Thu, 7 May 2020 08:58:07 +0000 (14:28 +0530)]
common/octeontx2: upgrade mbox definition to version 7

Upgrade mailbox definitions to version 0x0007 of kernel AF driver.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/bnx2x: add Rx descriptor MTU segment limitation
Rasesh Mody [Tue, 5 May 2020 03:08:12 +0000 (20:08 -0700)]
net/bnx2x: add Rx descriptor MTU segment limitation

Add Rx descriptor limit for number of segments per MTU.
PMD doesn't support Jumbo Rx scatter gather hence set 1 segment per
MTU. Some applications can adjust mbuf_size based on this value.
For others PMD detects the condition where Rx packet length cannot
be held by configured mbuf size and logs the message.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
4 years agonet/ice: fix variable initialization
Qi Zhang [Wed, 6 May 2020 10:43:15 +0000 (18:43 +0800)]
net/ice: fix variable initialization

Fix coverity defect due to uninitialized scalar variable.

Coverity issue: 357763
Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/igc: remove useless log
Alvin Zhang [Thu, 7 May 2020 09:36:36 +0000 (17:36 +0800)]
net/igc: remove useless log

Some log will always be printed when the device is initialized
and shut down, which will mislead users and should be removed.

Fixes: 746664d546fb ("net/igc: support flow API")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix PPPoE-IPv6 dummy packet
Wei Zhao [Thu, 7 May 2020 01:15:41 +0000 (09:15 +0800)]
net/ice/base: fix PPPoE-IPv6 dummy packet

The dummy packet for pppoe-ipv6 has an error, we should
use 0x3b for next header in ipv6 header in the dummy packet,
or some case can not be download, such as:

"eth / pppoes seid is 3 / pppoe_proto_id is 0x0057 /
end actions vf id 1 / end"

Fixes: 55d61fb27a5e ("net/ice/base: add PPPoE IPv6 dummy packet")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Nannan Lu <nannan.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix flow API error logs
Jeff Guo [Fri, 8 May 2020 20:58:30 +0000 (16:58 -0400)]
net/iavf: fix flow API error logs

When processing a rte flow, such as creating a parse engine, or
creating or destroying a RSS rule, if they are failed, they all
need to construct the flow error structure before return the error
message back to app. If not so, it will cause app crash when
app printing the message out of a flow error.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix link state timing on fiber ports
Phil Yang [Fri, 8 May 2020 10:28:27 +0000 (18:28 +0800)]
net/ixgbe: fix link state timing on fiber ports

In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
to ixgbe_dev_setup_link_thread_handler() is scheduled which should
try to set up the link and clear the flag afterwards. This flag works
as a guard variable between threads.

To avoid potential race condition between threads, set the
IXGBE_FLAG_NEED_LINK_CONFIG flag only when there is no link thread
running.

Bugzilla ID: 388
Fixes: 819d0d1d57f1 ("net/ixgbe: fix blocking system events")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/iavf: fix input set for RSS hash
Jeff Guo [Sat, 9 May 2020 19:29:34 +0000 (15:29 -0400)]
net/iavf: fix input set for RSS hash

Since some specific RSS hash type need to combine with the protocol
hash type when configure a RSS hash rule, so add the corresponding
input set to support these case for iavf hash.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/dpaa2: support additional link speeds
Hemant Agrawal [Fri, 8 May 2020 13:02:11 +0000 (18:32 +0530)]
net/dpaa2: support additional link speeds

This patch adds the support for additional link speed
supported by LX2160A platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: fix size of qman fq descriptor
Hemant Agrawal [Fri, 8 May 2020 13:02:10 +0000 (18:32 +0530)]
bus/fslmc: fix size of qman fq descriptor

Correct the qman_fq_desc as per the HW defined size

Fixes: 6fef517e17cf ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: fix congestion ID for multiple traffic classes
Jun Yang [Fri, 8 May 2020 13:02:09 +0000 (18:32 +0530)]
net/dpaa2: fix congestion ID for multiple traffic classes

When using a single TC, flow id is same as congestion group id.
However in case of multiple traffic classes, same flow id values
are used within each traffic class, which causes incorrect
traffic behavior e.g. halting of traffic.
This patches changes to use the cgid as the index which works
for single as well as multiple traffic classes.

Fixes: 13b856ac02a8 ("net/dpaa2: support taildrop on frame count basis")
Cc: stable@dpdk.org
Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: reduce logs in Rx queue count
Hemant Agrawal [Fri, 8 May 2020 13:02:08 +0000 (18:32 +0530)]
net/dpaa2: reduce logs in Rx queue count

Changing them to DP as it is impacting l3fwd-power apps

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support UDP destination port based muxing
Nipun Gupta [Fri, 8 May 2020 13:02:07 +0000 (18:32 +0530)]
net/dpaa2: support UDP destination port based muxing

This change adds DPDMUX support to bifurcate traffic on
the basis of UDP destination port.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agodrivers: enhance DPAA2 portal allocation error logs
Nipun Gupta [Fri, 8 May 2020 13:02:06 +0000 (18:32 +0530)]
drivers: enhance DPAA2 portal allocation error logs

Update the portal allocation failure log to print the thread id
as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: add default Rx/Tx configuration
Hemant Agrawal [Fri, 8 May 2020 13:02:05 +0000 (18:32 +0530)]
net/dpaa2: add default Rx/Tx configuration

This patch adds default/preferred rx/tx params in dev info,
specially the advertised burst size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: do not prefetch annotation for physical mode
Nipun Gupta [Fri, 8 May 2020 13:02:04 +0000 (18:32 +0530)]
net/dpaa2: do not prefetch annotation for physical mode

When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: fix 10G port negotiation
Rohit Raj [Fri, 8 May 2020 13:02:03 +0000 (18:32 +0530)]
net/dpaa2: fix 10G port negotiation

Fixed 10G port negotiation issue with another 10G/non 10G port.

When running testpmd with 10G interfaces on 10BaseT interface
on LS2088ARDB, the ports were showing link as down.

This was identified to be caused by the setting of link as down
during config.
Also, the line rate was not being updated in device link params,
thus having the incorrect link speed in status (as 0).

Fixes: c5acbb5ea20e ("net/dpaa2: support link status event")
Cc: stable@dpdk.org
Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: fix dereferencing null pointer
Apeksha Gupta [Fri, 8 May 2020 13:02:02 +0000 (18:32 +0530)]
bus/fslmc: fix dereferencing null pointer

Fixes: 6fef517e17cf ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org
Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agoapp/testpmd: fix memory failure handling for i40e DDP
Kalesh AP [Fri, 8 May 2020 04:50:24 +0000 (10:20 +0530)]
app/testpmd: fix memory failure handling for i40e DDP

In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed
even after the memory allocation for "p_list" fails.

With this patch, this null pointer dereference is avoided as we
return when there is malloc failure.

Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/ice/base: fix flow director rule completion report
Simei Su [Fri, 8 May 2020 01:36:50 +0000 (09:36 +0800)]
net/ice/base: fix flow director rule completion report

IAVF FDIR needs to check program status from FD completion descriptors
for both successful and failed case, rather than only ask for completion
on error. This patch corrects completion report value so that the called
can determine whether to report completion on error or other cases.

Fixes: 55daca4e45fc ("net/ice/base: change function to static")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bnxt: fix FW version query
Ajit Khaparde [Thu, 7 May 2020 05:43:28 +0000 (22:43 -0700)]
net/bnxt: fix FW version query

bnxt_fw_version_get is not indicating the complete FW version.
Fix it to indicate complete version string.

Fixes: e2652b0a20a0 ("net/bnxt: support get FW version")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix uninitialized variable
Ajit Khaparde [Thu, 30 Apr 2020 04:11:51 +0000 (21:11 -0700)]
net/bnxt: fix uninitialized variable

Fix uninitialized variable error reported by coverity.

Coverity issue: 357771
Fixes: 69c410b8448d ("net/bnxt: support EM/EEM")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
4 years agonet/bnxt: fix overrun of ULP device params array
Kishore Padmanabha [Thu, 30 Apr 2020 21:42:12 +0000 (17:42 -0400)]
net/bnxt: fix overrun of ULP device params array

Fix a buffer overrun issue spotted by coverity while accessing
the array ulp_device_params.
Note that the issue was observed in an internal Coverity scan.

Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/virtio: fix 32-bit build with clang 6
Marvin Liu [Wed, 6 May 2020 06:47:37 +0000 (14:47 +0800)]
net/virtio: fix 32-bit build with clang 6

Clang 6.0.0 will undefine function _mm512_maskz_set1_epi64 on i686
target. Fix it by replacing the function with _mm512_set4_epi64 when
doing 32-bit build.

Warning message during build:
../drivers/net/virtio/virtio_rxtx_packed_avx.c:385:19: warning:
implicit declaration of function '_mm512_maskz_set1_epi64' is invalid
in C99 [-Wimplicit-function-declaration]

Fixes: 77d66da83834 ("net/virtio: add vectorized packed ring Rx")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: fix crash when device reconnecting
Marvin Liu [Wed, 6 May 2020 15:07:24 +0000 (23:07 +0800)]
net/virtio: fix crash when device reconnecting

When doing virtio device initialization, virtqueues will be reset in
server mode if ring type is packed. It will cause issue because queues
have been freed in the beginning of device initialization.

Fix this issue by checking whether device has been initialized before
reset. If device hasn't been initialized, there's no need to reset
queues.

Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agodoc: refine ethernet and VLAN flow rule items
Dekel Peled [Sun, 3 May 2020 07:17:22 +0000 (10:17 +0300)]
doc: refine ethernet and VLAN flow rule items

Specified pattern may be translated in different manner.
For example the pattern "eth / ipv4" can be translated to match
untagged packets only, since the pattern doesn't specify a VLAN item.
It can also be translated to match both tagged and untagged packets,
for the same reason.
This patch updates the rte_flow documentation to clearly specify the
required pattern to use.
For example:
To match tagged ipv4 packets, the pattern "eth / vlan / ipv4 / end"
should be used.
To match untagged ipv4 packets, the pattern "eth / ipv4 / end"
should be used.
To match all IPV4 packets, both tagged and untagged, need to apply
two rules with the patterns above.
To match both tagged and untagged packets of any type, the pattern
"eth / end" should be used.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoapp/testpmd: add option for Rx multi-queue mode
Xiaoyu Min [Thu, 7 May 2020 00:51:59 +0000 (03:51 +0300)]
app/testpmd: add option for Rx multi-queue mode

One new cmdline option `--rx-mq-mode` is added in order to have the
possibility to check whether PMD handle the mq mode correctly or not.

The reason is some NICs need to do different settings based on different
RX mq mode, i.e RSS or not.

With this support in testpmd, the above scenario can be tested easily.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/bnxt: fix TQM ring context memory size
Kalesh AP [Wed, 6 May 2020 06:27:10 +0000 (11:57 +0530)]
net/bnxt: fix TQM ring context memory size

The current formulas to calculate the TQM slow path and fast path ring
context memory sizes are not quite correct. TQM slow path entry is
array index 0 of ctx->tqm_mem[]. The other array entries are for fast
path. Fix these sizes according to firmware spec. for 57500 and newer
chips.

Fixes: cc5e26b8ef98 ("net/bnxt: increase TQM entry allocation")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix number of TQM ring
Kalesh AP [Wed, 6 May 2020 06:27:09 +0000 (11:57 +0530)]
net/bnxt: fix number of TQM ring

Newer firmware advertises the number of TQM rings to allocate
context memory for.  Use the firmware specified value and fall back
to the old value derived from "bp->max_q" if it is not available.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/mlx5: support 200G link speed
Asaf Penso [Wed, 6 May 2020 12:22:08 +0000 (12:22 +0000)]
net/mlx5: support 200G link speed

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoethdev: add 200G link speed
Asaf Penso [Wed, 6 May 2020 12:22:08 +0000 (12:22 +0000)]
ethdev: add 200G link speed

There is no way to report back a link speed of 200Gbps.

Adding 200G link speed.

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/tap: use netlink extended ack support
Stephen Hemminger [Fri, 24 Apr 2020 23:36:57 +0000 (16:36 -0700)]
net/tap: use netlink extended ack support

In recent Linux kernels, there is support for extended acknowledgment
to netlink messages. This is quite useful for diagnosing errors
in configuration in the kernel with TAP.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
4 years agonet/tap: simplify netlink send/receive functions
Stephen Hemminger [Fri, 24 Apr 2020 23:36:56 +0000 (16:36 -0700)]
net/tap: simplify netlink send/receive functions

The tap_nl_recv() function does not need to use the full
complex recvmsg() system call, basic recv() will work here.

Ditto for tap_nl_send() full sendmsg is not needed.

Add logic to retry in case EINTR rather than forcing
error handling back in driver or worse to ethdev API.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
4 years agonet/tap: fix crash in flow destroy
Stephen Hemminger [Mon, 27 Apr 2020 21:39:26 +0000 (14:39 -0700)]
net/tap: fix crash in flow destroy

The TAP driver does not initialize all the elements of the rte_flow
structure. This can lead to crash in rte_flow_destroy.

(gdb) where
    flow=0x100e99280, error=0x0)
    at drivers/net/tap/tap_flow.c:1514

(gdb) p remote_flow
$1 = (struct rte_flow *) 0x6b6b6b6b6b6b6b6b

Which is here:
static int
tap_flow_destroy_pmd(struct pmd_internals *pmd,
     struct rte_flow *flow,
     struct rte_flow_error *error)
{
struct rte_flow *remote_flow = flow->remote_flow;
...
if (remote_flow) {
remote_flow->msg.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;

Simplest fix is to use rte_zmalloc() so remote_flow and other fields
are always set at zero.

Fixes: 2bc06869cd94 ("net/tap: add remote netdevice traffic capture")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: update LRO limitation in mlx5 guide
Dekel Peled [Sun, 12 Apr 2020 10:48:32 +0000 (13:48 +0300)]
doc: update LRO limitation in mlx5 guide

MLX5 PMD limitation regarding use of LRO is updated.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/ice: fix crash in switch filter
Junyu Jiang [Wed, 6 May 2020 03:05:25 +0000 (03:05 +0000)]
net/ice: fix crash in switch filter

The number of queues in queue group should be checked before
using it. This patch fixed the issue.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice: support mark only action for flow director
Simei Su [Tue, 14 Apr 2020 15:11:13 +0000 (23:11 +0800)]
net/ice: support mark only action for flow director

This patch fixes issue that doesn't support mark only case.
Mark only action is equal to mark + passthru action.

Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
Cc: stable@dpdk.org
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix link status synchronization on BSD
Zhihong Peng [Fri, 17 Apr 2020 03:52:12 +0000 (23:52 -0400)]
net/ixgbe: fix link status synchronization on BSD

DPDK does not implement interrupt mechanism on BSD,
so force NIC status synchronization.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org
Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix switch rule for IPsec
Wei Zhao [Wed, 29 Apr 2020 08:42:27 +0000 (16:42 +0800)]
net/ice/base: fix switch rule for IPsec

When we download a switch rule for ipv6 with esp payload
"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

if we don't add bm bit set check for tun_type, then a packet of
ipv4 with esp payload

"sendp([Ether(dst="00:00:00:00:01:00")/IP(proto=50)/ESP(spi=1)/
("X"*480)], iface="ens5f0", count=10)"

Will also go to queue index 2. And also, we need to do tun_type
check, or the second rule of following can not be download because
of rejection from switch rule download function ice_aq_sw_rules().

"eth / ipv4 / esp spi is 1 / end actions queue index 5 / end"

"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

Fixes: 4f11962fce84 ("net/ice/base: support AH ESP and NAT-T on switch")
Fixes: 99d8ba79efbe ("net/ice/base: force switch to use different recipe")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qi Fu <qi.fu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix link speed
Alvin Zhang [Thu, 30 Apr 2020 03:21:11 +0000 (11:21 +0800)]
net/iavf: fix link speed

If the PF driver does not support the new speed reporting capabilities
then use link_event instead of link_event_adv to get the speed.

Fixes: 48de41ca11f0 ("net/avf: enable link status update")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/bnxt: fix possible stack smashing
Linsi Yuan [Thu, 30 Apr 2020 13:37:52 +0000 (21:37 +0800)]
net/bnxt: fix possible stack smashing

We see a stack smashing as a result of defensive code missing. Once the
nb_pkts is less than RTE_BNXT_DESCS_PER_LOOP, it will be modified to
zero after doing a floor align, and we can not exit the following
receiving packets loop. And the buffers will be overwrite, then the
stack frame was ruined.

Fix the problem by adding defensive code, once the nb_pkts is zero, just
directly return with no packets.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")
Cc: stable@dpdk.org
Signed-off-by: Linsi Yuan <yuanlinsi01@baidu.com>
Signed-off-by: Dongsheng Rong <rongdongsheng@baidu.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix build with gcc 10 default no-common
Randy Schacher [Mon, 4 May 2020 15:06:19 +0000 (11:06 -0400)]
net/bnxt: fix build with gcc 10 default no-common

Remove the defensive compile-time checker macro.

Bugzilla ID: 468
Fixes: 8430a8b841c8 ("net/bnxt: add initial TruFlow core session open")

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/netvsc: do not configure RSS if disabled
Stephen Hemminger [Thu, 30 Apr 2020 19:08:53 +0000 (12:08 -0700)]
net/netvsc: do not configure RSS if disabled

This fixes the problem where driver would not start if only
have a single Rx queue and multiple Txq. In that case, RSS
should stay disabled.

Fixes: 92d23a57cafe ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: do RSS across Rx queue only
Stephen Hemminger [Thu, 30 Apr 2020 19:08:52 +0000 (12:08 -0700)]
net/netvsc: do RSS across Rx queue only

If number of tx queues is greater than the number of rx queues;
the driver ends up allocating more channels than rx queues.
The problem is that the RSS indirection table is programmed such
that some packets will end up on a channel that would never be
polled. The fix is to limit the RSS indirection table by number
of rx queues not channels.

Fixes: 92d23a57cafe ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: manage VF port under read/write lock
Stephen Hemminger [Thu, 30 Apr 2020 19:08:51 +0000 (12:08 -0700)]
net/netvsc: manage VF port under read/write lock

With multiple channels, the primary channel may receive notification
that VF has been added or removed while secondary channel is in
process of doing receive or transmit.  Resolve this race by converting
existing vf_lock to a reader/writer lock.

Users of lock (tx/rx/stats) acquire for read, and actions like
add/remove acquire it for write.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: check vmbus ring buffer more often
Stephen Hemminger [Thu, 30 Apr 2020 19:08:50 +0000 (12:08 -0700)]
net/netvsc: check vmbus ring buffer more often

Since VF notifications are handled as VMBUS notifications on the
primary channel (and not as hotplug). The channel should be checked
before deciding to use VF for Rx or Tx.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agobus/vmbus: add missing barrier
Stephen Hemminger [Thu, 30 Apr 2020 19:08:49 +0000 (12:08 -0700)]
bus/vmbus: add missing barrier

The check for event ring being empty needs a barrier
to avoid any over aggressive optimization.
This is same barrier as Linux kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agobus/vmbus: fix comment spelling
Stephen Hemminger [Thu, 30 Apr 2020 19:08:48 +0000 (12:08 -0700)]
bus/vmbus: fix comment spelling

No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: fix comment spelling
Stephen Hemminger [Thu, 30 Apr 2020 19:08:47 +0000 (12:08 -0700)]
net/netvsc: fix comment spelling

No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoapp/testpmd: fix statistics after reset
Wei Hu (Xavier) [Tue, 28 Apr 2020 11:50:45 +0000 (19:50 +0800)]
app/testpmd: fix statistics after reset

Currently, when running start/clear stats&xstats/stop command many times
based on testpmd application, there are incorrect forward Rx/Tx-packets
stats as below:
---------------------- Forward statistics for port 0  --------------
RX-packets: 18446744073709544808 RX-dropped: 0                <snip>
TX-packets: 18446744073709536616 TX-dropped: 0                <snip>
--------------------------------------------------------------------

The root cause as below:
1. The struct rte_port of testpmd.h has a member variable "struct
   rte_eth_stats stats" to store the last port statistics.
2. When running start command, it execute cmd_start_parsed ->
   start_packet_forwarding -> fwd_stats_reset, which call
   rte_eth_stats_get API function to save current port statistics.
3. When running stop command, it execute fwd_stats_display, which call
   rte_eth_stats_get to get current port statistics, and then minus last
   port statistics.
4. If we run clear stats or xstats after start command, then run stop,
   it may display above incorrect stats because the current
   Rx/Tx-packets is lower than the last saved RX/TX-packets(uint64_t
   overflow).

This patch fixes it by clearing last port statistics when executing
"clear stats/xstats" command.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: support flow aging
Dong Zhou [Tue, 5 May 2020 09:49:06 +0000 (12:49 +0300)]
app/testpmd: support flow aging

Currently, there is no way to check the aging event or to get the
current aged flows in testpmd, this patch include those implements, it's
included:

- Add new item "flow_aged" to the current print event command arguments.
- Add new command to list all aged flows, meanwhile, we can set
  parameter to destroy it.

Signed-off-by: Dong Zhou <dongz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/failsafe: avoid crash on malformed ethdev
Gaetan Rivet [Tue, 5 May 2020 19:10:29 +0000 (21:10 +0200)]
net/failsafe: avoid crash on malformed ethdev

Some PMD do not respect the eth_dev API when allocating their
rte_eth_dev. As a result, on device add event resulting from
rte_eth_dev_probing_finish() call, the eth_dev processed is incomplete.

The segfault is a good way to focus the developer on the issue, but does
not inspire confidence. Instead, warn the user of the error repeatedly.

The failsafe PMD can warn of the issue and continue. It will repeatedly
attempt to initialize the failed port and complain about it, which
should result in the same developer focus but with less crashing.

Signed-off-by: Gaetan Rivet <grive@u256.net>
4 years agonet/failsafe: fix fd leak
Yunjian Wang [Mon, 27 Apr 2020 10:44:19 +0000 (18:44 +0800)]
net/failsafe: fix fd leak

Zero is a valid fd. The fd won't be closed thus leading fd leak,
when it is zero.

Also the service proxy is initialized at 0. This is assuming that all of
its fields are invalid at 0. The issue is that a file descriptor at 0 is
a valid one.

The value -1 is used as sentinel during cleanup. Initialize the RX proxy
file descriptor to -1.

Fixes: f234e5bd996d ("net/failsafe: register slaves Rx interrupts")
Fixes: 9e0360aebf23 ("net/failsafe: register as Rx interrupt mode")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
4 years agocryptodev: fix ABI compatibility for ChaCha20-Poly1305
Arek Kusztal [Thu, 7 May 2020 10:57:03 +0000 (12:57 +0200)]
cryptodev: fix ABI compatibility for ChaCha20-Poly1305

This patch adds versioned function rte_cryptodev_info_get()
to prevent some issues with ABI policy.
Node v21 works in same way as before, returning driver capabilities
directly to the API caller. These capabilities may include new elements
not part of the v20 ABI.
Node v20 function maintains compatibility with v20 ABI releases
by stripping out elements not supported in v20 ABI. Because
rte_cryptodev_info_get is called by other API functions,
rte_cryptodev_sym_capability_get function is versioned the same way.

Fixes: b922dbd38ced ("cryptodev: add ChaCha20-Poly1305 AEAD algorithm")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocryptodev: add ChaCha20-Poly1305 AEAD algorithm
Arek Kusztal [Thu, 7 May 2020 10:57:02 +0000 (12:57 +0200)]
cryptodev: add ChaCha20-Poly1305 AEAD algorithm

This patch adds Chacha20-Poly1305 AEAD algorithm to Cryptodev.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoipsec: check SAD lookup error
Vladimir Medvedkin [Mon, 11 May 2020 09:23:06 +0000 (10:23 +0100)]
ipsec: check SAD lookup error

Explicitly check return value in add_specific()
CID 357760 (#2 of 2): Negative array index write (NEGATIVE_RETURNS)
8. negative_returns: Using variable ret as an index to array sad->cnt_arr

Coverity issue: 357760
Fixes: b2ee26926775 ("ipsec: add SAD add/delete/lookup implementation")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoexamples/ipsec-secgw: remove limitation for crypto sessions
Vladimir Medvedkin [Mon, 20 Apr 2020 19:16:35 +0000 (20:16 +0100)]
examples/ipsec-secgw: remove limitation for crypto sessions

Get rid of hardcoded limit of cryptodev sessions.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agodoc: add QAT AES-GCM J0 in release notes
Arek Kusztal [Thu, 7 May 2020 09:19:49 +0000 (11:19 +0200)]
doc: add QAT AES-GCM J0 in release notes

This patch adds missing line about addition of AES-GCM/GMAC J0
capability to 20.05 release notes.

Fixes: 2165e2e9ea56 ("crypto/qat: support AES-GCM J0")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
4 years agodoc: support IPsec Multi-buffer lib v0.54
Pablo de Lara [Mon, 11 May 2020 09:14:21 +0000 (10:14 +0100)]
doc: support IPsec Multi-buffer lib v0.54

Updated SNOW3G and KASUMI PMD documentation guides
with information about the latest Intel IPSec Multi-buffer
library supported.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agocrypto/zuc: support IPsec Multi-buffer lib v0.54
Pablo de Lara [Mon, 11 May 2020 09:14:20 +0000 (10:14 +0100)]
crypto/zuc: support IPsec Multi-buffer lib v0.54

The latest version of the Intel IPSec Multi-buffer library
adds an API to authenticate multiple buffers in parallel.
The PMD is modified to use this API, improving
performance of the ZUC-EIA3 algorithm.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agotest/crypto: remove unused variable
Akhil Goyal [Sat, 9 May 2020 23:12:17 +0000 (04:42 +0530)]
test/crypto: remove unused variable

dev info is set but not used in
test_queue_pair_descriptor_setup().

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: remove QAT specific check
Akhil Goyal [Sat, 9 May 2020 23:12:16 +0000 (04:42 +0530)]
test/crypto: remove QAT specific check

In test_queue_pair_descriptor_setup() and
test_device_configure_invalid_queue_pair_ids a QAT specific
check is there, however the test case can be run on any PMD.
Hence removed the unnecessary check.

test_queue_pair_descriptor_setup and
test_device_configure_invalid_queue_pair_ids execution
need to be altered as the valid device values should be
configured in the end so that all other tests can be
executed.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: remove dpaaX_sec specific test suites
Akhil Goyal [Sat, 9 May 2020 23:12:15 +0000 (04:42 +0530)]
test/crypto: remove dpaaX_sec specific test suites

dpaa_sec and dpaa2_sec PMDs can run generic
cryptodev_testsuite. Hence removing the specific
test suites.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: run PDCP cases if supported
Akhil Goyal [Sat, 9 May 2020 23:12:14 +0000 (04:42 +0530)]
test/crypto: run PDCP cases if supported

cryptodevs which support rte_security PDCP protocol,
can run all PDCP cases if it sets a feature flag
RTE_CRYPTODEV_FF_SECURITY. Previously, only dpaa2_sec
and dpaa_sec test suites were running these tests.
Now it is moved to generic test suite with a check
on the feature flag and the case will be skipped if it
is not supported by the PMD.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: skip unsupported session
Akhil Goyal [Sat, 9 May 2020 23:12:13 +0000 (04:42 +0530)]
test/crypto: skip unsupported session

The session init routine rte_cryptodev_sym_session_init(),
could return -ENOTSUP when the requested algo combination
is not supported by the PMD. This should be treated as
unsupported feature.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: skip unsupported session-less cases
Akhil Goyal [Sat, 9 May 2020 23:12:12 +0000 (04:42 +0530)]
test/crypto: skip unsupported session-less cases

There were some PMD specific checks to skip the case if
it is not supported. This patch checks the feature flag
RTE_CRYPTODEV_FF_SYM_SESSIONLESS if PMD supports it or not.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: skip unsupported scatter/gather cases
Akhil Goyal [Sat, 9 May 2020 23:12:11 +0000 (04:42 +0530)]
test/crypto: skip unsupported scatter/gather cases

Checked the PMD feature flag list to identify if
inplace or OOP SGLs are supported or not. If not supported
the cases are skipped.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agotest/crypto: skip unsupported non-byte aligned cases
Akhil Goyal [Sat, 9 May 2020 23:12:10 +0000 (04:42 +0530)]
test/crypto: skip unsupported non-byte aligned cases

Skipped the test cases for the PMDs which do not support
RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA and subsequently
removed the PMD specific checks for running that case.

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agocryptodev: add feature flag for non-byte aligned data
Akhil Goyal [Sat, 9 May 2020 23:12:09 +0000 (04:42 +0530)]
cryptodev: add feature flag for non-byte aligned data

Some wireless algos like SNOW, ZUC may support input
data in bits which are not byte aligned. However, not
all PMDs can support this requirement. Hence added a
new feature flag RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA
to identify which all PMDs can support non-byte aligned
data.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agodrivers/crypto: disable gcc 10 no-common errors
Kevin Traynor [Fri, 8 May 2020 16:27:55 +0000 (17:27 +0100)]
drivers/crypto: disable gcc 10 no-common errors

gcc 10 defaults to -fno-common and as a result when linking
with crypto drivers:

drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o):
(.bss+0x4): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o):
(.data+0x0): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

This is a blunt fix for the issue by enabling fcommon for
dpaa_sec/dpaa2_sec/caam_jr.

Bugzilla ID: 469
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/dpaa_sec: improve error handling
Akhil Goyal [Sat, 9 May 2020 22:22:59 +0000 (03:52 +0530)]
crypto/dpaa_sec: improve error handling

The return values in cases of errors were not
specified properly. With this patch appropriate
error numbers are returned.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agocrypto/dpaa2_sec: improve error handling
Akhil Goyal [Sat, 9 May 2020 22:22:58 +0000 (03:52 +0530)]
crypto/dpaa2_sec: improve error handling

The return values in cases of errors were not
specified properly. With this patch appropriate
error numbers are returned.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agotest/crypto: handle unsupported error on session init
Ankur Dwivedi [Thu, 7 May 2020 15:26:10 +0000 (20:56 +0530)]
test/crypto: handle unsupported error on session init

The session init routine rte_cryptodev_sym_session_init(),
could return -ENOTSUP when the requested algo combination
is not supported by the PMD. This should be treated as
unsupported features. For other return values like -EINVAL
or -ENOMEM the test can be treated as failure.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoexamples/fips_validation: fix parsing of algorithms
Archana Muniganti [Fri, 17 Apr 2020 15:08:40 +0000 (20:38 +0530)]
examples/fips_validation: fix parsing of algorithms

Few of the NIST TDES test files don't contain TDES string.
Added indicators to identify such files. These indicators
are part of only NIST TDES test vector files.

Fixes: 527cbf3d5ee3 ("examples/fips_validation: support TDES parsing")
Cc: stable@dpdk.org
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agocommon/qat: remove redundant check
Adam Dybkowski [Wed, 6 May 2020 21:31:07 +0000 (23:31 +0200)]
common/qat: remove redundant check

This patch removed the non-essential check for NULL pointer.

Coverity issue: 357770
Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocommon/qat: fix enqueue/dequeue statistics
Adam Dybkowski [Wed, 6 May 2020 11:29:43 +0000 (13:29 +0200)]
common/qat: fix enqueue/dequeue statistics

This patch fixes enqueued and dequeued count statistics that should
contain the number of operations enqueued by the end user app
instead of the total number of QAT requests - bigger in case of
a multiple-request dynamic Huffman compression operation.

Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agoexamples/ipsec-secgw: fix ESP flow error log
Praveen Shetty [Wed, 6 May 2020 11:02:41 +0000 (12:02 +0100)]
examples/ipsec-secgw: fix ESP flow error log

Function create_ipsec_esp_flow returns a negative number in case of any
failure and we are passing this to strerror to display the error message.
But strerror()'s argument cannot be negative.
In case of failure, displaying exact error message to console is handled
in create_ipsec_esp_flow function.
So it is not required to print the error message again using strerror.
This patch will remove the unnecessary calling of strerror function
to fix the negative argument passing to strerror issue.

Coverity issue: 357691
Fixes: 6738c0a95695 ("examples/ipsec-secgw: support flow director")

Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agocrypto/kasumi: fix extern declaration
Kevin Traynor [Wed, 6 May 2020 09:45:18 +0000 (10:45 +0100)]
crypto/kasumi: fix extern declaration

gcc 10 defaults to fno-common and it reports:

crypto_kasumi_rte_kasumi_pmd_ops.c.o:(.data.rel+0x0):
multiple definition of `rte_kasumi_pmd_ops';
crypto_kasumi_rte_kasumi_pmd.c.o:(.bss+0x8): first defined here

Fix by making rte_kasumi_pmd_ops extern in the header file.

Fixes: 2773c86d061a ("crypto/kasumi: add driver for KASUMI library")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
4 years agotest/crypto: set null cipher IV length to zero
Ankur Dwivedi [Wed, 6 May 2020 09:37:26 +0000 (15:07 +0530)]
test/crypto: set null cipher IV length to zero

For null cipher the iv length should be set to zero.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocrypto/dpaa_sec: repair memory allocations
Lukasz Wojciechowski [Tue, 5 May 2020 21:41:05 +0000 (23:41 +0200)]
crypto/dpaa_sec: repair memory allocations

This patch repairs 2 memory allocations issues:

1) possible leak of memory
    In cryptodev_dpaa_sec_probe() function in case of portal
    initialization failure, function exited without cleanup.

    The patch redirects flow to out label, which provides
    proper cleanup in case of error: freeing cryptodevice private
    data and releasing cryptodevice.

2) double free of cryptodev private data
    The function dpaa_sec_dev_init() in case of failure called
    dpaa_sec_uninit() which freed both private data and security
    context. However one layer above in cryptodev_dpaa_sec_probe()
    function, the private data were freed one more time.

    The patch limits cleanup of the dpaa_sec_dev_init() function
    to freeing only the security context.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/dpaa_sec: improve memory freeing
Lukasz Wojciechowski [Tue, 5 May 2020 21:41:04 +0000 (23:41 +0200)]
crypto/dpaa_sec: improve memory freeing

This patch fixes management of memory for authentication
and encryption keys.
There were two issues with former state of implementation:

1) Invalid access to dpaa_sec_session union members
    The dpaa_sec_session structure includes an anonymous union:
    union {
        struct {...} aead_key;
        struct {
            struct {...} cipher_key;
            struct {...} auth_key;
        };
    };
    Depending on the used algorithm a rte_zmalloc() function
    allocated memory that was kept in aead_key, cipher_key
    or auth_key. However every time the memory was released,
    rte_free() was called only on cipher and auth keys, even
    if pointer to allocated memory was stored in aead_key.

    The C language specification defines such behavior as undefined.
    As the cipher_key and aead_key are similar, have same sizes and
    alignment, it has worked, but it's directly against C specification.

    This patch fixes this, providing a free_session_data() function
    to free the keys data. It verifies which algorithm was used
    (aead or auth+cipher) and frees proper part of the union.

2) Some keys might have been freed multiple times
    In functions like: dpaa_sec_cipher_init(), dpaa_sec_auth_init(),
    dpaa_sec_chain_init(), dpaa_sec_aead_init() keys data were freed
    before returning due to some error conditions. However the pointers
    were not zeroed causing another calls to ret_free from higher
    layers of code. This causes an error log about invalid memory address
    to be printed.

    This patch fixes it by making only one layer responsible for freeing
    memory

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocommon/qat: fix queue head update
Adam Dybkowski [Tue, 5 May 2020 15:30:37 +0000 (17:30 +0200)]
common/qat: fix queue head update

This patch fixes missing queue head update that occurred when
a multiple-request dynamic Huffman compression operation was not
complete within one qat_dequeue_op_burst function call.

Fixes: c13cecf60f12 ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Tested-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
4 years agoexamples/ipsec-secgw: clean up test scripts
Mariusz Drost [Mon, 4 May 2020 10:06:34 +0000 (12:06 +0200)]
examples/ipsec-secgw: clean up test scripts

As more test cases are defined for execution, test scripts structure
needs to be reorganized, so fewer files are needed to describe the test.
To achieve that, new environment variables are incorporated into the
scripts.
Additionally, tests for mixed tunnel protocols are added.

Signed-off-by: Mariusz Drost <mariuszx.drost@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agocrypto/qat: fix cipher descriptor for ZUC and SNOW
Arek Kusztal [Wed, 29 Apr 2020 14:51:34 +0000 (16:51 +0200)]
crypto/qat: fix cipher descriptor for ZUC and SNOW

Offset of cd pointer is too big by state1size + state2size, so few extra
unnecessary bytes will be copied into cd. Snow offset was improved as well.

Fixes: d9b7d5bbc845 ("crypto/qat: add ZUC EEA3/EIA3 capability")
Cc: stable@dpdk.org
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>