dpdk.git
2 years agovhost: improve socket layer logs
Maxime Coquelin [Wed, 26 Jan 2022 09:55:06 +0000 (10:55 +0100)]
vhost: improve socket layer logs

This patch adds the Vhost socket path whenever possible in
order to make debugging possible when multiple Vhost
devices are in use. Some vhost-user layer functions are
modified to pass the device path down to the socket layer.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: improve vhost-user layer logs
Maxime Coquelin [Wed, 26 Jan 2022 09:55:05 +0000 (10:55 +0100)]
vhost: improve vhost-user layer logs

This patch adds the Vhost-user socket path to Vhost-user
layer logs in order to ease logs filtering.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: improve vhost layer logs
Maxime Coquelin [Wed, 26 Jan 2022 09:55:04 +0000 (10:55 +0100)]
vhost: improve vhost layer logs

This patch prepends Vhost logs with the Vhost-user socket
path when available to ease filtering logs for a given port.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: improve vDPA registration failure log
Maxime Coquelin [Wed, 26 Jan 2022 09:55:03 +0000 (10:55 +0100)]
vhost: improve vDPA registration failure log

This patch adds name of the device failing vDPA registration.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: improve IOTLB logs
Maxime Coquelin [Wed, 26 Jan 2022 09:55:02 +0000 (10:55 +0100)]
vhost: improve IOTLB logs

This patch adds IOTLB mempool name when logging debug
or error messages, and also prepends the socket path.
to all the logs.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2 years agovhost: add log when setting vring base
Andy Pei [Fri, 14 Jan 2022 07:57:07 +0000 (15:57 +0800)]
vhost: add log when setting vring base

This patch adds log for vring related info in handling of vhost message
VHOST_USER_SET_VRING_BASE, which will be useful in live migration case.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/virtio: fix uninitialized RSS key
Yunjian Wang [Sat, 8 Jan 2022 08:14:21 +0000 (16:14 +0800)]
net/virtio: fix uninitialized RSS key

This patch fixes an issue that uninitialized old_rss_key
is used for restoring the rss_key.

