dpdk.git
3 years agonet/mlx4: fix buffer leakage on device close
Viacheslav Ovsiienko [Sat, 17 Apr 2021 17:14:14 +0000 (20:14 +0300)]
net/mlx4: fix buffer leakage on device close

The mlx4 PMD tracks the buffers (mbufs) for the packets being
transmitted in the dedicated array named as "elts". The tx_burst
routine frees the mbufs from this array once it needs to rearm
the hardware descriptor and store the new mbuf, so it looks
like as replacement mbuf pointer in the elts array.

On the device stop mlx4 PMD freed only the part of elts according
tail and head pointers, leaking the rest of buffers, remained in
the elts array.

Fixes: a2ce2121c01c ("net/mlx4: separate Tx configuration functions")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: remove drop queue function prototypes
Viacheslav Ovsiienko [Mon, 5 Apr 2021 10:07:16 +0000 (10:07 +0000)]
net/mlx5: remove drop queue function prototypes

There are some leftovers of removed code - there are
no drop queue handling routines anymore.

Fixes: 78be885295b8 ("net/mlx5: handle drop queues as regular queues")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
3 years agonet/mlx5: support meter PPS profile
Li Zhang [Tue, 27 Apr 2021 10:41:34 +0000 (13:41 +0300)]
net/mlx5: support meter PPS profile

Currently meter algorithms only supports bytes units for meter profiles.
Using ASO feature, the driver can support metering in per packet units.

Add support for packet units in meter profiles.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: connect meter policy to created flows
Shun Hao [Tue, 27 Apr 2021 10:43:54 +0000 (13:43 +0300)]
net/mlx5: connect meter policy to created flows

Currently ASO meter must be followed by policy table, so this adds
the support that connecting meter and policy table.

There are several cases to be considered:
1. For non-termination policy, connect meter to the default policy
table.
2. For non-RSS termination policy case, simply get the policy
table id and connect meter to it.
3. For RSS termination policy case, need to split the flow due
to RSS info in policy, and translate each sub-flow using that RSS,
then create the sub policy table to be connected.
4. In termination policy case, if there's no actions to modify the
packet before meter, no need to use set_tag to save meter id in
register. Only add a new flow in drop table using the same match
criteria as suf-flow, to save cache miss.

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: prepare sub-policy for flow with meter
Li Zhang [Tue, 27 Apr 2021 10:43:53 +0000 (13:43 +0300)]
net/mlx5: prepare sub-policy for flow with meter

When a flow has a RSS action, the driver splits
each sub flow finally is configured with
a different HW TIR action.

Any RSS action configured in meter policy may cause
a split in the flow configuration.
To save performance, any TIR action will be configured
in different flow table, so policy can be split to
sub-policies per TIR in the flow creation time.

Create a function to prepare the policy and
its sub-policies for a configured flow with meter.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: support meter creation with policy
Li Zhang [Tue, 27 Apr 2021 10:43:52 +0000 (13:43 +0300)]
net/mlx5: support meter creation with policy

Create a meter with the new pre-defined policy.

The following cases to be considered:
1.Add entry match with meter_id in global drop table.
2.For non-termination policy (policy id 0),
  add jump rule to suffix table for green and
  jump rule to drop table for red.
3.Allocate counter per meter in drop table.
4.Allocate meter resource per domain per color.
5.It can work with both ASO and legacy meter HW objects.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/mlx5: support meter policy operations
Li Zhang [Tue, 27 Apr 2021 10:43:51 +0000 (13:43 +0300)]
net/mlx5: support meter policy operations

MLX5 PMD checks the validation of actions in policy while add
a new meter policy, if pass the validation, allocates the new
policy object from the meter policy indexed memory pool.

It is common to use the same policy for multiple meters.
MLX5 PMD supports two types of policy: termination policy and
no-termination policy.

Implement the next policy operations:
validate:
The driver doesn't support to configure actions in the flow
after the meter action except one case when the meter policy
is configured to do nothing in GREEN\YELLOW and only DROP action
in RED, this special policy is called non-terminated policy
and is handed as a singleton object internally.

For all the terminated policies, the next actions are supported:
GREEN - QUEUE, RSS, PORT_ID, JUMP, DROP, MARK and SET_TAG.
YELLOW - not supported at all -> must be empty.
RED - must include DROP action.

Hence, in ingress case, for example,
QUEUE\RSS\JUMP must be configured as last action for GREEN color.

All the above limitations will be validated.

create:
Validate the policy configuration.
Prepare the related tables and actions.

destroy:
Release the created policy resources.

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
3 years agonet/bnxt: use prefix on global function
Stephen Hemminger [Fri, 23 Apr 2021 21:04:44 +0000 (14:04 -0700)]
net/bnxt: use prefix on global function

When statically linked the function prandom_bytes is exposed
and might conflict with something in application. All driver
functions should use the same prefix.

Fixes: 9738793f28ec ("net/bnxt: add VNIC functions and structs")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: remove unused function parameters
Kalesh AP [Fri, 23 Apr 2021 05:19:29 +0000 (10:49 +0530)]
net/bnxt: remove unused function parameters

1. Clean up unused function parameters.
2. Declare no external referenced function as static and remove
   their prototype from the header file.

