dpdk.git
2 years agoexamples/pipeline: fix build
Ali Alnubani [Thu, 2 Jun 2022 12:34:12 +0000 (15:34 +0300)]
examples/pipeline: fix build

This patch fixes the following build failure seen on Ubuntu 16.04
with gcc 5.4.0 because of uninitialized variable:
  [..]
  examples/pipeline/cli.c:2853:9: error: 'session_id' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]
  [..]

Fixes: 172254555f9f ("examples/pipeline: support packet mirroring")

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2 years agodma/idxd: add generic option for queue config
Kevin Laatz [Fri, 1 Apr 2022 10:35:00 +0000 (11:35 +0100)]
dma/idxd: add generic option for queue config

The device config script currently uses some defaults to configure
devices in a generic way.

With the addition of this option, users have more control over how
queues are configured.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
2 years agodma/hisilicon: support vchan status query
Chengwen Feng [Fri, 27 May 2022 03:40:55 +0000 (11:40 +0800)]
dma/hisilicon: support vchan status query

This patch adds support for vchan-status ops.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2 years agodma/hisilicon: enhance CQ scan robustness
Chengwen Feng [Fri, 27 May 2022 03:40:54 +0000 (11:40 +0800)]
dma/hisilicon: enhance CQ scan robustness

The CQ (completion queue) descriptors were updated by hardware, and then
scanned by driver to retrieve hardware completion status.

This patch enhances robustness by following:
1. replace while (true) with a finite loop to avoid potential dead loop.
2. check the csq_head field in CQ descriptor to avoid status array
overflows.

Fixes: 2db4f0b82360 ("dma/hisilicon: add data path")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2 years agotest/dma: check index when no DMA completed
Chengwen Feng [Fri, 27 May 2022 03:40:53 +0000 (11:40 +0800)]
test/dma: check index when no DMA completed

If no DMA request is completed, the ring_idx of the last completed
operation need returned by last_idx parameter. This patch adds
testcase for it.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Tested-by: Kevin Laatz <kevin.laatz@intel.com>
2 years agodma/hisilicon: fix index returned when no DMA completed
Chengwen Feng [Fri, 27 May 2022 03:40:52 +0000 (11:40 +0800)]
dma/hisilicon: fix index returned when no DMA completed

If no DMA request is completed, the ring_idx of the last completed
operation need returned by last_idx parameter. This patch fixes it.

Fixes: 2db4f0b82360 ("dma/hisilicon: add data path")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
2 years agoexamples/dma: add force minimal copy size parameter
Chengwen Feng [Sun, 24 Apr 2022 06:07:41 +0000 (14:07 +0800)]
examples/dma: add force minimal copy size parameter

This patch adds force minimal copy size parameter
(-m/--force-min-copy-size), so when do copy by CPU or DMA, the real copy
size will be the maximum of mbuf's data_len and this parameter.

This parameter was designed to compare the performance between CPU copy
and DMA copy. User could send small packets with a high rate to drive
the performance test.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2 years agoexamples/dma: fix Tx drop statistics
Chengwen Feng [Sun, 24 Apr 2022 06:07:40 +0000 (14:07 +0800)]
examples/dma: fix Tx drop statistics

The Tx drop statistic was designed to be collected by
rte_eth_dev_tx_buffer mechanism, but the application uses
rte_eth_tx_burst to send packets and this lead the Tx drop statistic
was not collected.

This patch removes rte_eth_dev_tx_buffer mechanism to fix the problem.

Fixes: 632bcd9b5d4f ("examples/ioat: print statistics")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
2 years agoexamples/dma: fix MTU configuration
Huisong Li [Sun, 24 Apr 2022 06:07:39 +0000 (14:07 +0800)]
examples/dma: fix MTU configuration

The MTU in dma App can be configured by 'max_frame_size' parameters which
have a default value(1518). It's not reasonable to use it directly as MTU.
This patch fix it.

Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
2 years agodmadev: add telemetry
Sean Morrissey [Fri, 1 Apr 2022 15:01:35 +0000 (15:01 +0000)]
dmadev: add telemetry

Telemetry commands are now registered through the dmadev library
for the gathering of DSA stats. The corresponding callback
functions for listing dmadevs and providing info and stats for a
specific dmadev are implemented in the dmadev library.

An example usage can be seen below:

Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
{"version": "DPDK 22.03.0-rc2", "pid": 2956551, "max_output_len": 16384}
Connected to application: "dpdk-dma"
--> /
{"/": ["/", "/dmadev/info", "/dmadev/list", "/dmadev/stats", ...]}
--> /dmadev/list
{"/dmadev/list": [0, 1]}
--> /dmadev/info,0
{"/dmadev/info": {"name": "0000:00:01.0", "nb_vchans": 1, "numa_node": 0,
"max_vchans": 1, "max_desc": 4096, "min_desc": 32, "max_sges": 0,
"capabilities": {"mem2mem": 1, "mem2dev": 0, "dev2mem": 0, ...}}}
--> /dmadev/stats,0,0
{"/dmadev/stats": {"submitted": 0, "completed": 0, "errors": 0}}

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Conor Walsh <conor.walsh@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
Tested-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
2 years agodmadev: clarify visibility of completed jobs
Bruce Richardson [Thu, 12 May 2022 15:11:22 +0000 (16:11 +0100)]
dmadev: clarify visibility of completed jobs

Clarify that once an operation has completed, the output of that
operation is visible to all cores.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
2 years agokni: fix build
Thomas Monjalon [Mon, 6 Jun 2022 10:39:49 +0000 (12:39 +0200)]
kni: fix build

