dpdk.git
2 years agonet/dpaa2: update management complex to 10.32
Rohit Raj [Fri, 22 Apr 2022 04:57:26 +0000 (10:27 +0530)]
net/dpaa2: update management complex to 10.32

Updating the management complex to version 10.32

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/nfp: update how max MTU is read
Walter Heymans [Wed, 20 Apr 2022 13:46:39 +0000 (15:46 +0200)]
net/nfp: update how max MTU is read

The 'max_rx_pktlen' value was previously read from hardware, which was
set by the running firmware. This caused confusion due to different
meanings of 'MAX_MTU'. This patch updates the 'max_rx_pktlen' to the
maximum value that the NFP NIC can support. The 'max_mtu' value that is
read from hardware, is assigned to the 'dev_info->max_mtu' variable.

If more layer 2 metadata must be used, the firmware can be updated to
report a smaller 'max_mtu' value.

The constant defined for NFP_FRAME_SIZE_MAX is derived for the maximum
supported buffer size of 10240, minus 136 bytes that is reserved by the
hardware and another 56 bytes reserved for expansion in firmware. This
results in a usable maximum packet length of 10048 bytes.

Signed-off-by: Walter Heymans <walter.heymans@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Richard Donkin <richard.donkin@corigine.com>
2 years agovdpa/mlx5: make statistics counter persistent
Xueming Li [Sun, 8 May 2022 14:25:54 +0000 (17:25 +0300)]
vdpa/mlx5: make statistics counter persistent

In order to speed-up the device suspend and resume, make the statistics
counters persistent in reconfiguration until the device gets removed.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: support device cleanup callback
Xueming Li [Sun, 8 May 2022 14:25:53 +0000 (17:25 +0300)]
vdpa/mlx5: support device cleanup callback

This patch supports device cleanup callback API which is called when
the device is disconnected from the VM. Cached resources like VM MR and
VQ memory are released.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: cache and reuse hardware resources
Xueming Li [Sun, 8 May 2022 14:25:52 +0000 (17:25 +0300)]
vdpa/mlx5: cache and reuse hardware resources

During device suspend and resume, resources are not changed normally.
When huge resources were allocated to VM, like huge memory size or lots
of queues, time spent on release and recreate became significant.

To speed up, this patch reuses resources like VM MR and VirtQ memory if
not changed.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: reuse resources in reconfiguration
Xueming Li [Sun, 8 May 2022 14:25:51 +0000 (17:25 +0300)]
vdpa/mlx5: reuse resources in reconfiguration

To speed up device resume, create reuseable resources during device
probe state, release when device is removed. Reused resources includes
TIS,
TD, VAR Doorbell mmap, error handling event channel and interrupt
handler, UAR, Rx event channel, NULL MR, steer domain and table.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: avoid kick handling during shutdown
Xueming Li [Sun, 8 May 2022 14:25:50 +0000 (17:25 +0300)]
vdpa/mlx5: avoid kick handling during shutdown

When Qemu suspends a VM, HW notifier is un-mmapped while vCPU thread may
still be active and write notifier through kick socket.

PMD kick handler thread tries to install HW notifier through client
socket. In such case, it will timeout and slow down device close.

This patch skips HW notifier install if VQ or device in middle of
shutdown.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: fix dead loop when process interrupted
Xueming Li [Sun, 8 May 2022 14:25:49 +0000 (17:25 +0300)]
vdpa/mlx5: fix dead loop when process interrupted

In Ctrl+C handling, sometimes kick handling thread gets endless EGAIN
error and fall into dead lock.

Kick happens frequently in real system due to busy traffic or retry
mechanism. This patch simplifies kick firmware anyway and skip setting
hardware notifier due to potential device error, notifier could be set
in next successful kick request.

Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: fix interrupt trash that leads to crash
Xueming Li [Sun, 8 May 2022 14:25:48 +0000 (17:25 +0300)]
vdpa/mlx5: fix interrupt trash that leads to crash

Disable interrupt unregister timeout to avoid invalid FD caused
interrupt thread segment fault.

Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: fix missing virtqueue lock protection
Maxime Coquelin [Thu, 24 Mar 2022 12:46:34 +0000 (13:46 +0100)]
vhost: fix missing virtqueue lock protection

This patch ensures virtqueue metadata are not being
modified while rte_vhost_vring_call() is executed.

Fixes: 6c299bb7322f ("vhost: introduce vring call API")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: validate FDs attached to messages
David Marchand [Mon, 25 Apr 2022 12:54:30 +0000 (14:54 +0200)]
vhost: validate FDs attached to messages

Some message handlers do not expect any file descriptor attached as
ancillary data.
Provide a common way to enforce this by adding a accepts_fd boolean in
the message handler structure. When a message handler sets accepts_fd to
true, it is responsible for calling validate_msg_fds with a right
expected file descriptor count.
This will avoid leaking some file descriptor by mistake when adding
support for new vhost user message types.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: refactor messages handlers declaration
David Marchand [Mon, 25 Apr 2022 12:54:29 +0000 (14:54 +0200)]
vhost: refactor messages handlers declaration

Move message handler description and callbacks into a single array and
remove unneeded VHOST_USER_MAX and VHOST_SLAVE_MAX enums.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/vhost: fix TSO feature default disablement
Maxime Coquelin [Fri, 22 Apr 2022 09:35:43 +0000 (11:35 +0200)]
net/vhost: fix TSO feature default disablement

By default, TSO feature should be disabled because it requires
application's support to be functional as mentioned in the
documentation.

However, if "tso" devarg was not specified, the feature did
not get disabled.

