dpdk.git
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>
2 years agonet/vmxnet3: set packet type for fragmented packet
Pankaj Gupta [Wed, 25 May 2022 00:40:27 +0000 (17:40 -0700)]
net/vmxnet3: set packet type for fragmented packet

The packet type is set even if it is a fragmented packet.

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
2 years agonet/vmxnet3: advertise RETA size in device info
Pankaj Gupta [Wed, 25 May 2022 00:40:26 +0000 (17:40 -0700)]
net/vmxnet3: advertise RETA size in device info

Currently the driver assumes that the size of the RETA table is
four times the number of Rx queues at multiple places. However,
it sets it to four times the maximum number of queues (4 * 32 = 128)
when it first initializes the device. Change the other uses to use
the stored value, not the assumed default.

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
2 years agonet/vmxnet3: support version 6
Pankaj Gupta [Wed, 25 May 2022 00:40:25 +0000 (17:40 -0700)]
net/vmxnet3: support version 6

VMXNET3 version 6 supports some new features, including but not limited to:
 - Increased maximum MTU up to 9190
 - Increased maximum number of Rx and Tx queues
 - Removes power-of-two limitations on queue sizes
 - Extended interrupt structures (required for additional queues)

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
2 years agonet/vmxnet3: report HW version on FW version query
Pankaj Gupta [Wed, 25 May 2022 00:40:24 +0000 (17:40 -0700)]
net/vmxnet3: report HW version on FW version query

Support rte_eth_dev_fw_version_get() API.

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/vmxnet3: reorder ethdev callbacks initialization
Pankaj Gupta [Wed, 25 May 2022 00:40:23 +0000 (17:40 -0700)]
net/vmxnet3: reorder ethdev callbacks initialization

Driver callbacks initialization should follow callbacks order in the
structure definition.

Do not reorder callbacks implementation to avoid extra noise in
the code.

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Signed-off-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/vmxnet3: add Rx queue count
Pankaj Gupta [Wed, 25 May 2022 00:40:22 +0000 (17:40 -0700)]
net/vmxnet3: add Rx queue count

Count the number of entries in the Rx queue for debugging.

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
2 years agonet/vmxnet3: support RETA query and update
Pankaj Gupta [Wed, 25 May 2022 00:40:21 +0000 (17:40 -0700)]
net/vmxnet3: support RETA query and update

Add RETA query and RETA update support for VMXNET3.

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
2 years agonet/vmxnet3: support version 5
Pankaj Gupta [Wed, 25 May 2022 00:40:20 +0000 (17:40 -0700)]
net/vmxnet3: support version 5

Add VMXNET3 v5 support.

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

Signed-off-by: Pankaj Gupta <pagupta@vmware.com>
Reviewed-by: Jochen Behrens <jbehrens@vmware.com>
2 years agoapp/testpmd: fix help of create meter command
Jin Liu [Thu, 28 Apr 2022 02:03:32 +0000 (04:03 +0200)]
app/testpmd: fix help of create meter command

The help message of create meter command is incomplete,
lack of policy_id param, update help string.

Fixes: f29fa2c59b85 ("app/testpmd: support policy actions per color")
Cc: stable@dpdk.org
Signed-off-by: Jin Liu <jin.liu@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2 years agonet/nfp: fix disabling VLAN stripping
Peng Zhang [Thu, 26 May 2022 14:34:44 +0000 (16:34 +0200)]
net/nfp: fix disabling VLAN stripping

"vlan set strip off 0" can't work, due to the incorrect usage
of the mask, it just represent that the status is changed or not,
not represent offloaded or not, so that the driver send the
error control message to the nic.

Now, by first inspect the mask of things that changed, and then
change the requested state if VLAN stripping according the
requested offload status. So this change can fix this bug.