Fixes: ec77c6298301 ("net/bnxt: add stats context allocation")
Fixes: 200b64ba0be8 ("net/bnxt: free statistics context")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/bnxt: remove unnecessary forward declarations
Kalesh AP [Thu, 22 Apr 2021 04:12:00 +0000 (09:42 +0530)]
net/bnxt: remove unnecessary forward declarations

This patch removes several redundant forward declarations of
functions and structure.

Fixes: 0b42b92ae429 ("net/bnxt: fix xstats by id")
Fixes: cf4f055a6578 ("net/bnxt: remove EEM system memory support")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
3 years agonet/bnxt: skip get statistics for stopped queues
Stephen Hemminger [Wed, 21 Apr 2021 23:09:29 +0000 (16:09 -0700)]
net/bnxt: skip get statistics for stopped queues

An application using rte_flow may define a large number of queues
but only use a small subset of them at any one time.

Since querying the status of each queue requires a request/spin/reply
with the firmware, optimize by skipping the request for queues not
running.
For those queues the statistics will be 0.

This cuts the cost of single xstats query in half and has even
bigger gain for simple stats query.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
3 years agonet/virtio: fix kernel set memtable for multi-queue device
Thierry Herbelot [Fri, 23 Apr 2021 12:25:15 +0000 (14:25 +0200)]
net/virtio: fix kernel set memtable for multi-queue device

Restore the original code, where VHOST_SET_MEM_TABLE is applied to
all vhostfds of the device.

Fixes: 539d910c9c76 ("net/virtio: add virtio-user memory tables ops")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovdpa/mlx5: improve portability of thread naming
Thomas Monjalon [Wed, 21 Apr 2021 17:59:23 +0000 (19:59 +0200)]
vdpa/mlx5: improve portability of thread naming

The function pthread_setname_np is non-portable,
so it may be unavailable in old glibc or other systems.
The function rte_thread_setname is workarounding portability issues.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
3 years agonet/virtio: fix getline memory leakage
Chengwen Feng [Wed, 21 Apr 2021 01:37:49 +0000 (09:37 +0800)]
net/virtio: fix getline memory leakage

This patch fixes getline memory leakage when parsing dynamic major num.

Fixes: 7d62bf6f54ba ("net/virtio: introduce vhost-vDPA backend type")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
3 years agovhost: allocate and free packets in bulk in Tx packed
Balazs Nemeth [Fri, 16 Apr 2021 10:25:19 +0000 (12:25 +0200)]
vhost: allocate and free packets in bulk in Tx packed

Move allocation out further and perform all allocation in bulk. The same
goes for freeing packets. In the process, also introduce
virtio_dev_pktmbuf_prep and make virtio_dev_pktmbuf_alloc use that.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: remove remaining packets count
Balazs Nemeth [Tue, 13 Apr 2021 13:31:03 +0000 (15:31 +0200)]
vhost: remove remaining packets count

The remained variable stores the same information as the difference
between count and pkt_idx. Remove the remained variable to simplify.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: read last used index once
Balazs Nemeth [Wed, 28 Apr 2021 02:17:31 +0000 (10:17 +0800)]
vhost: read last used index once

Instead of calculating the address of a packed descriptor based on the
vq->desc_packed and vq->last_used_idx every time, store that base
address in desc_base. On arm, this saves 176 bytes in code size of
function in which vhost_flush_enqueue_batch_packed gets inlined.

Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agoexamples/vhost: fix ioat ring space in callbacks
Cheng Jiang [Wed, 17 Mar 2021 05:40:54 +0000 (05:40 +0000)]
examples/vhost: fix ioat ring space in callbacks

We use ioat ring space for determining if ioat callbacks can enqueue a
packet to ioat device. But there is one slot can't be used in ioat
ring due to the ioat driver design, so we need to reduce one slot in
ioat ring to prevent ring size mismatch in ioat callbacks.

Fixes: 2aa47e94bfb2 ("examples/vhost: add ioat ring space count and check")
Cc: stable@dpdk.org
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agodoc: update async vhost register/unregister
Jiayu Hu [Tue, 20 Apr 2021 08:57:46 +0000 (04:57 -0400)]
doc: update async vhost register/unregister

This patch is to update programmer guide for register/unregister
copy devices in vhost.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: fix redundant vring status change notification
Jiayu Hu [Tue, 20 Apr 2021 08:57:45 +0000 (04:57 -0400)]
vhost: fix redundant vring status change notification

When VHOST_USER_F_PROTOCOL_FEATURES is not negotiated,
there is no need for vhost_user_set_vring_kick() to
notify the application of vring enabled, as
vhost_user_msg_handler() also notifies the application.

This patch is to remove unnecessary vring_state_changed() call.

Fixes: d0fcc38f5fa4 ("vhost: improve device readiness notifications")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
3 years agovhost: remove unnecessary free
Jiayu Hu [Tue, 20 Apr 2021 08:57:44 +0000 (04:57 -0400)]
vhost: remove unnecessary free

This patch removes unnecessary rte_free() for async_pkts_info
and async_descs_split.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
3 years agovhost: fix queue initialization
Jiayu Hu [Tue, 20 Apr 2021 08:57:43 +0000 (04:57 -0400)]
vhost: fix queue initialization

This patch allocates vhost queue by rte_zmalloc() to avoid
undefined values.

Fixes: a277c7159876 ("vhost: refactor code structure")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
3 years agonet/ice/base: clean duplicate in finding GTPU dummy packet
Yuying Zhang [Mon, 26 Apr 2021 07:17:49 +0000 (07:17 +0000)]
net/ice/base: clean duplicate in finding GTPU dummy packet

