dpdk.git
3 years agocommon/cnxk: support inline IPsec flow action
Satheesh Paul [Fri, 1 Oct 2021 13:40:09 +0000 (19:10 +0530)]
common/cnxk: support inline IPsec flow action

Add support to configure flow rules with inline IPsec action.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support anti-replay check in SW for cn9k
Srujana Challa [Fri, 1 Oct 2021 13:40:08 +0000 (19:10 +0530)]
common/cnxk: support anti-replay check in SW for cn9k

Adds anti replay SW implementation for cn9k platform.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: setup aura BP conf based on NIX
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:07 +0000 (19:10 +0530)]
common/cnxk: setup aura BP conf based on NIX

Currently only NIX0 conf is setup in AURA for backpressure.
This patch adds support for NIX1 as well.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: add CQ enable support in NIX Tx path
Kommula Shiva Shankar [Fri, 1 Oct 2021 13:40:06 +0000 (19:10 +0530)]
common/cnxk: add CQ enable support in NIX Tx path

This patch provides applications to add CQ support
in Tx path. This enables packet completion events on
CQ for requested packets.

Signed-off-by: Kommula Shiva Shankar <kshankar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: restore NIX SQB pool limit before destroy
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:05 +0000 (19:10 +0530)]
common/cnxk: restore NIX SQB pool limit before destroy

Restore SQB AURA/POOL limit before destroying SQB to be
able to drain all the buffers from the aura.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: align CPT LF enable/disable sequence
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:04 +0000 (19:10 +0530)]
common/cnxk: align CPT LF enable/disable sequence

For CPT LF IQ enable, set CPT_LF_CTL[ENA] before setting
CPT_LF_INPROG[EENA] to true.

For CPT LF IQ disable, align sequence to that of HRM.

Also this patch aligns space for instructions in CPT LF
to ROC_ALIGN to make complete memory cache aligned and
has other minor fixes/additions.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: dump CPT LF registers on error interrupt
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:03 +0000 (19:10 +0530)]
common/cnxk: dump CPT LF registers on error interrupt

Dump CPT LF registers on error interrupt for debugging
purpose.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: disable CQ drop when inline inbound is enabled
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:02 +0000 (19:10 +0530)]
common/cnxk: disable CQ drop when inline inbound is enabled

Disable CQ drop when inline inbound is enabled. CQ drop
is not supported for second pass IPsec decrypted packets.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support NIX inline inbound and outbound setup
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:01 +0000 (19:10 +0530)]
common/cnxk: support NIX inline inbound and outbound setup

Add API to support setting up NIX inline inbound and
NIX inline outbound. In case of inbound, SA base is setup
on NIX PFFUNC and in case of outbound, required number of
CPT LF's are attached to NIX PFFUNC.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support NIX inline device init and fini
Nithin Dabilpuram [Fri, 1 Oct 2021 13:40:00 +0000 (19:10 +0530)]
common/cnxk: support NIX inline device init and fini

Add support to init and fini inline device with NIX LF,
SSO LF and SSOW LF for inline inbound IPSec in CN10K.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support NIX inline device IRQ
Nithin Dabilpuram [Fri, 1 Oct 2021 13:39:59 +0000 (19:09 +0530)]
common/cnxk: support NIX inline device IRQ

Add API to setup NIX inline device IRQ's. This registers
IRQ's for errors in case of NIX, CPT LF, SSOW and get wor
interrupt in case of SSO.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: change NIX debug API and queue API interface
Nithin Dabilpuram [Fri, 1 Oct 2021 13:39:58 +0000 (19:09 +0530)]
common/cnxk: change NIX debug API and queue API interface

Change NIX debug API and queue API interface for use by
internal NIX inline device initialization.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: allow reuse of SSO API for inline dev
Nithin Dabilpuram [Fri, 1 Oct 2021 13:39:57 +0000 (19:09 +0530)]
common/cnxk: allow reuse of SSO API for inline dev

Rework interface of SSO internal functions to use for NIX inline dev's
SSO LF's.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support CPT parse header dump
Nithin Dabilpuram [Fri, 1 Oct 2021 13:39:56 +0000 (19:09 +0530)]
common/cnxk: support CPT parse header dump

Add helper API to dump CPT parse header.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support cn9k fast path security session
Srujana Challa [Fri, 1 Oct 2021 13:39:55 +0000 (19:09 +0530)]
common/cnxk: support cn9k fast path security session

Add security support to init cn9k fast path SA data
for AES GCM and AES CBC + HMAC SHA1.

Signed-off-by: Srujana Challa <schalla@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agonet/cxgbe: remove useless address check
Ferruh Yigit [Mon, 4 Oct 2021 17:27:54 +0000 (18:27 +0100)]
net/cxgbe: remove useless address check

reported by "gcc (GCC) 12.0.0 20211003 (experimental)":

../drivers/net/cxgbe/cxgbe_ethdev.c:
In function ‘cxgbe_dev_rx_queue_setup’:
../drivers/net/cxgbe/cxgbe_ethdev.c:682:24:
error: the comparison will always evaluate as ‘true’ for the
address of ‘fl’ will never be NULL [-Werror=address]
  682 |         if ((&rxq->fl) != NULL)
      |                        ^~

Fixing it by removing useless check.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agoethdev: improve xstats names by IDs get prototype
Andrew Rybchenko [Fri, 1 Oct 2021 09:07:22 +0000 (12:07 +0300)]
ethdev: improve xstats names by IDs get prototype

