dpdk.git
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>
2 years agonet/dpaa2: warn on high Rx descriptor number
Rohit Raj [Mon, 3 Jan 2022 10:01:17 +0000 (15:31 +0530)]
net/dpaa2: warn on high Rx descriptor number

Added warning message if application is configuring nb_desc
more than supported by PEB memory suggesting user to configure
HW descriptors in normal memory rather than in faster PEB
memory.

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agobus/fslmc: use DMB OSHST for synchronization before I/O
Nipun Gupta [Mon, 3 Jan 2022 10:01:16 +0000 (15:31 +0530)]
bus/fslmc: use DMB OSHST for synchronization before I/O

Outer Shareable Store (oshst) is sufficient for Data Memory
Barrier (dmb) when doing IO on the interface via QBMAN.

This will sync L3/DDR with the L1/L2 cached data.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agobus/fslmc: update management complex FW to 10.29
Nipun Gupta [Mon, 3 Jan 2022 10:01:15 +0000 (15:31 +0530)]
bus/fslmc: update management complex FW to 10.29

update MC firmware library version to 10.29

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2 years agonet/cxgbe: fix dangling pointer by mailbox access rework
Rahul Lakkireddy [Wed, 19 Jan 2022 21:56:40 +0000 (03:26 +0530)]
net/cxgbe: fix dangling pointer by mailbox access rework

Rework mailbox access serialization to dynamically allocate and
free mbox entry. Also remove unnecessary temp memory and macros.

Observed with: gcc-12.0 (GCC) 12.0.1 20220118 (experimental)

In file included from ../lib/eal/linux/include/rte_os.h:14,
                 from ../lib/eal/include/rte_common.h:28,
                 from ../lib/eal/include/rte_log.h:25,
                 from ../lib/ethdev/rte_ethdev.h:164,
                 from ../lib/ethdev/ethdev_driver.h:18,
                 from ../drivers/net/cxgbe/base/t4vf_hw.c:6:
In function ‘t4_os_atomic_add_tail’,
    inlined from ‘t4vf_wr_mbox_core’ at
../drivers/net/cxgbe/base/t4vf_hw.c:115:2:
../drivers/net/cxgbe/base/adapter.h:742:9:
      warning: storing the address of local variable ‘entry’ in
      ‘((struct mbox_list *)adapter)[96].tqh_last’ [-Wdangling-pointer=]
  742 |         TAILQ_INSERT_TAIL(head, entry, next);
      |         ^~~~~~~~~~~~~~~~~
../drivers/net/cxgbe/base/t4vf_hw.c: In function ‘t4vf_wr_mbox_core’:
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘entry’ declared here
   86 |         struct mbox_entry entry;
      |                           ^~~~~
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘adapter’ declared here

Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2 years agoapp/testpmd: fix external buffer allocation
Dmitry Kozlyuk [Fri, 17 Dec 2021 09:58:16 +0000 (11:58 +0200)]
app/testpmd: fix external buffer allocation

External pinned buffer memory (--mp-alloc=xbuf)
was allocated as multiple IOVA-contiguous memzones
of 2M size and 2M alignment.
Due to the malloc overhead and the alignment requirement,
each 2M memzone consumed 4M of hugepage memory:
2M of usable memory + X of malloc overhead + (2M-X) padding.
The allocation often failed with 2M hugepages and IOVA-as-PA
if a PA-contiguous span of 2 hugepages could not be found.
Also, with any hugepage size and IOVA mode
memory consumption was almost 2x of the usable amount.

Alignment requirement of 2M for external buffers is redundant.
It was an attempt to ensure IOVA-contiguity
by forcing memzones to start at hugepage boundaries,
while 2M size intended to leave no unused space on the page.
As shown above, this in fact caused excessive memory consumption
and decreased the chance of a successful allocation.
RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.

Remove the alignment requirement.
Reduce the memzone size by the malloc overhead size (4 cache lines),
so that memory consumption for each memzone is
(2M-X) of usable memory + X of malloc overhead = 2M.
This also means that whenever there are free 2M hugepages,
an IOVA-contiguous memzone can always be allocated.

Fixes: 72512e1897b2 ("app/testpmd: add mempool with external data buffers")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agoapp/testpmd: fix dereference before null check
Sean Morrissey [Tue, 18 Jan 2022 10:53:09 +0000 (10:53 +0000)]
app/testpmd: fix dereference before null check

Assign 'left' variable only after null check on 'size'
as function returns if 'size' is null.

Coverity issue: 374381
Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/bonding: fix mode type mismatch
Yunjian Wang [Fri, 10 Dec 2021 11:41:01 +0000 (19:41 +0800)]
net/bonding: fix mode type mismatch

There were some type-mismatch issues in bonding and fix them:
- Use %u to fix argument type mismatch in RTE_BOND_LOG.
- The internals->mode is of type uint8_t. But the function
  parameter 'mode' is of type int. So change the mode type
  from int to uint8_t.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Fixes: a45b288ef21a ("bond: support link status polling")
Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2 years agonet/af_xdp: fix build with -Wunused-function
Ciara Loftus [Thu, 9 Dec 2021 17:19:47 +0000 (17:19 +0000)]
net/af_xdp: fix build with -Wunused-function