Four GTPU tunnel types are used twice to find GTPU dummy packets
(ipv4_gtpu_ipv4/ipv6, ipv6_gtpu_ipv4/ipv6). Clean redundant code.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/e1000: fix flow error message object
Min Hu (Connor) [Tue, 27 Apr 2021 08:51:21 +0000 (16:51 +0800)]
net/e1000: fix flow error message object

This patch fixes parameter misuse when set rte flow action error.

Fixes: c0688ef1eded ("net/igb: parse flow API n-tuple filter")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/i40e: support power management on VF
Anatoly Burakov [Mon, 26 Apr 2021 13:49:12 +0000 (13:49 +0000)]
net/i40e: support power management on VF

When .get_monitor_addr API was introduced, it was implemented in the
i40e driver, but only for the physical function; the virtual function
portion of the driver does not support that API.

Add the missing function pointer to VF device structure.

The i40e driver is not meant to use the VF portion any more, as
currently i40e VF devices are supposed to be managed by iavf drier, but
add this just in case it needs backporting later.

Fixes: a683abf90a22 ("net/i40e: implement power management API")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
3 years agonet/ixgbe: support power management on VF
Anatoly Burakov [Mon, 26 Apr 2021 13:49:11 +0000 (13:49 +0000)]
net/ixgbe: support power management on VF

When .get_monitor_addr API was introduced, it was implemented in the
ixgbe driver, but only for the physical function; the virtual function
portion of the driver does not support that API.

Add the missing function pointer to VF device structure.

Fixes: 3982b7967bb7 ("net/ixgbe: implement power management API")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Hunt <david.hunt@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
3 years agonet/iavf: fix Tx L4 checksum
Wenzhuo Lu [Tue, 27 Apr 2021 02:24:28 +0000 (10:24 +0800)]
net/iavf: fix Tx L4 checksum

Leverage the behavior of the scalar path, preparing
packets is necessary for vector paths which support checksum
offload.

Fixes: 059f18ae2aec ("net/iavf: add offload path for Tx AVX512")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
3 years agonet/ice/base: fix inner L4 offset for GTPU dummy packet
Yuying Zhang [Mon, 26 Apr 2021 06:02:08 +0000 (06:02 +0000)]
net/ice/base: fix inner L4 offset for GTPU dummy packet

Fix inner L4 offset of ipv6_gtpu_ipv6_tcp/udp dummy packet.

Fixes: bd4d9a89dbc1 ("net/ice/base: add GTP filtering via advanced switch filter")
Cc: stable@dpdk.org
Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agocommon/iavf: use macro to define offload/capability
Qi Zhang [Sat, 24 Apr 2021 06:03:37 +0000 (14:03 +0800)]
common/iavf: use macro to define offload/capability

Currently raw hex values are used to define specific bits for each
offload/capability in virtchnl.h. The can and has led to duplicate
defined bits. Fix this by using the BIT() macro so it's
immediately obvious which bits are used/available.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agocommon/iavf: refine comment in virtual channel
Qi Zhang [Sat, 24 Apr 2021 06:03:36 +0000 (14:03 +0800)]
common/iavf: refine comment in virtual channel

General clean up for comment in virtchnl.

Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Signed-off-by: Joshua Hay <joshua.a.hay@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agocommon/iavf: add enumeration for Rx descriptor ID
Qi Zhang [Sat, 24 Apr 2021 06:03:35 +0000 (14:03 +0800)]
common/iavf: add enumeration for Rx descriptor ID

Support for allowing VFs to negotiate the descriptor format was added
previously.

This support requires that the VF specify which descriptor format to use
when requesting Rx queues. The VF is supposed to request the set of
supported formats via the new VIRTCHNL_OP_GET_SUPPORTED_RXDIDS, and then
set one of the supported formats in the rxdid field of the
virtchnl_rxq_info structure.

The virtchnl.h header does not provide an enumeration of the format
values. The existing implementations in the PF directly use the values
from the DDP package.

Make the formats explicit by defining an enumeration of the RXDIDs.
Provide an enumeration for the values as well as the bit positions as
returned by the supported_rxdids data from the
VIRTCHNL_OP_GET_SUPPORTED_RXDIDS.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agocommon/iavf: fix duplicated offload bit
Qi Zhang [Sat, 24 Apr 2021 06:03:34 +0000 (14:03 +0800)]
common/iavf: fix duplicated offload bit

The value of offload VIRTCHNL_VF_OFFLOAD_CRC bit already existed as
VIRTCHNL_VF_CAP_ADV_LINK_SPEED. Fix this now by changing the value of
VIRTCHNL_VF_OFFLOAD_CRC to a currently unused value.

Also, move the define for VIRTCHNL_VF_CAP_ADV_LINK_SPEED in the correct
place to line up with the other bit values and add a comment for its
purpose. Hopefully this will prevent from defining duplicate bits moving
forward.

Fixes: e244eeafcecb ("net/iavf/base: update virtual channel")
Cc: stable@dpdk.org
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/ice: refactor input set fields for switch filter
Yuying Zhang [Mon, 26 Apr 2021 05:38:14 +0000 (05:38 +0000)]
net/ice: refactor input set fields for switch filter