Adjust parameters order to eth_xstats_get_by_id_t prototype.
Make ids the second parameter similar to eth_xstats_get_by_id_t.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: update xstats by ID driver callbacks documentation
Ivan Ilchenko [Fri, 1 Oct 2021 09:07:21 +0000 (12:07 +0300)]
ethdev: update xstats by ID driver callbacks documentation

Update xstats by IDs callbacks documentation in accordance with
ethdev usage of these callbacks. Document valid combinations of
input arguments to make driver implementation simpler.

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: do not use get xstats names by IDs to obtain count
Andrew Rybchenko [Fri, 1 Oct 2021 09:07:20 +0000 (12:07 +0300)]
ethdev: do not use get xstats names by IDs to obtain count

Relax requirements on get xstats names by IDs. After the patch
corresponding the driver operation is called with non-NULL ids
and xstats_names parameters only.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoethdev: fix xstats by ID API documentation
Ivan Ilchenko [Fri, 1 Oct 2021 09:07:19 +0000 (12:07 +0300)]
ethdev: fix xstats by ID API documentation

Document valid combinations of input arguments in accordance with
current implementation in ethdev.

Fixes: 79c913a42f0e ("ethdev: retrieve xstats by ID")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/af_packet: reinsert stripped VLAN tag
Tudor Cornea [Fri, 1 Oct 2021 08:35:01 +0000 (11:35 +0300)]
net/af_packet: reinsert stripped VLAN tag

The af_packet pmd driver binds to a raw socket and allows sending and
receiving of packets through the kernel.

Since commit [1], the kernel strips the vlan tags early in
__netif_receive_skb_core(), so we receive untagged packets while running
with the af_packet pmd.

Luckily for us, the skb vlan-related fields are still populated from the
stripped vlan tags, so we end up having all the information that we need
in the mbuf.

Having the pmd driver support DEV_RX_OFFLOAD_VLAN_STRIP allows the
application to control the desired vlan stripping behavior, until we
have a way to describe offloads that can't be disabled by pmd drivers.

This patch will cause a change in the default way that the af_packet pmd
treats received vlan-tagged frames. While previously, the application
was required to check the PKT_RX_VLAN_STRIPPED flag, after this patch,
the pmd will re-insert the vlan tag transparently to the user, unless
the DEV_RX_OFFLOAD_VLAN_STRIP is enabled in rxmode.offloads.

I've attempted a preliminary benchmark to understand if the change could
cause a sizable performance hit.

Setup:
Two virtual machines running on top of an ESXi hypervisor

Tx: DPDK app (running on top of vmxnet3 PMD)
Rx: af_packet (running on top of a kernel vmxnet3 interface)
Packet size :68 (packet contains a vlan tag)

Rates:
Tx - 1.419 Mpps
Rx (without vlan insertion) - 1227636 pps
Rx (with vlan insertion)    - 1220081 pps

At a first glance, we don't seem to have a large degradation in terms of
packet rate.

[1]
https://github.com/torvalds/linux/commit/bcc6d47903612c3861201cc3a866fb60

Signed-off-by: Tudor Cornea <tudor.cornea@gmail.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/cxgbe: support firmware version query
Nikhil Vasoya [Thu, 30 Sep 2021 17:09:59 +0000 (22:39 +0530)]
net/cxgbe: support firmware version query

Implement eth_dev_ops callback to get firmware version.

Signed-off-by: Nikhil Vasoya <nikhil.vasoya@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agonet/cxgbe: support xstats for VF
Nikhil Vasoya [Thu, 30 Sep 2021 17:09:58 +0000 (22:39 +0530)]
net/cxgbe: support xstats for VF

Add support to fetch port and queue stats via xstats API. Also remove
queue stats from basic stats because they're now available via xstats
API for the VF.

Signed-off-by: Nikhil Vasoya <nikhil.vasoya@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agonet/memif: allocate socket hash on any NUMA socket
Junxiao Shi [Tue, 28 Sep 2021 13:51:59 +0000 (13:51 +0000)]
net/memif: allocate socket hash on any NUMA socket

Previously, memif socket hash is always allocated on NUMA socket 0.
If the application is entirely running on another NUMA socket and EAL
--socket-limit prevents memory allocation on NUMA socket 0, memif
creation fails with "HASH: memory allocation failed" error.

This patch allows allocating memif socket hash on any NUMA socket.

Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
Reviewed-by: Jakub Grajciar <jgrajcia@cisco.com>
3 years agocommon/cnxk: enable completion queue overflow errata
Harman Kalra [Tue, 21 Sep 2021 11:00:38 +0000 (16:30 +0530)]
common/cnxk: enable completion queue overflow errata

An issue exists on some HW revisions whereby if a CQ overflows
NIX may have undefined behavior, e.g. free incorrect buffers.
Implementing a workaround for this known HW issue.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: enable RVUM interrupt errata
Harman Kalra [Tue, 21 Sep 2021 11:00:37 +0000 (16:30 +0530)]
common/cnxk: enable RVUM interrupt errata

As per an known HW issue RVUM interrupts may get dropped, If an RVUM
interrupt event occurs when PCCPF_XXX_MSIX_CAP_HDR[MSIXEN]=0 then no
interrupt is triggered, which is expected. But after MSIXEN is set to
1, subsequently if same interrupts event occurs again, still no
interrupt will be triggered.

As a workaround, all RVUM interrupt lines should be cleared between
MSIXEN=0 and MSIXEN=1.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agodoc: remove unneeded min/max fields deprecations
Dmitry Kozlyuk [Thu, 7 Oct 2021 22:07:50 +0000 (01:07 +0300)]
doc: remove unneeded min/max fields deprecations

