dpdk.git
21 months agodoc: announce behavior change for device NUMA node field deprecation_20220713
Olivier Matz [Wed, 13 Jul 2022 14:34:57 +0000 (16:34 +0200)]
doc: announce behavior change for device NUMA node field

The dev->device.numa_node field is set by the bus driver for each device
it manages to indicate on which NUMA node this device lies.

When this information is unknown, the assigned value is not consistent
accross the bus drivers. In v22.11, the value will be set to -1 in
this case.

Link: https://patches.dpdk.org/project/dpdk/patch/20211026090610.10823-1-houssem.bouhlel@6wind.com/
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
21 months agomaintainers: update for octeontx_ep driver
Veerasenareddy Burru [Wed, 13 Jul 2022 08:18:50 +0000 (01:18 -0700)]
maintainers: update for octeontx_ep driver

Remove Nalla Pradeep as co-maintainer of octeontx_ep driver.
Add Sathesh Edara as co-maintainer of octeontx_ep driver.

Signed-off-by: Veerasenareddy Burru <vburru@marvell.com>
21 months agoversion: 22.07-rc4
Thomas Monjalon [Mon, 11 Jul 2022 21:52:51 +0000 (23:52 +0200)]
version: 22.07-rc4

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
21 months agodoc: add tested Intel platforms with Intel NICs
Lingli Chen [Fri, 8 Jul 2022 09:16:45 +0000 (05:16 -0400)]
doc: add tested Intel platforms with Intel NICs

Add tested Intel platforms with Intel NICs to v22.07 release note.

Signed-off-by: Lingli Chen <linglix.chen@intel.com>
21 months agodoc: add tested platforms with NVIDIA NICs
Raslan Darawsheh [Thu, 7 Jul 2022 13:46:30 +0000 (16:46 +0300)]
doc: add tested platforms with NVIDIA NICs

Add tested platforms with NVIDIA NICs to the 22.07 release notes.

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
21 months agodoc: update NVIDIA devices in mlx5 guides
Raslan Darawsheh [Thu, 7 Jul 2022 14:26:51 +0000 (17:26 +0300)]
doc: update NVIDIA devices in mlx5 guides

This updates the doc to include new supported devices like ConnectX-7,
and updates the description of older ones.

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
21 months agoevent/dlb2: improve CQ weight error messages
Timothy McDaniel [Wed, 6 Jul 2022 21:46:28 +0000 (16:46 -0500)]
event/dlb2: improve CQ weight error messages

This commit changes 2 error messages to better
describe cq_weight related errors, should one occur.

Fixes: ffa46fc4a2b5 ("event/dlb2: support CQ weight")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
21 months agoevent/dlb2: fix CQ weight array overflow
Timothy McDaniel [Wed, 6 Jul 2022 21:46:27 +0000 (16:46 -0500)]
event/dlb2: fix CQ weight array overflow

The cq_weight array must be sized for the maximum number
of eventdev ports, not the maximum number of DLB2
load balanced ports.

This commit fixes the above array sizing bug and resultant
coverity warning.

Coverity issue: 379234
Fixes: ffa46fc4a2b5 ("event/dlb2: support CQ weight")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
21 months agodoc: add IP ECN rewrite requirements to mlx5 guide
Jiawei Wang [Mon, 11 Jul 2022 09:58:58 +0000 (12:58 +0300)]
doc: add IP ECN rewrite requirements to mlx5 guide

This patch updates the mlx5 notes for IPv4/IPv6 ECN field
rewrite offload.

Fixes: c4e442fa4c45 ("ethdev: add IPv4/IPv6 ECN header rewrite action")
Fixes: 097d84a42a87 ("common/mlx5: check ECN modification capability")
Fixes: 76d575612277 ("net/mlx5: support modifying ECN field")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Asaf Penso <asafp@nvidia.com>
22 months agoapp/testpmd: fix RSS types display
Huisong Li [Fri, 8 Jul 2022 01:41:59 +0000 (09:41 +0800)]
app/testpmd: fix RSS types display

Now testpmd fails to display types when query RSS rule. The failure is
because the '\n' character is missing at the end of the function
'rss_config_display()'.
Actually, all places calling 'xxx_types_display()' need to '\n'. So this
patch moves '\n' to the inside of these function.

Bugzilla ID: 1048
Fixes: 534988c490f1 ("app/testpmd: unify RSS types display")
Fixes: 44a37f3cffe0 ("app/testpmd: compact RSS types output")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Tested-by: Weiyuan Li <weiyuanx.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
22 months agoapp/testpmd: fix memory leak for DSCP table
Jasvinder Singh [Tue, 28 Jun 2022 13:29:16 +0000 (14:29 +0100)]
app/testpmd: fix memory leak for DSCP table

Fix memory leak reported by Coverity.

Coverity issue: 379220
Fixes: 9f5488e326d3 ("app/testpmd: support different input color method")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Sean Morrissey <sean.morrissey@intel.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
22 months agoapp/testpmd: fix GTP PSC raw processing
Gregory Etelson [Wed, 6 Jul 2022 16:11:50 +0000 (19:11 +0300)]
app/testpmd: fix GTP PSC raw processing

Fix GTP PSP extension size initialization.
Clear input buffer.

Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
22 months agonet/i40e: disable QinQ by default
Kevin Liu [Thu, 7 Jul 2022 17:04:34 +0000 (17:04 +0000)]
net/i40e: disable QinQ by default

Previously, QinQ is enabled by default and can't be disabled,
but there'll be performance drop if QinQ is enabled.

So, disabled QinQ by default and also updated the knowing VLAN
issue with this configure.

Fixes: 5bd74df1dbf5 ("net/i40e: fix QinQ enablement")

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
22 months agonet/iavf: fix GTP-U extension flow
Wenxuan Wu [Wed, 6 Jul 2022 02:56:26 +0000 (10:56 +0800)]
net/iavf: fix GTP-U extension flow

Due to the change of struct rte_gtp_psc_generic_hdr, kernel driver can
not handle gtp_psc properly, we introduce a new structure to fix this
gap between kernel driver and struct rte_gtp_psc_generic_hdr.

Fixes: d5eb3e600d9e ("net/iavf: support flow director basic rule")
Cc: stable@dpdk.org
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
22 months agovdpa/sfc: resolve race between vhost lib and device conf
Abhimanyu Saini [Wed, 6 Jul 2022 09:24:01 +0000 (14:54 +0530)]
vdpa/sfc: resolve race between vhost lib and device conf

libvhost calls dev_conf() before prosessing the
VHOST_USER_SET_VRING_CALL message for the last VQ. So
this message is processed after dev_conf() returns.