Coverity issue: 373866
Fixes: 0c9d66207054 ("net/virtio: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/virtio-user: check FD flags getting failure
Yunjian Wang [Sat, 8 Jan 2022 07:52:31 +0000 (15:52 +0800)]
net/virtio-user: check FD flags getting failure

The function fcntl() could return errors,
the return value need to be checked.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/virtio-user: fix resource leak on probing failure
Harold Huang [Thu, 23 Dec 2021 04:42:37 +0000 (12:42 +0800)]
net/virtio-user: fix resource leak on probing failure

When eth_virtio_dev_init is failed, the registered virtio user memory
event cb is not released and the backend created tap device is not
destroyed.  It would cause some residual tap device existed in the host
and creating a new vdev could be failed because the new virtio_user_dev
could use the same address pointer and register memory event cb to the
same address is not allowed.

Fixes: ca8326a94365 ("net/virtio_user: fix error management during init")
Cc: stable@dpdk.org
Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: fix log info mismatch
Andy Pei [Mon, 13 Dec 2021 07:00:40 +0000 (15:00 +0800)]
vdpa/ifc: fix log info mismatch

Fix log info mismatch.

Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/virtio: fix Tx queue 0 overriden by queue 128
Xueming Li [Thu, 2 Dec 2021 13:50:45 +0000 (21:50 +0800)]
net/virtio: fix Tx queue 0 overriden by queue 128

Both Rx queue and Tx queue are VirtQ in virtio, VQ index is 256 for Tx
queue 128. Uint8 type of TxQ VQ index overflows and overrides Tx queue 0
data.

This patch fixes VQ index type with uint16 type.

Fixes: c1f86306a026 ("virtio: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovdpa/mlx5: workaround queue stop with traffic
Matan Azrad [Mon, 22 Nov 2021 13:12:35 +0000 (15:12 +0200)]
vdpa/mlx5: workaround queue stop with traffic

When the event thread polls traffic and a virtq is stopping, the FW loses
synchronization in the virtq indexes.

It causes LM failure on synchronization between the HOST indexes to
the GUEST indexes.

Unset the event thread before the queue stop in the LM process.

Fixes: 31b9c29c86af ("vdpa/mlx5: support close and config operations")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/axgbe: alter port speed bit range
Selwin Sebastian [Tue, 25 Jan 2022 12:17:47 +0000 (17:47 +0530)]
net/axgbe: alter port speed bit range

Newer generation Hardware uses the slightly different
port speed bit widths, so alter the existing port speed
bit range to extend support to the newer generation hardware
while maintaining the backward compatibility with older
generation hardware.

The previously reserved bits are now being used which
then requires the adjustment to the BIT values, e.g.:

Before:
   PORT_PROPERTY_0[22:21] - Reserved
   PORT_PROPERTY_0[26:23] - Supported Speeds

After:
   PORT_PROPERTY_0[21] - Reserved
   PORT_PROPERTY_0[26:22] - Supported Speeds

To make this backwards compatible, the existing BIT
definitions for the port speeds are incremented by one
to maintain the original position.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
2 years agonet/axgbe: support no-autoneg port mode
Selwin Sebastian [Tue, 25 Jan 2022 12:17:46 +0000 (17:47 +0530)]
net/axgbe: support no-autoneg port mode

Add support for a new port mode that is a backplane
connection without support for auto negotiation.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
2 years agonet/axgbe: reset PHY Rx when mailbox command timeout
Selwin Sebastian [Tue, 25 Jan 2022 12:17:45 +0000 (17:47 +0530)]
net/axgbe: reset PHY Rx when mailbox command timeout

Sometimes mailbox commands timeout when the RX data path becomes
unresponsive. This prevents the submission of new mailbox commands
to DXIO. This patch identifies the timeout and resets the RX data
path so that the next message can be submitted properly.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
2 years agonet/axgbe: simplify rate change mailbox interface
Selwin Sebastian [Tue, 25 Jan 2022 12:17:44 +0000 (17:47 +0530)]
net/axgbe: simplify rate change mailbox interface

Simplify and centralize the mailbox command rate change interface by
having a single function perform the writes to the mailbox registers
to issue the request.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
2 years agonet/axgbe: toggle PLL settings during rate change
Selwin Sebastian [Tue, 25 Jan 2022 12:17:43 +0000 (17:47 +0530)]
net/axgbe: toggle PLL settings during rate change

For each rate change command submission, the FW has to do a phy
power off sequence internally. For this to happen correctly, the
PLL re-initialization control setting has to be turned off before
sending mailbox commands and re-enabled once the command submission
is complete. Without the PLL control setting, the link up takes
longer time in a fixed phy configuration.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
2 years agonet/axgbe: attempt always link training in KR mode
Selwin Sebastian [Tue, 25 Jan 2022 12:17:42 +0000 (17:47 +0530)]
net/axgbe: attempt always link training in KR mode

Link training is always attempted when in KR mode, but the code is
structured to check if link training has been enabled before attempting
to perform it. Since that check will always be true, simplify the code
to always enable and start link training during KR auto-negotiation.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Acked-by: Chandubabu Namburu <chandu@amd.com>
2 years agonet/hns3: support indirect counter flow action
Chengwen Feng [Sat, 22 Jan 2022 01:51:42 +0000 (09:51 +0800)]
net/hns3: support indirect counter flow action

This patch support indirect counter action because the shared counter
attribute has been deprecated in DPDK 21.11.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: extract functions to create RSS and FDIR flow rule
Huisong Li [Sat, 22 Jan 2022 01:51:41 +0000 (09:51 +0800)]
net/hns3: extract functions to create RSS and FDIR flow rule

Extract two functions to create the RSS and FDIR flow rule for clearer
code logic.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: rename function
Chengwen Feng [Sat, 22 Jan 2022 01:51:40 +0000 (09:51 +0800)]
net/hns3: rename function

This patch rename hns3_parse_rss_key with hns3_adjust_rss_key to
improve readability.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove non re-entrant strerror call
Chengwen Feng [Sat, 22 Jan 2022 01:51:39 +0000 (09:51 +0800)]
net/hns3: remove non re-entrant strerror call

This patch delete strerror invoke which was non re-entrant.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: replace single line functions
Chengwen Feng [Sat, 22 Jan 2022 01:51:38 +0000 (09:51 +0800)]
net/hns3: replace single line functions

This patch removes single functions with actual calls.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: extract common function to obtain revision ID
Huisong Li [Sat, 22 Jan 2022 01:51:37 +0000 (09:51 +0800)]
net/hns3: extract common function to obtain revision ID

The code logic of obtaining the revision ID of PCI device is the same
for PF and VF driver. This patch extracts a common interface to do it.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove logging memory addresses
Huisong Li [Sat, 22 Jan 2022 01:51:36 +0000 (09:51 +0800)]
net/hns3: remove logging memory addresses

Remove the printing of memory addresses.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove getting number of queue descriptors from FW
Huisong Li [Sat, 22 Jan 2022 01:51:35 +0000 (09:51 +0800)]
net/hns3: remove getting number of queue descriptors from FW

Application can specify the number of Rx/Tx queue descriptors in DPDK.
So driver does not obtain the default value from firmware and PF.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove unused variables
Huisong Li [Sat, 22 Jan 2022 01:51:34 +0000 (09:51 +0800)]
net/hns3: remove unused variables

Remove unused variables.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: extract reset failure handling to function
Huisong Li [Sat, 22 Jan 2022 01:51:33 +0000 (09:51 +0800)]
net/hns3: extract reset failure handling to function

Extract a function to handle reset fail for clearer code logic.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove unnecessary blank lines
Huisong Li [Sat, 22 Jan 2022 01:51:32 +0000 (09:51 +0800)]
net/hns3: remove unnecessary blank lines

Remove unnecessary blank lines.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: make control plane function non-inline
Jie Hai [Sat, 22 Jan 2022 01:51:31 +0000 (09:51 +0800)]
net/hns3: make control plane function non-inline

This function is a control-plane interface and does
not need to use inline.

Signed-off-by: Jie Hai <haijie1@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: extract common function to initialize MAC address
Huisong Li [Sat, 22 Jan 2022 01:51:30 +0000 (09:51 +0800)]
net/hns3: extract common function to initialize MAC address

The code logic to initialize "data->mac_addrs" for PF and VF is similar.
This patch extracts a common API to initialize it to improve code
maintainability.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix using enum as boolean
Huisong Li [Sat, 22 Jan 2022 01:51:29 +0000 (09:51 +0800)]
net/hns3: fix using enum as boolean

The enum type variables cannot be used as bool variables. This patch
fixes for "with->func" in hns3_action_rss_same().

Fixes: eb158fc756a5 ("net/hns3: fix config when creating RSS rule after flush")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: remove unnecessary assignment
Huisong Li [Sat, 22 Jan 2022 01:51:28 +0000 (09:51 +0800)]
net/hns3: remove unnecessary assignment

Remove unnecessary assignment.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/nfp: free HW ring memzone on queue release
Heinrich Kuhn [Wed, 19 Jan 2022 11:48:00 +0000 (13:48 +0200)]
net/nfp: free HW ring memzone on queue release

During Rx/Tx queue setup, memory is reserved for the hardware rings.
This memory zone should subsequently be freed in the queue release
logic. This commit also adds a call to the release logic in the
dev_close() callback so that the ring memzone may be freed during port
close too.

Fixes: b812daadad0d ("nfp: add Rx and Tx")
Cc: stable@dpdk.org
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
2 years agonet/tap: forbid different Rx/Tx queue number
Nobuhiro Miki [Wed, 19 Jan 2022 07:43:16 +0000 (16:43 +0900)]
net/tap: forbid different Rx/Tx queue number

Users can create the desired number of RxQ and TxQ in DPDK. For
example, if the number of RxQ = 2 and the number of TxQ = 5,
a total of 8 file descriptors will be created for a tap device,
including RxQ, TxQ, and one for keepalive. The RxQ and TxQ
with the same ID are paired by dup(2).

In this scenario, Kernel will have 3 RxQ where packets are
incoming but not read. The reason for this is that there are only
2 RxQ that are polled by DPDK, while there are 5 queues in Kernel.
This patch add a checking if DPDK has appropriate numbers of
queues to avoid unexpected packet drop.

Signed-off-by: Nobuhiro Miki <nmiki@yahoo-corp.jp>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/bonding: fix RSS with early configure
Yu Wenjun [Tue, 18 Jan 2022 09:18:52 +0000 (17:18 +0800)]
net/bonding: fix RSS with early configure

RSS don't work when bond_ethdev_configure called before
rte_eth_bond_slave_add.

This is because internals->rss_key_len is 0 in bond_ethdev_configure().
If internals->rss_key_len is 0, internals->rss_key can not be set
properly.

e.g.:
doesn't work (examples/bond/main.c):
rte_eth_bond_create()
rte_eth_dev_configure()
rte_eth_bond_slave_add()
rte_eth_dev_start()

works (testpmd):
rte_eth_bond_create()
rte_eth_bond_slave_add()
rte_eth_dev_configure()
rte_eth_dev_start()

Fixing by using 'default_rss_key' when 'internals->rss_key_len' is 0.

Fixes: 6b1a001ec546 ("net/bonding: fix RSS key length")
Cc: stable@dpdk.org
Signed-off-by: Yu Wenjun <yuwenjun@cmss.chinamobile.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix vector Rx/Tx when PTP enabled
Min Hu (Connor) [Mon, 17 Jan 2022 02:43:02 +0000 (10:43 +0800)]
net/hns3: fix vector Rx/Tx when PTP enabled

If hardware supports IEEE 1588 PTP, PTP capability will be set.
Currently, vec and sve burst is unsupported when PTP capability is set.

For sake of Rx/Tx performance, IEEE 1588 PTP is not supported in sve or
vec burst mode. When enabling IEEE 1588 PTP, Rx/Tx burst mode should be
simple or common. Rx/Tx burst mode could be set like this, for example:
-a 0000:35:00.0,rx_func_hint=common,tx_func_hint=common

This patch supports vec and sve burst when PTP is disabled. And only
support simple or common burst When PTP is enabled.

Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/hns3: fix mailbox wait time
Huisong Li [Mon, 17 Jan 2022 02:43:01 +0000 (10:43 +0800)]
net/hns3: fix mailbox wait time

The mailbox wait time can be specified at runtime. But the variable that
controls this time are not initialized when the variable isn't designated
or is specified as an invalid value, which will fail to initialize device
in the case where no device is bound to initialize the device.

Fixes: 2fc3e696a7f1 ("net/hns3: add runtime config for mailbox limit time")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
2 years agonet/hns3: fix Rx/Tx functions update
Min Hu (Connor) [Mon, 17 Jan 2022 02:43:00 +0000 (10:43 +0800)]
net/hns3: fix Rx/Tx functions update

When fast path operation is introduced, the Rx/Tx function is done by
object 'rte_eth_fp_ops'. So 'rte_eth_fp_ops' should be updated if
'fast-path functions' need to be changed, such as PMD receive function,
prepare function and so on.

This patch fixed receiving packets bug when fast path operation is
introduced.

Fixes: bba636698316 ("net/hns3: support Rx/Tx and related operations")
Fixes: 168b7d79dada ("net/hns3: support set link up/down for PF")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/memif: remove unnecessary Rx interrupt stub
Stephen Hemminger [Fri, 14 Jan 2022 20:46:44 +0000 (12:46 -0800)]
net/memif: remove unnecessary Rx interrupt stub

The code in memif driver to stub out rx_irq_enable is unnecessary
and causes different error returns than other drivers.
The core ethdev code will return -ENOTSUP if the driver has
a null rx_queue_intr_enable callback.

Fixes: 09c7e63a71f9 ("net/memif: introduce memory interface PMD")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agoraw/ifpga/base: fix port feature ID
Wei Huang [Tue, 25 Jan 2022 02:30:47 +0000 (21:30 -0500)]
raw/ifpga/base: fix port feature ID

Fix ID value of port features to match the definition from hardware.

Fixes: 473c88f9b391 ("drivers/raw: remove rawdev from directory names")
Cc: stable@dpdk.org
Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2 years agonet/bnxt: fix VF resource allocation strategy
Ajit Khaparde [Thu, 20 Jan 2022 09:12:28 +0000 (14:42 +0530)]
net/bnxt: fix VF resource allocation strategy

1. VFs need a notification queue to handle async messages.
But the current logic does not reserve a notification queue leading
to initialization failure in some cases.
2. With the current logic, DPDK PF driver reserves only one VNIC
to the VFs leading to initialization failure with more than 1 RXQs.

Added logic to distribute number of NQs and VNICs from the pool
across VFs and PF.

While reserving resources for the VFs, the strategy is to keep
both min & max values the same. This could result in a failure
when there isn't enough resources to satisfy the request.
Hence fixed to instruct the FW to not reserve all minimum
resources requested for the VF. The VF driver can request the FW
for the allocated resources during probe.

Fixes: b7778e8a1c00 ("net/bnxt: refactor to properly allocate resources for PF/VF")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix memzone allocation per VNIC
Kalesh AP [Thu, 20 Jan 2022 09:12:27 +0000 (14:42 +0530)]
net/bnxt: fix memzone allocation per VNIC

In case of Thor RSS table size is too big. This could result in
memory allocation failure when the supported vnic count is high.
Instead of allocating the memzone for all VNICs in one shot,
allocate for each VNIC individually.

Also, fixed to free the memzone in the uninit path.

Fixes: 9738793f28ec ("net/bnxt: add VNIC functions and structs")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: handle ring cleanup in case of error
Kalesh AP [Thu, 20 Jan 2022 09:12:26 +0000 (14:42 +0530)]
net/bnxt: handle ring cleanup in case of error

In bnxt_alloc_mem(), after bnxt_alloc_async_ring_struct(),
any of the functions failure causes an error:

bnxt_hwrm_ring_free(): hwrm_ring_free nq failed. rc:1

Fix this by initializing ring->fw_ring_id to INVALID_HW_RING_ID
in bnxt_alloc_async_ring_struct().

Fixes: bd0a14c99f65 ("net/bnxt: use dedicated CPR for async events")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix check for autoneg enablement
Kalesh AP [Thu, 20 Jan 2022 09:12:25 +0000 (14:42 +0530)]
net/bnxt: fix check for autoneg enablement

HWRM_PORT_PHY_QCFG_OUTPUT response indicates the autoneg speed mask
supported by the FW. While enabling autoneg, driver should also check
the FW advertised PAM4 speeds supported in auto mode which is set
in the HWRM_PORT_PHY_QCFG_OUTPUT response.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agoraw/ifpga: fix thread closing
Tianfei Zhang [Mon, 24 Jan 2022 03:50:05 +0000 (22:50 -0500)]
raw/ifpga: fix thread closing

When we want to close a thread, we should set a flag to notify
thread handler function.

Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2 years agonet/ice: fix link up when starting device
Yunjian Wang [Tue, 25 Jan 2022 01:39:07 +0000 (09:39 +0800)]
net/ice: fix link up when starting device

Currently, there is a possibility that the link status is not correct
after set link up, the device ID is 159b. It would be fixed by calling
ice_link_update() while the parameter 'wait_to_complete' is true. It's
reasonable to wait for complete right after set link up as it is not
in an link status change interrupt handling scenario.

Fixes: cf911d90e366 ("net/ice: support link update")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support module EEPROM
Steve Yang [Thu, 20 Jan 2022 02:59:30 +0000 (02:59 +0000)]
net/ice: support module EEPROM

Add new callbacks for eth_dev_ops of ice to get the information
and data of plugin module EEPROM.

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix mbuf offload flag for Rx timestamp
Simei Su [Thu, 20 Jan 2022 10:21:52 +0000 (18:21 +0800)]
net/ice: fix mbuf offload flag for Rx timestamp

For received PTP packets, the flag "RTE_MBUF_F_RX_IEEE1588_TMST" has not
been set which leads to received PTP packet not timestamped by hardware
shown in testpmd/ieee1588 fwd.

Fixes: 646dcbe6c701 ("net/ice: support IEEE 1588 PTP")
Cc: stable@dpdk.org
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agoraw/ifpga/base: fix SPI transaction
Tianfei Zhang [Wed, 19 Jan 2022 01:44:59 +0000 (20:44 -0500)]
raw/ifpga/base: fix SPI transaction

When EOP is detected, 2 more bytes should be received
(may be a SPI_PACKET_ESC before last valid byte) then
rx should be finished.

Fixes: 96ebfcf8125c ("raw/ifpga/base: add SPI and MAX10 device driver")
Cc: stable@dpdk.org
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
2 years agonet/sfc: validate queue span when parsing flow action RSS
Ivan Malov [Mon, 10 Jan 2022 21:48:45 +0000 (00:48 +0300)]
net/sfc: validate queue span when parsing flow action RSS

The current code silently shrinks the value if it exceeds
the supported maximum. Do not do that. Validate the value.

Fixes: d77d07391d4d ("net/sfc: support flow API RSS action")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: fix Rx queue telemetry memory leak on failure
Yunjian Wang [Sat, 8 Jan 2022 07:51:57 +0000 (15:51 +0800)]
ethdev: fix Rx queue telemetry memory leak on failure

In eth_dev_handle_port_info() allocated memory for rxq_state,
we should free it when error happens, otherwise it will lead
to memory leak.

Fixes: 58b43c1ddfd1 ("ethdev: add telemetry endpoint for device info")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agocommon/cnxk: update NIX and NPA dump functions
Rahul Bhansali [Mon, 20 Dec 2021 13:26:25 +0000 (18:56 +0530)]
common/cnxk: update NIX and NPA dump functions

Updates nix_dump and npa_dump to use plt_dump function.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix error checking
Weiguo Li [Sat, 22 Jan 2022 06:49:04 +0000 (14:49 +0800)]
common/cnxk: fix error checking

Fixes: 804c108b039a ("common/cnxk: set BPHY IRQ handler")
Cc: stable@dpdk.org
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn10k template Tx functions to build
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:19 +0000 (21:18 +0530)]
net/cnxk: add cn10k template Tx functions to build

Add cn10k segregated Tx and event Tx template functions to build,
add macros to make future modifications simpler.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn10k segregated Tx functions
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:18 +0000 (21:18 +0530)]
net/cnxk: add cn10k segregated Tx functions