Input set has been divided into inner and outer part to distinguish
different fields. However, the parse method of switch filter doesn't
match this update. Refactor switch filter to distinguish inner and outer
input set in the same way as other filters.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: clean redundant macro definition of filters
Yuying Zhang [Mon, 26 Apr 2021 05:38:13 +0000 (05:38 +0000)]
net/ice: clean redundant macro definition of filters

The input set has been divided into two parts to distinguish
inner and outer field. ICE_INSET_TUN_* is the same as non tunnel
macro definition. Clean redundant ICE_INSET_TUN_* codes.

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix VF to PF command failure handling
Alvin Zhang [Sun, 25 Apr 2021 07:39:34 +0000 (15:39 +0800)]
net/iavf: fix VF to PF command failure handling

When the command sent by VF to PF fails, iavf may need to run
different code paths according to the specific reason of the
failure (not supported or other reasons).

This patch adds support of identifying PF return error type.

Fixes: 22b123a36d07 ("net/avf: initialize PMD")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agonet/iavf: fix RSS initialization
Xuan Ding [Sun, 25 Apr 2021 08:05:50 +0000 (08:05 +0000)]
net/iavf: fix RSS initialization

When the default RSS is disabled during initialization, the RSS should
be turned on when creating RSS rule.

This patch adds support to configure RSS key and lookup table even
when the default RSS is disabled.

Fixes: c678299594a8 ("net/iavf: fix default RSS configuration")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/ice: fix fast mbuf freeing
Alvin Zhang [Sun, 25 Apr 2021 05:18:51 +0000 (13:18 +0800)]
net/ice: fix fast mbuf freeing

MBUF_FAST_FREE should be supported as per queue offload for ice.

Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/iavf: fix RSS configuration on i40e VF
Alvin Zhang [Sun, 25 Apr 2021 05:08:47 +0000 (13:08 +0800)]
net/iavf: fix RSS configuration on i40e VF

The iavf does not support configuring RSS type on i40e VF,
because the i40e kernel driver does not support
VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF capability.

This patch adds support of RSS type configuration for i40e VF by
sending VIRTCHNL_OP_SET_RSS_HENA message to the PF after checking
that the PF does not support VIRTCHNL_VF_OFFLOAD_ADV_RSS_PF
capability.

Fixes: c678299594a8 ("net/iavf: fix default RSS configuration")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
3 years agocommon/iavf: add header types for PPP and L2TPv2
Ting Xu [Fri, 23 Apr 2021 08:06:37 +0000 (16:06 +0800)]
common/iavf: add header types for PPP and L2TPv2

Added two virtchnl protocol header types for L2TPv2 and PPP to support
the RSS hash for PPPoL2TPv2oUDP.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: remove redundant VSI check in Tx queue setup
Chengwen Feng [Wed, 21 Apr 2021 02:33:14 +0000 (10:33 +0800)]
net/i40e: remove redundant VSI check in Tx queue setup

The VSI pointer is always valid, so there is no need to judge its
validity.

Fixes: b6583ee40265 ("i40e: full VMDQ pools support")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agonet/i40e: fix negative VEB index
Chengwen Feng [Wed, 21 Apr 2021 02:33:13 +0000 (10:33 +0800)]
net/i40e: fix negative VEB index

This patch adds check for negative VEB index when parsing VEB list.

Fixes: 79f2248219c0 ("net/i40e: add floating VEB option")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
3 years agocommon/sfc_efx/base: fix dereferencing null pointer
Hongbo Zheng [Sun, 25 Apr 2021 12:58:16 +0000 (20:58 +0800)]
common/sfc_efx/base: fix dereferencing null pointer

In function efx_pci_xilinx_cap_tbl_find, pointer entry_offsetp is used
before null pointer check, which may cause access to null pointer.

This patch fix this problem.

Fixes: ba9568b8b4b7 ("common/sfc_efx/base: add Xilinx capabilities table lookup")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/hns3: fix handling link update
Chengwen Feng [Tue, 27 Apr 2021 12:17:39 +0000 (20:17 +0800)]
net/hns3: fix handling link update

The link fails code should be parsed using the structure
hns3_mbx_vf_to_pf_cmd, else it will parse fail.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/bonding: fix socket ID check
Chengchang Tang [Tue, 27 Apr 2021 11:39:41 +0000 (19:39 +0800)]
net/bonding: fix socket ID check

The socket ID entered by user is cast to an unsigned integer. However,
the value may be an illegal negative value, which may cause some
problems. In this case, an error should be returned.

In addition, the socket ID may be an invalid positive number, which is
also processed in this patch.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: fix formatting in testpmd guide
Ajit Khaparde [Fri, 23 Apr 2021 16:29:44 +0000 (17:29 +0100)]
doc: fix formatting in testpmd guide

Fix formatting in testpmd user guide for hairpin operation.

Fixes: 01817b10d27c ("app/testpmd: change hairpin queues setup")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Bing Zhao <bingz@nvidia.com>
3 years agoapp/testpmd: fix segment number check
Viacheslav Ovsiienko [Fri, 23 Apr 2021 16:09:52 +0000 (17:09 +0100)]
app/testpmd: fix segment number check

The --txpkts command line parameter was silently ignored due to
application was unable to check the Tx queue ring sizes for non
configured ports.

The "set txpkts <len0[,len1]*>" was also rejected if there
was some stopped or /unconfigured port.