However, the dev_conf() function spawns a thread to set
rte_vhost_host_notifier_ctrl() before returning control to
libvhost. This parallel thread in turn invokes get_notify_area().
To get the notify_area, the vdpa driver needs to query the HW and
for this query it needs an enabled VQ.

But at the same time libvhost is processing the last
VHOST_USER_SET_VRING_CALL, and to do that it disables the last VQ.

Hence there is a race b/w the libvhost and the vdpa driver.

To resolve this race condition, query the HW and cache notify_area
inside dev_conf() instead of doing it the parallel thread.

Fixes: 630be406dcbf ("vdpa/sfc: get queue notify area info")
Cc: stable@dpdk.org
Signed-off-by: Abhimanyu Saini <absaini@amd.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agovdpa/ifc/base: fix null pointer dereference
Andy Pei [Fri, 8 Jul 2022 05:57:41 +0000 (13:57 +0800)]
vdpa/ifc/base: fix null pointer dereference

Fix null pointer dereference reported in coverity scan.
Output some log information when lm_cfg is null.
Make sure lm_cfg is not null before operate on lm_cfg.

Coverity issue: 378882
Fixes: d7fe5a2861e7 ("net/ifc: support live migration")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agovhost: fix unnecessary dirty page logging
Xuan Ding [Thu, 7 Jul 2022 06:55:13 +0000 (06:55 +0000)]
vhost: fix unnecessary dirty page logging

The dirty page logging is only required in vhost enqueue direction for
live migration. This patch removes the unnecessary dirty page logging
in vhost dequeue direction. Otherwise, it will result in a performance
drop. Some if-else judgements are also optimized to improve performance.

Fixes: 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf refactoring")
Fixes: b6eee3e83402 ("vhost: fix sync dequeue offload")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Xingguang He <xingguang.he@intel.com>
22 months agodoc: add release notes for async vhost dequeue datapath
Cheng Jiang [Tue, 28 Jun 2022 02:06:43 +0000 (02:06 +0000)]
doc: add release notes for async vhost dequeue datapath

Add release notes for asynchronous vhost dequeue data-path. Emphasize
that split virtqueue and packed virtqueue are both supported in
asynchronous vhost dequeue data-path.

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovdpa/mlx5: fix leak on event thread creation
David Marchand [Mon, 20 Jun 2022 13:10:44 +0000 (15:10 +0200)]
vdpa/mlx5: fix leak on event thread creation

As stated in the manual, pthread_attr_init return value should be
checked.
Besides, a pthread_attr_t should be destroyed once unused.

In practice, we may have no leak (from what I read in glibc current code),
but this may change in the future.
Stick to a correct use of the API.

Fixes: 5cf3fd3af4df ("vdpa/mlx5: add CPU core parameter to bind polling thread")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Matan Azrad <matan@nvidia.com>
22 months agodoc: add reference to virtio-user from KNI guide
Bruce Richardson [Fri, 10 Jun 2022 15:35:35 +0000 (16:35 +0100)]
doc: add reference to virtio-user from KNI guide

To help encourage use of virtio-user in place of KNI, put a reference to
the relevant howto section at the top of the KNI doc.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agodoc: add code example for virtio-user exception path
Bruce Richardson [Fri, 10 Jun 2022 15:35:34 +0000 (16:35 +0100)]
doc: add code example for virtio-user exception path

The HOWTO guide for using virtio-user as an exception path to the kernel
only provided an example of how testpmd may be used for that purpose.
However, a real application wanting to use virtio-user as exception path
would likely want to create such devices from code within the app
itself. Therefore, we update the doc with instructions and a code
snippet showing how this may be done.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agodoc: rework section on virtio-user as exception path
Bruce Richardson [Fri, 10 Jun 2022 15:35:32 +0000 (16:35 +0100)]
doc: rework section on virtio-user as exception path

This patch extensively reworks the howto guide on using virtio-user for
exception packets. Changes include:

* rename "exceptional path" to "exception path"
* remove references to uio and just reference vfio-pci
* simplify testpmd command-lines, giving a basic usage example first
  before adding on detail about checksum or TSO parameters
* give a complete working example showing traffic flowing through the
  whole system from a testpmd loopback using the created TAP netdev
* replace use of "ifconfig" with Linux standard "ip" command
* other general rewording.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agoexamples/link_status_interrupt: fix stats refresh rate
Raja Zidane [Thu, 7 Jul 2022 08:22:34 +0000 (08:22 +0000)]
examples/link_status_interrupt: fix stats refresh rate

TIMER_MILLISECOND is defined as the number of CPU cycles per millisecond.
The current definition is correct only for cores with frequency of 2GHz.

Use DPDK API to get CPU frequency, and to define timer period.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Signed-off-by: Omar Awaysa <omara@nvidia.com>
22 months agoconfig/arm: add Phytium FT-2000+
Zhipeng Lu [Tue, 5 Jul 2022 13:30:57 +0000 (15:30 +0200)]
config/arm: add Phytium FT-2000+

Here adds configs for Phytium server.

Signed-off-by: Zhipeng Lu <luzhipeng@cestc.cn>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
22 months agoversion: 22.07-rc3
Thomas Monjalon [Tue, 5 Jul 2022 20:28:46 +0000 (22:28 +0200)]
version: 22.07-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
22 months agoapp/regex: fix mbuf size for multi-segment buffer
Raslan Darawsheh [Tue, 5 Jul 2022 08:09:16 +0000 (11:09 +0300)]
app/regex: fix mbuf size for multi-segment buffer

When allocating multi segmented buffers, and in case there is
a remainder in total buf len, the actual job len might be more
than expected job_len.

This adds additional space in the mbuf in the multi seg case,
to allow the remaining memory to be stored in one segment.

Fixes: c1d1b94eec58 ("app/regex: fix number of matches")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
22 months agoapp/regex: avoid division by zero
Thierry Herbelot [Mon, 24 May 2021 08:57:00 +0000 (10:57 +0200)]
app/regex: avoid division by zero

Check that nb_jobs is not zero before using it for a division.

Fixes: f5cffb7eb7fb6 ("app/regex: read data file once at startup")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
22 months agoraw/ntb: add PPD status check for Sapphire Rapids
Junfeng Guo [Thu, 30 Jun 2022 08:56:16 +0000 (08:56 +0000)]
raw/ntb: add PPD status check for Sapphire Rapids

Add PPD (PCIe Port Definition) status check for SPR (Sapphire Rapids).

Note that NTB on SPR has the same device id with that on ICX, while
the field offsets of PPD Control Register are different. Here, we use
the PCI device revision id to distinguish the HW platform (ICX/SPR)
and check the Port Config Status and Port Definition accordingly.