A previous fix had #else instead of #endif.
The error message is:
kernel/linux/kni/kni_net.c: In function ‘kni_net_rx_normal’:
kernel/linux/kni/kni_net.c:448:2: error: #else after #else

Bugzilla ID: 1025
Fixes: c98600d4bed6 ("kni: fix build with Linux 5.18")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2 years agonet/mlx5: support ESP item on Windows
Raja Zidane [Thu, 2 Jun 2022 13:03:08 +0000 (16:03 +0300)]
net/mlx5: support ESP item on Windows

ESP item is not supported on Windows, yet it is expanded from the
expansion graph when trying to create default flow to RSS all packets.

Support ESP item match (without ability to match on SPI field on Windows).
Split ESP validation per OS.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: fix entry size in construct data ipool
Michael Baum [Thu, 2 Jun 2022 11:39:16 +0000 (14:39 +0300)]
net/mlx5: fix entry size in construct data ipool

The mlx5_action_construct_data structure memory is managed by ipool
named acts_ipool.

The size of one entry in this ipool is mistakenly defined as size of
rte_flow_hw structure.
This size is used to reset in the allocated part. When the size is
incorrect it resets memory that does not belong to it.

This patch defines the correct size.

Fixes: f13fab23922b ("net/mlx5: add flow jump action")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: remove unused lcore check
Suanming Mou [Tue, 31 May 2022 01:25:48 +0000 (04:25 +0300)]
common/mlx5: remove unused lcore check

While non-lcore list operations were supported, non-lcore index will
be converted to MLX5_LIST_NLCORE. In that case, no need to check the
lcore index be -1 or not anymore.

This commit removes the unused lcore check in list.

Fixes: 7e1cf892711b ("common/mlx5: support list non-lcore operations")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/iavf: remove dead code
Qi Zhang [Mon, 30 May 2022 11:36:29 +0000 (07:36 -0400)]
net/iavf: remove dead code

Remove unimplemented function call be wrapped by
RTE_LIBRTE_IAVF_DEBUG_TX_DESC_RING

Fixes: 1e728b01120c ("net/iavf: rework Tx path")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2 years agonet/iavf: increase reset complete wait count
Qiming Yang [Mon, 30 May 2022 05:34:58 +0000 (13:34 +0800)]
net/iavf: increase reset complete wait count

Kernel iavf driver has sent patch to increase the completion
wait time to reduce the "Reset never finished" case.
Follow this action in DPDK iavf driver.
Kernel reference commit:
8e3e4b9da7e6 ("iavf: increase reset complete wait time")

Fixes: 22b123a36d07 ("net/avf: initialize PMD")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix outer L4 checksum in scalar Rx
Wenjing Qiao [Fri, 27 May 2022 08:09:55 +0000 (04:09 -0400)]
net/ice: fix outer L4 checksum in scalar Rx

In scalar datapath, ol_flag shows RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
which is error, therefore fixing this bug.

Fixes: 94005e4640a7 ("net/ice: fix build with 16-byte Rx descriptor")
Cc: stable@dpdk.org
Signed-off-by: Wenjing Qiao <wenjing.qiao@intel.com>
Reported-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix initialization with quanta configuration
Wenjun Wu [Fri, 27 May 2022 05:38:51 +0000 (13:38 +0800)]
net/iavf: fix initialization with quanta configuration

When kernel driver does not support quanta size configuration,
it will return error. We do not expect it to occur in default
initialization process.

Fixes: b14e8a57b9fe ("net/iavf: support quanta size configuration")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/igc: support I226 devices
Qiming Yang [Wed, 25 May 2022 05:57:50 +0000 (13:57 +0800)]
net/igc: support I226 devices

Added I226 Series device ID in igc driver and updated igc guide
document for new devices.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix device stop
Radu Nicolau [Mon, 23 May 2022 12:04:36 +0000 (13:04 +0100)]
net/iavf: fix device stop

Move security context destroy from device stop to device close function.
Deleting the context on device stop can prevent the application from
properly cleaning and releasing resources.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix device initialization without inline crypto
Radu Nicolau [Wed, 20 Apr 2022 11:03:01 +0000 (12:03 +0100)]
net/iavf: fix device initialization without inline crypto

When the inline crypto feature VF capability flag is set also check if the
feature is enabled, otherwise the initialization will fail even when
the inline crypto is not required.

Fixes: 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix race condition with Rx timestamp offload
Wenjun Wu [Mon, 23 May 2022 04:49:00 +0000 (12:49 +0800)]
net/iavf: fix race condition with Rx timestamp offload

In multi-cores cases for Rx timestamp offload, if packets arrive
too fast, aq command to get phc time will be pended.

This patch adds spinlock to fix this issue. To avoid phc time being
frequently overwritten, move related variables to iavf_rx_queue
structure, and each queue will handle timestamp calculation by itself.

Fixes: b5cd735132f6 ("net/iavf: enable Rx timestamp on flex descriptor")
Fixes: 33db16136e55 ("net/iavf: improve performance of Rx timestamp offload")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: support VF RSS flow rule with raw pattern
Ting Xu [Mon, 23 May 2022 02:31:38 +0000 (10:31 +0800)]
net/iavf: support VF RSS flow rule with raw pattern

Enable Protocol Agnostic Flow Offloading for RSS hash in VF. It supports
raw pattern flow rule creation in VF based on Parser Library feature. VF
parses the spec and mask input of raw pattern, and passes it to kernel
driver to create the flow rule. Current rte_flow raw API is utilized.