Add cn10k segregated Rx and event Tx enqueue template functions,
these help in parallelizing the build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn10k template Rx functions to build
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:17 +0000 (21:18 +0530)]
net/cnxk: add cn10k template Rx functions to build

Add cn10k segregated Rx and event dequeue functions to build,
add macros to make future modifications simpler.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn10k segregated Rx functions
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:16 +0000 (21:18 +0530)]
net/cnxk: add cn10k segregated Rx functions

Add cn10k segregated Rx and event dequeue template functions,
these help in parallelizing the build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k template Tx functions to build
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:15 +0000 (21:18 +0530)]
net/cnxk: add cn9k template Tx functions to build

Add cn9k segregated Tx and event Tx functions to build,
add macros to make future modifications simpler.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k segregated Tx functions
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:14 +0000 (21:18 +0530)]
net/cnxk: add cn9k segregated Tx functions

Add cn9k segregated Rx and event Tx enqueue template functions,
these help in parallelizing the build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k template Rx functions to build
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:13 +0000 (21:18 +0530)]
net/cnxk: add cn9k template Rx functions to build

Add cn9k segregated Rx and event dequeue functions to build,
add macros to make future modifications simpler.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add cn9k segregated Rx functions
Pavan Nikhilesh [Sat, 22 Jan 2022 15:48:12 +0000 (21:18 +0530)]
net/cnxk: add cn9k segregated Rx functions