+---------------------------+--------------------+--------------------+
|          Fields           | Bit Range (on ICX) | Bit Range (on SPR) |
+---------------------------+--------------------+--------------------+
| Port Configuration Status | 12                 | 14                 |
| Port Definition           | 9:8                | 10:8               |
+---------------------------+--------------------+--------------------+

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
22 months agodma/idxd: fix null dereference in PCI remove
Kevin Laatz [Mon, 4 Jul 2022 15:27:51 +0000 (16:27 +0100)]
dma/idxd: fix null dereference in PCI remove

The 'info' struct was being declared as a NULL pointer. If a NULL
pointer is passed to 'rte_dma_info_get', EINVAL is returned and the
struct is not populated. This subsequently causes a segfault when
dereferencing 'info'.

This patch fixes the issue by simply declaring 'info' on the stack and
passing its address to 'rte_dma_info_get'.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")
Cc: stable@dpdk.org
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
22 months agodma/idxd: fix partial freeing in PCI close
Kevin Laatz [Mon, 4 Jul 2022 15:27:50 +0000 (16:27 +0100)]
dma/idxd: fix partial freeing in PCI close

During PCI device close, any allocated memory needs to be free'd.
Currently, one of the free's is being called on an incorrect idxd_dmadev
struct member, namely 'batch_idx_ring'.

At device creation, memory is allocated for both 'batch_comp_ring' and
'batch_idx_ring' simultaneously. Calling free only on 'batch_idx_ring'
meant the first half of this memory was not being free'd, leading to the
memleak.

This patch fixes this memleak by calling free on 'batch_comp_ring' which
will free the memory for both rings.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")
Cc: stable@dpdk.org
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
22 months agodma/idxd: fix memory leak in PCI close
Kevin Laatz [Mon, 4 Jul 2022 15:27:49 +0000 (16:27 +0100)]
dma/idxd: fix memory leak in PCI close

ASAN reports a memory leak for the 'pci' pointer in the 'idxd_dmadev'
struct.

This is fixed by free'ing the struct when the last queue on the PCI
device is being closed.

Fixes: 9449330a8458 ("dma/idxd: create dmadev instances on PCI probe")
Cc: stable@dpdk.org
Reported-by: Xingguang He <xingguang.he@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
22 months agocrypto/openssl: fix 3.0 EVP_PKEY usage in RSA operations
Kai Ji [Tue, 5 Jul 2022 13:16:25 +0000 (21:16 +0800)]
crypto/openssl: fix 3.0 EVP_PKEY usage in RSA operations

EVP_PKEY function need to be called twice for RSA sign
and verify operations in 3.0 EVP API. Original OpenSSL
1.x routines are untouched. The OPENSSL_API_COMPAT is
also removed as the driver now supports OpenSSL 3.0 lib
as well when it is detected on the host.

Fixes: d7bd42f6db19 ("crypto/openssl: update RSA routine with 3.0 EVP API")

Signed-off-by: Kai Ji <kai.ji@intel.com>
22 months agocrypto/qat: fix secure session check
Rebecca Troy [Tue, 5 Jul 2022 13:28:18 +0000 (21:28 +0800)]
crypto/qat: fix secure session check

Currently when running the dpdk-perf-test with DOCSIS
security sessions, a segmentation fault occurs. This
is due to the check being made that the session is not
equal to op->sym->sec_session. This check passes the
first time but on the second iteration fails and doesn't
create the build_request.

This commit fixes that error by getting the ctx first
from the private session data and then comparing ctx,
rather than op->sym->sec_session, with the sess.

Fixes: fb3b9f492205 ("crypto/qat: rework burst data path")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Signed-off-by: Kai Ji <kai.ji@intel.com>
22 months agovdpa/mlx5: use common interrupt management
Spike Du [Tue, 5 Jul 2022 13:44:51 +0000 (16:44 +0300)]
vdpa/mlx5: use common interrupt management

Replace vDPA interrupt handle creation logic
with mlx5-common interrupt management function.

Signed-off-by: Spike Du <spiked@nvidia.com>
22 months agonet/mlx5: reject negative integrity item configuration
Raja Zidane [Mon, 4 Jul 2022 10:11:39 +0000 (13:11 +0300)]
net/mlx5: reject negative integrity item configuration

Negative integrity item refers to condition when the item value mask
is set, but value spec is cleared:
    ... integrity value mask l4_ok value spec 0 ...

ethdev library defines integrity bits `l3_ok` and `l4_ok` as accumulators
for all hardware L3 and L4 integrity verifications respectfully.
Hardware `l3_ok` and `l4_ok` integrity bits refer to L3 and L4
network headers only.
Integrity bits `l3_ok` and `l4_ok` are not compatible between
ethdev library and hardware.

PMD translations for ethdev `l3_ok` are:
 IPv4: `l3_ok` and `l3_csum_ok`
 IPv6: `l3_ok`
ethdev `l4_ok` is translated into PMD `l4_ok` and `l4_csum_ok` bits.

Positive IPv4 `l3_ok` flow item configuration is translated into
a single matcher that AND corresponding hardware bits.
Negative IPv4 `l3_ok` is translated into 2 hardware conditions where
each condition probes a single integrity bit:
  ethdev::l3_ok is 0 => MLX5::l3_ok is 0 OR MLX5:l3_csum_ok is 0
MLX5 hardware does not do OR condition in flow rule item.
Negative IPv4 `l3_ok` must be translated into 2 flow rules.
Similarly negative ethdev `l4_ok` condition is also translated into 2
hardware rules.

Current PMD roadmap does not allow implicit flow rule split.

Bugzilla ID: 948
Cc: stable@dpdk.org
Suggested-by: Raja Zidane <rzidane@nvidia.com>
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
22 months agocommon/mlx5: fix non-expandable global MR cache
Dmitry Kozlyuk [Wed, 29 Jun 2022 22:08:00 +0000 (01:08 +0300)]
common/mlx5: fix non-expandable global MR cache

The number of memory regions (MR) that MLX5 PMD can use
was limited by 512 per IB device, the size of the global MR cache
that was fixed at compile time.
The cache allows to search MR LKey by address efficiently,
therefore it is the last place searched on data path
(skipped is the global MR database which would be slow).
If the application logic caused the PMD to create more than 512 MRs,
which can be the case with external memory,
those MRs would never be found on data path
and later cause a HW failure.

The cache size was fixed because at the time of overflow
the EAL memory hotplug lock may be held,
prohibiting to allocate a larger cache
(it must reside in DPDK memory for multi-process support).
This patch adds logic to release the necessary locks,
extend the cache, and repeat the attempt to insert new entries.

