dpdk.git
2 years agonet/ice/base: fix PF ID for DCF
Dapeng Yu [Mon, 13 Sep 2021 02:40:02 +0000 (10:40 +0800)]
net/ice/base: fix PF ID for DCF

In original implementation, if DCF is created on PF1, the PF ID is
still 0, but not 1. Without the right PF ID, the ACL will not work.

This patch makes VF to get its parent's physical function ID.

Fixes: 0b02c9519432 ("net/ice: handle PF initialization by DCF")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/i40e: fix device startup resource release
Qiming Chen [Sat, 21 Aug 2021 09:44:35 +0000 (17:44 +0800)]
net/i40e: fix device startup resource release

In the eth_i40e_dev_init function, the tunnel and ethertype hash table
resource release interface should be rte_hash_free instead of rte_free,
and the previously registered interrupt handling function also needs to
be removed from the interrupt list. The patch is amended to use the
correct interface to release the hash table resource and release the
interrupt handling function at the same time.

Fixes: 425c3325f0b0 ("net/i40e: store tunnel filter")
Fixes: 5c53c82c8174 ("net/i40e: store flow director filter")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/i40e: fix mbuf leak
Qiming Chen [Mon, 23 Aug 2021 01:50:34 +0000 (09:50 +0800)]
net/i40e: fix mbuf leak

A local test found that repeated port start and stop operations during
the continuous SSE vector bufflist receiving process will cause the mbuf
resource to run out. The final positioning is when the port is stopped,
the mbuf of the pkt_first_seg pointer is not released. Resources leak.
The patch scheme is to judge whether the pointer is empty when the port
is stopped, and release the corresponding mbuf if it is not empty.

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/iavf: update base driver version
Haiyue Wang [Tue, 7 Sep 2021 07:33:04 +0000 (15:33 +0800)]
common/iavf: update base driver version

Update the driver version to trace the change.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/iavf: remove flow director query opcode
Haiyue Wang [Tue, 7 Sep 2021 07:33:03 +0000 (15:33 +0800)]
common/iavf: remove flow director query opcode

The VIRTCHNL_OP_QUERY_FDIR_FILTER opcode is not used, so remove it.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/iavf: enable hash calculation based on L4 checksum
Alvin Zhang [Tue, 7 Sep 2021 07:33:02 +0000 (15:33 +0800)]
common/iavf: enable hash calculation based on L4 checksum

Add TCP/UDP/SCTP header checksum field selectors, they can be used in
creating FDIR or RSS rules related to TCP/UDP/SCTP header checksum.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/iavf: add QFI fields for GTPU UL and DL
Junfeng Guo [Tue, 7 Sep 2021 07:33:01 +0000 (15:33 +0800)]
common/iavf: add QFI fields for GTPU UL and DL

The QFI is 6-bit "QoS Flow Identifier" within the GTPU Extension Header.
Add virtchnl fields QFI of GTPU UL/DL for supporting the AVF FDIR.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/octeontx2: fix MTU when PTP is enabled
Hanumanth Reddy Pothula [Tue, 10 Aug 2021 07:21:00 +0000 (12:51 +0530)]
net/octeontx2: fix MTU when PTP is enabled

Update MTU value based on PTP enable status and reserve eight
bytes in TX path to accommodate VLAN tags.

If PTP is enabled maximum allowed MTU is 9200 otherwise it's 9208.

Fixes: b5dc3140448e ("net/octeontx2: support base PTP")
Cc: stable@dpdk.org
Signed-off-by: Hanumanth Reddy Pothula <hpothula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add callback to get link status
Harman Kalra [Fri, 30 Jul 2021 16:08:29 +0000 (21:38 +0530)]
net/cnxk: add callback to get link status

Adding a new callback for reading the link status. PF can read its
link status and can forward the same to VF once it comes up.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: send link status event to VF
Harman Kalra [Fri, 30 Jul 2021 16:08:28 +0000 (21:38 +0530)]
common/cnxk: send link status event to VF

Currently link event is only sent to the PF by AF as soon as it comes
up, or in case of any physical change in link. PF will broadcast
these link events to all its VFs as soon as it receives it.
But no event is sent when a new VF comes up, hence it will not have
the link status.
Adding support for sending link status to the VF once it comes up
successfully.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support dual VLAN insert and strip actions
Satheesh Paul [Mon, 19 Jul 2021 05:41:57 +0000 (11:11 +0530)]
common/cnxk: support dual VLAN insert and strip actions

Add ROC API to configure dual VLAN tag addition and removal.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/bnxt: fix Rx queue startup state
Lance Richardson [Tue, 14 Sep 2021 12:50:58 +0000 (08:50 -0400)]
net/bnxt: fix Rx queue startup state

Since the addition of support for runtime queue setup,
receive queues that are started by default no longer
have the correct state. Fix this by setting the state
when a port is started.

Fixes: 0105ea1296c9 ("net/bnxt: support runtime queue setup")
Cc: stable@dpdk.org
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2 years agonet/mlx5: fix RSS expansion traversal over next nodes
Lior Margalit [Sun, 5 Sep 2021 09:35:58 +0000 (12:35 +0300)]
net/mlx5: fix RSS expansion traversal over next nodes

The RSS expansion is based on DFS algorithm to traverse over the possible
expansion paths.

The current implementation breaks out, if it reaches the terminator of
the "next nodes" array, instead of going backwards to try the next path.
For example:
testpmd> flow create 0 ingress pattern eth / ipv6 / udp / vxlan / end
actions rss level 2 types tcp end / end
The paths found are:
ETH IPV6 UDP VXLAN END
ETH IPV6 UDP VXLAN ETH IPV4 TCP END
ETH IPV6 UDP VXLAN ETH IPV6 TCP END
The traversal stopped after getting to the terminator of the next nodes
of the ETH node. It missed the rest of the nodes in the next nodes array
of the VXLAN node.

The fix is to go backwards when reaching the terminator of the current
level and find if there is a "next node" to start traversing a new path.
Using the above example, the flows will be:
ETH IPV6 UDP VXLAN END
ETH IPV6 UDP VXLAN ETH IPV4 TCP END
ETH IPV6 UDP VXLAN ETH IPV6 TCP END
ETH IPV6 UDP VXLAN IPV4 TCP END
ETH IPV6 UDP VXLAN IPV6 TCP END
The traversal will find additional paths, because it traverses through
all the next nodes array of the VXLAN node.