command example:
RSS hash for ipv4-src-dst:
flow create 0 ingress pattern raw pattern spec
00000000000000000000000008004500001400004000401000000000000000000000
pattern mask
0000000000000000000000000000000000000000000000000000ffffffffffffffff /
end actions rss queues end / end

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: enable flow rule with raw pattern
Junfeng Guo [Mon, 23 May 2022 02:31:36 +0000 (10:31 +0800)]
net/iavf: enable flow rule with raw pattern

This patch enabled Protocol Agnostic Flow (raw flow) Offloading Flow
Director (FDIR) in AVF, based on the Parser Library feature and the
existing rte_flow `raw` API.

The input spec and mask of raw pattern are first parsed via the
Parser Library, and then passed to the kernel driver to create the
flow rule.

Similar as ice PMD's implemnentation, each raw flow requires:
1. A byte string of raw target packet bits.
2. A byte string contains mask of target packet.

Here is an example:
FDIR matching ipv4 dst addr with 1.2.3.4 and redirect to queue 3:

flow create 0 ingress pattern raw \
pattern spec \
00000000000000000000000008004500001400004000401000000000000001020304 \
pattern mask \
000000000000000000000000000000000000000000000000000000000000ffffffff \
/ end actions queue index 3 / mark id 3 / end

Note that mask of some key bits (e.g., 0x0800 to indicate ipv4 proto)
is optional in our cases. To avoid redundancy, we just omit the mask
of 0x0800 (with 0xFFFF) in the mask byte string example. The prefix
'0x' for the spec and mask byte (hex) strings are also omitted here.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agocommon/iavf: support raw packet in protocol header
Junfeng Guo [Mon, 23 May 2022 02:31:34 +0000 (10:31 +0800)]
common/iavf: support raw packet in protocol header

The patch extends existing virtchnl_proto_hdrs structure to allow VF
to pass a pair of buffers as packet data and mask that describe
a match pattern of a filter rule. Then the kernel PF driver is requested
to parse the pair of buffer and figure out low level hardware metadata
(ptype, profile, field vector.. ) to program the expected FDIR or RSS
rules.

Also update the proto_hdrs template init to align the virtchnl changes.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agodoc: update matching versions in i40e guide
Qiming Yang [Fri, 20 May 2022 07:04:41 +0000 (15:04 +0800)]
doc: update matching versions in i40e guide

Add recommended matching list for i40e PMD in DPDK 21.05,
21.08, 21.11 and 22.03. And add a known issue when FW upgrade
to a version 8.4 and higher

Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix Rx queue interrupt setting
Ke Zhang [Fri, 20 May 2022 03:00:23 +0000 (03:00 +0000)]
net/iavf: fix Rx queue interrupt setting

For Rx-Queue Interrupt Setting, when VF Rx interrupt
disable (INTENA=0), there are two ways to write back
descriptor to host memory:

1) Set WB_ON_ITR bit 0 to Interrupt Dynamic Control Register:
Completed descriptors are posted to host memory according to
the internal descriptor cache policy (in other words when a
full cache line is available for write-back).

A internal descriptor size is 16 bytes or 32 bytes, a cache
line size is 64 bytes or 128 bytes from datasheet :
PCIe Global Config 2 - GLPCI_CNF2 (0x000BE004; RO)
so the full cache line could contains 4 packets, it means
Network card will send 4 packets to host when a full cache line
is available.

2) Set WB_ON_ITR bit 1 to Interrupt Dynamic Control Register:
Completed descriptors also trigger the ITR. Following ITR
expiration, all leftover completed descriptors are posted to
host memory.

Network card will send packet to host even if only one
descriptor is completed.

Changing 1) to 2) to make sure VF send the packet to host even
if there is only one Rx packet is ready in hardware.

Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix mbuf release in multi-process
Ke Zhang [Thu, 19 May 2022 07:36:04 +0000 (07:36 +0000)]
net/iavf: fix mbuf release in multi-process

In the multiple process environment, the subprocess operates on the
shared memory and changes the function pointer of the main process,
resulting in the failure to find the address of the function when main
process releasing, resulting in crash.