`mlx5_mr_btree` structure had `overflow` field
that was set when a cache (not only the global one)
could not accept new entries.
However, it was only checked for the global cache,
because caches of upper layers were dynamically expandable.
With the global cache size limitation removed, this field is not needed.
Cache size was previously limited by 16-bit indices.
Use the space in the structure previously field by `overflow` field
to extend indices to 32 bits.
With this patch, it is the HW and RAM that limit the number of MRs.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
22 months agonet/mlx5: add test for external Rx queue
Michael Baum [Tue, 28 Jun 2022 14:58:41 +0000 (17:58 +0300)]
net/mlx5: add test for external Rx queue

Add mlx5 internal test for map and unmap external RxQs.
This patch adds to testpmd app a runtime function to test the mapping
API.

  testpmd> mlx5 port (port_id) ext_rxq map (sw_queue_id) (hw_queue_id)
  testpmd> mlx5 port (port_id) ext_rxq unmap (sw_queue_id)

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
22 months agonet/mlx5: add test for remote PD and CTX
Michael Baum [Tue, 28 Jun 2022 14:58:40 +0000 (17:58 +0300)]
net/mlx5: add test for remote PD and CTX

Add mlx5 internal option in testpmd similar to run-time function
"port attach" which adds another parameter named "socket" for attaching
port and add 2 devargs before.

The arguments are "cmd_fd" and "pd_handle" using to import device
created out of PMD. Testpmd application import it using IPC, and updates
the devargs list before attaching.

These arguments were added in
the commit 9d936f4f1a5e ("common/mlx5: support remote PD and CTX")

The syntax is:

  testpmd> mlx5 port attach (identifier) socket=(path)

Where "path" is the IPC socket path agreed on the remote process.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
22 months agocommon/cnxk: allow changing PTP mode on CN10K
Tomasz Duszynski [Fri, 1 Jul 2022 11:54:48 +0000 (13:54 +0200)]
common/cnxk: allow changing PTP mode on CN10K

Since firmware has added support for toggling PTP mode on 10k platforms
userspace code should allow doing that as well.

Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
22 months agogro: fix identifying fragmented packets
Kumara Parameshwaran [Mon, 27 Jun 2022 10:31:14 +0000 (16:01 +0530)]
gro: fix identifying fragmented packets

A packet with RTE_PTYPE_L4_FRAG(0x300) contains both RTE_PTYPE_L4_TCP
(0x100) & RTE_PTYPE_L4_UDP (0x200). A fragmented packet as defined in
rte_mbuf_ptype.h cannot be recognized as other L4 types and hence the
GRO layer should not use IS_IPV4_TCP_PKT or IS_IPV4_UDP_PKT for
RTE_PTYPE_L4_FRAG. Hence, if the packet type is RTE_PTYPE_L4_FRAG the
IP header should be parsed to recognize the appropriate IP type and
invoke the respective gro handler.

Fixes: 1ca5e6740852 ("gro: support UDP/IPv4")
Cc: stable@dpdk.org
Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
22 months agoservice: fix lingering active status
Harry van Haaren [Tue, 5 Jul 2022 13:32:07 +0000 (13:32 +0000)]
service: fix lingering active status

This commit fixes an issue where calling rte_service_lcore_stop()
would result in a service's "active on lcore" status becoming stale.

The stale status would result in rte_service_may_be_active() always
returning "1", indicating that the service is not certainly stopped.

This is fixed by ensuring the "active on lcore" status of each service
is set to 0 when an lcore is stopped.

Fixes: e30dd31847d2 ("service: add mechanism for quiescing")
Fixes: 8929de043eb4 ("service: retrieve lcore active state")

Reported-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
22 months agonet/igc: support multi-process
Zhichao Zeng [Thu, 30 Jun 2022 11:03:30 +0000 (19:03 +0800)]
net/igc: support multi-process

The Rx function was not specified in the secondary process, causing the
secondary process to segfault in a multi-process environment.

This patch specify RX/TX functions in "dev_init" to support secondary
processes.

Fixes: 66fde1b943eb ("net/igc: add skeleton")
Cc: stable@dpdk.org
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
22 months agonet/i40e: fix QinQ enablement
Kevin Liu [Wed, 29 Jun 2022 15:39:50 +0000 (15:39 +0000)]
net/i40e: fix QinQ enablement

Enable double VLAN by default after firmware v8.3
and disable double VLAN is not allowed in subsequent
operations.

Fixes: 38e9762be16a ("net/i40e: add outer VLAN processing")

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
22 months agonet/iavf: fix VF reset
Yiding Zhou [Mon, 27 Jun 2022 07:22:32 +0000 (15:22 +0800)]
net/iavf: fix VF reset

When the VF is in closed state, the vf_reset flag can not be reverted
if the VF is reset asynchronously. This prevents all virtchnl commands
from executing, causing subsequent calls to iavf_dev_reset() to fail.

So the vf_reset flag needs to be reverted even when VF is in closed state.

Fixes: 676d986b4b86 ("net/iavf: fix crash after VF reset failure")
Cc: stable@dpdk.org
Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
22 months agonet/ice: fix memory allocation insufficiency
Yuying Zhang [Tue, 28 Jun 2022 04:06:51 +0000 (04:06 +0000)]
net/ice: fix memory allocation insufficiency

Current code doesn't allocate memory of lookup element to add packet
flag. This patch adds one lookup item in the list to fix this memory
issue.

Fixes: 8b95092b7f69 ("net/ice/base: fix direction of flow that matches any")
Cc: stable@dpdk.org
Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
22 months agonet/cnxk: fix extended statistics
Rakesh Kudurumalla [Fri, 1 Jul 2022 12:51:10 +0000 (18:21 +0530)]
net/cnxk: fix extended statistics

This fix replaces the usage of roc_nix_num_xstats_get() which is compile
time RoC API with runtime RoC  roc_nix_xstats_names_get() API resolving
xstat count difference for cn9k and cn10k while displaying xstats
for ethdev ports

Fixes: 825bd1d9d8e6 ("common/cnxk: update extra stats for inline device")
Cc: stable@dpdk.org
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
22 months agodoc: add environment variables in cnxk guide
Nithin Dabilpuram [Fri, 24 Jun 2022 11:32:15 +0000 (17:02 +0530)]
doc: add environment variables in cnxk guide

Add list of environment variables used by cnxk drivers.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
22 months agocommon/cnxk: fix GRE tunnel parsing
Satheesh Paul [Thu, 23 Jun 2022 03:42:04 +0000 (09:12 +0530)]
common/cnxk: fix GRE tunnel parsing

After parsing GRE tunnel, parse subsequent protocols
(for example, TCP or UDP) as tunneled versions.

Fixes: c34ea71b878 ("common/cnxk: add NPC parsing API")
Cc: stable@dpdk.org
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
22 months agonet/virtio-user: fix Rx interrupts with multi-queue
Yuan Wang [Mon, 4 Jul 2022 07:04:28 +0000 (15:04 +0800)]
net/virtio-user: fix Rx interrupts with multi-queue