Split template functions to multiple files based on the range
of offloads. This allows them to be built in parallel reducing
time spent on compiling single files containing all the template
functions.
The files are added to the build system in later patches modifying
the existing scheme of selecting template lookup with a simple
flat array based lookup.

Add cn9k segregated Rx and event dequeue template functions,
these help in parallelizing the build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: synchronize inline session create and destroy
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:24 +0000 (17:34 +0530)]
net/cnxk: synchronize inline session create and destroy

Synchronize inline session create and destroy using spinlock.
Also move security related error prints outside the spinlock.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2 years agocommon/cnxk: set UDP ports for IPsec UDP encapsulation
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:23 +0000 (17:34 +0530)]
common/cnxk: set UDP ports for IPsec UDP encapsulation

Set UDP ports for IPsec UDP encapsulation feature in
outbound inline.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2 years agonet/cnxk: improve inbound inline error handling for cn9k
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:22 +0000 (17:34 +0530)]
net/cnxk: improve inbound inline error handling for cn9k

Improve inbound inline error handling for CN9K in terms of
packet delivered to application for different kinds of errors.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2 years agocommon/cnxk: fix uninitialized variables
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:21 +0000 (17:34 +0530)]
common/cnxk: fix uninitialized variables

Fix uninitialized variable issues reported by
klockwork(static analysis tool).