It was announced that `min` and `max` fields and variables in public
headers will be renamed to avoid clash with `min` and `max` macros
defined in Windows headers. However, it is unnecessary, because these
are function-like macros, which are not expanded unless the next token
is an opening brace. It cannot happen for integer fields and variables.
Remove the deprecation notices.

Fixes: c4379ee599ef ("doc: announce API changes for Windows compatibility")

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agonet: rename Ethernet header fields
Dmitry Kozlyuk [Thu, 7 Oct 2021 22:07:49 +0000 (01:07 +0300)]
net: rename Ethernet header fields

Definition of `rte_ether_addr` structure used a workaround allowing DPDK
and Windows SDK headers to be used in the same file, because Windows SDK
defines `s_addr` as a macro. Rename `s_addr` to `src_addr` and `d_addr`
to `dst_addr` to avoid the conflict and remove the workaround.
Deprecation notice:
https://mails.dpdk.org/archives/dev/2021-July/215270.html

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agonet/ixgbe: build on Windows
William Tu [Wed, 6 Oct 2021 22:35:44 +0000 (22:35 +0000)]
net/ixgbe: build on Windows

This patch enables building the ixgbe driver for Windows.
It also enables its dependencies on security and cryptodev.
I tested on AWS using ixgbe VF device, using dpdk-testpmd.

Signed-off-by: William Tu <u9012063@gmail.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
3 years agosecurity: build on Windows
Tal Shnaiderman [Wed, 6 Oct 2021 22:35:42 +0000 (22:35 +0000)]
security: build on Windows

Build the security library on Windows.

Remove unneeded export of inline functions from version file.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: William Tu <u9012063@gmail.com>
3 years agocryptodev: build on Windows
Tal Shnaiderman [Wed, 6 Oct 2021 22:35:43 +0000 (22:35 +0000)]
cryptodev: build on Windows

Build the cryptography device library on Windows OS
by removing unneeded include and exports of inline functions
blocking the compilation.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: William Tu <u9012063@gmail.com>
3 years agosecurity: use net library to include IP structs
Tal Shnaiderman [Wed, 6 Oct 2021 22:35:41 +0000 (22:35 +0000)]
security: use net library to include IP structs

Remove the netinet includes and replaces them
with rte_ip.h to support the in_addr/in6_addr structs
on all operating systems.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: William Tu <u9012063@gmail.com>
3 years agocommon/dpaax: fix physical address conversion
Gagandeep Singh [Wed, 6 Oct 2021 17:01:31 +0000 (22:31 +0530)]
common/dpaax: fix physical address conversion

If some of the VA entries of table are somehow not populated and are
NULL, it can add offset to NULL and return the invalid VA in PA to
VA conversion.

In this patch, adding a check if the VA entry has valid address only
then add offset and return VA.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Cc: stable@dpdk.org
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>
3 years agoraw/dpaa2_qdma: remove datapath checks for lcore ID
Nipun Gupta [Wed, 6 Oct 2021 17:01:30 +0000 (22:31 +0530)]
raw/dpaa2_qdma: remove datapath checks for lcore ID

There is no need for preventional check of rte_lcore_id() in
data path. This patch removes the same.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agoraw/dpaa2_qdma: handle size for config and queue setup
Nipun Gupta [Wed, 6 Oct 2021 17:01:29 +0000 (22:31 +0530)]
raw/dpaa2_qdma: handle size for config and queue setup

RAW configure and Queue setup APIs support size parameter for
configure. This patch supports the same for DPAA2 QDMA PMD APIs

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/dpaa: explain behaviour with FMC policy
Rohit Raj [Wed, 6 Oct 2021 17:01:28 +0000 (22:31 +0530)]
net/dpaa: explain behaviour with FMC policy

This patch adds comment to explain how dpaa_port_fmc_ccnode_parse
function is working to get the HW queue from FMC policy file

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/dpaa2: add more RSS distributions
Vanshika Shukla [Wed, 6 Oct 2021 17:01:27 +0000 (22:31 +0530)]
net/dpaa2: add more RSS distributions

This patch updates the RSS support to support following additional
distributions:
- VLAN
- ESP
- AH
- PPPOE

Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/dpaa2: generate HW hash key
Hemant Agrawal [Wed, 6 Oct 2021 17:01:26 +0000 (22:31 +0530)]
net/dpaa2: generate HW hash key

This patch add support to generate the hash key in software
equivalent to WRIOP key generation.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/dpaa2: add debug log for jumbo MTU
Hemant Agrawal [Wed, 6 Oct 2021 17:01:25 +0000 (22:31 +0530)]
net/dpaa2: add debug log for jumbo MTU

This patch adds a debug print for MTU configured on the
device when jumbo frames are enabled.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agobus/fslmc: add qbman debug
Hemant Agrawal [Wed, 6 Oct 2021 17:01:24 +0000 (22:31 +0530)]
bus/fslmc: add qbman debug

Add support for debugging qbman FQs

Signed-off-by: Youri Querry <youri.querry_1@nxp.com>
Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
3 years agonet/dpaa2: support Tx flow redirection action
Jun Yang [Wed, 6 Oct 2021 17:01:23 +0000 (22:31 +0530)]
net/dpaa2: support Tx flow redirection action

TX redirection support by flow action RTE_FLOW_ACTION_TYPE_PHY_PORT
and RTE_FLOW_ACTION_TYPE_PORT_ID

This action is executed by HW to forward packets between ports.
If the ingress packets match the rule, the packets are switched
without software involved and perf is improved as well.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agobus/fslmc: update MC FW to 10.28
Hemant Agrawal [Wed, 6 Oct 2021 17:01:22 +0000 (22:31 +0530)]
bus/fslmc: update MC FW to 10.28