Fixes: 4ed05fcd441b ("ethdev: add flow API to expand RSS flows")
Cc: stable@dpdk.org
Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix RSS expansion for explicit graph node
Lior Margalit [Sun, 5 Sep 2021 09:35:57 +0000 (12:35 +0300)]
net/mlx5: fix RSS expansion for explicit graph node

The RSS expansion algorithm is using a graph to find the possible
expansion paths. A graph node with the 'explicit' flag will be skipped,
if it is not found in the flow pattern.

The current implementation misses the case where the node with the
explicit flag is in the middle of the expanded path.
For example:
testpmd> flow create 0 ingress pattern eth / ipv6 / udp / vxlan / end
actions rss level 2 types tcp end / end
The VLAN node has the explicit flag, so it is currently included in the
expanded flow:
ETH IPV6 UDP VXLAN END
ETH IPV6 UDP VXLAN ETH VLAN IPV4 TCP END
ETH IPV6 UDP VXLAN ETH VLAN IPV6 TCP END

The fix is to skip the nodes with the explicit flag while iterating over
the possible expansion paths. Using the above example, the flows will be:
ETH IPV6 UDP VXLAN END
ETH IPV6 UDP VXLAN ETH IPV4 TCP END
ETH IPV6 UDP VXLAN ETH IPV6 TCP END

Fixes: 3f02c7ff6815 ("net/mlx5: fix RSS expansion for inner tunnel VLAN")
Cc: stable@dpdk.org
Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/virtio: fix device configure without jumbo Rx offload
Ivan Ilchenko [Thu, 2 Sep 2021 14:39:39 +0000 (17:39 +0300)]
net/virtio: fix device configure without jumbo Rx offload

Use max-pkt-len only if jumbo frames offload is requested
since otherwise this field isn't valid.

Fixes: 8b90e4358112 ("net/virtio: set offload flag for jumbo frames")
Fixes: 4e8169eb0d2d ("net/virtio: fix Rx scatter offload")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: promote some APIs to stable
Chenbo Xia [Tue, 7 Sep 2021 02:58:00 +0000 (10:58 +0800)]
vhost: promote some APIs to stable

As reported by symbol bot, APIs listed in this patch have been
experimental for more than two years. This patch promotes these
18 APIs to stable.

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: log socket path on adding connection
Gaoxiang Liu [Tue, 7 Sep 2021 00:51:27 +0000 (08:51 +0800)]
vhost: log socket path on adding connection

Add log print of socket path in vhost_user_add_connection.
It's useful when adding a mass of socket connections,
because the information of every connection is clearer.

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/virtio: fix repeated freeing of virtqueue
Gaoxiang Liu [Tue, 31 Aug 2021 14:39:51 +0000 (22:39 +0800)]
net/virtio: fix repeated freeing of virtqueue

When virtio_init_queue returns error, the memory of vq is freed.
But the value of hw->vqs[queue_idx] does not restore.
If virtio_init_queue returns error, the memory of vq is freed again
in virtio_free_queues.

Fixes: 69c80d4ef89b ("net/virtio: allocate queue at init stage")
Cc: stable@dpdk.org
Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: fix crash on port deletion
Gaoxiang Liu [Thu, 2 Sep 2021 15:45:53 +0000 (23:45 +0800)]
vhost: fix crash on port deletion

The rte_vhost_driver_unregister() and vhost_user_read_cb()
can be called at the same time by 2 threads.
when memory of vsocket is freed in rte_vhost_driver_unregister(),
the invalid memory of vsocket is accessed in vhost_user_read_cb().
It's a bug of both mode for vhost as server or client.

E.g., vhostuser port is created as server.
Thread1 calls rte_vhost_driver_unregister().
Before the listen fd is deleted from poll waiting fds,
"vhost-events" thread then calls vhost_user_server_new_connection(),
then a new conn fd is added in fdset when trying to reconnect.
"vhost-events" thread then calls vhost_user_read_cb() and
accesses invalid memory of socket while thread1 frees the memory of
vsocket.

E.g., vhostuser port is created as client.
Thread1 calls rte_vhost_driver_unregister().
Before vsocket of reconn is deleted from reconn list,
"vhost_reconn" thread then calls vhost_user_add_connection()
then a new conn fd is added in fdset when trying to reconnect.
"vhost-events" thread then calls vhost_user_read_cb() and
accesses invalid memory of socket while thread1 frees the memory of
vsocket.

The fix is to move the "fdset_try_del" in front of free memory of conn,
then avoid the race condition.

The core trace is:
Program terminated with signal 11, Segmentation fault.

Fixes: 52d874dc6705 ("vhost: fix crash on closing in client mode")
Cc: stable@dpdk.org
Signed-off-by: Gaoxiang Liu <liugaoxiang@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/virtio-user: fix Rx interrupts with multi-queue
David Marchand [Tue, 31 Aug 2021 15:54:11 +0000 (17:54 +0200)]
net/virtio-user: fix Rx interrupts with multi-queue

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

Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: avoid unneeded link interrupt configuration
David Marchand [Tue, 31 Aug 2021 15:54:10 +0000 (17:54 +0200)]
net/virtio: avoid unneeded link interrupt configuration

There is no reason to re-register a interrupt handler for LSC if this
feature was not requested in the first place.
A simple use case is when asking for Rx interrupts without LSC interrupt.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: report max/min/align Rx descriptor limits
Ivan Ilchenko [Fri, 20 Aug 2021 12:48:12 +0000 (15:48 +0300)]
net/virtio: report max/min/align Rx descriptor limits

Report max/min/align descriptors limits in device info get callback.
Before calling the callback, rte_eth_dev_info_get() provides
default values of nb_min as zero and nb_max as UINT16_MAX that are
not correct for the driver, so one can't rely on them.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: fix split queue vectorized Rx
Ivan Ilchenko [Fri, 20 Aug 2021 12:47:52 +0000 (15:47 +0300)]
net/virtio: fix split queue vectorized Rx

Descriptors number may be set less than queue size for split queue
vectorized Rx path. Pointers to mbufs for received packets are
obtained from SW ring, that is initially filled with them in the end
of queue setup in virtio_dev_rx_queue_setup_finish(). The begin of the
SW ring filled up to the size of descriptors number. At queue size
offset from the begin of the SW ring pointers to some fake mbuf are also
set for wrapping purpose. So the ring may contains the hole of invalid
pointers from descriptors number offset to queue size offset, and split
vectorized Rx routines could write to the invalid addresses since they
use the ring up to the queue size. Fix this by setting descriptors
number to queue size on Rx queue setup.