This patch fixes this issue, so that TSO is disabled, even if
"tso=0" is not passed as devarg.

Fixes: e289400669d5 ("net/vhost: support TSO disabling")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/virtio: restore some optimisations with AVX512
David Marchand [Mon, 11 Apr 2022 15:04:20 +0000 (17:04 +0200)]
net/virtio: restore some optimisations with AVX512

Those optimisations were only enabled with make builds, fix the meson
part.

Fixes: 77d66da83834 ("net/virtio: add vectorized packed ring Rx")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agoexamples/vhost: use API to check in-flight packets
Xuan Ding [Fri, 8 Apr 2022 10:22:14 +0000 (10:22 +0000)]
examples/vhost: use API to check in-flight packets

In async data path, call rte_vhost_async_get_inflight_thread_unsafe()
API to directly return the number of in-flight packets instead of
maintaining a local variable.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: add unsafe API to check in-flight packets
Xuan Ding [Fri, 8 Apr 2022 10:22:13 +0000 (10:22 +0000)]
vhost: add unsafe API to check in-flight packets

In async data path, when vring state changes or device is destroyed,
it is necessary to know the number of in-flight packets in DMA engine.
This patch provides a thread unsafe API to return the number of
in-flight packets for a vhost queue without using any lock.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/vhost: fix access to freed memory
Yuan Wang [Fri, 11 Mar 2022 16:35:12 +0000 (00:35 +0800)]
net/vhost: fix access to freed memory

This patch fixes heap-use-after-free reported by ASan.

It is possible for the rte_vhost_dequeue_burst() to access the vq
is freed when numa_realloc() gets called in the device running state.
The control plane will set the vq->access_lock to protected the vq
from the data plane. Unfortunately the lock will fail at the moment
the vq is freed, allowing the rte_vhost_dequeue_burst() to access
the fields of the vq, which will trigger a heap-use-after-free error.

In the case of multiple queues, the vhost pmd can access other queues
that are not ready when the first queue is ready, which makes no sense
and also allows numa_realloc() and rte_vhost_dequeue_burst() access to
vq to happen at the same time. By controlling vq->allow_queuing we can make
the pmd access only the queues that are ready.

Fixes: 1ce3c7fe149 ("net/vhost: emulate device start/stop behavior")

Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: support NAPI when using vhost-net backend
Harold Huang [Wed, 2 Mar 2022 09:41:05 +0000 (17:41 +0800)]
net/virtio: support NAPI when using vhost-net backend

In patch [1], NAPI has been supported in kernel tun driver to accelerate
packet processing received from vhost-net. This will greatly improve the
throughput of the tap device in the vhost-net backend.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=fb3f903769e8

Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/cxgbe: simplify Rx payload buffer size posting
Rahul Lakkireddy [Mon, 18 Apr 2022 22:24:20 +0000 (03:54 +0530)]
net/cxgbe: simplify Rx payload buffer size posting

Match the closest supported Rx payload buffer size with the mempool
data size and program it for the Rx queue. This removes unnecessary
need for handling additional padding, packing, and alignment, when
posting Rx buffers to hardware.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/cxgbe: fix Tx queue stuck with mbuf chain coalescing
Rahul Lakkireddy [Mon, 18 Apr 2022 22:24:19 +0000 (03:54 +0530)]
net/cxgbe: fix Tx queue stuck with mbuf chain coalescing

When trying to coalesce mbufs with chain on Tx side, it is possible
to get stuck during queue wrap around. When coalescing this mbuf
chain fails, the Tx path returns EBUSY and when the same packet
is retried again, it couldn't get coalesced again, and the loop
repeats. Fix by pushing the packet through the normal Tx path.
Also use FW_ETH_TX_PKTS_WR to handle mbufs with chain for FW
to optimize.

Fixes: 6c2809628cd5 ("net/cxgbe: improve latency for slow traffic")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/cxgbe: fix port ID in Rx mbuf
Rahul Lakkireddy [Mon, 18 Apr 2022 22:24:18 +0000 (03:54 +0530)]
net/cxgbe: fix port ID in Rx mbuf

Fill the correct DPDK ethdev port_id, instead of local adapter
physical port_id in mbufs allocated for Rx.

Fixes: 78fc1a716ae8 ("cxgbe: improve Rx performance")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agonet/hns3: fix device info dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:56 +0000 (21:00 +0800)]
net/hns3: fix device info dump

Rx/Tx queue info dump and pvid info dump is both supported
in PF and VF. This patch fixed it.