Updating MC firmware support APIs to be latest. It supports
improved DPDMUX (SRIOV equivalent) for traffic split between
dpnis and additional PTP APIs.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agoexamples/kni: close port before exit
Huisong Li [Tue, 14 Sep 2021 06:02:19 +0000 (14:02 +0800)]
examples/kni: close port before exit

This patch adds dev_close() step to release network adapter resources
when kni free.

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoraw/ifpga/base: fix linking with librt
Mohamad Noor Alim Hussin [Tue, 28 Sep 2021 04:36:10 +0000 (12:36 +0800)]
raw/ifpga/base: fix linking with librt

Finding with "librt" keyword would give the output with
full path of librt such as
/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/librt.so
instead of -lrt in libdpdk.pc pkg-config file.

Assume find_library() will prepend "lib", thus remove
"lib" from "librt" keyword. The output will shows
as -lrt.

This will cause an issue when compile DPDK app with
static library as the path of librt has been hard-coded
in the libdpdk.pc file.

Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")
Cc: stable@dpdk.org
Signed-off-by: Mohamad Noor Alim Hussin <mohamad.noor.alim.hussin@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
3 years agoregex/mlx5: refactor HW queue objects
Raja Zidane [Tue, 5 Oct 2021 12:27:33 +0000 (12:27 +0000)]
regex/mlx5: refactor HW queue objects

The mlx5 PMD for regex class uses an MMO WQE operated by the GGA engine
in BF devices.
Currently, all the MMO WQEs are managed by the SQ object.
Starting from BF3, the queue of the MMO WQEs should be connected to the
GGA engine using a new configuration, MMO, that will be supported only
in the QP object.
The FW introduced new capabilities to define whether the MMO
configuration should be configured for the GGA queue.
Replace all the GGA queue objects to QP, set MMO configuration according
to the new FW capabilities.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agocompress/mlx5: refactor HW queue object
Raja Zidane [Tue, 5 Oct 2021 12:27:32 +0000 (12:27 +0000)]
compress/mlx5: refactor HW queue object

The mlx5 PMD for compress class uses an MMO WQE operated by the GGA
engine in BF devices.
Currently, all the MMO WQEs are managed by the SQ object.
Starting from BF3, the queue of the MMO WQEs should be connected to the
GGA engine using a new configuration, MMO, that will be supported only
in the QP object.
The FW introduced new capabilities to define whether the MMO
configuration should be configured for the GGA queue.
Replace all the GGA queue objects to QP, set MMO configuration according
to the new FW capabilities.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agocommon/mlx5: add MMO configuration for DevX queue pair
Raja Zidane [Tue, 5 Oct 2021 12:27:31 +0000 (12:27 +0000)]
common/mlx5: add MMO configuration for DevX queue pair

A new configuration MMO was added to QP Context.
If set, MMO WQEs are supported on this QP.
For DMA MMO, supported only when dma_mmo_qp==1.
For REGEXP MMO, supported only when regexp_mmo_qp==1.
For COMPRESS MMO, supported only when compress_mmo_qp==1.
For DECOMPRESS MMO, supported only when decompress_mmo_qp==1.
Add support to DevX interface to set MMO bit.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agocommon/mlx5: update MMO HCA capabilities
Raja Zidane [Tue, 5 Oct 2021 12:27:30 +0000 (12:27 +0000)]
common/mlx5: update MMO HCA capabilities

New MMO HCA capabilities were added and others were renamed.
Align hca capabilities with new prm.
Add support in DevX interface for changes in HCA capabilities.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agocommon/mlx5: share DevX queue pair operations
Raja Zidane [Tue, 5 Oct 2021 12:27:29 +0000 (12:27 +0000)]
common/mlx5: share DevX queue pair operations

Currently drivers using QP (vDPA, crypto and compress, regex soon)
manage their memory, creation, modification and destruction of the QP,
in almost identical code.
Move QP memory management, creation and destruction to common.
Add common function to change QP state to RTS.
Add user_index attribute to QP creation.
It's for better code maintenance and reuse.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agotest/latency: fix loop boundary
David Marchand [Sat, 2 Oct 2021 16:24:31 +0000 (18:24 +0200)]
test/latency: fix loop boundary

Caught running ASAN.

lat_stats_strings[] is an array containing NUM_STATS strings.

Fixes: 1e3676a06e4c ("test/latency: add unit tests for latencystats library")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
3 years agobus/vmbus: fix leak on device scan
David Marchand [Sat, 2 Oct 2021 16:24:30 +0000 (18:24 +0200)]
bus/vmbus: fix leak on device scan

Caught running ASAN.
The device name was leaked on scan.
rte_device name field being a const, use a local pointer and release
in error path.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Long Li <longli@microsoft.com>
3 years agosort symbol maps
David Marchand [Tue, 5 Oct 2021 09:16:26 +0000 (11:16 +0200)]
sort symbol maps

Fixed with ./devtools/update-abi.sh $(cat ABI_VERSION)

Fixes: e73a7ab22422 ("net/softnic: promote manage API")
Fixes: 8f532a34c4f2 ("fib: promote API to stable")
Fixes: 4aeb92396b85 ("rib: promote API to stable")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agonet/ice/base: fix strict-aliasing with GCC
Aman Deep Singh [Tue, 5 Oct 2021 11:57:54 +0000 (17:27 +0530)]
net/ice/base: fix strict-aliasing with GCC

Code changes done for build issue as reported in Bug 817
error: dereferencing type-punned pointer will break strict-aliasing rules.
added union to avoid pointer dereferencing