Fixes: ed135040f0ab ("common/cnxk: add CPT LF configuration")
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")
Fixes: 58debb813a8d ("common/cnxk: enable TM to listen on Rx pause frames")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix null pointer dereferences
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:20 +0000 (17:34 +0530)]
common/cnxk: fix null pointer dereferences

Fix null pointer dereference issues reported by
klockwork(static analysis tool).

Fixes: c045d2e5cbbc ("common/cnxk: add CPT configuration")
Fixes: 585bb3e538f9 ("common/cnxk: add VF support to base device class")
Fixes: 665ff1ccc2c4 ("common/cnxk: add base device class")
Fixes: da57d4589a6f ("common/cnxk: support NIX flow control")
Fixes: 218d022e1f3f ("common/cnxk: support NIX stats")
Fixes: 4efa6e82fe43 ("common/cnxk: support NIX extended stats")
Fixes: 0885429c3028 ("common/cnxk: add NIX TM hierarchy enable/disable")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: always use single interrupt ID with NIX
Harman Kalra [Fri, 21 Jan 2022 12:04:19 +0000 (17:34 +0530)]
common/cnxk: always use single interrupt ID with NIX

An errata exists whereby, in certain cases NIX may use an
incorrect QINT_IDX for SQ interrupts. As a result, the
interrupt may not be delivered to software, or may not be
associated with the correct SQ.
When NIX uses an incorrect QINT_IDX :
1. NIX_LF_QINT(0..63)_CNT[COUNT] will be incremented for
incorrect QINT.
2. NIX_LF_QINT(0..63)_INT[INTR] will be set for incorrect
QINT.