The callfds[] array stores eventfds sequentially for Rx and Tx vq.

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
22 months agoexamples/vhost: update usage message
Herakliusz Lipiec [Tue, 21 Jun 2022 15:20:33 +0000 (16:20 +0100)]
examples/vhost: update usage message

updating vhost usage message to be aligned with the documentation.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agodoc: update vhost application guide
Herakliusz Lipiec [Tue, 21 Jun 2022 15:20:32 +0000 (16:20 +0100)]
doc: update vhost application guide

Vhost sample app documentation describes parameters that are not in the
code and omits parameters that exist.
Also switching the order of sections on running vhost and VM,
since the --client parameter in the sample line
requires a socket to be created by VM.
Removing uio references and updating with vfio-pci.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agoexamples/vhost: update makefile to match Meson build
Herakliusz Lipiec [Tue, 21 Jun 2022 15:20:31 +0000 (16:20 +0100)]
examples/vhost: update makefile to match Meson build

Meson build system creates a vhost binary but Makefile
and docs reference same as vhost-switch. Updating makefile
to match meson and the docs accordingly.

Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agovhost: prefix logs with context
David Marchand [Fri, 1 Jul 2022 13:20:56 +0000 (15:20 +0200)]
vhost: prefix logs with context

We recently improved the log messages in the vhost library, adding some
context that helps filtering for a given vhost-user device.
However, some parts of the code were missed, and some later code changes
broke this new convention (fixes were sent previous to this patch).

Change the VHOST_LOG_CONFIG/DATA helpers and always ask for a string
used as context. This should help limit regressions on this topic.

Most of the time, the context is the vhost-user device socket path.
For the rest when a vhost-user device can not be related, generic
names were chosen:
- "dma", for vhost-user async DMA operations,
- "device", for vhost-user device creation and lookup,
- "thread", for threads management,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agovhost: improve some datapath log messages
David Marchand [Fri, 1 Jul 2022 07:55:10 +0000 (09:55 +0200)]
vhost: improve some datapath log messages

Those messages were missed when adding socket context.
Fix this.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agovhost: restore device information in log messages
David Marchand [Fri, 1 Jul 2022 07:55:09 +0000 (09:55 +0200)]
vhost: restore device information in log messages

device information in the log messages was dropped.

Fixes: 52ade97e3641 ("vhost: fix physical address mapping")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovhost: add some trailing newline in log messages
David Marchand [Fri, 1 Jul 2022 07:55:08 +0000 (09:55 +0200)]
vhost: add some trailing newline in log messages

VHOST_LOG_* macros don't append a newline.
Add missing ones.

Fixes: e623e0c6d8a5 ("vhost: add reconnect ability")
Fixes: af1475918124 ("vhost: introduce API to start a specific driver")
Fixes: 2dfeebe26546 ("vhost: check return of mutex initialization")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovhost: check DMA info return
Jiayu Hu [Wed, 29 Jun 2022 09:07:06 +0000 (05:07 -0400)]
vhost: check DMA info return

This patch checks the return value of rte_dma_info_get()
called in rte_vhost_async_dma_configure().

Coverity issue: 379066
Fixes: 53d3f4778c1d ("vhost: integrate dmadev in asynchronous data-path")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovdpa/sfc: fix sync between QEMU and vhost-user
Abhimanyu Saini [Tue, 28 Jun 2022 05:29:26 +0000 (10:59 +0530)]
vdpa/sfc: fix sync between QEMU and vhost-user

When DPDK app is running in the VF, it sometimes rings the doorbell
before dev_config has had a chance to complete and hence it misses
the event. As workaround, ring the doorbell when vDPA reports the
notify_area to QEMU.

Fixes: 630be406dcbf ("vdpa/sfc: get queue notify area info")
Cc: stable@dpdk.org
Signed-off-by: Vijay Kumar Srivastava <vsrivast@xilinx.com>
Signed-off-by: Abhimanyu Saini <absaini@amd.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agonet/vhost: fix deadlock on vring state change
Yuan Wang [Mon, 27 Jun 2022 05:51:25 +0000 (13:51 +0800)]
net/vhost: fix deadlock on vring state change

If vring state changes after pmd starts working, the locked vring
notifies pmd, thus calling update_queuing_status(), the latter
will wait for pmd to finish accessing vring, while pmd is also
waiting for vring to be unlocked, thus causing deadlock.

Actually, update_queuing_status() only needs to wait while
destroy/stopping the device, but not in other cases.

This patch adds a flag for whether or not to wait to fix this issue.

Fixes: 1ce3c7fe149f ("net/vhost: emulate device start/stop behavior")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovhost: fix sync dequeue offload
Xuan Ding [Fri, 24 Jun 2022 05:38:24 +0000 (05:38 +0000)]
vhost: fix sync dequeue offload

This patch fixes the missing virtio net header copy in sync
dequeue path caused by refactoring, which affects dequeue
offloading.

Fixes: 6d823bb302c7 ("vhost: prepare sync for descriptor to mbuf refactoring")

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agodoc: fix readability in vhost guide
Herakliusz Lipiec [Thu, 23 Jun 2022 13:57:21 +0000 (14:57 +0100)]
doc: fix readability in vhost guide

fix grammar issues and readbility in vhost library programmer guide

Fixes: 768274ebbd5e ("vhost: avoid populate guest memory")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovdpa/mlx5: add ConnectX-6 LX device ID
Wisam Jaddo [Thu, 23 Jun 2022 09:00:04 +0000 (12:00 +0300)]
vdpa/mlx5: add ConnectX-6 LX device ID

This adds ConnectX-6 LX to the list of supported
Mellanox devices that run the MLX5 vdpa PMD.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agoexamples/vhost: fix retry logic on Rx path
Yuan Wang [Wed, 22 Jun 2022 09:25:55 +0000 (17:25 +0800)]
examples/vhost: fix retry logic on Rx path

drain_eth_rx() uses rte_vhost_avail_entries() to calculate
the available entries to determine if a retry is required.
However, this function only works with split rings, and
calculating packed rings will return the wrong value and cause
unnecessary retries resulting in a significant performance penalty.

This patch fix that by using the difference between tx/rx burst
as the retry condition.

Fixes: be800696c26e ("examples/vhost: use burst enqueue and dequeue from lib")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
22 months agovhost: fix virtio block vDPA live migration IO drop
Andy Pei [Wed, 22 Jun 2022 07:47:08 +0000 (15:47 +0800)]
vhost: fix virtio block vDPA live migration IO drop