Fixes: 1a03c659cb9d ("net/hns3: dump device basic info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix TM info dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:55 +0000 (21:00 +0800)]
net/hns3: fix TM info dump

Shouldn't dump TM info when TM is not supported by the NIC.
This patch fixed it.

Fixes: e4cfe6bb9114 ("net/hns3: dump TM configuration info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor queue info dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:54 +0000 (21:00 +0800)]
net/hns3: refactor queue info dump

This patch refactors queue info dump.

Fixes: 6038c8a3f63c ("net/hns3: dump queue info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor feature capability dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:53 +0000 (21:00 +0800)]
net/hns3: refactor feature capability dump

This patch refactors feature capability dump.

Fixes: 14ea9f0a62c6 ("net/hns3: dump device feature capability")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: refactor adapter state dump
Min Hu (Connor) [Thu, 14 Apr 2022 13:00:52 +0000 (21:00 +0800)]
net/hns3: refactor adapter state dump

This patch refactors adapter state dump.

Fixes: 1a03c659cb9d ("net/hns3: dump device basic info")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/bonding: fix RSS key config with extended key length
Ke Zhang [Mon, 11 Apr 2022 05:40:03 +0000 (05:40 +0000)]
net/bonding: fix RSS key config with extended key length

When creating a bonding device, if the slave device's
RSS key length = standard_rss_key length + extended_hash_key length,
then bonding device will be same as slave,
in function bond_ethdev_configure(), the default_rss_key length is 40,
it is not matched, so it should calculate a new key for bonding device
if the default key could not be used.

Fixes: 6b1a001ec546 ("net/bonding: fix RSS key length")
Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/nfp: remove unneeded header inclusion
David Marchand [Fri, 8 Apr 2022 09:41:16 +0000 (11:41 +0200)]
net/nfp: remove unneeded header inclusion

Looking at this driver history, there was never a need for including
execinfo.h.

Fixes: bdbf45c24b07 ("net/nfp: fix build with musl libc")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2 years agonet/netvsc: fix hot adding multiple VF PCI devices
Long Li [Thu, 24 Mar 2022 17:46:17 +0000 (10:46 -0700)]
net/netvsc: fix hot adding multiple VF PCI devices

This patch fixes two issues with hot removing/adding a VF PCI device:
1. The original device argument is lost when it's hot added
2. If there are multiple VFs hot adding at the same time, some of the
   VFs may not get added successfully because only one single VF status
   is stored in the netvsc.

Fix these by storing the original device arguments and maintain a list
of hot add contexts to deal with multiple VF devices.

Fixes: a2a23a794b ("net/netvsc: support VF device hot add/remove")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
2 years agoci: build some job with ASan
David Marchand [Thu, 5 May 2022 09:29:52 +0000 (11:29 +0200)]
ci: build some job with ASan

Enable ASan, this can greatly help identify leaks and buffer overflows.
Running unit tests relying on multiprocess is unreliable with ASan
enabled, so skip them.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2 years agotest/mem: disable ASan when accessing unallocated memory
David Marchand [Thu, 5 May 2022 09:29:51 +0000 (11:29 +0200)]
test/mem: disable ASan when accessing unallocated memory

As described in bugzilla, ASan reports accesses to all memory segment as
invalid, since those parts have not been allocated with rte_malloc.
Move __rte_no_asan to rte_common.h and disable ASan on a part of the test.

Bugzilla ID: 880
Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agotest/hash: report non HTM numbers for single thread
Stanislaw Kardach [Tue, 10 May 2022 11:57:34 +0000 (13:57 +0200)]
test/hash: report non HTM numbers for single thread

In hash_readwrite_perf_autotest a single read and write operation is
benchmarked for both HTM and non HTM cases. However the result summary
only shows the HTM value. Therefore add the non HTM value for
completeness.

Fixes: 0eb3726ebcf1 ("test/hash: add test for read/write concurrency")

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2 years agomaintainers: update for Intel i40e
Beilei Xing [Tue, 12 Apr 2022 02:02:57 +0000 (10:02 +0800)]
maintainers: update for Intel i40e

Add Yuying as Intel i40e maintainer.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
2 years agomaintainers: update for Intel igc
Haiyue Wang [Fri, 8 Apr 2022 05:58:17 +0000 (13:58 +0800)]
maintainers: update for Intel igc

Junfeng and Simei have been appointed the new maintainers for the igc
PMD. Update the MAINTAINERS file to reflect this.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Simei Su <simei.su@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
2 years agomaintainers: update for Intel ixgbe
Haiyue Wang [Fri, 8 Apr 2022 05:58:16 +0000 (13:58 +0800)]
maintainers: update for Intel ixgbe

Qiming and Wenjun have been appointed the new maintainers for the ixgbe
PMD. Update the MAINTAINERS file to reflect this.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2 years agomaintainers: update for Intel e1000
Haiyue Wang [Fri, 8 Apr 2022 05:58:15 +0000 (13:58 +0800)]
maintainers: update for Intel e1000

Simei and Wenjun have been appointed the new maintainers for the e1000
PMD. Update the MAINTAINERS file to reflect this.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Simei Su <simei.su@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2 years agomaintainers: update for vmxnet3 driver
Jochen Behrens [Fri, 6 May 2022 20:06:31 +0000 (20:06 +0000)]
maintainers: update for vmxnet3 driver

Make Jochen Behrens the maintainer of the net/vmxnet3 device
driver as Yong Wang is not working on vmxnet3 any more.

Signed-off-by: Jochen Behrens <jbehrens@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
2 years agomaintainers: update email address
Konstantin Ananyev [Thu, 21 Apr 2022 15:20:59 +0000 (16:20 +0100)]
maintainers: update email address

Use new email address.

Signed-off-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Acked-by: John McNamara <john.mcnamara@intel.com>
2 years agoexamples/l2fwd-crypto: fix stats refresh rate
Raja Zidane [Thu, 7 Apr 2022 11:42:49 +0000 (14:42 +0300)]
examples/l2fwd-crypto: fix stats refresh rate

TIMER_MILLISECOND is defined as the number of cpu cycles per millisecond,
current definition is correct for cores with frequency of 2GHZ, for cores
with different frequency, it caused different periods between refresh,
(i.e. the definition is about 14ms on ARM cores).
The devarg that stated the period between stats print was not used,
instead, it was always defaulted to 10 seconds (on 2GHZ core).

Use DPDK API to get CPU frequency, to define TIMER_MILLISECOND.
Use the refresh period devarg instead of defaulting to 10s always.

Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocompress/octeontx: support OCTEON TX2 SoC family
Mahipal Challa [Mon, 28 Feb 2022 03:40:35 +0000 (09:10 +0530)]
compress/octeontx: support OCTEON TX2 SoC family

The octeontx2 9xxx SoC family support is added.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Acked-by: Ashish Gupta <ashishg@marvell.com>
2 years agotest/crypto-perf: add vector file for AES-GCM
Archana Muniganti [Fri, 8 Apr 2022 10:18:35 +0000 (15:48 +0530)]
test/crypto-perf: add vector file for AES-GCM

Added test vector file for AES-128-GCM for
64B and 512B length buffers.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto-perf: populate mbuf in latency test
Archana Muniganti [Fri, 8 Apr 2022 10:18:34 +0000 (15:48 +0530)]
test/crypto-perf: populate mbuf in latency test

For decrypt, ICV mismatch can come as data is dummy and
latency will be calculated for error path. Hence populate
mbuf with test vector data.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax: fix short MAC-I IV calculation for ZUC
Gagandeep Singh [Thu, 28 Apr 2022 11:47:33 +0000 (17:17 +0530)]
common/dpaax: fix short MAC-I IV calculation for ZUC

Fixing the IV calculation for ZUC based short MAC-I
as per the HW security engine guidelines.

Fixes: 73a24060cd70 ("crypto/dpaa2_sec: add sample PDCP descriptor APIs")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: move cdb preparation to session create
Gagandeep Singh [Thu, 28 Apr 2022 11:47:32 +0000 (17:17 +0530)]
crypto/dpaa_sec: move cdb preparation to session create

Driver is preparing the shared descriptor of session while
attaching the session to a queue pair.
It should be prepared on session create.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agobus/dpaa: remove unused thread-specific variables
Gagandeep Singh [Thu, 28 Apr 2022 11:47:31 +0000 (17:17 +0530)]
bus/dpaa: remove unused thread-specific variables

There are some crypto driver related thread specific
variables which are no longer used, so removing them.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix operation status for simple FD
Gagandeep Singh [Thu, 28 Apr 2022 11:47:30 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix operation status for simple FD

Driver is not filling the operation status on dequeue
in case the FD is simple.

So setting the status as per the results.

Fixes: 0a23d4b6f4c2 ("crypto/dpaa2_sec: support protocol offload IPsec")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix crypto operation pointer
Gagandeep Singh [Thu, 28 Apr 2022 11:47:29 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix crypto operation pointer

Driver is filling the crypto_op variable with an invalid value
for atomic and ordered events which can results into
segmentation fault.

This patch assigning the correct crypto_op and event buffer
pointers by extracting from FD.

Fixes: a77db24643b7 ("crypto/dpaa2_sec: support atomic queues")
Fixes: 4562de326d30 ("crypto/dpaa2_sec: support ordered queue")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: create fle pool per queue pair
Gagandeep Singh [Thu, 28 Apr 2022 11:47:28 +0000 (17:17 +0530)]
crypto/dpaa2_sec: create fle pool per queue pair

Driver is creating a fle pool with a fixed number of
buffers for all queue pairs of a DPSECI object.
These fle buffers are equivalent to the number of descriptors.

In this patch, creating the fle pool for each queue pair
so that user can control the number of descriptors of a
queue pair using API rte_cryptodev_queue_pair_setup().

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: fix secondary process probing
Vanshika Shukla [Thu, 28 Apr 2022 11:47:27 +0000 (17:17 +0530)]
crypto/dpaa_sec: fix secondary process probing

DPAA hardware supports non-i/o performing secondary
applications only. So we do not have to probe crypto
devices in secondary applications.

Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax: remove obsolete code
Gagandeep Singh [Thu, 28 Apr 2022 11:47:26 +0000 (17:17 +0530)]
common/dpaax: remove obsolete code

Remove sec era 1 to 7 IPsec and caam operations code
as none of the NXP platform use it.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: replace use of old build macros
Gagandeep Singh [Thu, 28 Apr 2022 11:47:25 +0000 (17:17 +0530)]
crypto/dpaa_sec: replace use of old build macros

Use the newer security macros defined by meson.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: enable QI physically
Gagandeep Singh [Thu, 28 Apr 2022 11:47:24 +0000 (17:17 +0530)]
crypto/dpaa_sec: enable QI physically

To perform crypto operations on DPAA platform,
QI interface of HW must be enabled.
Earlier DPAA crypto driver was dependent on
kernel for QI enable. Now with this patch
there is no such dependency on kernel.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix chained FD length in raw datapath
Gagandeep Singh [Thu, 28 Apr 2022 11:47:23 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix chained FD length in raw datapath

DPAA2 sec raw driver is calculating the wrong lengths while
creating the FD for chain.
This patch fixes lengths for chain FD.

Fixes: aa6ec1fd8443 ("crypto/dpaa2_sec: support authenc with raw buffer API")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: fix chained FD length in raw datapath
Gagandeep Singh [Thu, 28 Apr 2022 11:47:22 +0000 (17:17 +0530)]
crypto/dpaa_sec: fix chained FD length in raw datapath

DPAA sec raw driver is calculating the wrong lengths while
creating the FD for chain.
This patch fixes lengths for chain FD.

Fixes: 78156d38e112 ("crypto/dpaa_sec: support authonly and chain with raw API")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix buffer pool ID check
Gagandeep Singh [Thu, 28 Apr 2022 11:47:21 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix buffer pool ID check

Simple fd rely on bpid of the buffers whereas
other FD types can support buffers without bpid
of pool.

So moving the bpid check to simple fd to mbuf
conversion function.

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: fix fle buffer leak
Gagandeep Singh [Thu, 28 Apr 2022 11:47:20 +0000 (17:17 +0530)]
crypto/dpaa2_sec: fix fle buffer leak

Driver allocates a fle buffer for each packet
before enqueue and free the buffer on dequeue. But in case if
there are enqueue failures, then code should free the fle buffers.

Fixes: 4562de326d30 ("crypto/dpaa2_sec: support ordered queue")
Fixes: 3ffce51a1f04 ("crypto/dpaa2_sec: add enqueue retry timeout")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto-perf: extend asymmetric crypto throughput test
Kiran Kumar K [Fri, 29 Apr 2022 06:23:15 +0000 (11:53 +0530)]
test/crypto-perf: extend asymmetric crypto throughput test

Extended support for asymmetric crypto perf throughput test.
Added support for new modulus lengths.
Added new parameter --modex-len.
Supported lengths are 60, 128, 255, 448. Default length is 128.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/mlx5: fix login cleanup
Raja Zidane [Mon, 18 Apr 2022 11:05:16 +0000 (14:05 +0300)]
crypto/mlx5: fix login cleanup

In case of a probing failure caused by wrong devarg provided,
login isn't destroyed when exiting.

Destroy login on failure.

Fixes: ba707cdb6da2 ("crypto/mlx5: fix queue size configuration")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocrypto/cnxk: prevent out-of-bound access in capabilities
Gowrishankar Muthukrishnan [Thu, 21 Apr 2022 07:58:19 +0000 (13:28 +0530)]
crypto/cnxk: prevent out-of-bound access in capabilities

In a situation where crypto_caps elements are checked only for
RTE_CRYPTO_OP_TYPE_UNDEFINED until valid op defined, there is
possibility for an out of bound access. Add this array by one
element for current capabilities.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2 years agocrypto/cnxk: use set ctx operation for session destroy
Anoob Joseph [Mon, 25 Apr 2022 05:38:25 +0000 (11:08 +0530)]
crypto/cnxk: use set ctx operation for session destroy

Usage of flush and invalidate would involve delays to account
for flush delay. Use set_ctx operation instead. When set_ctx fails,
fall back to flush + invalidate scheme.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/cnxk: add timeout for ctx write operation
Anoob Joseph [Mon, 25 Apr 2022 05:38:24 +0000 (11:08 +0530)]
common/cnxk: add timeout for ctx write operation

Add busy wait and polling for ctx write operation
rather than waiting with 1 ms delay.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: remove useless return code
Anoob Joseph [Mon, 25 Apr 2022 05:38:23 +0000 (11:08 +0530)]
crypto/cnxk: remove useless return code

The function doesn't return error. Remove return.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: support AES-GMAC
Archana Muniganti [Mon, 25 Apr 2022 05:38:22 +0000 (11:08 +0530)]
crypto/cnxk: support AES-GMAC

Added lookaside IPsec AES-GMAC support in CNXK PMD.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/cnxk: support AH mode
Archana Muniganti [Mon, 25 Apr 2022 05:38:21 +0000 (11:08 +0530)]
crypto/cnxk: support AH mode

Added IPsec AH mode support in CN9K and CN10K PMD

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agosecurity: fix SA lifetime comments
Anoob Joseph [Wed, 27 Apr 2022 06:01:45 +0000 (11:31 +0530)]
security: fix SA lifetime comments

Fix comments to reflect the hard expiry fields.

Fixes: ad7515a39f2a ("security: add SA lifetime configuration")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
2 years agocrypto/dpaa_sec: fix digest size
Gagandeep Singh [Thu, 17 Mar 2022 08:55:58 +0000 (14:25 +0530)]
crypto/dpaa_sec: fix digest size

DPAA crypto driver can support 64 bytes size digest size
for SHA512-HMAC.
This patch changes the value of macro max supported digest size to
64.

Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2 years agocommon/dpaax: remove dead code
Gagandeep Singh [Thu, 17 Mar 2022 08:55:57 +0000 (14:25 +0530)]
common/dpaax: remove dead code

This patch remove structural and logical dead code from
caamflib.

Coverity issue: 375251, 375258, 375261, 375267, 375269
Coverity issue: 375285, 373161, 375249, 375257

Fixes: 6127fff842a7 ("common/dpaax: remove outdated caamflib code")
Fixes: 81eb760d2207 ("common/dpaax/caamflib: remove some inline keys")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2 years agotest/crypto: add AH AES-GMAC test vectors
Archana Muniganti [Fri, 8 Apr 2022 10:16:25 +0000 (15:46 +0530)]
test/crypto: add AH AES-GMAC test vectors

Added AES_GMAC test vectors along with combined mode support.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: add AH test vectors
Archana Muniganti [Fri, 8 Apr 2022 10:16:24 +0000 (15:46 +0530)]
test/crypto: add AH test vectors

Added tunnel and transport AH known test vectors for
SHA256 HMAC.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: add AH under combined mode
Archana Muniganti [Fri, 8 Apr 2022 10:16:23 +0000 (15:46 +0530)]
test/crypto: add AH under combined mode

Added auth only and null cipher + auth under combined mode
for following combinations.
1. Tunnel IPv4
2. Transport IPv4

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agoci: add MinGW cross-compilation in GHA
David Marchand [Fri, 6 May 2022 11:57:36 +0000 (13:57 +0200)]
ci: add MinGW cross-compilation in GHA

Add mingw cross compilation in our public CI so that users with their
own github repository have a first level of checks for Windows compilation
before submitting to the mailing list.
This does not replace our better checks in other entities of the CI.

Only the helloworld example is compiled (same as what is tested in
test-meson-builds.sh).

Note: the mingw cross compilation toolchain (version 5.0) in Ubuntu
18.04 was broken (missing a ENOMSG definition).

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
2 years agoci: switch to Ubuntu 20.04
David Marchand [Fri, 6 May 2022 11:57:35 +0000 (13:57 +0200)]
ci: switch to Ubuntu 20.04

Ubuntu 18.04 is now rather old.
Besides, other entities in our CI are also testing this distribution.

Switch to a newer Ubuntu release and benefit from more recent
tool(chain)s: for example, net/cnxk now builds fine and can be
re-enabled.

Note: Ubuntu 18.04 and 20.04 seem to preserve the same paths for the ARM
and PPC cross compilation toolchains, so we can use a single
configuration file (with the hope, future releases of Ubuntu will do the
same).

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoeal: fix C++ include for device event and DMA
Tianhao Chai [Thu, 5 May 2022 04:39:35 +0000 (23:39 -0500)]
eal: fix C++ include for device event and DMA

Currently the "extern C" section ends right before rte_dev_dma_unmap
and other DMA function declarations, causing some C++ compilers to
produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols.
This leads to build failures later when linking a final executable
against this object.

Fixes: a753e53d517b ("eal: add device event monitor framework")
Cc: stable@dpdk.org
Signed-off-by: Tianhao Chai <cth451@gmail.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2 years agomalloc: fix ASan handling for unmapped memory
Anatoly Burakov [Wed, 4 May 2022 14:31:58 +0000 (14:31 +0000)]
malloc: fix ASan handling for unmapped memory

Currently, when we free previously allocated memory, we mark the area as
"freed" for ASan purposes (flag 0xfd). However, sometimes, freeing a
malloc element will cause pages to be unmapped from memory and re-backed
with anonymous memory again. This may cause ASan's "use-after-free"
error down the line, because the allocator will try to write into
memory areas recently marked as "freed".

To fix this, we need to mark the unmapped memory area as "available",
and fixup surrounding malloc element header/trailers to enable later
malloc routines to safely write into new malloc elements' headers or
trailers.

Bugzilla ID: 994
Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agomem: skip attaching external memory in secondary process
Deepak Khandelwal [Thu, 21 Apr 2022 09:11:21 +0000 (14:41 +0530)]
mem: skip attaching external memory in secondary process

Currently, EAL init in secondary processes will attach all fbarrays
in the memconfig to have access to the primary process's page tables.
However, fbarrays corresponding to external memory segments should
not be attached at initialization, because this will happen as part
of `rte_extmem_attach` [1] or `rte_malloc_heap_memory_attach` [2] calls.

1: https://doc.dpdk.org/api/rte__memory_8h.html#a2796da68de6825f8edf53759f8e4d230
2: https://doc.dpdk.org/api/rte__malloc_8h.html#af6360dea35bdf162feeb2b62cf149fd3

Fixes: ff3619d6244b ("malloc: allow attaching to external memory chunks")
Cc: stable@dpdk.org
Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Deepak Khandelwal <deepak.khandelwal@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2 years agotest/table: fix buffer overflow on lpm entry
Vladimir Medvedkin [Thu, 21 Apr 2022 17:35:27 +0000 (17:35 +0000)]
test/table: fix buffer overflow on lpm entry

This patch fixes stack buffer overflow reported by ASan.

Bugzilla ID: 820
Fixes: 5205954791cb ("app/test: packet framework unit tests")
Cc: stable@dpdk.org
Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agonet/mlx5: fix LRO configuration in drop Rx queue
Michael Baum [Mon, 25 Apr 2022 09:30:20 +0000 (12:30 +0300)]
net/mlx5: fix LRO configuration in drop Rx queue

The driver wrongly set the LRO configurations to the TIR of the DevX
drop queue even when LRO is not supported.
Actually, the LRO configuration is not relevant to the drop queue at
all.

This causes failure in the initialization of the device, which doesn't
support LRO where the drop queue is created.

Probably, the drop queue creation by DevX missed the fact that LRO is
set by default in the TIR creation function and didn't unset it in the
drop queue case like other cases that unset LRO.

Move the default LRO configuration to unset it and set it only in the
case of all the TIR queues configured with LRO.

Fixes: bc5bee028ebc ("net/mlx5: create drop queue using DevX")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix LRO validation in Rx setup
Michael Baum [Mon, 25 Apr 2022 09:30:19 +0000 (12:30 +0300)]
net/mlx5: fix LRO validation in Rx setup

The mlx5_rx_queue_setup() get LRO offload from user.

When LRO is configured, the LRO flag in rxq_data is set to 1.

This patch adds validation to make sure the LRO is supported.

Fixes: 17ed314 ("net/mlx5: allow LRO per Rx queue")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix RSS hash types adjustment
Dariusz Sosnowski [Thu, 21 Apr 2022 20:36:56 +0000 (20:36 +0000)]
net/mlx5: fix RSS hash types adjustment

When an indirect action was created with an RSS action configured to
hash on both source and destination L3 addresses (or L4 ports), it caused
shared hrxq to be configured to hash only on destination address
(or port).

This patch fixes this behavior by refining RSS types specified in
configuration before calculating hash types used for hrxq. Refining RSS
types removes *_SRC_ONLY and *_DST_ONLY flags if they are both set.

Fixes: 212d17b6a650 ("net/mlx5: fix missing shared RSS hash types")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix Rx/Tx stats concurrency
Raja Zidane [Wed, 20 Apr 2022 15:32:17 +0000 (18:32 +0300)]
net/mlx5: fix Rx/Tx stats concurrency

Queue statistics are being continuously updated in Rx/Tx burst
routines while handling traffic. In addition to that, statistics
can be reset (written with zeroes) on statistics reset in other
threads, causing a race condition, which in turn could result in
wrong stats.

The patch provides an approach with reference values, allowing
the actual counters to be writable within Rx/Tx burst threads
only, and updating reference values on stats reset.

Fixes: 87011737b715 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix GTP handling in header modify action
Dariusz Sosnowski [Wed, 13 Apr 2022 11:18:31 +0000 (11:18 +0000)]
net/mlx5: fix GTP handling in header modify action

GTP items were ignored during conversion of modify header actions. This
caused modify TTL action to generate a wrong modify header command when
tunnel and inner headers used different IP versions.

This patch adds GTP item handling to modify header action conversion.

Fixes: 04233f36c712 ("net/mlx5: fix layer type in header modify action")
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: support MTU settings on Windows
Adham Masarwah [Sun, 10 Apr 2022 10:31:07 +0000 (13:31 +0300)]
net/mlx5: support MTU settings on Windows

Mlx5Devx library has new API's for setting and getting MTU.
Added new glue functions that wrap the new mlx5devx lib API's.
Implemented the os_ethdev callbacks to use the new glue
functions in Windows.

Signed-off-by: Adham Masarwah <adham@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support promiscuous modes on Windows
Adham Masarwah [Sun, 10 Apr 2022 10:31:06 +0000 (13:31 +0300)]
net/mlx5: support promiscuous modes on Windows

Support of the set promiscuous modes by calling the new API
In Mlx5DevX Lib.
Added new glue API for Windows which will be used to communicate
with Windows driver to enable/disable PROMISC or ALLMC.

Signed-off-by: Adham Masarwah <adham@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: remove redundant check for hairpin queue
Michael Baum [Sun, 10 Apr 2022 09:25:28 +0000 (12:25 +0300)]
net/mlx5: remove redundant check for hairpin queue

The mlx5_rxq_is_hairpin() function checks whether RxQ type is Hairpin.
It is done by reading a flag in Rx control structure coming from
mlx5_rxq_ctrl_get() function.

The function verifies that the queue index is valid even though it has
been checked within the mlx5_rxq_ctrl_get() function.

This patch removes the redundant check.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: restrict Rx queue array access to boundary
Michael Baum [Sun, 10 Apr 2022 09:25:27 +0000 (12:25 +0300)]
net/mlx5: restrict Rx queue array access to boundary

The mlx5_rxq_get() function gets RxQ index and return RxQ priv
accordingly.

When it gets an invalid index, it accesses out of array bounds which
might cause undefined behavior.

This patch adds a check for invalid indexes before accessing to array.

Fixes: 0cedf34da78f ("net/mlx5: move Rx queue reference count")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix setting flags to external Rx queue
Michael Baum [Sun, 10 Apr 2022 09:25:26 +0000 (12:25 +0300)]
net/mlx5: fix setting flags to external Rx queue

The flow_drv_rxq_flags_set sets the Rx queue flags (Mark/Flag and Tunnel
Ptypes) according to the device flow.

It tries to get the RxQ control structure to update its ptype. However,
external RxQs don't have control structure to update and it may cause a
crash.

This patch add check whether this Queue is external.

Fixes: 311b17e669ab ("net/mlx5: support queue/RSS actions for external Rx queue")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix counter in non-termination meter
Shun Hao [Wed, 6 Apr 2022 08:54:01 +0000 (11:54 +0300)]
net/mlx5: fix counter in non-termination meter

In rte_flow, if a counter action is before a meter which has
non-termination policy, the counter value only includes packets not
being dropped.

This patch fixes this issue by differentiating the order of counter and
non-termination meter:
1. counter + meter, counts all packets hitting this flow.
2. meter + counter, only counts packets not being dropped.

Fixes: 51ec04dc7bcf ("net/mlx5: connect meter policy to created flows")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix probing with secondary bonding member
Rongwei Liu [Wed, 6 Apr 2022 07:12:24 +0000 (10:12 +0300)]
net/mlx5: fix probing with secondary bonding member

Users can probe primary or secondary PCIe id when bonding is
configured.
1. -a 0a:00.0,representor=pf[0-1]vf[0-1], PMD probes 5 ports
totally: bonding device plus 4 representor ports.
2. -a 0a:00.1,representor=pf[0-1]vf[0-1], PMD only probes 2
representor ports.

Under the 2nd condition, bonding IB device doesn't have the same
PCIe id and PMD needs to check bonding relationship otherwise
probe failure.

Fixes: 6856efa54eea ("net/mlx5: fix PF leak on PCI probing failure")
Cc: stable@dpdk.org
Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix Tx when inlining is impossible
Dmitry Kozlyuk [Thu, 31 Mar 2022 14:38:41 +0000 (17:38 +0300)]
net/mlx5: fix Tx when inlining is impossible

When txq_inline_max is too large and an mbuf is multi-segment
it may be impossible to inline data and build a valid WQE,
because WQE length would be larger then HW can represent.
It is impossible to detect misconfiguration at startup,
because the condition depends on the mbuf composition.
The check on the data path to prevent the error
treated the length limit as expressed in 64B units,
while the calculated length and limit are in 16B units.
Fix the condition to avoid subsequent TxQ failure and recovery.

Fixes: 18a1c20044c0 ("net/mlx5: implement Tx burst template")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: fix memory region range calculation
Dmitry Kozlyuk [Thu, 31 Mar 2022 14:33:16 +0000 (17:33 +0300)]
common/mlx5: fix memory region range calculation

MR end for a mempool chunk may be calculated incorrectly.
For example, for chunk with addr=1.5M and len=1M with 2M page size
the range would be [0, 2M), while the proper result is [0, 4M).
Fix the calculation.

Fixes: 690b2a88c2f7 ("common/mlx5: add mempool registration facilities")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: handle MPRQ incompatibility with external buffers
Alexander Kozyrev [Fri, 11 Mar 2022 23:08:25 +0000 (01:08 +0200)]
net/mlx5: handle MPRQ incompatibility with external buffers

Multi-Packet Rx queue uses PMD-managed buffers to store packets.
These buffers are externally attached to user mbufs.
This conflicts with the feature that allows using user-managed
externally attached buffers in an application.
Fall back to SPRQ in case external buffers mempool is configured.
The limitation is already documented in mlx5 guide.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/netvsc: fix calculation of checksums based on mbuf flag
Long Li [Thu, 24 Mar 2022 17:46:08 +0000 (10:46 -0700)]
net/netvsc: fix calculation of checksums based on mbuf flag

The netvsc should use RTE_MBUF_F_TX_L4_MASK and check the masked value
to decide the correct way to calculate checksums.

Not checking for RTE_MBUF_F_TX_L4_MASK results in incorrect RNDIS
packets sent to VSP and incorrect checksums calculated by the VSP.

Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2 years agonet/iavf: support quanta size configuration
Wenjun Wu [Fri, 22 Apr 2022 01:43:00 +0000 (09:43 +0800)]
net/iavf: support quanta size configuration

This patch adds quanta size configuration support.
Quanta size should between 256 and 4096, and be a product of 64.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: support queue rate limit configuration
Wenjun Wu [Fri, 22 Apr 2022 01:42:59 +0000 (09:42 +0800)]
net/iavf: support queue rate limit configuration

This patch adds queue rate limit configuration support.
Only max bandwidth is supported.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: remove extra copy step in Rx bulk path
Kathleen Capella [Thu, 24 Mar 2022 22:11:32 +0000 (22:11 +0000)]
net/iavf: remove extra copy step in Rx bulk path

In the Rx bulk path, packets which are taken from the HW ring, are first
copied to the stage data structure and then later copied from the stage
to the rx_pkts array. For the number of packets requested immediately
by the receiving function, this two-step process adds extra overhead
that is not necessary.

Instead, put requested number of packets directly into the rx_pkts array
and only stage excess packets. On N1SDP with 1 core/port, l3fwd saw up
to 4% performance improvement. On x86, no difference in performance was
observed.

Signed-off-by: Kathleen Capella <kathleen.capella@arm.com>
Suggested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix raw flow input pattern parsing
Ting Xu [Mon, 18 Apr 2022 06:59:08 +0000 (14:59 +0800)]
net/ice: fix raw flow input pattern parsing

When parsing raw flow pattern in FDIR, the input parameter spec and
mask are used directly and the original value will be changed. It
will cause error if these values are used in other functions. In this
patch, temporary variables are created to store the spec and mask.

Fixes: 25be39cc1760 ("net/ice: enable protocol agnostic flow offloading in FDIR")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
2 years agonet/ice: refactor parser usage
Qi Zhang [Thu, 7 Apr 2022 16:06:14 +0000 (12:06 -0400)]
net/ice: refactor parser usage

Not necessary to create / destroy a parser instance for every raw packet
rule. A global parser instance will be created in ice_flow_init and be
destroyed in ice_flow_uninit.

Also, ice_dev_udp_tunnel_port_add has been hooked to perform corresponding
parser configure. This also fix the issue that RSS engine can't support
VXLAN inner through raw packet filter.

Fixes: 1b9c68120a1c ("net/ice: enable protocol agnostic flow offloading in RSS")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xu Ting <ting.xu@intel.com>
2 years agonet/ice: add missing Tx burst mode name
Michael Pfeiffer [Mon, 4 Apr 2022 14:41:44 +0000 (16:41 +0200)]
net/ice: add missing Tx burst mode name

The function ice_xmit_pkts_vec_avx2_offload was left out in the list
of tx functions for ice_tx_burst_mode_get.

Fixes: 52ccdcf2fd41 ("net/ice: add AVX2 offload Tx")
Cc: stable@dpdk.org
Signed-off-by: Michael Pfeiffer <michael.pfeiffer@tu-ilmenau.de>
Suggested-by: Michael Rossberg <michael.rossberg@tu-ilmenau.de>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/i40e: populate error in flow director parser
Mike Pattrick [Tue, 22 Mar 2022 03:19:37 +0000 (23:19 -0400)]
net/i40e: populate error in flow director parser

Errors from i40e_flow_parse_fdir_pattern() can bubble up to
rte_flow_create. If rte_flow_error is not initialized a caller may
dereference error->message. This may be uninitialized memory, leading
to a segemntation fault.

Fixes: 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
Cc: stable@dpdk.org
Signed-off-by: Mike Pattrick <mkp@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agonet/ice: improve performance of Rx timestamp offload
Wenjun Wu [Mon, 28 Feb 2022 07:36:07 +0000 (15:36 +0800)]
net/ice: improve performance of Rx timestamp offload

Previously, each time a burst of packets is received, SW reads HW
register and assembles it and the timestamp from descriptor together to
get the complete 64 bits timestamp.

This patch optimizes the algorithm. The SW only needs to check the
monotonicity of the low 32bits timestamp to avoid crossing borders.
Each time before SW receives a burst of packets, it should check the
time difference between current time and last update time to avoid
the low 32 bits timestamp cycling twice.

The patch proved a 50% ~ 70% single core performance improvement on a
main stream Xeon server, this fix the performance gap for some use cases.

Fixes: f9c561ffbccc ("net/ice: fix performance for Rx timestamp")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>