The build issue has been reported with both gcc 4.8.5 (RHEL 7) and
gcc 5.4.0 (Ubuntu 16.04).

Bugzilla ID: 817
Fixes: 39925373a333 ("net/ice/base: add parser execution main loop")

Signed-off-by: Aman Deep Singh <aman.deep.singh@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agovdpa/ifc: increase readability with bool type
Jilei Chen [Mon, 27 Sep 2021 10:17:55 +0000 (18:17 +0800)]
vdpa/ifc: increase readability with bool type

Use bool type for function's switch parameter,
this could avoid passing "1" or "0" which is not reader friendly.

Signed-off-by: Jilei Chen <chenjilei@cmss.chinamobile.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
3 years agonet/cxgbe: avoid sending link params change from VF
Nikhil Vasoya [Mon, 27 Sep 2021 17:56:30 +0000 (23:26 +0530)]
net/cxgbe: avoid sending link params change from VF

VFs are not allowed to change physical link params when a port
module change is detected. The firmware already returns appropriate
permission error when VF tries to change physical link params. But,
make sure to avoid sending the command to firmware from VF in the
first place and prevent flooding firmware debug logs with permission
errors.

Fixes: a83041b1e998 ("net/cxgbe: rework and simplify link handling")
Cc: stable@dpdk.org
Signed-off-by: Nikhil Vasoya <nikhil.vasoya@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
3 years agonet/mlx5: fix Tx metadata endianness in data path
Bing Zhao [Mon, 27 Sep 2021 08:02:03 +0000 (11:02 +0300)]
net/mlx5: fix Tx metadata endianness in data path

The metadata can be set in the mbuf dynamic field and then used in
flow rules steering for egress direction. The hardware requires
network order for both the insertion of a rule and sending a packet.
Indeed, there is no strict restriction for the endianness. The order
for sending a packet and its steering rule should be consistent.

In the past, there was no endianness conversion due to the
performance reason. The flow rule converted the metadata into little
endian for hardware (if needed) and the packet hit the flow rule also
with little endian.

After the metadata was converted to big endian, the missing adaption
in the data path resulted in a flow miss of the egress packets.

Converting the metadata to big endian before posting a WQE to the
hardware solves this issue.

Fixes: b57e414b48c0 ("net/mlx5: convert meta register to big-endian")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: fix flow tables double release
Bing Zhao [Tue, 28 Sep 2021 04:08:51 +0000 (07:08 +0300)]
net/mlx5: fix flow tables double release

In the function mlx5_alloc_shared_dr(), there are various reasons
to result in a failure and error clean up process. While in the
caller of mlx5_dev_spawn(), once there is a error occurring after
the mlx5_alloc_shared_dr(), the mlx5_os_free_shared_dr() is called
to release all the resources.

To prevent a double release, the pointers of the resources should
be checked before the releasing and set to NULL after done.

In the mlx5_free_table_hash_list(), after the releasing, the pointer
was missed to set to NULL and a double release may cause a crash.

By setting the tables pointer to NULL as done for other resources,
the double release and crash could be solved.

Fixes: 54534725d2f3 ("net/mlx5: fix flow table hash list conversion")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: support new global device syntax
Xueming Li [Thu, 23 Sep 2021 06:45:26 +0000 (14:45 +0800)]
net/mlx5: support new global device syntax

This patch support new global device syntax like:
bus=pci,addr=BB:DD.F/class=eth/driver=mlx5,devargs,..

In driver parameters check, ignores "driver" key which is part of new
global device syntax instead of reporting error.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/virtio: revert forcing IOVA as VA mode for virtio-user
Maxime Coquelin [Thu, 30 Sep 2021 08:12:59 +0000 (10:12 +0200)]
net/virtio: revert forcing IOVA as VA mode for virtio-user

This patch removes the simplification in Virtio descriptors
handling, where their buffer addresses are IOVAs for Virtio
PCI devices, and VA-only for Virtio-user devices, which
added a requirement on Virtio-user that it only supported
IOVA as VA.

This change introduced a regression for applications using
Virtio-user and other physical PMDs that require IOVA as PA
because they don't use an IOMMU.

This patch reverts to the old behaviour, but needed to be
reworked because of the refactoring that happened in v21.02.

Fixes: 17043a2909bb ("net/virtio: force IOVA as VA mode for virtio-user")
Cc: stable@dpdk.org
Reported-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
3 years agonet/virtio-user: fix init when using existing tap
David Marchand [Tue, 28 Sep 2021 08:51:14 +0000 (10:51 +0200)]
net/virtio-user: fix init when using existing tap

When attaching to an existing mono queue tap, the virtio-user was not
reporting that the virtio device was not properly initialised which
prevented from starting the port later.

$ ip tuntap add test mode tap
$ dpdk-testpmd --vdev \
  net_virtio_user0,iface=test,path=/dev/vhost-net,queues=2 -- -i

...
virtio_user_dev_init_mac(): (/dev/vhost-net) No valid MAC in devargs or
device, use random
vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument
vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel
virtio_user_start_device(): (/dev/vhost-net) Failed to start device
...
Configuring Port 0 (socket 0)
vhost_kernel_open_tap(): TUNSETIFF failed: Invalid argument
vhost_kernel_enable_queue_pair(): fail to open tap for vhost kernel
virtio_set_multiple_queues(): Multiqueue configured but send command
failed, this is too late now...
Fail to start port 0: Invalid argument
Please stop the ports first
Done

The virtio-user with vhost-kernel backend was going through a lot
of complications to initialise tap fds only when using them.