This provides the following:

  - If fails to get ring size from the port, this can be because port is
    not initialized yet, ignore the check and just be sure segment size
    won't cause an out of bound access. The port descriptor check will
    be done during Tx setup.

  - The capability to send single packet is supposed to be very basic
    and always supported, the setting segment number to 1 is always
    allowed, no check performed

  - At the moment of Tx queue setup the descriptor number is checked
    against configured segment number

Bugzilla ID: 584
Fixes: 8dae835d88b7 ("app/testpmd: remove restriction on Tx segments set")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agonet/hns3: disable MAC status report interrupt
Hongbo Zheng [Fri, 23 Apr 2021 09:56:34 +0000 (17:56 +0800)]
net/hns3: disable MAC status report interrupt

Disable the MAC status report interrupt which hns3 driver not concern
currently.

Fixes: 5f8845f4ba8f ("net/hns3: process MAC interrupt")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agodoc: add runtime option examples to hns3 guide
Min Hu (Connor) [Fri, 23 Apr 2021 09:27:39 +0000 (17:27 +0800)]
doc: add runtime option examples to hns3 guide

This patch added examples for runtime config options, to help user
how to use this.

Fixes: a124f9e9591b ("net/hns3: add runtime config to select IO burst function")
Fixes: 70791213242e ("net/hns3: support masking device capability")

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix typos on comments
Min Hu (Connor) [Fri, 23 Apr 2021 09:27:38 +0000 (17:27 +0800)]
net/hns3: fix typos on comments

This patch fixed wrong word in comments.

Fixes: f53a793bb7c2 ("net/hns3: add more hardware error types")
Fixes: d51867db65c1 ("net/hns3: add initialization")
Fixes: 411d23b9eafb ("net/hns3: support VLAN")
Fixes: 5f8845f4ba8f ("net/hns3: process MAC interrupt")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/tap: fix interrupt vector array size
Chengchang Tang [Thu, 22 Apr 2021 11:27:14 +0000 (19:27 +0800)]
net/tap: fix interrupt vector array size

The size of the current interrupt vector array is fixed to an integer.

This patch will create an interrupt vector array based on the number
of rxqs.