Fixes: d4a27a3b092a ("nfp: add basic features")
Cc: stable@dpdk.org
Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Signed-off-by: Yong Xu <yong.xu@corigine.com>
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2 years agonet/txgbe: fix max number of queues for SR-IOV
Jiawen Wu [Mon, 30 May 2022 09:30:16 +0000 (17:30 +0800)]
net/txgbe: fix max number of queues for SR-IOV

Hardware restrictions require a maximum of 4 queues for every pool.

Fixes: a6712cd029a4 ("net/txgbe: add PF module init and uninit for SRIOV")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/txgbe: fix SGMII mode to link up
Jiawen Wu [Mon, 30 May 2022 09:30:15 +0000 (17:30 +0800)]
net/txgbe: fix SGMII mode to link up

Fix SGMII mode to link up.

Fixes: 01c3cf5c85a7 ("net/txgbe: add autoneg control read and write")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: redesign internal PHY init flow
Jiawen Wu [Mon, 30 May 2022 09:30:14 +0000 (17:30 +0800)]
net/ngbe: redesign internal PHY init flow

Add to read efuse values from flash, and disable EEE to improve signal
quality. Remove PHY semaphore to access PHY registers faster. And remove
unnecessary page selection where quick access is required.

When rte_eth_link_get_nowait() is called frequently with LSC disabled by
self-developed applications, eventually the PHY status register will be
accessed frequently. It will cause internal PHY init failure, if they
are done simultaneously. So there is a protection added for internal PHY
init.

Fixes: 3518df5774c7 ("net/ngbe: support device start/stop")
Fixes: 91bc12c5227c ("net/ngbe: optimize PHY initialization process")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: fix PCIe related operations with bus API
Jiawen Wu [Mon, 30 May 2022 09:30:13 +0000 (17:30 +0800)]
net/ngbe: fix PCIe related operations with bus API

When using mailbox to request firmware to enable or disable PCIe bus
master, there is a small probability that mailbox cannot respond.
Change to use rte_pci_read_config() and rte_pci_write_config(), to
avoid this problem.

Fixes: ac6c5e9af56a ("net/ngbe: fix Tx hang on queue disable")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: fix reading M88E1512 PHY mode
Jiawen Wu [Mon, 30 May 2022 09:30:12 +0000 (17:30 +0800)]
net/ngbe: fix reading M88E1512 PHY mode

For M88E1512 PHY mixed mode, PXE driver overrides PHY mode at load
time. To workaround this problem, change to read PHY mode from flash
instead of register.

Fixes: 1c44384fce76 ("net/ngbe: support custom PHY interfaces")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: fix external PHY power down
Jiawen Wu [Mon, 30 May 2022 09:30:11 +0000 (17:30 +0800)]
net/ngbe: fix external PHY power down

External PHY cannot power down after LAN reset, so need to manually
power down when device stopped.

Fixes: 3d0af7066759 ("net/ngbe: setup PHY link")
Fixes: 1c44384fce76 ("net/ngbe: support custom PHY interfaces")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: fix reading PHY ID
Jiawen Wu [Mon, 30 May 2022 09:30:10 +0000 (17:30 +0800)]
net/ngbe: fix reading PHY ID

Change to check low ID register to determine the valid PHY address,
for yt8521s PHY with high ID register value 0. And fix polling
register when expect value is 0, to complete MDIO read.

Fixes: 44e97550ca68 ("net/ngbe: identify and reset PHY")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: support yt8531s PHY
Jiawen Wu [Mon, 30 May 2022 09:30:09 +0000 (17:30 +0800)]
net/ngbe: support yt8531s PHY

Add support for yt8531s PHY.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
2 years agonet/ngbe: fix link speed check
Jiawen Wu [Mon, 30 May 2022 09:30:08 +0000 (17:30 +0800)]
net/ngbe: fix link speed check

Since the bit of ETH_LINK_SPEED_FIXED was set for the force link
speed, it conflicts with '~allowed_speeds'.

Fixes: 3518df5774c7 ("net/ngbe: support device start/stop")
Cc: stable@dpdk.org
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>