The get_shared_umem function is only called when the kernel
flag XDP_UMEM_UNALIGNED_CHUNK_FLAG is defined. Move the
function implementation and associated helper so that it only
gets compiled when that flag is set.

Fixes: 74b46340e2d4 ("net/af_xdp: support shared UMEM")
Cc: stable@dpdk.org
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/tap: remove maintainer
Keith Wiles [Thu, 2 Dec 2021 17:15:37 +0000 (17:15 +0000)]
net/tap: remove maintainer

I no longer have the bandwidth to support the TAP PMD, so I am
removing myself as the maintainer so as to not hold up commits.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/axgbe: use PCI root complex device to distinguish device
Chandubabu Namburu [Thu, 2 Dec 2021 16:10:34 +0000 (16:10 +0000)]
net/axgbe: use PCI root complex device to distinguish device

"bus/pci: optimize bus scan" broke axgbe on V1000/R1000.
RV root complex pci device does not have any kernel driver assigned
so it is removed from pci scan list which is used in
"net/axgbe: add a HW quirk for register definitions".

Get root complex device id directly from pci sysfs instead of
pci scan list.

Fixes: 991e0b1dbc4a ("net/axgbe: add a HW quirk for register definitions")
Cc: stable@dpdk.org
Signed-off-by: Chandubabu Namburu <chandu@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
2 years agoapp/testpmd: fix Tx scheduling interval
Viacheslav Ovsiienko [Tue, 23 Nov 2021 16:32:58 +0000 (18:32 +0200)]
app/testpmd: fix Tx scheduling interval

The first "set txtimes" command parameter specifies the time
interval between scheduled send bursts for single queue. This
interval should be the same for all the forwarding ports.
It requires to maintain the timing related variables on per
queue basis instead of per core, as currently implemented.
This resulted in wrong burst intervals if two or more cores
were generating the scheduled traffic for two or more ports
in txonly mode.

This patch moves the timing variable to the fstream structure.
Only txonly forwarding mode with enabled send scheduling is
affected.

Fixes: 4940344dab1d ("app/testpmd: add Tx scheduling command")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/bonding: fix offloading configuration
Chengchang Tang [Tue, 9 Nov 2021 07:57:26 +0000 (15:57 +0800)]
net/bonding: fix offloading configuration

Currently, part offloadings of the bonding device will not take effect
by using dev_configure(). Because the related configuration will not be
delivered to the slave devices in this way.

The offloading capability of the bonding device is the intersection of
the capability of all slave devices. Based on this, the following
functions are added to the bonding driver:
1. If a Tx offloading is within the capability of the bonding device
   (i.e, all the slave devices support this Tx offloading), the enabling
   status of the offloading of all slave devices depends on the
   configuration of the bonding device.

2. For the Tx offloading that is not within the Tx offloading capability
   of the bonding device, the enabling status of the offloading on the
   slave devices is irrelevant to the bonding device configuration. And
   it depends on the original configuration of the slave devices.

Fixes: e8b3e1a9b1bb ("net/bonding: switch to new offloading API")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2 years agoethdev: mark old macros as deprecated
Ferruh Yigit [Wed, 12 Jan 2022 14:36:23 +0000 (14:36 +0000)]
ethdev: mark old macros as deprecated

Old macros kept for backward compatibility, but this cause old macro
usage to sneak in silently.

Marking old macros as deprecated. Downside is this will cause some noise
for applications that are using old macros.

Fixes: 295968d17407 ("ethdev: add namespace")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2 years agonet/cnxk: fix promiscuous mode in multicast enable flow
Asaf Ravid [Wed, 1 Dec 2021 10:29:53 +0000 (15:59 +0530)]
net/cnxk: fix promiscuous mode in multicast enable flow

When multicast promiscuous was being enabled it caused the unicast
promiscuous to be disabled. This fix resolves this by setting
NIX_RX_MODE_PROMISC when eth_dev->data->promiscuous is set, regardless.

Fixes: 325d79c00a5a ("net/cnxk: support all multicast")
Cc: stable@dpdk.org
Signed-off-by: Asaf Ravid <aravid@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/bnxt: check VF representor pointer before access
Ajit Khaparde [Tue, 4 Jan 2022 08:38:24 +0000 (14:08 +0530)]
net/bnxt: check VF representor pointer before access

The PF or trusted VF Rx handler could invoke the VF representor's
Rx function without knowledge of the application cleaning up the
representor ports. Check if the vfr_bp pointer is valid before
accessing it.

Fixes: 6dc83230b43b ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix xstats query
Kalesh AP [Tue, 4 Jan 2022 08:38:23 +0000 (14:08 +0530)]
net/bnxt: fix xstats query

Fix incorrect memset in bnxt_dev_xstats_get_op.
In bnxt_dev_xstats_get_op(), the PMD is not zeroing the whole
buffer supplied by the application. This can end up passing
junk statistics values to the application when the FW does not
support extended stats on a function.
Fixed to call memset() with correct size.