Fixes: 4870a8cdd968 ("net/tap: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agoapp/testpmd: fix max queue number for Tx offloads
Chengchang Tang [Thu, 22 Apr 2021 07:03:31 +0000 (15:03 +0800)]
app/testpmd: fix max queue number for Tx offloads

When txq offload is configured, max rxq is used as the max queue. This
patch fixes it.

Fixes: 74453ac9ef67 ("app/testpmd: fix queue offload configuration")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
3 years agotest/kni: check init result
Min Hu (Connor) [Thu, 22 Apr 2021 03:56:29 +0000 (11:56 +0800)]
test/kni: check init result

Return value 'rte_kni_init' of a function is not checked. If
it fails, error handling (logging and return) should be done.

This patch fixed it.

Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agotest/kni: fix a comment
Min Hu (Connor) [Thu, 22 Apr 2021 03:56:27 +0000 (11:56 +0800)]
test/kni: fix a comment

This patch changed 'subsytem' to 'subsystem'.

Fixes: 0c6bc8ef70ba ("kni: memzone pool for alloc and release")
Cc: stable@dpdk.org
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/bonding: fix leak on remove
Chengwen Feng [Thu, 22 Apr 2021 02:05:02 +0000 (10:05 +0800)]
net/bonding: fix leak on remove

If the bond device was created by vdev mode, the kvlist was not free
when the bond device removed.

Fixes: 8d30fe7fa737 ("bonding: support port hotplug")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/hns3: remove unused mailbox macro and struct
Chengwen Feng [Thu, 22 Apr 2021 01:55:52 +0000 (09:55 +0800)]
net/hns3: remove unused mailbox macro and struct

In hns3_mbx.h, some macro and structure were defined in previous
versions but never used.

Fixes: 463e748964f5 ("net/hns3: support mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix processing link status message on PF
Chengwen Feng [Thu, 22 Apr 2021 01:55:50 +0000 (09:55 +0800)]
net/hns3: fix processing link status message on PF

The opcode of the link status notification message reported by the
firmware is zero, it will be filtered out because driver treats it as
already processed message. As a result, the PF can't update the link
status in a timely manner.

Because only VF can set opcode to zero when processing mailbox message,
we add a judgment to make sure the PF messages will not be filtered out.

Fixes: dbbbad23e380 ("net/hns3: fix VF handling LSC event in secondary process")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agonet/hns3: fix mailbox error message
Chengwen Feng [Thu, 22 Apr 2021 01:55:49 +0000 (09:55 +0800)]
net/hns3: fix mailbox error message

The hns3_dev_handle_mbx_msg() could be called under both PF and VF,
but the error messages show VF.

Fixes: 109e4dd1bd7a ("net/hns3: get link state change through mailbox")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
3 years agodrivers/net: fix FW version query
Ferruh Yigit [Wed, 21 Apr 2021 16:20:57 +0000 (17:20 +0100)]
drivers/net: fix FW version query

Fixes a few different things:
* Remove 'fw_version' NULL checks, it is allowed if the 'fw_size' is
  zero, 'fw_version' being NULL but 'fw_size' not zero condition checked
  in ethdev layer
* Be sure required buffer size is returned if provided one is not big
  enough, instead of returning success (0)
* Document in doxygen comment the '-EINVAL' is a valid return type
* Take into account that 'snprintf' can return negative value
* Cast length to 'size_t' to compare it with 'fw_size'

Fixes: bb42aa9ffe4e ("net/atlantic: configure device start/stop")
Fixes: ff70acdf4299 ("net/axgbe: support reading FW version")
Fixes: e2652b0a20a0 ("net/bnxt: support get FW version")
Fixes: cf0fab1d2ca5 ("net/dpaa: support firmware version get API")
Fixes: 748eccb97cdc ("net/dpaa2: add support for firmware version get")
Fixes: b883c0644a24 ("net/e1000: add firmware version get")
Fixes: 293430677e9c ("net/enic: add handler to return firmware version")
Fixes: 1f5ca0b460cd ("net/hns3: support some device operations")
Fixes: bd5b86732bc7 ("net/hns3: modify format for firmware version")
Fixes: ed0dfdd0e976 ("net/i40e: add firmware version get")
Fixes: e31cb9a36298 ("net/ice: support FW version getting")
Fixes: 4f09bc55ac3d ("net/igc: implement device base operations")
Fixes: eec10fb0ce6b ("net/ionic: support FW version")
Fixes: 8b0b56574269 ("net/ixgbe: add firmware version get")
Fixes: 4d9f5b8adc02 ("net/octeontx2: add FW version get operation")
Fixes: f97b56f9f12e ("net/qede: support FW version query")
Fixes: 83fef46a22b2 ("net/sfc: add callback to retrieve FW version")
Fixes: bc84ac0fadef ("net/txgbe: support getting FW version")
Fixes: 21913471202f ("ethdev: add firmware version get")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
Acked-by: Jiawen Wu <jiawenwu@trustnetic.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
3 years agonet/txgbe: fix flow error message object
Chengwen Feng [Wed, 21 Apr 2021 06:31:13 +0000 (14:31 +0800)]
net/txgbe: fix flow error message object

This patch fixes parameter misusage when set rte flow action error.

Fixes: b7eeecb17556 ("net/txgbe: parse n-tuple filter")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/txgbe: fix memset type
Hongbo Zheng [Wed, 21 Apr 2021 03:36:09 +0000 (11:36 +0800)]
net/txgbe: fix memset type

Fix memset type error in function txgbe_parse_rss_filter
while clear rss_conf buffer.

Fixes: 7a6d87fb8398 ("net/txgbe: parse RSS filter")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agonet/kni: check init result
Chengwen Feng [Wed, 21 Apr 2021 02:14:18 +0000 (10:14 +0800)]
net/kni: check init result

This patch adds checking for rte_kni_init() result.

Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
3 years agodoc: fix multiport syntax in nfp guide
Chaoyong He [Thu, 25 Feb 2021 11:46:22 +0000 (13:46 +0200)]
doc: fix multiport syntax in nfp guide

Fix up the suffix of the PCI ID to be consistent with the code.

Fixes: 979f2bae0714 ("doc: improve multiport PF in nfp guide")
Cc: stable@dpdk.org
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
3 years agopower: save original ACPI governor always
Anatoly Burakov [Fri, 23 Apr 2021 11:01:56 +0000 (11:01 +0000)]
power: save original ACPI governor always

Currently, when we set the acpi governor to "userspace", we check if
it is already set to this value, and if it is, we skip setting it.

However, we never save this value anywhere, so that next time we come
back and request the governor to be set to its original value, the
original value is empty.

Fix it by saving the original pstate governor first. While we're at it,
replace `strlcpy` with `rte_strscpy`.

Fixes: 445c6528b55f ("power: common interface for guest and host")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
3 years agobpf: fix JSLT validation
Hongbo Zheng [Thu, 22 Apr 2021 07:30:01 +0000 (15:30 +0800)]
bpf: fix JSLT validation

In function 'eval_jcc', judgment 'op == EBPF_JLT' occurs
twice, as a result, the corresponding second statement
cannot be accessed.

This patch fix this problem.

Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
3 years agoacl: fix build with GCC 11
Konstantin Ananyev [Mon, 26 Apr 2021 13:35:19 +0000 (14:35 +0100)]
acl: fix build with GCC 11

gcc 11 with '-O2' complains about some variables being used without
being initialized:

In function ‘start_flow_avx512x8’,
    inlined from ‘search_trie_avx512x8.constprop’ at acl_run_avx512_common.h:317:
lib/librte_acl/acl_run_avx512_common.h:210:13: warning:
    ‘pdata’ is used uninitialized [-Wuninitialized]
In function ‘search_trie_avx512x8.constprop’:
lib/librte_acl/acl_run_avx512_common.h:314:32: note: ‘pdata’ declared here
...

Indeed, these variables are not explicitly initialized,
but this is done intentionally.
We rely on constant mask value that we pass to start_flow*() functions
as a parameter to mask out uninitialized values.
Note that '-O3' doesn't produce this warning.
Anyway, to support clean build with gcc-11 this patch adds
explicit initialization for these variables.
I checked the output binary: with '-O3' both clang and gcc 10/11
generate no extra code for it.
Also performance test didn't reveal any regressions.

Bugzilla ID: 673
Fixes: b64c2295f7fc ("acl: add 256-bit AVX512 classify method")
Fixes: 45da22e42ec3 ("acl: add 512-bit AVX512 classify method")
Cc: stable@dpdk.org
Reported-by: Ali Alnubani <alialnu@nvidia.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
3 years agoevent/cnxk: add option to control timer adapters
Shijith Thotton [Tue, 4 May 2021 00:27:25 +0000 (05:57 +0530)]
event/cnxk: add option to control timer adapters

Add devargs to control each event timer adapter i.e. TIM rings internal
parameters uniquely. The following dict format is expected
[ring-chnk_slots-disable_npa-stats_ena]. 0 represents default values.

Example:
--dev "0002:1e:00.0,tim_ring_ctl=[2-1023-1-0]"

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add timer adapter start and stop
Shijith Thotton [Tue, 4 May 2021 00:27:24 +0000 (05:57 +0530)]
event/cnxk: add timer adapter start and stop

Add event timer adapter start and stop functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add timer stats
Shijith Thotton [Tue, 4 May 2021 00:27:23 +0000 (05:57 +0530)]
event/cnxk: add timer stats

Add event timer adapter statistics get and reset functions.
Stats are disabled by default and can be enabled through devargs.

Example:
--dev "0002:1e:00.0,tim_stats_ena=1"

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add timer cancel
Pavan Nikhilesh [Tue, 4 May 2021 00:27:22 +0000 (05:57 +0530)]
event/cnxk: add timer cancel

Add function to cancel event timer that has been armed.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add timer arm timeout burst
Pavan Nikhilesh [Tue, 4 May 2021 00:27:21 +0000 (05:57 +0530)]
event/cnxk: add timer arm timeout burst

Add event timer arm timeout burst function.
All the timers requested to be armed have the same timeout.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add timer arm routine
Pavan Nikhilesh [Tue, 4 May 2021 00:27:20 +0000 (05:57 +0530)]
event/cnxk: add timer arm routine

Add event timer arm routine.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add TIM bucket operations
Pavan Nikhilesh [Tue, 4 May 2021 00:27:19 +0000 (05:57 +0530)]
event/cnxk: add TIM bucket operations

Add TIM bucket operations used for event timer arm and cancel.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add options for timer chunk size and rings
Shijith Thotton [Tue, 4 May 2021 00:27:18 +0000 (05:57 +0530)]
event/cnxk: add options for timer chunk size and rings

Add devargs to control default chunk size and max numbers of
timer rings to attach to a given RVU PF.

Example:
--dev "0002:1e:00.0,tim_chnk_slots=1024"
--dev "0002:1e:00.0,tim_rings_lmt=4"

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add timer adapter info query
Shijith Thotton [Tue, 4 May 2021 00:27:17 +0000 (05:57 +0530)]
event/cnxk: add timer adapter info query

Add TIM event timer adapter info get function.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: allow adapters to resize in-flights
Pavan Nikhilesh [Tue, 4 May 2021 00:27:16 +0000 (05:57 +0530)]
event/cnxk: allow adapters to resize in-flights

Add internal SSO functions to allow event adapters to resize SSO buffers
that are used to hold in-flight events in DRAM.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add option to disable NPA
Pavan Nikhilesh [Tue, 4 May 2021 00:27:15 +0000 (05:57 +0530)]
event/cnxk: add option to disable NPA

If the chunks are allocated from NPA then TIM can automatically free
them when traversing the list of chunks.
Add devargs to disable NPA and use software mempool to manage chunks.

Example:
--dev "0002:0e:00.0,tim_disable_npa=1"

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: create and free timer adapter
Shijith Thotton [Tue, 4 May 2021 00:27:14 +0000 (05:57 +0530)]
event/cnxk: create and free timer adapter

When the application calls timer adapter create the following is used:
- Allocate a TIM LF based on number of LF's provisioned.
- Verify the config parameters supplied.
- Allocate memory required for
* Buckets based on min and max timeout supplied.
* Allocate the chunk pool based on the number of timers.

On Free:
- Free the allocated bucket and chunk memory.
- Free the TIM lf allocated.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add timer adapter capabilities
Shijith Thotton [Tue, 4 May 2021 00:27:13 +0000 (05:57 +0530)]
event/cnxk: add timer adapter capabilities

Add function to retrieve event timer adapter capabilities.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: support timer
Shijith Thotton [Tue, 4 May 2021 00:27:12 +0000 (05:57 +0530)]
event/cnxk: support timer

Add event timer adapter a.k.a TIM initialization on SSO probe.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add event port and queue xstats
Pavan Nikhilesh [Tue, 4 May 2021 00:27:11 +0000 (05:57 +0530)]
event/cnxk: add event port and queue xstats

Add support for retrieving statistics from SSO HWS and HWGRP.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add SSO selftest and dump
Pavan Nikhilesh [Tue, 4 May 2021 00:27:10 +0000 (05:57 +0530)]
event/cnxk: add SSO selftest and dump

Add selftest to verify sanity of SSO and also add function to
dump internal state of SSO.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add device stop and close
Shijith Thotton [Tue, 4 May 2021 00:27:09 +0000 (05:57 +0530)]
event/cnxk: add device stop and close

Add event device stop and close callback functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add device start
Shijith Thotton [Tue, 4 May 2021 00:27:08 +0000 (05:57 +0530)]
event/cnxk: add device start

Add eventdev start function along with few cleanup API's to maintain
sanity.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add SSO GWS dequeue fast path
Pavan Nikhilesh [Tue, 4 May 2021 00:27:07 +0000 (05:57 +0530)]
event/cnxk: add SSO GWS dequeue fast path

Add SSO GWS event dequeue fastpath functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add SSO GWS enqueue fast path
Pavan Nikhilesh [Tue, 4 May 2021 00:27:06 +0000 (05:57 +0530)]
event/cnxk: add SSO GWS enqueue fast path

Add SSO GWS fastpath event device enqueue functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add SSO HW device operations
Pavan Nikhilesh [Tue, 4 May 2021 00:27:05 +0000 (05:57 +0530)]
event/cnxk: add SSO HW device operations

Add SSO HW device operations used for enqueue/dequeue.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add option to configure getwork mode
Pavan Nikhilesh [Tue, 4 May 2021 00:27:04 +0000 (05:57 +0530)]
event/cnxk: add option to configure getwork mode

Add devargs to configure the platform specific getwork mode.

CN9K getwork mode by default is set to use dual workslot mode.
Add option to force single workslot mode.
Example:
--dev "0002:0e:00.0,single_ws=1"

CN10K supports multiple getwork prefetch modes, by default the
prefetch mode is set to none.
Add option to select getwork prefetch mode
Example:
--dev "0002:1e:00.0,gw_mode=1"

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add event port link and unlink
Shijith Thotton [Tue, 4 May 2021 00:27:03 +0000 (05:57 +0530)]
event/cnxk: add event port link and unlink

Add platform specific event port, queue link and unlink APIs.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add port config
Shijith Thotton [Tue, 4 May 2021 00:27:02 +0000 (05:57 +0530)]
event/cnxk: add port config

Add SSO HWS a.k.a event port setup and release functions.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add option to control SSO HWGRP QoS
Shijith Thotton [Tue, 4 May 2021 00:27:01 +0000 (05:57 +0530)]
event/cnxk: add option to control SSO HWGRP QoS

SSO HWGRPs i.e. queue uses DRAM & SRAM buffers to hold in-flight
events. By default the buffers are assigned to the SSO HWGRPs to
satisfy minimum HW requirements. SSO is free to assign the remaining
buffers to HWGRPs based on a preconfigured threshold.
We can control the QoS of SSO HWGRP by modifying the above mentioned
thresholds. HWGRPs that have higher importance can be assigned higher
thresholds than the rest.

Example:
        --dev "0002:0e:00.0,qos=[1-50-50-50]" // [Qx-XAQ-TAQ-IAQ]

Qx  -> Event queue Aka SSO GGRP.
XAQ -> DRAM In-flights.
TAQ & IAQ -> SRAM In-flights.

The values need to be expressed in terms of percentages, 0 represents
default.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add option for in-flight buffer count
Shijith Thotton [Tue, 4 May 2021 00:27:00 +0000 (05:57 +0530)]
event/cnxk: add option for in-flight buffer count

The number of events for a *open system* event device is specified
as -1 as per the eventdev specification.
Since, SSO inflight events are only limited by DRAM size, the
xae_cnt devargs parameter is introduced to provide upper limit for
in-flight events.

Example:
        --dev "0002:0e:00.0,xae_cnt=8192"

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: allocate event in-flight buffers
Pavan Nikhilesh [Tue, 4 May 2021 00:26:59 +0000 (05:56 +0530)]
event/cnxk: allocate event in-flight buffers

Allocate buffers in DRAM that hold inflight events.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add event queue config
Shijith Thotton [Tue, 4 May 2021 00:26:58 +0000 (05:56 +0530)]
event/cnxk: add event queue config

Add setup and release functions for event queues i.e.
SSO HWGRPs.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add platform specific device config
Shijith Thotton [Tue, 4 May 2021 00:26:57 +0000 (05:56 +0530)]
event/cnxk: add platform specific device config

Add platform specific event device configuration that attaches the
requested number of SSO HWS(event ports) and HWGRP(event queues) LFs
to the RVU PF/VF.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add common configuration validation
Pavan Nikhilesh [Tue, 4 May 2021 00:26:56 +0000 (05:56 +0530)]
event/cnxk: add common configuration validation

Add configuration validation, port and queue configuration
functions.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add platform specific device probe
Pavan Nikhilesh [Tue, 4 May 2021 00:26:55 +0000 (05:56 +0530)]
event/cnxk: add platform specific device probe

Add platform specific event device probe and remove, also add
event device info get function.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
3 years agoevent/cnxk: add device capabilities
Shijith Thotton [Tue, 4 May 2021 00:26:54 +0000 (05:56 +0530)]
event/cnxk: add device capabilities

Add the info_get function to return details on the queues, flow,
prioritization capabilities, etc. which this device has.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agoevent/cnxk: add build infra and device setup
Pavan Nikhilesh [Tue, 4 May 2021 00:26:53 +0000 (05:56 +0530)]
event/cnxk: add build infra and device setup

Add meson build infra structure along with the event device
SSO initialization and teardown functions.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
3 years agocommon/cnxk: update inline asm prefix
Pavan Nikhilesh [Tue, 4 May 2021 00:26:52 +0000 (05:56 +0530)]
common/cnxk: update inline asm prefix

Update inline asm prefix to prevent overriding cpu type, instead express
the additional extensions required.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
3 years agocommon/cnxk: rename deprecated PCI constant
Pavan Nikhilesh [Tue, 4 May 2021 00:26:51 +0000 (05:56 +0530)]
common/cnxk: rename deprecated PCI constant

The PCI_ANY_ID constant is deprecated and renamed as RTE_PCI_ANY_ID.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>