Fixes: 319c421f3890 ("net/avf: enable SSE Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix queue start exception handling
Qiming Yang [Thu, 19 May 2022 05:01:56 +0000 (05:01 +0000)]
net/iavf: fix queue start exception handling

If any queue start fail during dev_start, all started queues
should be stopped.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/i40e: fix max frame size config at port level
Wenxuan Wu [Wed, 18 May 2022 04:59:14 +0000 (04:59 +0000)]
net/i40e: fix max frame size config at port level

Previously, max frame size can only be set when link is up, and the wait
time is 1 sec. Startup time of 10G_BASET longer than 1s would result in
failure.

Actually, max frame size of media type I40E_MEDIA_TYPE_BASET can be set
regardless of link status.

This patch omitted the link status check of 10G_MEDIA_TYPE_BASET.

Fixes: a4ba77367923 ("net/i40e: enable maximum frame size at port level")
Cc: stable@dpdk.org
Signed-off-by: Wenxuan Wu <wenxuanx.wu@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
2 years agonet/iavf: fix crash after VF reset failure
Yiding Zhou [Thu, 12 May 2022 10:48:51 +0000 (18:48 +0800)]
net/iavf: fix crash after VF reset failure

Some pointers will be set to NULL when iavf_dev_reset() failed,
for example vf->vf_res, vf->vsi_res vf->rss_key and etc.
APIs access these NULL pointers will trigger segfault.

This patch adds closed flag to indicate that the VF is closed,
and rejects API calls in this state to avoid coredump.

Fixes: e74e1bb6280d ("net/iavf: enable port reset")
Cc: stable@dpdk.org
Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: fix MTU info for DCF
Kevin Liu [Fri, 8 Apr 2022 01:43:08 +0000 (01:43 +0000)]
net/ice: fix MTU info for DCF

In the DCF module, Missing maximum and minimum
MTU value settings.

This patch adds the settings of the maximum and
minimum MTU to correctly calculate the MTU value.

Fixes: bf89db4409bb ("net/ice: complete device info get in DCF")
Cc: stable@dpdk.org
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: fix direction of flow that matches any
Yuying Zhang [Thu, 12 May 2022 07:42:00 +0000 (07:42 +0000)]
net/ice/base: fix direction of flow that matches any

The tx/rx packets were both dropped when creating drop any rule
for ingress direction only, the root cause is the recipe didn't
contain direction flag matching.

This patch adds the packet flag which represents the direction of
source interface to solve the issue.

Fixes: 92317961a731 ("net/ice: support drop any and steer all to queue")
Cc: stable@dpdk.org
Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: add warning for unsupported TM configuration
Wenjun Wu [Tue, 17 May 2022 05:09:32 +0000 (13:09 +0800)]
net/ice: add warning for unsupported TM configuration

Priority configuration is enabled in level 3 and level 4.
Weight configuration is enabled in level 4.
This patch adds warning log for unsupported priority
and weight configuration.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support queue weight configuration
Wenjun Wu [Tue, 17 May 2022 05:09:31 +0000 (13:09 +0800)]
net/ice: support queue weight configuration

This patch adds queue weight configuration support.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support queue and queue group priority config
Wenjun Wu [Tue, 17 May 2022 05:09:30 +0000 (13:09 +0800)]
net/ice: support queue and queue group priority config

This patch adds queue and queue group priority configuration
support. The highest priority is 0, and the lowest priority
is 7.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: support queue and queue group bandwidth limit
Ting Xu [Tue, 17 May 2022 05:09:29 +0000 (13:09 +0800)]
net/ice: support queue and queue group bandwidth limit

Enable basic TM API for PF only. Support for adding profiles and queue
nodes. Only max bandwidth is supported in profiles. Profiles can be
assigned to target queues and queue group. To set up the exact queue
group, we need to reconfigure topology by delete and then recreate
queue nodes. Only TC0 is valid.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: support priority configuration of exact node
Wenjun Wu [Tue, 17 May 2022 05:09:28 +0000 (13:09 +0800)]
net/ice/base: support priority configuration of exact node

This patch adds priority configuration support of the exact
node in the scheduler tree.
This function does not need additional calls to the scheduler
lock.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: support queue BW allocation configuration
Wenjun Wu [Tue, 17 May 2022 05:09:27 +0000 (13:09 +0800)]
net/ice/base: support queue BW allocation configuration

This patch adds BW allocation support of queue scheduling node
to support WFQ in queue level.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: fix getting sched node from ID type
Wenjun Wu [Tue, 17 May 2022 05:09:26 +0000 (13:09 +0800)]
net/ice/base: fix getting sched node from ID type

The function ice_sched_get_node_by_id_type needs to be called
with the scheduler lock held. However, the function
ice_sched_get_node also requests the scheduler lock.
It will cause the dead lock issue.

This patch replaces function ice_sched_get_node with
function ice_sched_find_node_by_teid to solve this problem.

Fixes: 93e84b1bfc92 ("net/ice/base: add basic Tx scheduler")
Cc: stable@dpdk.org
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ixgbe: add option for link up check on pin SDP3
Jeff Daly [Tue, 10 May 2022 18:57:25 +0000 (14:57 -0400)]
net/ixgbe: add option for link up check on pin SDP3

1ca05831b9b added a check that SDP3 (used as a TX_DISABLE output to the
SFP cage on these cards) is not asserted to avoid incorrectly reporting
link up when the SFP's laser is turned off.

ff8162cb957 limited this workaround to fiber ports

This patch:
* Adds devarg 'fiber_sdp3_no_tx_disable' not all fiber ixgbe devs use
  SDP3 as TX_DISABLE

Fixes: 1ca05831b9b ("net/ixgbe: fix link status")
Fixes: ff8162cb957 ("net/ixgbe: fix link status")
Cc: stable@dpdk.org
Signed-off-by: Jeff Daly <jeffd@silicom-usa.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice: complete VLAN offload capability for DCF
Alvin Zhang [Fri, 29 Apr 2022 09:19:58 +0000 (09:19 +0000)]
net/ice: complete VLAN offload capability for DCF

The new VLAN virtchnl opcodes introduce new capabilities like VLAN
filtering, stripping and insertion.

The DCF needs to query the VLAN capabilities based on current device
configuration firstly.

DCF is able to configure inner VLAN filter when port VLAN is enabled
base on negotiation; and DCF is able to configure outer VLAN (0x8100)
if port VLAN is disabled to be compatible with legacy mode.

When port VLAN is updated by DCF, the DCF needs to reset to query the
new VLAN capabilities.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/ice/base: enable flow director for IPv6 next protocol
Jie Wang [Sat, 7 May 2022 09:13:45 +0000 (17:13 +0800)]
net/ice/base: enable flow director for IPv6 next protocol

To support the new DDP and be compatible with the old version DDP
file, API function 'check_ddp_support_proto_id' is added to detect
if the required protocol ID is supported by the current DDP file.

Add new protocol ID IPV6_NEXT_PROTO support for PF FDIR if current
DDP is new DDP and keep behavior if it is the old version DDP.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix data path selection
Yiding Zhou [Sat, 7 May 2022 19:52:39 +0000 (03:52 +0800)]
net/iavf: fix data path selection

If PF driver don't support a flex Rx descriptor that required by VF,
legacy descriptor format will be negotiated to configure the hardware
queue.

The patch fixes the issue that an Rx data path that handle flexible
descriptor  (e.g.:
iavf_recv_scattered_pkts_vec_avx512_flex_rxd) is selected while the
actual hardware queues are configured as legacy due to above scenario,
which will cause following coredump.

Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")
Cc: stable@dpdk.org
Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agonet/iavf: fix memory leak
Wenjun Wu [Tue, 10 May 2022 00:54:25 +0000 (08:54 +0800)]
net/iavf: fix memory leak

Set an invalid quanta size from devargs will cause memory leak and this
is reported by coverity.

The patch fix the issue by correcting the error handle.

Coverity issue: 378017
Fixes: b14e8a57b9fe ("net/iavf: support quanta size configuration")

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2 years agokni: fix build with Linux 5.18
Jiri Slaby [Wed, 1 Jun 2022 06:53:58 +0000 (08:53 +0200)]
kni: fix build with Linux 5.18

Since commit 2655926aea9b (net: Remove netif_rx_any_context() and
netif_rx_ni().) in 5.18, netif_rx_ni() no longer exists as netif_rx()
can be called from any context. So define HAVE_NETIF_RX_NI for older
releases and call the appropriate function in kni_net.

netif_rx_ni() must be used on older kernel since netif_rx() might
might lead to deadlocks or other problems there.

Cc: stable@dpdk.org
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/mlx5: fix statistics read on Linux
Geoffrey Le Gourriérec [Thu, 17 Mar 2022 13:23:48 +0000 (14:23 +0100)]
net/mlx5: fix statistics read on Linux

This patch encompasses a few fixes carried by a previous patch
that aimed to support bonding device stats counting.

- If mlx5_os_read_dev_stat fails, it returns 1 instead of a
  negative value, causing mlx5_xstats_get to return an invalid
  number of counters. Since this error is not blocking, do not
  mess ret value with mlx5_os_read_dev_stat returned value.

  This allows avoiding the very annoying log:
  "n_xstats != n_xstats_names => skipping"

- Invert the check for mlx5_os_read_dev_stat(), currently leading
  us to store the result if the function failed, and use a
  backup value if it succeeded, which is the opposite of what we
  actually want. Revert to the original (correct) test.

- Add missing test on _mlx5_os_read_dev_counters() to prevent
  using trash stats values.

Fixes: 7ed15acdcd69 ("net/mlx5: improve xstats of bonding port")
Cc: stable@dpdk.org
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
Signed-off-by: Geoffrey Le Gourriérec <geoffrey.le_gourrierec@6wind.com>
Tested-by: Bassam Zaid AlKilani <bzalkilani@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: add Rx drop counters to xstats
Rongwei Liu [Thu, 26 May 2022 02:49:41 +0000 (05:49 +0300)]
net/mlx5: add Rx drop counters to xstats

Add two kinds of Rx drop counters to DPDK xstats which are
physical port scope.

1. rx_prio[0-7]_buf_discard
   The number of unicast packets dropped due to lack of shared
   buffer resources.
2. rx_prio[0-7]_cong_discard
   The number of packets that is dropped by the Weighted Random
   Early Detection (WRED) function.

Prio[0-7] is determined by VLAN PCP value which is 0 by default.
Both counters are retrieved from kernel ethtool API which calls
PRM command finally.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix Tx recovery
Raja Zidane [Wed, 18 May 2022 09:42:32 +0000 (12:42 +0300)]
net/mlx5: fix Tx recovery

When an error occurs in Tx, and it is moved to ERROR state, it
is not recoverable, during recovery it's state cannot be modified
to INIT. to modify state from RESET to INIT, the port must be
passed in modify attributes, and in case of ERROR to READY
modification path, it was not provided.

Provide port number when changing state from RESET to INIT.

Fixes: 3a87b964edd3 ("net/mlx5: create Tx queues with DevX")
Cc: stable@dpdk.org
Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
2 years agonet/mlx5: validate yellow meter action
Shun Hao [Fri, 13 May 2022 07:33:08 +0000 (10:33 +0300)]
net/mlx5: validate yellow meter action

Yellow meter action support is added in meter hierarchy validation.
If one color uses meter action, the other can only use NULL action
or the same meter action. And only shared meter is supported.

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support yellow meter action for hierarchy tag rule
Shun Hao [Fri, 13 May 2022 07:33:07 +0000 (10:33 +0300)]
net/mlx5: support yellow meter action for hierarchy tag rule

When a hierarchy meter is shared by other ports, it's needed to iterate
all meter policies in hierarchy to create tag rules, to set packet with
next meter ID, which will be used by related meter drop count.
This patch adds the tag rule for yellow support in hierarchy, so both
green/yellow policy flows can set the correct meter ID.

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support yellow meter action in hierarchy
Shun Hao [Fri, 13 May 2022 07:33:06 +0000 (10:33 +0300)]
net/mlx5: support yellow meter action in hierarchy

This patch adds the support of meter action for yellow meter policy
flow, so can use meter action for both green and yellow policy flows
in meter hierarchy.
Currently must use the same meter within one meter policy. Packets
passing green/yellow policy flow will have previous meter color of
green/yellow in subsequent meter.

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support previous meter color aware
Shun Hao [Fri, 13 May 2022 07:33:05 +0000 (10:33 +0300)]
net/mlx5: support previous meter color aware

This patch adds the support for previous color aware for meter.
Start_color setting is set to UNDEFINED when creating meter object that
is color aware.

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agoexamples/vhost: fix crash when no VMDq
Yuan Wang [Wed, 18 May 2022 13:36:33 +0000 (21:36 +0800)]
examples/vhost: fix crash when no VMDq

If the VMDq limits is 0, a divide-by-zero error occurs.
This patch replaces throwing a floating point exception with
a normal error message.

Fixes: d19533e86f ("examples/vhost: copy old vhost example")
Cc: stable@dpdk.org
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc/base: access block device registers
Andy Pei [Tue, 24 May 2022 02:48:17 +0000 (10:48 +0800)]
vdpa/ifc/base: access block device registers

Register address is different between net and blk device.
We are re-using most of the code, when register address is
different, we have to check net and blk device go through
different code.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: add interrupt handling for config space
Andy Pei [Tue, 24 May 2022 02:48:16 +0000 (10:48 +0800)]
vdpa/ifc: add interrupt handling for config space

Create a thread to poll and relay config space change interrupt.
Use VHOST_USER_SLAVE_CONFIG_CHANGE_MSG to inform QEMU.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: add log for config space of virtio block
Andy Pei [Tue, 24 May 2022 02:48:15 +0000 (10:48 +0800)]
vdpa/ifc: add log for config space of virtio block

Add some log of virtio blk device config space information
at vDPA launch before QEMU connects.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agousertools/devbind: support virtio block device
Andy Pei [Tue, 24 May 2022 02:48:14 +0000 (10:48 +0800)]
usertools/devbind: support virtio block device

Add virtio blk device support to devbind.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agoexamples/vdpa: support virtio block device
Andy Pei [Tue, 24 May 2022 02:48:13 +0000 (10:48 +0800)]
examples/vdpa: support virtio block device

Add virtio blk device support to vDPA example.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: get device type
Andy Pei [Tue, 24 May 2022 02:48:12 +0000 (10:48 +0800)]
vdpa/ifc: get device type

Add get device type ops to ifc driver.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: get vDPA device type
Andy Pei [Tue, 24 May 2022 02:48:11 +0000 (10:48 +0800)]
vhost: get vDPA device type

Vhost backend of different devices have different features.
Add an API to get vDPA device type, net device or blk device
currently, so users can set different features for different
kinds of devices.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: add block device SW live-migration
Andy Pei [Tue, 24 May 2022 02:48:10 +0000 (10:48 +0800)]
vdpa/ifc: add block device SW live-migration

Add SW live-migration support to block device.
For block device, it is critical that no packet
should be dropped. So when virtio blk device is
paused, make sure hardware last_avail_idx and
last_used_idx are the same. This indicates all
requests have received acks, and no inflight IO.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: add interrupt relay for block device
Andy Pei [Tue, 24 May 2022 02:48:09 +0000 (10:48 +0800)]
vdpa/ifc: add interrupt relay for block device

For the net device type, only interrupt of rxq needed to be relayed.
But for block, since all the queues are used for both read and write
requests. Interrupt of all queues needed to be relayed.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: add block operations
Andy Pei [Tue, 24 May 2022 02:48:08 +0000 (10:48 +0800)]
vdpa/ifc: add block operations

For virtio blk device, re-use part of ifc driver ops.
Implement ifcvf_blk_get_config for virtio blk device.
Support VHOST_USER_PROTOCOL_F_CONFIG feature for virtio
blk device.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: support vhost message for get/set config
Andy Pei [Tue, 24 May 2022 02:48:07 +0000 (10:48 +0800)]
vhost: support vhost message for get/set config

Add support for VHOST_USER_GET_CONFIG and VHOST_USER_SET_CONFIG.
VHOST_USER_GET_CONFIG and VHOST_USER_SET_CONFIG message is only
supported by virtio blk VDPA device.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: add vDPA operations for block device
Andy Pei [Tue, 24 May 2022 02:48:06 +0000 (10:48 +0800)]
vhost: add vDPA operations for block device

Get_config and set_config are necessary ops for blk device.
Add get_config and set_config ops to vDPA ops.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovdpa/ifc: support virtio block device
Andy Pei [Tue, 24 May 2022 02:48:05 +0000 (10:48 +0800)]
vdpa/ifc: support virtio block device

Re-use the vdpa/ifc code, distinguish blk and net device by pci_device_id.
Blk and net device are implemented with proper feature and ops.

Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: fix deadlock when message handling failed
Wenwu Ma [Sat, 7 May 2022 13:27:53 +0000 (13:27 +0000)]
vhost: fix deadlock when message handling failed

In vhost_user_msg_handler(), if vhost message handling
failed, we should check whether the queue is locked and
release the lock before returning. Or, it will cause a
deadlock later.

Fixes: 7f31d4ea05ca ("vhost: fix lock on device readiness notification")
Cc: stable@dpdk.org
Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Wei Ling <weix.ling@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
2 years agoexamples/vhost: support async dequeue data path
Xuan Ding [Mon, 16 May 2022 11:10:41 +0000 (11:10 +0000)]
examples/vhost: support async dequeue data path

This patch adds the use case for async dequeue API. Vswitch can
leverage DMA device to accelerate vhost async dequeue path.

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: support async dequeue for split ring
Xuan Ding [Mon, 16 May 2022 11:10:40 +0000 (11:10 +0000)]
vhost: support async dequeue for split ring

This patch implements asynchronous dequeue data path for vhost split
ring, a new API rte_vhost_async_try_dequeue_burst() is introduced.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: merge sync and async descriptor to mbuf filling
Xuan Ding [Mon, 16 May 2022 11:10:39 +0000 (11:10 +0000)]
vhost: merge sync and async descriptor to mbuf filling

This patch refactors copy_desc_to_mbuf() used by the sync
path to support both sync and async descriptor to mbuf filling.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: prepare async for descriptor to mbuf refactoring
Xuan Ding [Mon, 16 May 2022 11:10:38 +0000 (11:10 +0000)]
vhost: prepare async for descriptor to mbuf refactoring

This patch refactors vhost async enqueue path and dequeue path to use
the same function async_fill_seg() for preparing batch elements,
which simplifies the code without performance degradation.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: prepare sync for descriptor to mbuf refactoring
Xuan Ding [Mon, 16 May 2022 11:10:37 +0000 (11:10 +0000)]
vhost: prepare sync for descriptor to mbuf refactoring

This patch extracts the descriptors to buffers filling from
copy_desc_to_mbuf() into a dedicated function. Besides, enqueue
and dequeue path are refactored to use the same function
sync_fill_seg() for preparing batch elements, which simplifies
the code without performance degradation.

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Tested-by: Yvonne Yang <yvonnex.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agovhost: add runtime locking check in unsafe API
Maxime Coquelin [Wed, 11 May 2022 06:58:37 +0000 (08:58 +0200)]
vhost: add runtime locking check in unsafe API

This patch adds runtime checks in unsafe Vhost async APIs,
to ensure the access lock is taken.

The detection won't work every time, as another thread
could take the lock, but it would help to detect misuse
of these unsafe API.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: add statistics for in-flight packets
Maxime Coquelin [Tue, 10 May 2022 20:17:20 +0000 (22:17 +0200)]
vhost: add statistics for in-flight packets

This patch adds statistics for packets in-flight submission
and completion, when Vhost async mode is used.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: add statistics for IOTLB
Maxime Coquelin [Tue, 10 May 2022 20:17:19 +0000 (22:17 +0200)]
vhost: add statistics for IOTLB

This patch adds statistics for IOTLB hits and misses.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: add statistics for guest notification
Maxime Coquelin [Tue, 10 May 2022 20:17:18 +0000 (22:17 +0200)]
vhost: add statistics for guest notification

This patch adds a new virtqueue statistic for guest
notifications. It is useful to deduce from hypervisor side
whether the corresponding guest Virtio device is using
Kernel Virtio-net driver or DPDK Virtio PMD.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agonet/vhost: move to vhost library statistics API
Maxime Coquelin [Tue, 10 May 2022 20:17:17 +0000 (22:17 +0200)]
net/vhost: move to vhost library statistics API

Now that we have Vhost statistics APIs, this patch replaces
Vhost PMD extended statistics implementation with calls
to the new API. It will enable getting more statistics for
counters that cannot be implemented at the PMD level.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: support per-virtqueue statistics
Maxime Coquelin [Tue, 10 May 2022 20:17:16 +0000 (22:17 +0200)]
vhost: support per-virtqueue statistics

This patch introduces new APIs for the application
to query and reset per-virtqueue statistics. The
patch also introduces generic counters.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agodoc: fix vhost multi-queue reconnection
Xuan Ding [Mon, 9 May 2022 04:11:58 +0000 (04:11 +0000)]
doc: fix vhost multi-queue reconnection

Since QEMU 5.2.0 fixes the vhost split ring multi-queue reconnection
issue in commit f66337bdbfda ("vhost-user: save features of multiqueues
if chardev is closed"), this patch updates known issue to indicate
the range of affeacted QEMU versions.

Fixes: b37e95507e1b ("doc: add vhost multi-queue reconnection issue")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
2 years agovhost: fix async access
David Marchand [Mon, 11 Apr 2022 11:00:08 +0000 (13:00 +0200)]
vhost: fix async access

vq->async accesses must be protected with vq->access_lock.

Fixes: eb666d24085f ("vhost: fix async unregister deadlock")
Fixes: 0c0935c5f794 ("vhost: allow to check in-flight packets for async vhost")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2 years agonet/bnxt: remove some dead code
Ruifeng Wang [Tue, 10 May 2022 06:31:18 +0000 (14:31 +0800)]
net/bnxt: remove some dead code

Removed some macros that were defined but not used in this driver.
As a result, rte_smp_xx occurrence is removed from this driver.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: use compiler atomics for statistics
Ruifeng Wang [Tue, 10 May 2022 06:31:17 +0000 (14:31 +0800)]
net/bnxt: use compiler atomics for statistics

Converted rte_atomic usages to compiler atomic built-ins.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Kathleen Capella <kathleen.capella@arm.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: fix ULP parser to ignore segment offset
Shuanglin Wang [Mon, 14 Mar 2022 21:23:33 +0000 (14:23 -0700)]
net/bnxt: fix ULP parser to ignore segment offset

Fix ULP parser to ignore segment_offset of IPv4 header.
Currently the IPv4 handler is assuming default setting,
which causes the flow table to be updated incorrectly.

Fixes: 741172be52de ("net/bnxt: refactor flow parser in ULP")
Cc: stable@dpdk.org
Signed-off-by: Shuanglin Wang <shuanglin.wang@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agonet/bnxt: fix compatibility with some old firmwares
David Marchand [Fri, 18 Mar 2022 15:03:31 +0000 (16:03 +0100)]
net/bnxt: fix compatibility with some old firmwares

This reverts commit 3972281f47b2cc0cf844698885f0e6b4228c0975.

Reported by Red Hat QE: with older firmware versions (at least versions
20.6.112.0 and 20.6.143.0), initialisation never succeeds following this
change.
Revert it for now, waiting for a more complete fix.

Fixes: 3972281f47b2 ("net/bnxt: fix device readiness check")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agoethdev: promote port ownership API as stable
Thomas Monjalon [Thu, 28 Oct 2021 08:34:57 +0000 (10:34 +0200)]
ethdev: promote port ownership API as stable

The port ownership concept was introduced in ethdev in DPDK 18.02.
Not sure it is used by applications except those using failsafe or netvsc.
It can also be used by libraries or applications to sort out
how ports are controlled.

Hiding sub-ports controlled by failsafe or netvsc look to be enough
justification to promote this API as stable.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: add IPv4/IPv6 ECN header rewrite action
Jiawei Wang [Sat, 2 Apr 2022 07:11:47 +0000 (10:11 +0300)]
ethdev: add IPv4/IPv6 ECN header rewrite action

This patch introduces the IPv4/IPv6 ECN modify field support, and
adds the testpmd CLI commands support.

Usage:
modify_field op set dst_type ipv4_ecn src_type ...

For example:

flow create 0 ingress group 1 pattern eth / ipv4 /  end actions
modify_field op set dst_type ipv4_ecn src_type value src_value
0x03 width 2 / queue index 0 / end

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoethdev: fix port close in secondary process
Min Hu (Connor) [Wed, 1 Jun 2022 03:15:13 +0000 (11:15 +0800)]
ethdev: fix port close in secondary process

Secondary process needs to close device to release process private
resources.  But secondary process should not be obliged to wait for
device stop before closing ethdev.

Fixes: febc855b358e ("ethdev: forbid closing started device")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/sfc: allow to control the represented entity MAC address
Ivan Malov [Thu, 26 May 2022 08:45:50 +0000 (11:45 +0300)]
net/sfc: allow to control the represented entity MAC address

The MAC address is accessed via the representor ethdev's one.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agocommon/sfc_efx/base: manage VNIC MAC address by MCDI handle
Ivan Malov [Thu, 26 May 2022 08:45:49 +0000 (11:45 +0300)]
common/sfc_efx/base: manage VNIC MAC address by MCDI handle

The board admin may need to assign a MAC address to a guest
VNIC identified by its MCDI handle. Provide an API for that.

In the case when a libefx-based driver is used at the guest,
it will need to check its MAC address using the symmetrical
API if the admin has tweaked it by means of its representor.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2 years agocommon/sfc_efx/base: convert EFX PCIe INTF to MCDI value
Ivan Malov [Thu, 26 May 2022 08:45:48 +0000 (11:45 +0300)]
common/sfc_efx/base: convert EFX PCIe INTF to MCDI value

When the driver queries its PCIe interface type via MCDI,
the value from the response is translated to an EFX enum.

When the driver passes this enum value back to any other
MCDI helper, the inverse translation has to be conducted.

Fixes: 1bf9ff57ccb3 ("common/sfc_efx/base: allow getting VNIC MCDI client handles")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2 years agoapp/testpmd: register driver specific commands
David Marchand [Tue, 24 May 2022 20:06:42 +0000 (22:06 +0200)]
app/testpmd: register driver specific commands

Introduce a testpmd API so that drivers can register specific commands.

A driver can list some files to compile with testpmd, by setting them
in the testpmd_sources (driver local) meson variable.
drivers/meson.build then takes care of appending this to a global meson
variable, and adding the driver to testpmd dependency.

Note: testpmd.h is fixed to that it is self sufficient when being
included.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoapp/testpmd: mark most cmdline symbols as static
David Marchand [Tue, 24 May 2022 20:06:41 +0000 (22:06 +0200)]
app/testpmd: mark most cmdline symbols as static

All those symbols don't need to be global, plus it was hiding unused
code such as:
- cmd_set_conntrack_dir_set and cmd_set_conntrack_dir_conntrack in
  cmdline.c,
- cmd_create_port_meter_g_action, cmd_create_port_meter_r_action,
  cmd_create_port_meter_y_action in cmdline_mtr.c,

Mark those symbols as static.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2 years agoethdev: support SFF-8636 module telemetry
Robin Zhang [Thu, 26 May 2022 07:32:15 +0000 (07:32 +0000)]
ethdev: support SFF-8636 module telemetry

Add support for module EEPROM information format defined in
SFF-8636 Rev 2.7.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: support SFF-8472 module telemetry
Robin Zhang [Thu, 26 May 2022 07:32:14 +0000 (07:32 +0000)]
ethdev: support SFF-8472 module telemetry

Add support for module EEPROM information format defined in
SFF-8472 Rev 12.0

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: support SFF-8079 module telemetry
Robin Zhang [Thu, 26 May 2022 07:32:13 +0000 (07:32 +0000)]
ethdev: support SFF-8079 module telemetry

Add support for module EEPROM information format defined in
SFF-8079 Rev 1.7.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: add common code for different SFF specs
Robin Zhang [Thu, 26 May 2022 07:32:12 +0000 (07:32 +0000)]
ethdev: add common code for different SFF specs

Add support for SFF-8024 Rev 4.0 of pluggable I/O configuration
and some common utilities for SFF-8436/8636 and SFF-8472/8079.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: add telemetry command for module EEPROM
Robin Zhang [Thu, 26 May 2022 07:32:11 +0000 (07:32 +0000)]
ethdev: add telemetry command for module EEPROM

Add a new telemetry command /ethdev/module_eeprom to dump the module
EEPROM of each port. The format of module EEPROM information follows
the SFF(Small Form Factor) Committee specifications.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/vmxnet3: fix Rx data ring initialization
Pankaj Gupta [Wed, 25 May 2022 00:40:28 +0000 (17:40 -0700)]
net/vmxnet3: fix Rx data ring initialization

Fix merge error.

Tested, using testpmd, for different hardware versions on ESXi 7.0
Update 2.

Fixes: 046f11619567 ("net/vmxnet3: support MSI-X interrupt")
Cc: stable@dpdk.org
Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>