Fixes: ae06070901ab ("common/cnxk: add NIX Tx queue management API")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: reset stale values on error debug registers
Harman Kalra [Fri, 21 Jan 2022 12:04:18 +0000 (17:34 +0530)]
common/cnxk: reset stale values on error debug registers

LF's error debug registers like NIX_LF_SQ_OP_ERR_DBG,
NIX_LF_MNQ_ERR_DBG, NIX_LF_SEND_ERR_DBG captures debug
info for an error detected during LMT operation or meta
enqueue or after meta enqueue granted respectively. HW
sets a valid bit when info is captured and SW is expected
to clear this valid bit by writing 1, else these registers
will show stale values of first interrupt when occurred and
will never update with subsequent interrupts.

Fixes: f6d567b03d28 ("common/cnxk: support NIX IRQ")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix byte order of frag sizes and infos
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:17 +0000 (17:34 +0530)]
common/cnxk: fix byte order of frag sizes and infos

Change the byte order of frag sizes and infos to match HW
implementation.

Fixes: 64a73ebd87bd ("common/cnxk: add CPT hardware definitions")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2 years agocommon/cnxk: use for loop in shaper profiles cleanup
Gowrishankar Muthukrishnan [Fri, 21 Jan 2022 12:04:16 +0000 (17:34 +0530)]
common/cnxk: use for loop in shaper profiles cleanup

In shaper profiles cleanup, Klockwork static analyzer tool reports
infinite loop although existing loop condition is alright.
False positive may be due to tqh_first not checked in loop,
hence switching to FOREACH_SAFE to make Klockwork happy.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: fix shift offset for TL3 length disable
Nithin Dabilpuram [Fri, 21 Jan 2022 12:04:15 +0000 (17:34 +0530)]
common/cnxk: fix shift offset for TL3 length disable

Fix shift offset for length disable flag in NIXX_AF_TL3X_SHAPE
register to be 24 instead of zero similar to other level SHAPE
registers. Also mask unused bits in adjust value.

Fixes: 0885429c3028 ("common/cnxk: add NIX TM hierarchy enable/disable")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Satha Rao <skoteshwar@marvell.com>
2 years agocommon/cnxk: support extensions attributes in IPv6 item
Satheesh Paul [Fri, 21 Jan 2022 06:26:41 +0000 (11:56 +0530)]
common/cnxk: support extensions attributes in IPv6 item

Support matching existence of specific extension headers
after RTE_FLOW_ITEM_TYPE_IPV6 item.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2 years agocommon/cnxk: support matching VLAN existence
Satheesh Paul [Fri, 21 Jan 2022 06:26:40 +0000 (11:56 +0530)]
common/cnxk: support matching VLAN existence

Support matching existence of VLAN after
RTE_FLOW_ITEM_TYPE_ETH and RTE_FLOW_ITEM_TYPE_VLAN items.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2 years agocommon/cnxk: support custom pre L2 header parsing as raw
Kiran Kumar K [Fri, 21 Jan 2022 06:26:39 +0000 (11:56 +0530)]
common/cnxk: support custom pre L2 header parsing as raw

Add ROC API for parsing custom pre_l2 headers as raw data.
Only relative offset is supported and search and limit is
not supported with this raw item type.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
2 years agonet/cnxk: support pre L2 switch header type
Kiran Kumar K [Fri, 21 Jan 2022 06:26:38 +0000 (11:56 +0530)]
net/cnxk: support pre L2 switch header type

Adding changes to configure switch header type pre_l2 for cnxk.
pre_l2 headers are custom headers placed before the ethernet
header. Along with switch header type, user needs to provide the
offset within the custom header that holds the size of the
custom header and mask for the size within the size offset.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
2 years agonet/dpaa2: fix build with musl
Thomas Monjalon [Tue, 1 Feb 2022 09:46:37 +0000 (10:46 +0100)]
net/dpaa2: fix build with musl