For each qp enabled for the first time, a tapfd was created via
TUNSETIFF with unneeded additional steps (see below) and then mapped to
the right qp in the vhost-net backend.
Unneeded steps (as long as it has been done once for the port):
- tap features were queried while this is a constant on a running
  system,
- the device name in DPDK was updated,
- the mac address of the tap was set,

On subsequent qps state change, the vhost-net backend fd mapping was
updated and the associated queue/tapfd were disabled/enabled via
TUNSETQUEUE.

Now, this patch simplifies the whole logic by keeping all tapfds opened
and in enabled state (from the tap point of view) at all time.

Unused ioctl defines are removed.

Tap features are validated earlier to fail initialisation asap.
Tap name discovery and mac address configuration are moved when
configuring qp 0.

To support attaching to mono queue tap, the virtio-user driver now tries
to attach in multi queue first, then fallbacks to mono queue.

Finally (but this is more for consistency), VIRTIO_NET_F_MQ feature is
exposed only if the underlying tap supports multi queue.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agonet/bnxt: fix tunnel port accounting
Ajit Khaparde [Fri, 24 Sep 2021 19:52:47 +0000 (12:52 -0700)]
net/bnxt: fix tunnel port accounting

Fix the tunnel port counting logic.
Currently we are incrementing the port count without checking
the if bnxt_hwrm_tunnel_dst_port_alloc would return success or failure.
Modify the logic to increment it only if the firmware returns success.

Fixes: 10d074b2022d ("net/bnxt: support tunneling")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: improve error recovery information messages
Kalesh AP [Fri, 24 Sep 2021 05:17:53 +0000 (10:47 +0530)]
net/bnxt: improve error recovery information messages

The error recovery async event messages are often mistaken
for errors. Improved the wording to clarify the meaning of
these events.
Also, take the first step towards more inclusive language.
The references to master will be changed to primary.
For example: "bnxt_is_master_func" will be renamed to
"bnxt_is_primary_func()".

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>
3 years agonet/bnxt: fix memzone free for Tx and Rx rings
Ajit Khaparde [Mon, 20 Sep 2021 23:11:51 +0000 (16:11 -0700)]
net/bnxt: fix memzone free for Tx and Rx rings

The device cleanup logic was freeing most of the ring related memory,
but was not freeing up the memzone associated with the rings.
This patch fixes the issue.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/bnxt: fix Tx queue startup state
Ajit Khaparde [Fri, 17 Sep 2021 20:20:45 +0000 (13:20 -0700)]
net/bnxt: fix Tx queue startup state

Default queue state of Tx queues on startup is not correct.
Fix this by setting the state when the port is started.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: fix function driver register/unregister
Kalesh AP [Wed, 22 Sep 2021 08:30:44 +0000 (14:00 +0530)]
net/bnxt: fix function driver register/unregister

1. Fix to use correct fields in the request structure of
   HWRM_FUNC_DRV_RGTR.
2. Remove the "flags" argument to bnxt_hwrm_func_driver_unregister()
   as it is not needed.

Fixes: beb3087f5056 ("net/bnxt: add driver register/unregister")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
3 years agonet/ice: support IEEE 1588 PTP
Simei Su [Tue, 28 Sep 2021 06:27:53 +0000 (14:27 +0800)]
net/ice: support IEEE 1588 PTP

Add ice support for new ethdev APIs to enable/disable and read/write/adjust
IEEE1588 PTP timestamps. Currently, only scalar path supports 1588 PTP,
vector path doesn't.

The example command for running ptpclient is as below:
./build/examples/dpdk-ptpclient -c 1 -n 3 -- -T 0 -p 0x1

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: retry getting VF VSI map after failure
Dapeng Yu [Fri, 24 Sep 2021 08:08:20 +0000 (16:08 +0800)]
net/ice: retry getting VF VSI map after failure

The request of getting VF VSI map request may fail when DCF is busy,
this patch adds retry mechanism to make it able to succeed.

Fixes: b09d34ac8584 ("net/ice: fix flow redirector")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agocommon/iavf: fix ARQ resource leak
Qiming Chen [Fri, 10 Sep 2021 03:12:49 +0000 (11:12 +0800)]
common/iavf: fix ARQ resource leak

In the iavf_init_arq function, if an exception occurs in the
iavf_config_arq_regs function, and the previously applied ARQ (Admin
Receive Queue) bufs resource is released. This patch maintains the same
modification as the iavf_init_asq function to roll back resources.

Fixes: 87aca6d8d8a4 ("net/iavf/base: fix command buffer memory leak")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix Rx queue IRQ resource leak
Qiming Chen [Fri, 10 Sep 2021 06:54:57 +0000 (14:54 +0800)]
net/iavf: fix Rx queue IRQ resource leak

In the iavf_config_rx_queues_irqs function, the memory pointed to by the
intr_handle->intr_vec and qv_map addresses is not released in the
subsequent hook branch, resulting in resource leakage.

Fixes: f593944fc988 ("net/iavf: enable IRQ mapping configuration for large VF")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: enable Rx timestamp on flex descriptor
Simei Su [Sun, 26 Sep 2021 14:04:45 +0000 (22:04 +0800)]
net/ice: enable Rx timestamp on flex descriptor

Use the dynamic mbuf to register timestamp field and flag.
The ice has the feature to dump Rx timestamp value into dynamic
mbuf field by flex descriptor. This feature is turned on by dev
config "enable-rx-timestamp". Currently, it's only supported
under scalar path.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: remove i40evf
Robin Zhang [Fri, 24 Sep 2021 06:22:26 +0000 (06:22 +0000)]
net/i40e: remove i40evf