In the virtio blk vDPA live migration use case, before the live
migration process, QEMU will set call fd to vDPA back-end. QEMU
and vDPA back-end stand by until live migration starts.
During live migration process, QEMU sets kick fd and a new call
fd. However, after the kick fd is set to the vDPA back-end, the
vDPA back-end configures device and data path starts. The new
call fd will cause some kind of "re-configuration", this kind
of "re-configuration" cause IO drop.
After this patch, vDPA back-end configures device after kick fd
and call fd are well set and make sure no IO drops.
This patch only impact virtio blk vDPA device and does not impact
net device.

Fixes: 7015b6577178 ("vdpa/ifc: add block device SW live-migration")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agodoc: clean vhost async note
Xuan Ding [Wed, 22 Jun 2022 01:45:56 +0000 (01:45 +0000)]
doc: clean vhost async note

This patch moves the 'Recommended IOVA mode in async datapath'
section under 'Vhost asynchronous data path' as a sub-section,
which makes the doc cleaner.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agovdpa/ifc: fix vhost message size check
Andy Pei [Tue, 21 Jun 2022 13:46:31 +0000 (21:46 +0800)]
vdpa/ifc: fix vhost message size check

For vhost message VHOST_USER_GET_CONFIG, we do not check
payload size in vhost lib, we check payload size in driver
specific ops.
For ifc vdpa driver, we just need to make sure payload size
is not smaller than sizeof(struct virtio_blk_config).

Fixes: 856d03bcdc54 ("vdpa/ifc: add block operations")

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
22 months agodoc: add vhost async enqueue API usage
Xuan Ding [Tue, 21 Jun 2022 07:21:31 +0000 (07:21 +0000)]
doc: add vhost async enqueue API usage

This patch updates the correct usage for async enqueue APIs.
The rte_vhost_poll_enqueue_completed() needs to be
called in time to notify the guest of completed packets and
avoid packet loss.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agonet/virtio-user: fix socket non-blocking mode
Yuan Wang [Fri, 17 Jun 2022 02:42:29 +0000 (10:42 +0800)]
net/virtio-user: fix socket non-blocking mode

The virtio-user initialization requires unix socket to receive backend
messages in block mode. However, vhost_user_update_link_state() sets
the same socket to nonblocking via fcntl, which affects all threads.
Enabling the rxq interrupt can causes both of these behaviors to occur
concurrently, with the result that the initialization may fail
because no messages are received in nonblocking socket.

Thread 1:
virtio_init_device()
--> virtio_user_start_device()
--> vhost_user_set_memory_table()
--> vhost_user_check_reply_ack()

Thread 2:
virtio_interrupt_handler()
--> vhost_user_update_link_state()

Fix that by replacing O_NONBLOCK with the recv per-call option
MSG_DONTWAIT.

Fixes: ef53b6030039 ("net/virtio-user: support LSC")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
22 months agonet/netvsc: fix vmbus device reference in multi-process
Long Li [Wed, 29 Jun 2022 23:29:44 +0000 (16:29 -0700)]
net/netvsc: fix vmbus device reference in multi-process

The vmbus device is allocated via "calloc" before the EAL memory is
initialized. The secondary process can't reference the vmbus device as
it is not mapped correctly in the shared memory region.

Replace all references to the vmbus device (and its contents) with the
pointers/contents set by the primary process.

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>
22 months agonet/ngbe: fix customized device probing
Jiawen Wu [Wed, 29 Jun 2022 03:34:17 +0000 (11:34 +0800)]
net/ngbe: fix customized device probing

The devices with OEM subsystem vendor ID failed to be initialized,
because flash was read before memory address was set.

Fixes: 240422edbf84 ("net/ngbe: support OEM subsystem vendor ID")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
22 months agonet/txgbe: fix customized device probing
Jiawen Wu [Wed, 29 Jun 2022 03:34:16 +0000 (11:34 +0800)]
net/txgbe: fix customized device probing

The devices with OEM subsystem vendor ID failed to be initialized,
because flash was read before memory address was set.

Fixes: 138d869e41c0 ("net/txgbe: support OEM subsystem vendor ID")

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
22 months agoapp/testpmd: remove duplicated flow type name table
Ferruh Yigit [Wed, 29 Jun 2022 08:34:51 +0000 (16:34 +0800)]
app/testpmd: remove duplicated flow type name table

Flow type table has two instance, one is used for flow type to string
conversion, and other is used for string to flow type conversion.
And tables are diverged by time.

Unifying tables to prevent maintaining two different tables.

Note: made 'flowtype_to_str()' and 'str_to_flowtype()' non-static to
prevent build error for the case PMDs using it disables. Making the two
functions generic, not for some PMDs.

Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
22 months agoapp/testpmd: reorder RSS type table
Huisong Li [Wed, 29 Jun 2022 08:34:50 +0000 (16:34 +0800)]
app/testpmd: reorder RSS type table

There are group and individual types in rss_type_table[]. However, group
types are very scattered, and individual types are not arranged based on
the bit number order in 'RTE_ETH_RSS_xxx'. For a clear distribution of
types and better maintenance, this patch reorders this table.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
22 months agoapp/testpmd: compact RSS types output
Ferruh Yigit [Wed, 29 Jun 2022 08:34:49 +0000 (16:34 +0800)]
app/testpmd: compact RSS types output

In port info command output, 'show port info all', supported RSS offload
types printed one type per line, and although this information is not
most important part of the command it takes big part of the command
output.

In port RSS hash and flow RSS command output, 'show port 0 rss-hash',
and 'flow query 0 0 rss', all enabled RSS types are printed on one line.
If there are many types, the print will be very long.

Compacting these RSS offloads and types output by fixing the length of
the character string printed on each line, instead of one per line or
one line.
Output becomes as following:

Supported RSS offload flow types:
  ipv4-frag  ipv4-tcp  ipv4-udp  ipv4-sctp  ipv4-other
  ipv6-frag  ipv6-tcp  ipv6-udp  ipv6-sctp  ipv6-other
  l4-dst-only  l4-src-only  l3-dst-only  l3-src-only

Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
22 months agoapp/testpmd: unify RSS types display
Huisong Li [Wed, 29 Jun 2022 08:34:48 +0000 (16:34 +0800)]
app/testpmd: unify RSS types display

The 'rss_type_table[]' maintains the name and value of RSS types. This
patch unifies a common interface to display RSS types.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
22 months agoapp/testpmd: refactor config all RSS command
Huisong Li [Wed, 29 Jun 2022 08:34:47 +0000 (16:34 +0800)]
app/testpmd: refactor config all RSS command

The "port config <port_id> rss-hash-key" and "show port <port_id>
rss-hash key" commands both use the 'rss_type_table[]' to get
'rss_types' or the RSS type name. So this patch uses the
'rss_type_table[]' to get the RSS types.  In this way, this command
naturally supports more individual types.