PAGE_SIZE is already defined in musl libc:

drivers/net/dpaa2/dpaa2_recycle.c:35: error: "PAGE_SIZE" redefined
/usr/include/limits.h:97: note:
   this is the location of the previous definition
   97 | #define PAGE_SIZE PAGESIZE

Fixes: f023d059769f ("net/dpaa2: support recycle loopback port")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
2 years agonet/nfp: remove useless range checks
Maxime Gouin [Wed, 5 Jan 2022 10:32:03 +0000 (11:32 +0100)]
net/nfp: remove useless range checks

Reported by code analysis tool C++test (version 10.4):

> /build/dpdk-20.11/drivers/net/nfp/nfpcore/nfp_target.h
> 375   Condition "island < 1" is always evaluated to false
> 415   Condition "island < 1" is always evaluated to false
> 547   Condition "target < 0" is always evaluated to false

All of these conditions have the same error. They call
NFP_CPP_ID_ISLAND_of or NFP_CPP_ID_TARGET_of which return a uint8_t and
put the result in "island" or "target" which are integers. These
variables can only contain values between 0 and 255.

Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/nfp: remove duplicated check when setting MAC address
Maxime Gouin [Wed, 5 Jan 2022 10:32:02 +0000 (11:32 +0100)]
net/nfp: remove duplicated check when setting MAC address

Reported by code analysis tool C++test (version 10.4):