Fixes: f55e12f33416 ("net/bnxt: support extended port counters")
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 crash by validating pointer
Ajit Khaparde [Tue, 4 Jan 2022 08:38:22 +0000 (14:08 +0530)]
net/bnxt: fix crash by validating pointer

Validate the pointers in rxq before accessing them.
Otherwise it can cause a segfault.

Fixes: 657c2a7f1dd4 ("net/bnxt: create aggregation rings when needed")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix PAM4 mask setting
Ajit Khaparde [Tue, 4 Jan 2022 08:38:21 +0000 (14:08 +0530)]
net/bnxt: fix PAM4 mask setting

Set the PAM4 mask setting only when PAM4 signaling is enabled.
Setting it otherwise seems to result in link negotiation.
Also auto_pam4_link_speeds has been renamed to
auto_pam4_link_speed_mask to reflect its real usage.

Fixes: c23f9ded0391 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2 years agonet/bnxt: fix ring teardown
Ajit Khaparde [Tue, 4 Jan 2022 08:38:20 +0000 (14:08 +0530)]
net/bnxt: fix ring teardown

Check for valid bit while scanning for hwrm_done completion
during ring teardown. Not checking the valid bit could cause a
ring overflow when we ring the doorbell.

Fixes: 4fb6ab3f866d ("net/bnxt: check flush status during ring free")
Cc: stable@dpdk.org
Signed-off-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/bnxt: fix handling of VF configuration change
Kalesh AP [Tue, 4 Jan 2022 08:38:19 +0000 (14:08 +0530)]
net/bnxt: fix handling of VF configuration change

When there is a change in the default VLAN of the VF,
FW sends the VF_CFG_CHANGE async event to the driver.
Upon receiving this async event, driver currently only queries
the FW using HWRM_FUNC_QCFG. But this is not enough.

Driver has to clean up the existing filter and recreate filters
so the FW can apply the default VLAN to the filter.

Fixes: 12213821a8a3 ("net/bnxt: register for more 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: refactor datapath stop for reuse
Somnath Kotur [Tue, 4 Jan 2022 08:38:18 +0000 (14:08 +0530)]
net/bnxt: refactor datapath stop for reuse

Refactor bnxt_stop_rxtx() for reuse.
By accepting rte_eth_dev as input, bnxt_stop_rxtx() can be used
in multiple scenarios such as representor devices.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2 years agonet/bnxt: get maximum supported multicast filters count
Kalesh AP [Tue, 4 Jan 2022 08:38:17 +0000 (14:08 +0530)]
net/bnxt: get maximum supported multicast filters count

The HWRM_FUNC_QCAPS response indicates the maximum number
of multicast filters that can be supported by this function
on the RX side.

Fixed to use this value instead of the hard coded value 16.

Fixes: d69851df12b2 ("net/bnxt: support multicast filter and set MAC addr")
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 flow create when RSS is disabled
Kalesh AP [Tue, 4 Jan 2022 08:38:16 +0000 (14:08 +0530)]
net/bnxt: fix flow create when RSS is disabled

This patch reverts the commit "5d47d06b2c83".
Revert this commit as it caused a regression on legacy chips.
On newer chips we use TruFlow based flow creation instead of
HWRM based flow creation.

Fixes: 5d47d06b2c83 ("net/bnxt: modify VNIC accounting")
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: add null check for mark table
Kalesh AP [Tue, 4 Jan 2022 08:38:15 +0000 (14:08 +0530)]
net/bnxt: add null check for mark table

During the port start, driver ignores mark table allocation failure.
This could cause a segfault due to NULL pointer dereference in
bnxt_set_mark_in_mbuf(). Fix this by checking the pointer validity
before accessing it.

Fixes: b87abb2e55cb ("net/bnxt: support marking packet")
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: improve recovery related log messages
Kalesh AP [Tue, 4 Jan 2022 08:38:14 +0000 (14:08 +0530)]
net/bnxt: improve recovery related log messages

Make these messages more specific.

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: set fast-path pointers only if recovery succeeds
Kalesh AP [Tue, 4 Jan 2022 08:38:13 +0000 (14:08 +0530)]
net/bnxt: set fast-path pointers only if recovery succeeds

During reset recovery, fixed to set the fast-path pointers
only if recovery succeeds.

Fixes: 720b55ad278e ("net/bnxt: fix crash caused by error recovery")
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: cap maximum number of unicast MAC addresses
Kalesh AP [Tue, 4 Jan 2022 08:38:12 +0000 (14:08 +0530)]
net/bnxt: cap maximum number of unicast MAC addresses

The Maximum number of receive mac addr is hard coded to 128
in the ethdev library(RTE_ETH_NUM_RECEIVE_MAC_ADDR).
But the bnxt devices support more than 128 unicast MAC filters
which could result in a segfault while user tries to add more
than 128 unicast MAC addresses to the port.

Fixes: a2033fda22ab ("net/bnxt: fix number of MAC addresses for VMDq")
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>