Suggested-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
22 months agoapp/testpmd: unify name of L2 payload offload
Huisong Li [Wed, 29 Jun 2022 08:34:45 +0000 (16:34 +0800)]
app/testpmd: unify name of L2 payload offload

Currently, the "port config all rss xx" command uses 'ether' name to match
and to set 'RTE_ETH_RSS_L2_PAYLOAD' offload. However, others RSS command,
such as, "port config <port_id> rss-hash-key" and "show port <port_id>
rss-hash key", use 'l2-payload' to represent this offload. So this patch
unifies the name of 'RTE_ETH_RSS_L2_PAYLOAD' offload.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
22 months agoapp/testpmd: fix supported RSS offload display
Huisong Li [Wed, 29 Jun 2022 08:34:44 +0000 (16:34 +0800)]
app/testpmd: fix supported RSS offload display

The rte_eth_dev_info.flow_type_rss_offloads is populated in terms of
RTE_ETH_RSS_* bits. If PMD sets RTE_ETH_RSS_L3_SRC_ONLY to
dev_info->flow_type_rss_offloads. testpmd will display "user defined 63"
when run 'show port info 0'. Because testpmd use flowtype_to_str()
to display the supported RSS offload of PMD. In fact, the function is
used to display flow type in FDIR commands for i40e or ixgbe. This patch
uses the RTE_ETH_RSS_* bits to display supported RSS offload of PMD.

Fixes: b12964f621dc ("ethdev: unification of RSS offload types")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
22 months agodoc: update DLB2 guide
Timothy McDaniel [Sat, 2 Jul 2022 19:35:00 +0000 (14:35 -0500)]
doc: update DLB2 guide

Updated DLB2 guide to document following features.
1) CQ Weight
2) Port COS
3) Maximum CQ depth
4) Maximum enqueue depth

Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
22 months agoevent/dlb2: fix port COS initialization
Timothy McDaniel [Sat, 2 Jul 2022 16:22:39 +0000 (11:22 -0500)]
event/dlb2: fix port COS initialization

Fix cos initialization, handling the default case too.

Substitute the semicolon for the comma
that was expected in the cos_bw command line override.
Commas are not allowed within a multi field option.
The new format is cos_bw=%d:%d:%d:%d, where the sum of
the 4 decimal values must be less than or equal to 100.

Corrected probe-time initialization order.

Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
22 months agoevent/dlb2: fix CQ depth override credit deadlock
Timothy McDaniel [Sat, 2 Jul 2022 16:22:38 +0000 (11:22 -0500)]
event/dlb2: fix CQ depth override credit deadlock

This commit fixes a bug, where we could encounter a credit
deadlock due to changing the CQ depth. To remedy this situation,
the commit reduces the maximum CQ depth from 1024 to 128,
and also allows configuring the maximum enqueue depth. Maximum
enqueue depth must be tuned to the CQ depth, if the CQ depth
is increased.

Fixes: 86fe66d45667 ("event/dlb2: allow CQ depths up to 1024")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
22 months agoevent/dlb2: fix CQ depth override
Timothy McDaniel [Sat, 2 Jul 2022 16:22:37 +0000 (11:22 -0500)]
event/dlb2: fix CQ depth override

This commit fixes a bug, where we could assign a CQ depth
of zero, leading to a subsequent divide-by-zero fault.
It also fixes an issue where the original default CQ depth
was returned on a query, instead of the overridden value.

Fixes: 86fe66d45667 ("event/dlb2: allow CQ depths up to 1024")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
22 months agoevent/dlb2: fix initialization of COS bandwidth args
Timothy McDaniel [Sat, 2 Jul 2022 16:22:36 +0000 (11:22 -0500)]
event/dlb2: fix initialization of COS bandwidth args

This commit fixes a typo and resultant bug that triggered a
coverity warning.

Coverity issue: 4607286
Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
22 months agoevent/dlb2: fix array overflow
Timothy McDaniel [Sat, 2 Jul 2022 16:22:35 +0000 (11:22 -0500)]
event/dlb2: fix array overflow

This commit fixes a segfault that resulted from reading
beyond the end of the port_cos array. The root cause was using
the DLB num ports define instead of the eventdev num ports define.

Fixes: bec8901bfe9f ("event/dlb2: support ldb port specific COS")
Cc: stable@dpdk.org
Signed-off-by: Timothy McDaniel <timothy.mcdaniel@intel.com>
22 months agoeventdev/eth_tx: fix queue delete
Naga Harish K S V [Thu, 23 Jun 2022 10:05:11 +0000 (15:35 +0530)]
eventdev/eth_tx: fix queue delete

Add spinlock protection in queue delete function.
This protects the data path while the queue delete operation
is in progress.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
Cc: stable@dpdk.org
Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>
Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com>
22 months agoexamples/fips_validation: fix print for zero length payload
Archana Muniganti [Thu, 30 Jun 2022 11:21:23 +0000 (16:51 +0530)]
examples/fips_validation: fix print for zero length payload

NIST GCM decrypt result vectors expects to have following print
for zero length payload instead of having no print.
"pt" = ""

Fixes: b09aac2d6e2b ("examples/fips_validation: add JSON to GCM test")

Signed-off-by: Archana Muniganti <marchana@marvell.com>
22 months agoexamples/ipsec-secgw: fix fallback session create
Radu Nicolau [Thu, 30 Jun 2022 11:45:27 +0000 (12:45 +0100)]
examples/ipsec-secgw: fix fallback session create

Fix fallback session create for inline sessions.

Fixes: a8ade12123c3 ("examples/ipsec-secgw: create lookaside sessions at init")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
22 months agodoc: update QAT driver location
Rebecca Troy [Fri, 1 Jul 2022 18:08:07 +0000 (18:08 +0000)]
doc: update QAT driver location

This commit removes any references to the old QAT
driver location 01.org in the documentation and
replaces them with the updated location IDZ (Intel
Development Zone).

This commit also adds a note to the docs to alert
users of a possible error when building the new QAT
driver and provides the patch needed to resolve this
error.

Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agodoc: fix grammar and parameters in l2fwd-crypto guide
Jakub Poczatek [Wed, 1 Jun 2022 09:35:52 +0000 (09:35 +0000)]
doc: fix grammar and parameters in l2fwd-crypto guide

Doc was updated with fixed grammar in most cases. These
include adding periods to ends of sentences and capitalizing
some words. Some instances of "a" were changed to "an". The
option "-n 4" has also been removed from the example of
running the application.