The default VF driver for Intel 700 Series Ethernet Controller already
switch to iavf in DPDK 21.05. And i40evf is no need to maintain now,
so remove i40evf related code.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: remove i40evf devargs option
Robin Zhang [Fri, 24 Sep 2021 06:22:27 +0000 (06:22 +0000)]
net/iavf: remove i40evf devargs option

Due to i40evf will be removed, so there's no need to keep the devargs
option "driver=i40evf" in iavf.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: support IPv4/L4 checksum RSS offload
Alvin Zhang [Fri, 24 Sep 2021 09:57:29 +0000 (17:57 +0800)]
net/iavf: support IPv4/L4 checksum RSS offload

Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types
in RSS flow.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agocommon/iavf: enable hash calculation based on IPv4 checksum
Alvin Zhang [Fri, 24 Sep 2021 09:57:28 +0000 (17:57 +0800)]
common/iavf: enable hash calculation based on IPv4 checksum

Add IPv4 header checksum field selector, it can be used in creating
FDIR or RSS rules related to IPv4 header checksum.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support IPv4/L4 checksum RSS offload
Alvin Zhang [Fri, 24 Sep 2021 09:53:41 +0000 (17:53 +0800)]
net/ice: support IPv4/L4 checksum RSS offload

Add supports for RSS_IPV4_CHKSUM & RSS_L4_CHKSUM RSS offload types
in RSS flow.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: support low Rx latency
Alvin Zhang [Fri, 24 Sep 2021 09:34:29 +0000 (17:34 +0800)]
net/ice: support low Rx latency

This patch adds a devarg parameter to enable/disable low Rx latency.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: fix double free ACL flow entry
Dapeng Yu [Fri, 3 Sep 2021 10:04:11 +0000 (18:04 +0800)]
net/ice: fix double free ACL flow entry

If call ice_flow_rem_entry() directly without checking entry_id, may
cause an ACL flow entry to be freed more than once.

This patch tries to find entry_id first, then call ice_flow_rem_entry()
to avoid the defect.

Fixes: 40d466fa9f76 ("net/ice: support ACL filter in DCF")
Cc: stable@dpdk.org
Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Reviewed-by: Simei Su <simei.su@intel.com>
3 years agonet/iavf: fix high CPU usage on frequent command
Qiming Chen [Sat, 11 Sep 2021 04:02:21 +0000 (12:02 +0800)]
net/iavf: fix high CPU usage on frequent command

There is currently a scenario test, which will continuously obtain port
statistics, causing the CPU usage to soar, which does not meet the
demand. After positioning analysis, it is found that the VF and PF
command interaction is completed through the iavf_execute_vf_cmd
function.
After the message is sent, it needs to wait for the interrupt thread to
obtain the response from the PF. For the data, the rte_delay_ms
interface is used here to wait, but the CPU will not be released during
the waiting period of this interface, which will cause the statistics to
keep occupying the CPU. This is also the root cause of the soaring CPU.

The command interaction should belong to the control plane, and there
will not be too high requirements for performance. It is recommended to
wait for the interface iavf_msec_delay to complete without taking up the
CPU time.

Fixes: 22b123a36d07 ("net/avf: initialize PMD")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/virtio: do not use PMD log type
David Marchand [Thu, 16 Sep 2021 13:25:02 +0000 (15:25 +0200)]
net/virtio: do not use PMD log type

Fixes: 1982462eadea ("net/virtio: add Rx free threshold setting")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agonet/virtio: remove blank lines in log
Thomas Monjalon [Thu, 16 Sep 2021 09:53:43 +0000 (11:53 +0200)]
net/virtio: remove blank lines in log

The macros PMD_*_LOG already include the line feed character.
Redundant \n are removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: normalize return type and function name
Xuan Ding [Thu, 16 Sep 2021 04:34:15 +0000 (04:34 +0000)]
vhost: normalize return type and function name

In some function definitions, adjust return type and function name on
a separate line to be consistent with DPDK coding style.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/virtio: report Tx descriptor limits in dev info
Ivan Ilchenko [Wed, 15 Sep 2021 12:23:27 +0000 (15:23 +0300)]
net/virtio: report Tx descriptor limits in dev info

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

Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: rework RARP packet injection
David Marchand [Wed, 15 Sep 2021 14:54:47 +0000 (16:54 +0200)]
vhost: rework RARP packet injection

Caught by code review, this copy is unnecessary.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/virtio: wait device ready during reset
Xueming Li [Wed, 15 Sep 2021 10:12:04 +0000 (18:12 +0800)]
net/virtio: wait device ready during reset

According to virtio spec, the device MUST reset when 0 is written to
device_status, and present 0 in device_status once reset is done.

This patch waits status value to be 0 during reset operation, if
timeout in 3 seconds, log and continue.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agonet/virtio: fix Tx completed mbuf leak on device stop
Ivan Ilchenko [Wed, 15 Sep 2021 09:19:42 +0000 (12:19 +0300)]
net/virtio: fix Tx completed mbuf leak on device stop

Free Tx completed mbufs on device stop. Not completed Tx mbufs cannot be
freed since they are still in use.