Fixes: fc3d66212fed ("virtio: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: remove handling of zero desc on Rx setup
Ivan Ilchenko [Fri, 20 Aug 2021 12:47:41 +0000 (15:47 +0300)]
net/virtio: remove handling of zero desc on Rx setup

Rx queue setup callback allows to use the whole ring when
descriptor number argument equals zero. There's no point to
handle zero in any way since RTE Rx queue setup function
rte_eth_rx_queue_setup() doesn't pass zero using fallback
values.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/virtio: fix mbuf count on Rx queue setup
Ivan Ilchenko [Fri, 20 Aug 2021 12:47:20 +0000 (15:47 +0300)]
net/virtio: fix mbuf count on Rx queue setup

Rx queue setup finish function may report wrong number of
allocated mbufs in case of in-order feature. Fix the
function to not ignore allocation error and count only
successfully allocated number of buffers.

Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: remove copy threshold for async path
Jiayu Hu [Fri, 20 Aug 2021 12:44:26 +0000 (08:44 -0400)]
vhost: remove copy threshold for async path

Copy threshold has been introduced in async vhost data
path to select the appropriate copy engine to do copies
for higher efficiency.

However, it may cause packets ordering issues and also
introduces performance unpredictability.

Therefore, this patch removes copy threshold support in
async vhost data path.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet: fix checksum offload for outer IPv4
Mohsin Kazmi [Tue, 7 Sep 2021 10:49:16 +0000 (12:49 +0200)]
net: fix checksum offload for outer IPv4

Preparation of the headers for the hardware offload
misses the outer IPv4 checksum offload.
It results in bad checksum computed by hardware NIC.

This patch fixes the issue by setting the outer IPv4
checksum field to 0.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Mohsin Kazmi <mohsin.kazmi14@gmail.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2 years agoethdev: promote sibling iterators to stable
David Marchand [Mon, 6 Sep 2021 13:02:20 +0000 (15:02 +0200)]
ethdev: promote sibling iterators to stable

This API saw no update since its introduction and will help applications
like OVS ([1] and [2]) that currently look at rte_eth_devices[] to
achieve the same.

1: https://github.com/openvswitch/ovs/blob/master/lib/netdev-dpdk.c#L1285
2: https://github.com/openvswitch/ovs/blob/master/lib/netdev-dpdk.c#L1476

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agoethdev: promote burst mode API
Haiyue Wang [Mon, 6 Sep 2021 05:56:18 +0000 (13:56 +0800)]
ethdev: promote burst mode API

The DPDK Symbol Bot reports:
Please note the symbols listed below have expired. In line with the
DPDK ABI policy, they should be scheduled for removal, in the next
DPDK release.

Symbol
rte_eth_rx_burst_mode_get
rte_eth_tx_burst_mode_get

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: fix typo in Rx queue setup API comment
Joyce Kong [Mon, 6 Sep 2021 02:13:53 +0000 (21:13 -0500)]
ethdev: fix typo in Rx queue setup API comment

Fix a typo that mb_pool was misspelt as mp_pool.

Fixes: 4ff702b5dfa9 ("ethdev: introduce Rx buffer split")
Cc: stable@dpdk.org
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agoethdev: promote API to set packet types
Pavan Nikhilesh [Thu, 2 Sep 2021 08:17:30 +0000 (13:47 +0530)]
ethdev: promote API to set packet types

Remove experimental tag from rte_eth_dev_set_ptypes().

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agonet/softnic: promote manage API
Jasvinder Singh [Wed, 1 Sep 2021 12:20:52 +0000 (13:20 +0100)]
net/softnic: promote manage API

This API was introduced in 18.08, therefore removing
experimental tag to promote it to stable state.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agoethdev: promote API to get interrupt FD per queue
Xiaoyun Li [Wed, 1 Sep 2021 01:50:54 +0000 (09:50 +0800)]
ethdev: promote API to get interrupt FD per queue

Remove the experimental tag for rte_eth_dev_rx_intr_ctl_q_get_fd API
that was introduced in 18.11 and have been around for 11 releases.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agoeal: fix memory leak when saving arguments
Conor Walsh [Wed, 1 Sep 2021 09:38:47 +0000 (09:38 +0000)]
eal: fix memory leak when saving arguments

This patch fixes a memleak which was reported in Bugzilla within the
eal_save_args function. This was caused by the function mistakenly
adding -- to the eal args instead of breaking beforehand.

Bugzilla ID: 722
Fixes: 293c53d8b23c ("eal: add telemetry callbacks")

Reported-by: Zhihong Peng <zhihongx.peng@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Signed-off-by: Conor Fogarty <conor.fogarty@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agoconfig/arm: make N2 crypto an optional feature
Juraj Linkeš [Tue, 17 Aug 2021 10:56:50 +0000 (12:56 +0200)]
config/arm: make N2 crypto an optional feature

Not all Neoverse-N2 CPUs must support the crypto feature/extension
which makes it an optional feature.
Only enable the feature for SoCs which support it.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2 years agoconfig/arm: split -march into arch and features
Juraj Linkeš [Tue, 17 Aug 2021 10:56:49 +0000 (12:56 +0200)]
config/arm: split -march into arch and features

Older compilers may not support all arch versions and all features that
the target SoC supports, in which case it's better to figure out the
highest arch version and features that the compiler supports.
Implement a way to achieve this:
1. Find the highest arch version that the compiler supports,
keeping in mind the SoC arch version we're building.
For example, if the SoC arch version is arm8.2-a,
but the compiler only supports arm8.1-a, use arm8.1-a.
On the other hand, if the compiler supports arm8.3-a (or higher),
use armv8.2-a.
2. With the architecture version locked, iterate over SoC features and
use all that are supported.

In all cases, emit a warning if there's something unsupported by the
compiler.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
2 years agoexamples/service_cores: fix lcore count check
Ruifeng Wang [Mon, 30 Aug 2021 08:04:12 +0000 (16:04 +0800)]
examples/service_cores: fix lcore count check

The example has various profiles to run services on specified
number of lcores. Due to incorrect boundary condition, service
can be dispatched to a core that does not exist. This puts main
core into endless wait.

Max available number of service cores is all detected lcores
excluding main core.

Fixes: 7f6ee6aee717 ("examples/service_cores: check cores before run")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
2 years agoeal: remove deprecated noninclusive API
Stephen Hemminger [Mon, 23 Aug 2021 15:06:53 +0000 (08:06 -0700)]
eal: remove deprecated noninclusive API

New API for these were added in 20.11 and the old API was retained
but marked deprecated. Since 21.11 is the next LTS, it is time
to remove the deprecated ones.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agotest/func_reentrancy: free memzones after test
Joyce Kong [Mon, 23 Aug 2021 02:57:40 +0000 (21:57 -0500)]
test/func_reentrancy: free memzones after test

Function reentrancy test limits maximum number of iterations
simultaneously, however it doesn't free the 'fr_test_once'
memzones after the fact, so introduce freeing 'fr_test_once'
in ring/mempool/hash/fbk/lpm_clean.

Meanwhile, add the missing free for test case on main thread.

Fixes: 104a92bd026f ("app: add reentrancy tests")
Fixes: 995eec619024 ("test: clean up memory for function reentrancy test")
Cc: stable@dpdk.org
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agobuild: add optional NUMA and CPU counts detection
Juraj Linkeš [Tue, 17 Aug 2021 10:45:56 +0000 (12:45 +0200)]
build: add optional NUMA and CPU counts detection

Add an option to automatically discover the host's NUMA and CPU counts
and use those values for a non cross-build.
Give users the option to override the per-arch default values or values
from cross files by specifying them on the command line with -Dmax_lcores
and -Dmax_numa_nodes.

Signed-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agotest/crypto: fix minsize build
Thomas Monjalon [Sun, 8 Aug 2021 12:51:37 +0000 (14:51 +0200)]
test/crypto: fix minsize build

Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

app/test/test_cryptodev_blockcipher.c:1133:45: error:
‘blk_tcs’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|         const struct blockcipher_test_case *blk_tcs;
|                                             ^~~~~~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agovdpa/mlx5: fix minsize build
Thomas Monjalon [Sun, 8 Aug 2021 12:51:36 +0000 (14:51 +0200)]
vdpa/mlx5: fix minsize build

Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

drivers/vdpa/mlx5/mlx5_vdpa_mem.c: In function â€˜mlx5_vdpa_mem_register’:
drivers/vdpa/mlx5/mlx5_vdpa_mem.c:183:24: error:
initialization of â€˜uint64_t’ {aka â€˜long unsigned int’} from â€˜void *’
makes integer from pointer without a cast [-Werror=int-conversion]
|         uint64_t gcd = NULL;
|                        ^~~~
drivers/vdpa/mlx5/mlx5_vdpa_mem.c:244:75: error:
‘mode’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|                         klm_size = mode == MLX5_MKC_ACCESS_MODE_KLM ?
|                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                               KLM_SIZE_MAX_ALIGN(empty_region_sz) : gcd;
|                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agoregex/mlx5: fix minsize build
Thomas Monjalon [Sun, 8 Aug 2021 12:51:35 +0000 (14:51 +0200)]
regex/mlx5: fix minsize build

Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

drivers/regex/mlx5/mlx5_regex_fastpath.c:398:17: error:
‘len’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
|                 complete_umr_wqe(qp, sq, &qp->jobs[mkey_job_id], sq->pi,
|                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|                                  klm_num, len);
|                                  ~~~~~~~~~~~~~
drivers/regex/mlx5/mlx5_regex_fastpath.c:315:31: note: â€˜len’ was declared here
|         uint32_t klm_num = 0, len;
|                               ^~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
2 years agonet/qede: fix minsize build
Thomas Monjalon [Sun, 8 Aug 2021 12:51:34 +0000 (14:51 +0200)]
net/qede: fix minsize build

Error occurs when configuring meson with --buildtype=minsize
with GCC 11.1.0:

In function â€˜__internal_ram_wr_relaxed’,
    inlined from â€˜internal_ram_wr’ at ecore_int_api.h:166:2,
    inlined from â€˜qede_update_rx_prod.constprop’ at qede_rxtx.c:736:2:
drivers/net/qede/base/bcm_osal.h:136:9: error:
‘rx_prods’ is used uninitialized [-Werror=uninitialized]
|         rte_write32_relaxed((_val), (_reg_addr))
|         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ecore_int_api.h:151:17: note: in expansion of macro â€˜DIRECT_REG_WR_RELAXED’
|                 DIRECT_REG_WR_RELAXED(p_hwfn, &((u32 OSAL_IOMEM *)addr)[i],
|                 ^~~~~~~~~~~~~~~~~~~~~
drivers/net/qede/qede_rxtx.c: In function â€˜qede_update_rx_prod.constprop’:
drivers/net/qede/qede_rxtx.c:724:33: note: â€˜rx_prods’ declared here
|         struct eth_rx_prod_data rx_prods = { 0 };
|                                 ^~~~~~~~

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Devendra Singh Rawat <dsinghrawat@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
2 years agoconfig/ppc: fix build with GCC >= 10
David Marchand [Wed, 15 Sep 2021 05:08:12 +0000 (07:08 +0200)]
config/ppc: fix build with GCC >= 10

Like for python, multiline statements in meson must either use a
backslash character (explicit continuation) or be enclosed in ()
(implicit continuation).

python PEP8 recommends the latter [1], and it looks like meson had
an issue with backslash before 0.50 [2].

1: https://www.python.org/dev/peps/pep-0008/#multiline-if-statements
2: https://github.com/mesonbuild/meson/commit/90c9b868b20b

Fixes: 394407f50c90 ("config/ppc: ignore GCC 11 psabi warnings")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2 years agobuild: fix essential drivers in disable list
Bruce Richardson [Wed, 18 Aug 2021 13:42:40 +0000 (14:42 +0100)]
build: fix essential drivers in disable list

The PCI and vdev bus drivers cannot be disabled for DPDK builds and
special logic is put in place to not skip them when they are specified
in the disable list. This logic is broken though, as the inclusion of
the driver-specific meson.build file is only included in the "else" leg
of the condition check. This means that when they are specified as
disabled the PCI and vdev buses are not disabled, but neither are their
source files compiled.

Fix this by moving the "subdir()" call into the next "if build" block,
ensuring that if not disabled the sources are always included. To take
account of the fact that the subdir call could itself disable the
driver, we add a break call into the following loop to ensure we quickly
fall through to the following block which stops processing appropriately
if the driver is disabled.

Fixes: 2e33309ebe03 ("config: enable/disable drivers in Arm builds")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2 years agodoc: add release milestones definition
Asaf Penso [Tue, 14 Sep 2021 07:56:04 +0000 (09:56 +0200)]
doc: add release milestones definition

Adding more information about the release milestones.
This includes the scope of change, expectations, etc.

Signed-off-by: Asaf Penso <asafp@nvidia.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agobuild: propagate Windows system dependencies to pkg-config
Dmitry Kozlyuk [Thu, 19 Aug 2021 23:14:46 +0000 (02:14 +0300)]
build: propagate Windows system dependencies to pkg-config

Windows EAL depends on some system libraries. They were linked using
add_project_link_arguments('-l<LIB>'), which prevented meson from adding
them to Libs.private of pkg-config file. As a result, applications using
pkg-config to find DPDK hit link errors, for example:

    librte_eal.a(eal_windows_eal_debug.c.obj) : error LNK2019: unresolved
    external symbol __imp_SymInitialize referenced in function
    rte_dump_stack

Reference required libraries in EAL using ext_deps meson variable.
bus/pci and net/pcap depend on lib/eal and will pull them automatically.
Drop advapi32 dependency, as MinGW locates VirtualAlloc2() dynamically.

Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management")
Fixes: c91717eb75c8 ("eal/windows: support exit and panic")
Cc: stable@dpdk.org
Reported-by: William Tu <u9012063@gmail.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: William Tu <u9012063@gmail.com>
2 years agocryptodev: fix indent in Meson file
Thomas Monjalon [Tue, 14 Sep 2021 13:57:32 +0000 (15:57 +0200)]
cryptodev: fix indent in Meson file

Fixes: af668035f7f4 ("cryptodev: expose driver interface as internal")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2 years agonet/ice: fix performance with writeback policy
Qi Zhang [Sun, 29 Aug 2021 09:24:52 +0000 (17:24 +0800)]
net/ice: fix performance with writeback policy

Apply the same fix that for iavf to DCF
commit ead06572bd8f ("net/iavf: fix performance with writeback policy")

Fixes: 4b0d391f0eab ("net/ice: add queue config in DCF")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Lijuan Tu <lijuan.tu@intel.com>
2 years agonet/ixgbe: fix mbuf leak
Qiming Chen [Wed, 1 Sep 2021 07:22:37 +0000 (15:22 +0800)]
net/ixgbe: fix mbuf leak

A local test found that repeated port start and stop operations during
the continuous SSE vector bufflist receiving process will cause the mbuf
resource to run out. The final positioning is when the port is stopped,
the mbuf of the pkt_first_seg pointer is not released. Resources leak.
The patch scheme is to judge whether the pointer is empty when the port
is stopped, and release the corresponding mbuf if it is not empty.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/ixgbe: fix MAC resource leak
Qiming Chen [Wed, 1 Sep 2021 07:12:07 +0000 (15:12 +0800)]
net/ixgbe: fix MAC resource leak

In the eth_ixgbevf_dev_init and eth_ixgbe_dev_init functions, memory is
allocated for the MAC address, and the address is stored in the
eth_dev->data->mac_addrs member variable. If the subsequent function is
abnormal, you need to use the rte_free function to release the MAC
address memory.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/ixgbe: fix queue resource leak
Qiming Chen [Tue, 31 Aug 2021 13:40:17 +0000 (21:40 +0800)]
net/ixgbe: fix queue resource leak

In the ixgbevf_dev_start function, after initializing the rxtx queue, if
an exception occurs in the subsequent function, the rxtx queue needs to
be released. The patch solves the problem of queue resource leakage.

Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/ixgbe: fix hash handle leak
Qiming Chen [Tue, 31 Aug 2021 13:24:07 +0000 (21:24 +0800)]
net/ixgbe: fix hash handle leak

In the ixgbe_fdir_filter_init and ixgbe_l2_tn_filter_init functions,
after the hash handle is created, the handle is not released in
subsequent abnormal branches.

Fixes: 080e3c0ee989 ("net/ixgbe: store flow director filter")
Fixes: d0c0c416ef1f ("net/ixgbe: store L2 tunnel filter")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support DCF device reset
Dapeng Yu [Wed, 1 Sep 2021 05:26:04 +0000 (13:26 +0800)]
net/ice: support DCF device reset

DCF PMD needs to support rte_eth_dev_reset, the reason is when a DCF
instance is killed, all the flow rules still exists in hardware, when
DCF gets to reconnect, it already lost the flow context, and if the
application wants to create new rules, it may fail due to firmware
reports rules already exist.

The rte_eth_dev_reset API provides a more elegant way for the
application to reset DCF when reconnect happens.

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/sfc: set FDIR bit for flow mark in EF100 Rx
Ivan Malov [Mon, 30 Aug 2021 14:35:42 +0000 (17:35 +0300)]
net/sfc: set FDIR bit for flow mark in EF100 Rx

According to flow action MARK definition, PMDs must set both
PKT_RX_FDIR and PKT_RX_FDIR_ID if the packet contains a mark.

Fixes: 1aacc3d388d3 ("net/sfc: support user mark and flag Rx for EF100")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/hns3: fix Tx push capability
Min Hu (Connor) [Mon, 30 Aug 2021 08:26:51 +0000 (16:26 +0800)]
net/hns3: fix Tx push capability

This patch fixes Tx push capability to be compatible with Kunpeng 920,
as Tx push is only supported on Kunpeng 930.

Fixes: 23e317dd1fbf ("net/hns3: support Tx push quick doorbell for performance")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix taskqueue pair reset command
Chengchang Tang [Mon, 30 Aug 2021 08:26:50 +0000 (16:26 +0800)]
net/hns3: fix taskqueue pair reset command

This new taskqueue pair reset command is used incorrectly, resulting in
the new command not taking effect.

This patch fixes the incorrect use.

Fixes: 6911e7c22c61 ("net/hns3: fix long task queue pairs reset time")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix queue flow action validation
Chengchang Tang [Mon, 30 Aug 2021 08:26:49 +0000 (16:26 +0800)]
net/hns3: fix queue flow action validation

The used_rx_queues only takes effect after device is started, and
its value is incorrect before the device is started. Therefore, it
is not suitable for flow action to use it to verify the queue index
before the device is started.

E.g. Enable dedicated queue in bonding device will configure a queue
flow action before start its slave devices. The above problem will
make this reasonable flow action configuration fail.

This patch use the nb_rx_queues from the configuration phase to
achieve verification.

Fixes: a951c1ed3ab5 ("net/hns3: support different numbers of Rx and Tx queues")
Fixes: f8e7fcbfd0b8 ("net/hns3: support flow action of queue region")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/pcap: improve Rx statistics
Qiming Chen [Thu, 9 Sep 2021 12:28:55 +0000 (20:28 +0800)]
net/pcap: improve Rx statistics

In the receiving direction, if alloc mbuf or jumbo process failed, there
is no err_pkts count, which makes it difficult to locate the problem.
Because alloc mbuf failed, the rx_nombuf field is counted.

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/pcap: fix resource leakage on port probe
Qiming Chen [Mon, 30 Aug 2021 03:01:08 +0000 (11:01 +0800)]
net/pcap: fix resource leakage on port probe

When the port is probed, if the eth_from_pcaps function fails, the
previously opened pcap resources are not released, causing resource
leakage.

The patch solves the problem of resource leakage caused by abnormal
branch exit during the port probe process.

Fixes: 4c173302c307 ("pcap: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/axgbe: fix unreleased lock in I2C transfer
Chengfeng Ye [Thu, 26 Aug 2021 18:55:59 +0000 (11:55 -0700)]
net/axgbe: fix unreleased lock in I2C transfer

The lock pdata->i2c_mutex is not released if the function return in
these two patched branches, which may lead to deadlock problem if
this lock is acquired again.

Bugzilla ID: 777
Fixes: 4ac7516b8b39 ("net/axgbe: add phy init and related APIs")
Cc: stable@dpdk.org
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agodoc: fix bonding driver name
Ben Magistro [Thu, 26 Aug 2021 23:10:44 +0000 (23:10 +0000)]
doc: fix bonding driver name

The documentation for the bond driver lists the name as `net/bond`
however the driver should be `net/bonding`.

Fixes: 89c67ae2cba7 ("doc: remove references to make from prog guide")
Cc: stable@dpdk.org
Signed-off-by: Ben Magistro <koncept1@gmail.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet: add macro to extract MAC address bytes
Aman Deep Singh [Wed, 25 Aug 2021 17:27:34 +0000 (22:57 +0530)]
net: add macro to extract MAC address bytes

Added macros to simplify print of MAC address.
The six bytes of a MAC address are extracted in
a macro here, to improve code readablity.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet: add macro for MAC address print
Aman Deep Singh [Wed, 25 Aug 2021 17:27:33 +0000 (22:57 +0530)]
net: add macro for MAC address print

Added macro to print six bytes of MAC address.
The MAC addresses will be printed in upper case
hexadecimal format.
In case there is a specific check for lower case
MAC address, the user may need to make a change in
such test case after this patch.

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/af_xdp: fix zero-copy Tx queue drain
Baruch Siach [Wed, 25 Aug 2021 10:05:44 +0000 (13:05 +0300)]
net/af_xdp: fix zero-copy Tx queue drain

Call xsk_ring_prod__submit() before kick_tx() so that the kernel
consumer sees the updated state of Tx ring. Otherwise, Tx packets are
stuck in the ring until the next call to af_xdp_tx_zc().

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Ciara Loftus <ciara.loftus@intel.com>
2 years agoapp/testpmd: support multi-process
Min Hu (Connor) [Wed, 25 Aug 2021 02:06:38 +0000 (10:06 +0800)]
app/testpmd: support multi-process

This patch adds multi-process support for testpmd.
For example the following commands run two testpmd
processes:

 * the primary process:

./dpdk-testpmd --proc-type=auto -l 0-1 -- -i \
   --rxq=4 --txq=4 --num-procs=2 --proc-id=0

 * the secondary process:

./dpdk-testpmd --proc-type=auto -l 2-3 -- -i \
   --rxq=4 --txq=4 --num-procs=2 --proc-id=1

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Aman Deep Singh <aman.deep.singh@intel.com>
2 years agonet/bnxt: fix double allocation of ring groups
Kalesh AP [Wed, 1 Sep 2021 04:00:01 +0000 (09:30 +0530)]
net/bnxt: fix double allocation of ring groups

After commit "d68249f88266", driver allocates ring groups in
bnxt_alloc_hwrm_rx_ring(). But during port start, driver invokes
bnxt_alloc_hwrm_rx_ring() followed by bnxt_alloc_all_hwrm_ring_grps().
This will cause the FW command failure in bnxt_alloc_all_hwrm_ring_grps()

To fix this, just don't create the ring group if it is already created.

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2 years agonet/bnxt: fix ring group free
Kalesh AP [Mon, 30 Aug 2021 03:58:11 +0000 (09:28 +0530)]
net/bnxt: fix ring group free

Added an invalid fw_grp_id check inside bnxt_hwrm_ring_grp_free().
This will prevent invalid fw_grp_id to be passed to the FW which can
result in an error.
This fixes the following failure in the "port stop" -> "port start"
sequence:

bnxt_hwrm_ring_grp_free(): error 2:0:00000000:0204
bnxt_hwrm_ring_grp_free(): error 2:0:00000000:0204

Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix VLAN indication in Rx mbuf
Kalesh AP [Mon, 23 Aug 2021 08:12:14 +0000 (13:42 +0530)]
net/bnxt: fix VLAN indication in Rx mbuf

Fix to ignore the RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
when the firmware doesn't support the VLAN strip offload.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: check FW capability for VLAN offloads
Kalesh AP [Mon, 23 Aug 2021 08:12:13 +0000 (13:42 +0530)]
net/bnxt: check FW capability for VLAN offloads

VLAN offload capability may be disabled in the FW. The driver
should not attempt to override or utilize this feature in such
scenarios since it will not work as expected.

Fixes: 0a6d2a720078 ("net/bnxt: get device infos")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: fix mbuf VLAN in scalar Rx
Kalesh AP [Mon, 23 Aug 2021 08:12:12 +0000 (13:42 +0530)]
net/bnxt: fix mbuf VLAN in scalar Rx

In the scalar Rx path, for the VLAN packet, TCI is not saved in
the "mbuf->vlan_tci", however the STRIPPED offload flag is set
along with PKT_RX_VLAN flag.

Fixes: c1b33d40315f ("net/bnxt: use table based mbuf flags handling")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/ixgbe: fix Rx multicast statistics after reset
Qiming Chen [Mon, 30 Aug 2021 03:31:57 +0000 (11:31 +0800)]
net/ixgbe: fix Rx multicast statistics after reset

In the implementation of the VF driver ixgbevf_update_stats to obtain
statistics, the multicast count hw_stats->vfmprc has been obtained,
but it is not cleared in the corresponding ixgbevf_dev_stats_reset
interface.

Fixes: abf7275bbaa2 ("ixgbe: move to drivers/net/")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2 years agonet/iavf: fix overflow in maximum packet length config
Tudor Cornea [Thu, 5 Aug 2021 11:35:23 +0000 (14:35 +0300)]
net/iavf: fix overflow in maximum packet length config

The len variable, used in the computation of max_pkt_len could
overflow, if used to store the result of the following computation:

rxq->rx_buf_len * IAVF_MAX_CHAINED_RX_BUFFERS

Since, we could define the mbuf size to have a large value (i.e 13312),
and IAVF_MAX_CHAINED_RX_BUFFERS is defined as 5, the computation
mentioned above could potentially result in a value which might be
bigger than MAX_USHORT.

The result will be that Jumbo Frames will not work properly

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix queue config in DCF
Jie Wang [Tue, 24 Aug 2021 15:13:17 +0000 (15:13 +0000)]
net/ice: fix queue config in DCF

When DCF configures rx_queues, it may cause the pointer of
rx_queues to go out of bounds.

This patch expands the scope of the judgment condition to
fix this issue.

Fixes: 4b0d391f0eab ("net/ice: add queue config in DCF")
Cc: stable@dpdk.org
Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix deadlock on flow query
Yu Wenjun [Thu, 19 Aug 2021 12:10:02 +0000 (20:10 +0800)]
net/ice: fix deadlock on flow query

Default case of the switch statement causes deadlock because it returns
without unlocking the 'flow_ops_lock' lock. Fixing it.

Fixes: 0d6ef740e411 ("net/ice: support flow ops thread safe")
Cc: stable@dpdk.org
Signed-off-by: Yu Wenjun <yuwenjun0x@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix default RSS hash for IP fragments
Wenjun Wu [Tue, 17 Aug 2021 08:45:02 +0000 (16:45 +0800)]
net/ice: fix default RSS hash for IP fragments

Previously, hash value is calculated by src IP address, dst IP address
and IP ID. However, default RSS field only needs src and dst IP address.

This patch removes IP ID from default RSS field for IP fragment packets
to improve default RSS configuration.

Fixes: 4027fffe86f4 ("net/ice: support default RSS for IP fragment packet")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix default RSS hash for IP fragments
Wenjun Wu [Tue, 17 Aug 2021 08:44:01 +0000 (16:44 +0800)]
net/iavf: fix default RSS hash for IP fragments

Previously, hash value is calculated by src IP address, dst IP address
and IP ID. However, default RSS field only needs src and dst IP address.

This patch removes IP ID from default RSS field for IP fragment packets
to improve default RSS configuration.

Fixes: 9e29a278bc0c ("net/iavf: support default RSS for IP fragment")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: support flow director for IPv6 fragments
Wenjun Wu [Tue, 17 Aug 2021 06:50:14 +0000 (14:50 +0800)]
net/iavf: support flow director for IPv6 fragments

This patch adds L3 fields FDIR support for IPv6 fragment packets.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix flow director L3 field for IPv4 fragments
Wenjun Wu [Tue, 17 Aug 2021 06:49:55 +0000 (14:49 +0800)]
net/iavf: fix flow director L3 field for IPv4 fragments

Originally, the value of field_selector for IPV4_FRAG header hdr1 is
the same as the previous header hdr2. For IPv4 packets, field_selector
for hdr2 can be any value between 0 and 4, depending on the selected
field. Actually, this value for IPV4_FRAG should be constant 0,
which denotes the field packet ID.

This patch adds an assignment to hdr1->field_selector to make sure that
it is always 0.

Fixes: 3334513ef484 ("net/iavf: support flow director for IP fragment")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix RXDID default value in DCF
Qi Zhang [Tue, 17 Aug 2021 03:41:23 +0000 (11:41 +0800)]
net/ice: fix RXDID default value in DCF

Since DPDK 20.11 the default rxdid is changed from 16 to 22, but the
DCF data path didn't change, the patch fix the gap.

Fixes: 12443386a0b0 ("net/ice: support flex Rx descriptor RxDID22")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
2 years agonet/ice: fix memzone leak after device init failure
Haiyue Wang [Fri, 13 Aug 2021 06:21:54 +0000 (14:21 +0800)]
net/ice: fix memzone leak after device init failure

When flow engine initialization or FXP resource reset failed, it needs
to free the memory zone and unregister the interrupt callback.

Bugzilla ID: 752
Fixes: 84dc7a95a2d3 ("net/ice: enable flow director engine")
Fixes: 7615a6895009 ("net/ice: rework for generic flow enabling")
Fixes: 7edc7158d771 ("net/ice: cleanup RSS/FDIR profile on device init")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: support flow director for IPv6 fragments
Wenjun Wu [Tue, 3 Aug 2021 07:23:54 +0000 (15:23 +0800)]
net/ice/base: support flow director for IPv6 fragments

Add L2 and L3 FDIR field support for IPv6 fragment packets.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agomaintainers: update for mlx4/mlx5 net drivers
Viacheslav Ovsiienko [Mon, 23 Aug 2021 14:50:41 +0000 (17:50 +0300)]
maintainers: update for mlx4/mlx5 net drivers

For net/mlx4:
    - removing Shahaf Shuler
    - adding Viacheslav Ovsiienko

For net/mlx5:
    - removing Shahaf Shuler

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/nfp: fix minimum descriptor sizes
Heinrich Kuhn [Mon, 23 Aug 2021 07:59:21 +0000 (09:59 +0200)]
net/nfp: fix minimum descriptor sizes

The NFP4000/6000 supports a minimum of 256 Tx/Rx descriptors and not 64.
Before this patch when a DPDK application configured < 256 Tx
descriptors the hardware read/write pointers would be unmasked and not
wrapped at the expected size of the ring. The PMD logic to determine the
amount of free space in the Tx ring is incompatible with the unmasked
hwqueue pointers and this will result in the PMD not updating the
read pointer at all.The knock-on effect is that under high load the
PMD will potentially re-use a Tx descriptor before the hw has had a
chance to process that particular descriptor. This issue can manifest as
a DMA error when the hardware tries to perform a DMA with info from a
partially populated descriptor.

Fixes: defb9a5dd156 ("nfp: introduce driver initialization")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
2 years agomaintainers: update for NFP
Heinrich Kuhn [Mon, 23 Aug 2021 08:29:19 +0000 (10:29 +0200)]
maintainers: update for NFP

Some of Netronome's activities and people have moved over to Corigine,
including NFP PMD maintenance and myself.

Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
2 years agoapp/testpmd: add option for number of flows in flowgen
Zhihong Wang [Thu, 19 Aug 2021 12:35:41 +0000 (20:35 +0800)]
app/testpmd: add option for number of flows in flowgen

Make number of flows in flowgen configurable by setting parameter
--flowgen-flows=N.

Signed-off-by: Zhihong Wang <wangzhihong.wzh@bytedance.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
2 years agonet/ipn3ke: change experimental symbol to internal
Rosen Xu [Thu, 19 Aug 2021 06:05:05 +0000 (14:05 +0800)]
net/ipn3ke: change experimental symbol to internal

'ipn3ke_bridge_func' is a global variable and it used in net & raw
drivers.
It's only used for drivers, so change it from EXPERIMENTAL to INTERNAL.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agocrypto/dpaa_sec: support PDCP short MAC-I
Gagandeep Singh [Wed, 8 Sep 2021 12:51:27 +0000 (18:21 +0530)]
crypto/dpaa_sec: support PDCP short MAC-I

This patch add PDCP security short MAC-I support for
dpaa_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support PDCP short MAC-I
Gagandeep Singh [Wed, 8 Sep 2021 12:51:26 +0000 (18:21 +0530)]
crypto/dpaa2_sec: support PDCP short MAC-I

This patch add PDCP short mac support in dpaa2_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agotest/crypto: support PDCP short MAC-I
Gagandeep Singh [Wed, 8 Sep 2021 12:51:25 +0000 (18:21 +0530)]
test/crypto: support PDCP short MAC-I

This patch add support to test the PDCP short MAC
packets in crypto.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agosecurity: support PDCP short MAC-I
Hemant Agrawal [Wed, 8 Sep 2021 12:51:24 +0000 (18:21 +0530)]
security: support PDCP short MAC-I

This patch add support to handle PDCP short MAC-I domain
along with standard control and data domains as it has to
be treaty as special case with PDCP protocol offload support.

ShortMAC-I is the 16 least significant bits of calculated MAC-I. Usually
when a RRC message is exchanged between UE and eNodeB it is integrity &
ciphered protected.

MAC-I = f(key, varShortMAC-I, count, bearer, direction).
Here varShortMAC-I is prepared by using (current cellId, pci of source cell
and C-RNTI of old cell). Other parameters like count, bearer and
direction set to all 1.

crypto-perf app is updated to take short MAC as input mode.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: support integrity only PDCP
Hemant Agrawal [Wed, 8 Sep 2021 12:51:23 +0000 (18:21 +0530)]
crypto/dpaa2_sec: support integrity only PDCP

To support short MAC-I, integrity only case is required
to be supported for PDCP.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2 years agocommon/cnxk: fix attaching NPA LF to CPT VF
Srujana Challa [Wed, 18 Aug 2021 11:56:35 +0000 (17:26 +0530)]
common/cnxk: fix attaching NPA LF to CPT VF

ATTACH_RESOURCES mailbox for CPT LFs is being called without
setting modify bit. Because of this previously attached NPA LF
to the CPT VF is getting removed, when only CPT VF is whitelisted.
This patch fixes the same.

Fixes: c045d2e5cbbc ("common/cnxk: add CPT configuration")
Cc: stable@dpdk.org
Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa2_sec: add error packet counters
Hemant Agrawal [Wed, 8 Sep 2021 06:59:53 +0000 (12:29 +0530)]
crypto/dpaa2_sec: add error packet counters

This patch add support to also counter err pkt counter per queue.
This also enhances few related debug prints.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocrypto/dpaa_sec: force inline keys to save space
Franck Lenormand [Wed, 8 Sep 2021 06:59:52 +0000 (12:29 +0530)]
crypto/dpaa_sec: force inline keys to save space

This patch improve storage and performance by force inline
of the keys.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax/caamflib: fix IV for short MAC-I in SNOW3G
Gagandeep Singh [Wed, 8 Sep 2021 06:59:51 +0000 (12:29 +0530)]
common/dpaax/caamflib: fix IV for short MAC-I in SNOW3G

The logic was incorrectly doing conditional swap. It need to
be bit swap always.

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 agocommon/dpaax/caamflib: remove some inline keys
Franck Lenormand [Wed, 8 Sep 2021 06:59:50 +0000 (12:29 +0530)]
common/dpaax/caamflib: remove some inline keys

The space in descriptor buffer is scarce as it is limited to
64 words for platforms except ERA10 (which has 128).

As the descriptors are processed with QI, it adds some words
to the descriptor which is passed.

Some descriptors used for SDAP were using too much words reaching
the limit.

This patch reduces the number of words used by removing the inlining
of some keys (done for performance) in order to have working
descriptors.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax/caamflib: remove DPOVRD clear for SDAP
Franck Lenormand [Wed, 8 Sep 2021 06:59:49 +0000 (12:29 +0530)]
common/dpaax/caamflib: remove DPOVRD clear for SDAP

For SDAP, we are not using the protocol operation to perform
4G/LTE operation so the DPOVRD option is not used.

Removing it save some space in the descriptor buffer and
execution time.

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2 years agocommon/dpaax/caamflib: load correct HFN from desc buffer
Franck Lenormand [Wed, 8 Sep 2021 06:59:48 +0000 (12:29 +0530)]
common/dpaax/caamflib: load correct HFN from desc buffer

The offset of the HFN word and Bearer/Dir word is different
depending on type of PDB.

The wrong value was used.

This patch address this issue

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>