Fixes: ba7b86b1419 ("doc: add l2fwd-crypto sample app guide")
Fixes: 2661f4fbe93 ("examples/l2fwd-crypto: add AEAD parameters")
Fixes: 4790f99d2d3 ("examples/l2fwd-crypto: use cryptodev algorithm parser")
Fixes: 5949e30dae6 ("doc: fix typo in l2fwd-crypto usage")
Fixes: acf8616901b ("cryptodev: add auth IV")
Fixes: b79e4c00af0 ("cryptodev: use AES-GCM/CCM as AEAD algorithms")
Fixes: d2797f51cc6 ("examples/l2fwd-crypto: add cryptodev mask option")
Fixes: e2a94f9ad3e ("doc: remove references to make from apps guide")
Fixes: 10b9d471a6f ("doc: update minimum requirement of l2fwd-crypto")
Fixes: 3cc28001a33 ("doc: fix typo in l2fwd-crypto guide")
Cc: stable@dpdk.org
Signed-off-by: Jakub Poczatek <jakub.poczatek@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
22 months agodoc: fix grammar and formatting in compressdev guide
Ciara Power [Mon, 30 May 2022 16:03:42 +0000 (16:03 +0000)]
doc: fix grammar and formatting in compressdev guide

Small improvements made to the compressdev programmer's guide.
This includes rephrasing some sentences, fixing grammar,
and aligning formatting.

Fixes: a584d3bea902 ("doc: add compressdev library guide")
Fixes: f7095d41bba6 ("doc: clarify data plane error handling in compressdev")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agocrypto/qat: fix DOCSIS crash
Rebecca Troy [Wed, 29 Jun 2022 16:10:36 +0000 (16:10 +0000)]
crypto/qat: fix DOCSIS crash

Currently if AES or DES algorithms fail for DOCSIS test suite,
a segmentation fault occurs when cryptodev_qat_autotest is ran.

This is due to a duplicate call of EVP_CIPHER_CTX_free for the
session context. Ctx is freed firstly in the bpi_cipher_ctx_init
function and then again at the end of qat_sym_session_configure_cipher
function.

This commit fixes this bug by removing the first instance
of EVP_CIPHER_CTX_free, leaving just the dedicated function in
the upper level to free the ctx.

Fixes: 98f060891615 ("crypto/qat: add symmetric session file")
Cc: stable@dpdk.org
Signed-off-by: Rebecca Troy <rebecca.troy@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agoexamples/fips_validation: add parsing for SHA
Gowrishankar Muthukrishnan [Wed, 29 Jun 2022 12:35:06 +0000 (18:05 +0530)]
examples/fips_validation: add parsing for SHA

Added function to parse algorithm for SHA test.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agoexamples/fips_validation: add parsing for AES-XTS
Gowrishankar Muthukrishnan [Wed, 29 Jun 2022 12:35:05 +0000 (18:05 +0530)]
examples/fips_validation: add parsing for AES-XTS

Added function to parse algorithm for AES XTS test.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agoexamples/fips_validation: add AES-CBC in the enum
Gowrishankar Muthukrishnan [Wed, 29 Jun 2022 12:35:04 +0000 (18:05 +0530)]
examples/fips_validation: add AES-CBC in the enum

Add algorithm enum specifically for AES_CBC instead of relying on
AES as such.

Fixes: 8b8546aaedf ("examples/fips_validation: add parsing for AES-CBC")

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agoexamples/fips_validation: handle empty payload
Gowrishankar Muthukrishnan [Tue, 28 Jun 2022 13:11:09 +0000 (18:41 +0530)]
examples/fips_validation: handle empty payload

Allocate at least onebyte to handle empty payload in a test vector
when defined.

Fixes: 3d0fad56b74 ("examples/fips_validation: add crypto FIPS application")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
22 months agocrypto/cnxk: decrement ESN to be used in session
Anoob Joseph [Mon, 27 Jun 2022 08:12:33 +0000 (13:42 +0530)]
crypto/cnxk: decrement ESN to be used in session

ESN provided in the session would be the next sequence number to be
used. Hence predecrement the value, so that in datapath, incremented
value will be as expected.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
22 months agotest/crypto: add additional stream cipher cases
Tejasree Kondoj [Thu, 23 Jun 2022 18:19:47 +0000 (23:49 +0530)]
test/crypto: add additional stream cipher cases

Added ZUC, SNOW3G and AES-CTR-CMAC auth-cipher
test vectors with same auth and cipher offsets
and total digest data encrypted.
Existing tests have different cipher and
auth offsets and partial or no digest encrypted.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
22 months agobaseband/acc100: remove prefix of internal file
Nicolas Chautru [Fri, 24 Jun 2022 23:32:42 +0000 (16:32 -0700)]
baseband/acc100: remove prefix of internal file

File renamed to avoid the rte_ file prefix since rte_acc100_pmd.h
is actually internal only.

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
22 months agotest/crypto: fix SNOW3G vector IV format
Ciara Power [Thu, 23 Jun 2022 14:42:50 +0000 (14:42 +0000)]
test/crypto: fix SNOW3G vector IV format

Some of the cipher and authentication IVs did not follow the spec for
SNOW3G algorithm [1].

Cipher IVs must have the last 3 bytes of each 8 byte block as 0x0.
IV[4] and IV[12] must have the last 2 bits set to 0.
Each 8 byte block is repeated.

Auth IVs must also have a repeated 8 byte block.
IV[8] and IV[14] may have a flipped bit based on direction.

[1] https://www.gsma.com/aboutus/wp-content/uploads/2014/12/uea2uia2d1v21.pdf

Fixes: 8bdf665fe6c0 ("app/test: add SNOW 3G")
Fixes: 24342ade2c9d ("test/crypto: check SNOW3G when digest is encrypted")
Fixes: 02ed7b3871d6 ("test/crypto: add SNOW3G test cases for auth-cipher")
Fixes: 11c5485bb276 ("test/crypto: add scatter-gather tests for IP and OOP")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>
22 months agotest/crypto: fix ZUC vector IV format
Ciara Power [Thu, 23 Jun 2022 14:42:49 +0000 (14:42 +0000)]
test/crypto: fix ZUC vector IV format

Some authentication and cipher IV formats were not following the spec [1].

For ZUC128 cipher IV, an 8 byte block is repeated,
with the last 3 bytes of each being 0x0.
IV[4] and IV[12] must have the last 2 bits set to 0.

Auth IVs must also have repeated bytes with the last 3 bytes
containing 0x0 in each 8 byte block.
IV[4] and IV[12] must have the last 3 bits set to 0.
IV[8] and IV[14] may have a flipped bit based on direction.

[1] https://www.gsma.com/security/wp-content/uploads/2019/05/EEA3_EIA3_specification_v1_8.pdf

Fixes: a81a81850fb1 ("test/crypto: add ZUC test cases for QAT")
Fixes: b1c1df46878d ("test/crypto: add ZUC test cases for auth-cipher")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Tejasree Kondoj <ktejasree@marvell.com>