Fixes: c1f86306a026 ("virtio: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agonet/virtio: fix Tx cleanup functions to have same signature
Ivan Ilchenko [Wed, 15 Sep 2021 09:19:41 +0000 (12:19 +0300)]
net/virtio: fix Tx cleanup functions to have same signature

There is a family of cleanup from completed transmits functions.
Fix packed virtqueues cleanup functions to have the same signature
as split virtqueues have. This lets all functions of the family to
match the same callback prototype.

Fixes: 892dc798fa9c ("net/virtio: implement Tx path for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Ivan Ilchenko <ivan.ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: clean IOTLB cache on vring stop
Eugenio Pérez [Fri, 27 Aug 2021 16:12:31 +0000 (18:12 +0200)]
vhost: clean IOTLB cache on vring stop

Old IOVA cache entries are left when there is a change on virtio driver
in VM. In case that all these old entries have iova addresses lesser
than new iova entries, vhost code will need to iterate all the cache to
find the new ones. In case of just a new iova entry needed for the new
translations, this condition will last forever.

This has been observed in virtio-net to testpmd's vfio-pci driver
transition, reducing the performance from more than 10Mpps to less than
0.07Mpps if the hugepage address was higher than the networking
buffers. Since all new buffers are contained in this new gigantic page,
vhost needs to scan IOTLB_CACHE_SIZE - 1 for each translation at worst.

Fixes: 69c90e98f483 ("vhost: enable IOMMU support")
Cc: stable@dpdk.org
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reported-by: Pei Zhang <pezhang@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agocommon/cnxk: support merging base steering rule
Satheesh Paul [Tue, 31 Aug 2021 04:16:14 +0000 (09:46 +0530)]
common/cnxk: support merging base steering rule

This patch adds an ROC API to merge base steering rule with rules
added by VF.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agoraw/cnxk_bphy: support reading NPA/SSO PF function
Tomasz Duszynski [Sun, 15 Aug 2021 23:12:02 +0000 (01:12 +0200)]
raw/cnxk_bphy: support reading NPA/SSO PF function

Add support for reading NPA/SSO pf_func which will be used
by a PSM to access NPA/SSO. PSM is a hardware block capable
of dispatching jobs to different blocks within a baseband
module.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support reading NPA/SSO PF function
Tomasz Duszynski [Sun, 15 Aug 2021 23:12:01 +0000 (01:12 +0200)]
common/cnxk: support reading NPA/SSO PF function

Add support for reading NPA/SSO pf_func which will be used
by a PSM to access NPA/SSO. PSM is a hardware block capable
of dispatching jobs to different blocks within a baseband
module.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
3 years agoraw/cnxk_bphy: fix device lookup
Tomasz Duszynski [Sun, 15 Aug 2021 23:12:00 +0000 (01:12 +0200)]
raw/cnxk_bphy: fix device lookup

Name needs to be prepared before the lookup otherwise
PMD will not be released.

Fixes: 24d9c5d59d5d ("raw/cnxk_bphy: add baseband PHY skeleton driver")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/octeontx2: fix link event message size
Harman Kalra [Fri, 30 Jul 2021 16:08:06 +0000 (21:38 +0530)]
common/octeontx2: fix link event message size

Due to wrong size of mbox message allocated for sending link status
to the VF, incorrect link status is observed.

Fixes: cb8d769fb6fe ("common/octeontx2: send link event to VF")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: update NPC MACM range for cn98xx
Harman Kalra [Fri, 30 Jul 2021 16:10:08 +0000 (21:40 +0530)]
common/cnxk: update NPC MACM range for cn98xx

NPC MCAM entry distribution is based on maximum number of PFs and LFs
available. Fixing the max no of PFs and LFs available on cn98xx to
fix the MCAM alloc entry range.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: support loop mode for cn98xx
Harman Kalra [Fri, 30 Jul 2021 16:10:07 +0000 (21:40 +0530)]
common/cnxk: support loop mode for cn98xx

In case of cn98xx, 2 NIX blocks and 4 LBK blocks are present. Moreover
AF VFs are alternatively attached to NIX0 and NIX1 to ensure load
balancing. To support loopback functionality between pairs NIX0/NIX1
are attached to LBK1/LBK2 for transmission/reception respectively.
But in this default configuration NIX blocks cannot receive the
packets they sent from the same LBK, which is an important requirement
as some ODP applications only uses one AF VF for loopback functionality.
To support this scenario, NIX0 can use LBK0 (NIX1 - LBK3) by setting a
loop flag while making LF alloc mailbox request.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agoraw/cnxk_bphy: use named value for queue count
Jakub Palider [Mon, 26 Jul 2021 13:58:15 +0000 (08:58 -0500)]
raw/cnxk_bphy: use named value for queue count

Queue counter is used in a few places so it was given some
reasonable name.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: align function naming
Jakub Palider [Mon, 26 Jul 2021 13:58:14 +0000 (08:58 -0500)]
common/cnxk: align function naming

There is an inconsistency in naming interrupt control
functions. This patch aligns names accordingly.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: reduce function visibility
Jakub Palider [Mon, 26 Jul 2021 13:58:13 +0000 (08:58 -0500)]
common/cnxk: reduce function visibility

Some functions are not used outside of local ROC scope. These need
updating classifiers and removal from header.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agoraw/cnxk_bphy: do not include IRQ header directly
Tomasz Duszynski [Mon, 26 Jul 2021 13:58:12 +0000 (08:58 -0500)]
raw/cnxk_bphy: do not include IRQ header directly

One should only use roc_api.h which exports all internal headers.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: remove duplicated constant
Tomasz Duszynski [Mon, 26 Jul 2021 13:58:11 +0000 (08:58 -0500)]
common/cnxk: remove duplicated constant

Drop duplicated constant.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
3 years agocommon/cnxk: return saner error codes
Tomasz Duszynski [Mon, 26 Jul 2021 13:58:10 +0000 (08:58 -0500)]
common/cnxk: return saner error codes

If particular LMAC does not exist then it's saner to return ENODEV
instead of EINVAL.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>