> /build/dpdk-20.11/drivers/net/nfp/nfp_net.c
> 546   Conditions "(hw->ctrl &NFP_NET_CFG_CTRL_ENABLE) &&
        !! (hw->cap &NFP_NET_CFG_C" is always evaluated to false
> 547   Condition "! (hw->cap &NFP_NET_CFG_C" is always evaluated to false

The previous "if" checks exactly the same condition. Removal of duplicate
code.

Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change")
Cc: stable@dpdk.org
Signed-off-by: Maxime Gouin <maxime.gouin@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/mlx5: fix MPRQ WQE size assertion
Alexander Kozyrev [Thu, 13 Jan 2022 14:36:09 +0000 (16:36 +0200)]
net/mlx5: fix MPRQ WQE size assertion

Preparation of the stride size and the number of strides for
Multi-Packet RQ was updated recently to accommodate the hardware
limitation about minimum WQE size. The wrong assertion was
introduced to ensure this limitation is met. Assert that the
configured WQE size is not less than the minimum supported size.

Fixes: 34776af600df ("net/mlx5: fix MPRQ stride devargs adjustment")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix maximum packet headers size for TSO
Alexander Kozyrev [Thu, 13 Jan 2022 14:32:29 +0000 (16:32 +0200)]
net/mlx5: fix maximum packet headers size for TSO

The maximum packet headers size for TSO is calculated as a sum of
Ethernet, VLAN, IPv6 and TCP headers (plus inner headers).
The rationale  behind choosing IPv6 and TCP is their headers
are bigger than IPv4 and UDP respectively, giving us the maximum
possible headers size. But it is not true for L3 headers.
IPv4 header size (20 bytes) is smaller than IPv6 header size
(40 bytes) only in the default case. There are up to 10
optional header fields called Options in case IHL > 5.
This means that the maximum size of the IPv4 header is 60 bytes.

Choosing the wrong maximum packets headers size causes inability
to transmit multi-segment TSO packets with IPv4 Options present.
PMD check that it is possible to inline all the packet headers
and the packet headers size exceeds the expected maximum size.
The maximum packet headers size was set to 192 bytes before,
but its value has been reduced during Tx path refactor activity.
Restore the proper maximum packet headers size for TSO.

Fixes: 50724e1bba76 ("net/mlx5: update Tx definitions")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/bnxt: restore dependency on kernel modules
Geoffrey Le Gourriérec [Wed, 12 Jan 2022 13:41:52 +0000 (14:41 +0100)]
net/bnxt: restore dependency on kernel modules

During a large refactoring sweep for 21.11, a previous commit
removed the dependency the bnxt driver had on Linux virtual
bus drivers, such as vfio-pci. This breaks port detection.

This patch adds the kmod dependency back as it was.

Fixes: 295968d17407 ("ethdev: add namespace")
Cc: stable@dpdk.org
Signed-off-by: Geoffrey Le Gourriérec <geoffrey.le_gourrierec@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agocommon/cnxk: update meter algorithm in band profile
Rakesh Kudurumalla [Thu, 13 Jan 2022 12:28:07 +0000 (17:58 +0530)]
common/cnxk: update meter algorithm in band profile

Update meter algorithm in NIX's band profile structure.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: update meter BPF ID in Rx queue
Rakesh Kudurumalla [Thu, 13 Jan 2022 12:28:06 +0000 (17:58 +0530)]
net/cnxk: update meter BPF ID in Rx queue

Patch updates configured meter BPF (Bandwidth profile) ID is in
receive queue context during meter creation.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support getting queue status
Rahul Bhansali [Wed, 19 Jan 2022 09:43:27 +0000 (15:13 +0530)]
net/cnxk: support getting queue status

Provides ethdev callback support of rx_queue_count,
rx_descriptor_status and tx_descriptor_status.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: get head and tail of Rx and Tx queues
Rahul Bhansali [Wed, 19 Jan 2022 09:43:26 +0000 (15:13 +0530)]
common/cnxk: get head and tail of Rx and Tx queues

Adds roc APIs roc_nix_cq_head_tail_get(), roc_nix_sq_head_tail_get()
to get tail and head of receive and transmit queue respectively.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable LMTST burst for batch free
Ashwin Sekhar T K [Sat, 4 Dec 2021 10:30:46 +0000 (16:00 +0530)]
common/cnxk: enable LMTST burst for batch free

Use LMTST (Large atomic block store) burst as a performance optimization
when more than 15 pointers are requested to be freed.

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/enic: support GENEVE flow item
Hyong Youb Kim [Thu, 20 Jan 2022 14:26:37 +0000 (06:26 -0800)]
net/enic: support GENEVE flow item

Recent VIC models can parse GENEVE, including options, and inner
packet headers. Enable GENEVE header and option flow items. Currently,
only the first option that follows the GENEVE header can be matched,
and the GENEVE header item must specify option length.

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
2 years agonet/pfe: remove unused link status setting
Apeksha Gupta [Mon, 3 Jan 2022 10:01:29 +0000 (15:31 +0530)]
net/pfe: remove unused link status setting

remove setting link status where it is not being used

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/pfe: reduce driver initialization time
Gagandeep Singh [Mon, 3 Jan 2022 10:01:28 +0000 (15:31 +0530)]
net/pfe: reduce driver initialization time

This patch reduces the delay in the device init.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/enetc: support VF
Gagandeep Singh [Mon, 3 Jan 2022 10:01:27 +0000 (15:31 +0530)]
net/enetc: support VF

Add virtual function support for enetc devices

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa: enable checksum for shared MAC interface
Nipun Gupta [Mon, 3 Jan 2022 10:01:26 +0000 (15:31 +0530)]
net/dpaa: enable checksum for shared MAC interface

In case of shared MAC B0V bit in contextA is required
to be set to set so that ASPID is 0.

Signed-off-by: Brick Yang <brick.yang@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa: check status before configuring shared MAC
Nipun Gupta [Mon, 3 Jan 2022 10:01:25 +0000 (15:31 +0530)]
net/dpaa: check status before configuring shared MAC

For shared MAC interface, it is a prerequisite to enable the
interface in the kernel, before using it in user-space. This
patch makes sure that device is not getting configured in
case shared MAC interface is not enabled in the kernel.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support recycle loopback port
Jun Yang [Mon, 3 Jan 2022 10:01:24 +0000 (15:31 +0530)]
net/dpaa2: support recycle loopback port

DPAA2 recycle port is used for configuring the device
in the loopback mode. Loopback configuration can be at
dpni level or at serdes level.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agobus/fslmc: add and scan DPRC devices
Jun Yang [Mon, 3 Jan 2022 10:01:23 +0000 (15:31 +0530)]
bus/fslmc: add and scan DPRC devices

In order to get connection endpoint of each objects,
scan the dprc object.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: handle secondary process for DPNI
Jun Yang [Mon, 3 Jan 2022 10:01:22 +0000 (15:31 +0530)]
net/dpaa2: handle secondary process for DPNI

This change uses 'dev->process_private' instead of 'priv->hw'
to get dpmcp per process while setting flow distribution,
as priv->hw is only valid for primary process.
It also initialize rte_dpaa2_bpid_info in secondary process.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support level 2 in traffic management
Gagandeep Singh [Mon, 3 Jan 2022 10:01:21 +0000 (15:31 +0530)]
net/dpaa2: support level 2 in traffic management

This patch adds support for level 2 for QoS shaping.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: support multiple Tx queues enqueue for ordered
Jun Yang [Mon, 3 Jan 2022 10:01:20 +0000 (15:31 +0530)]
net/dpaa2: support multiple Tx queues enqueue for ordered

Support the tx enqueue in order queue mode, where queue id
for each event may be different.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: fix timestamping for IEEE1588
Vanshika Shukla [Mon, 3 Jan 2022 10:01:19 +0000 (15:31 +0530)]
net/dpaa2: fix timestamping for IEEE1588

The current implementation of DPAA2 driver code is such
that it records Rx and Tx timestamp for PTP without checking
if they are PTP packets or not. Packets for which
RTE_MBUF_F_RX_IEEE1588_TMST and RTE_MBUF_F_TX_IEEE1588_TMST
is not set, Rx and Tx timestamp should not be recorded.

This patch fixes this issue by checking if the required
flags are set in the mbuf before recording timestamps.

Also this change defines separate values for
DPAA2_TX_CONF_ENABLE and DPAA2_NO_PREFETCH_RX

Fixes: e806bf878c17 ("net/dpaa2: support timestamp")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/dpaa2: fix unregistering interrupt handler
Vanshika Shukla [Mon, 3 Jan 2022 10:01:18 +0000 (15:31 +0530)]
net/dpaa2: fix unregistering interrupt handler

This patch fixes code that handles unregistering LSC
interrupt handler in dpaa2_dev_stop API.

Fixes: c5acbb5ea20e ("net/dpaa2: support link status event")
Cc: stable@dpdk.org
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>