dpdk.git
2 years agodistributor: fix potential overflow
Bruce Richardson [Thu, 17 Feb 2022 15:02:39 +0000 (15:02 +0000)]
distributor: fix potential overflow

Coverity flags the fact that the tag values used in distributor are
32-bit, which means that when we use bit-manipulation to convert a tag
match/no-match to a bit in an array, we need to typecast to a 64-bit
type before shifting past 32 bits.

Coverity issue: 375808
Fixes: 08ccf3faa6a9 ("distributor: new packet distributor library")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
2 years agoefd: fix uninitialized structure
Pablo de Lara [Fri, 25 Feb 2022 09:27:45 +0000 (09:27 +0000)]
efd: fix uninitialized structure

Coverity flags that both elements of efd_online_group_entry
are used uninitialized. This is OK because this structure
is initially used for starting values, so any value is OK.

Coverity ID: 375868
Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2 years agotest/efd: fix sockets mask size
Pablo de Lara [Fri, 25 Feb 2022 09:27:44 +0000 (09:27 +0000)]
test/efd: fix sockets mask size

Constant value 1 has a size of 32 bits, and shifting it more than 32 bits
to the left overflows. 1ULL is needed to be able to get a 64-bit value.

Coverity ID: 375846
Fixes: 8751a7e9832b ("efd: allow more CPU sockets in table creation")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
2 years agogpu/cuda: map GPU memory with GDRCopy
Elena Agostini [Fri, 25 Feb 2022 03:12:26 +0000 (03:12 +0000)]
gpu/cuda: map GPU memory with GDRCopy

To enable the gpudev rte_gpu_mem_cpu_map feature to expose
GPU memory to the CPU, the GPU CUDA driver library needs
the GDRCopy library and driver.

If DPDK is built without GDRCopy, the GPU CUDA driver returns
error if the is invoked rte_gpu_mem_cpu_map.

All the others GPU CUDA driver functionalities are not affected by
the absence of GDRCopy, thus this is an optional functionality
that can be enabled in the GPU CUDA driver.

CUDA driver documentation has been updated accordingly.

Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agodoc: add CUDA driver features
Elena Agostini [Fri, 25 Feb 2022 03:12:25 +0000 (03:12 +0000)]
doc: add CUDA driver features

The features list were missed when introducing the driver.

Fixes: 1306a73b1958 ("gpu/cuda: introduce CUDA driver")
Cc: stable@dpdk.org
Signed-off-by: Elena Agostini <eagostini@nvidia.com>
2 years agoraw/cnxk_gpio: stop device once tests are complete
Tomasz Duszynski [Fri, 25 Feb 2022 14:55:46 +0000 (15:55 +0100)]
raw/cnxk_gpio: stop device once tests are complete

Started device should eventually be stopped.

Fixes: 0e6557b448fa ("raw/cnxk_gpio: add self test")

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/mlx5: support queue/RSS actions for external Rx queue
Michael Baum [Thu, 24 Feb 2022 23:25:11 +0000 (01:25 +0200)]
net/mlx5: support queue/RSS actions for external Rx queue

Add support queue/RSS action for external Rx queue.
In indirection table creation, the queue index will be taken from
mapping array.

This feature supports neither LRO nor Hairpin.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: add external Rx queue mapping API
Michael Baum [Thu, 24 Feb 2022 23:25:10 +0000 (01:25 +0200)]
net/mlx5: add external Rx queue mapping API

External queue is a queue that has been created and managed outside the
PMD. The queues owner might use PMD to generate flow rules using these
external queues.

When the queue is created in hardware it is given an ID represented by
32 bits. In contrast, the index of the queues in PMD is represented by
16 bits. To enable the use of PMD to generate flow rules, the queue
owner must provide a mapping between the HW index and a 16-bit index
corresponding to the ethdev API.

This patch adds an API enabling to insert/cancel a mapping between HW
queue id and ethdev queue id.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: optimize queue type checks
Michael Baum [Thu, 24 Feb 2022 23:25:09 +0000 (01:25 +0200)]
net/mlx5: optimize queue type checks

The RxQ/TxQ control structure has a field named type. This type is enum
with values for standard and hairpin.
The use of this field is to check whether the queue is of the hairpin
type or standard.

This patch replaces it with a boolean variable that saves whether it is
a hairpin.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: support remote PD and CTX
Michael Baum [Thu, 24 Feb 2022 23:25:08 +0000 (01:25 +0200)]
common/mlx5: support remote PD and CTX

Add option to probe common device using import CTX/PD functions instead
of create functions.
This option requires accepting the context FD and the PD handle as
devargs.

This sharing can be useful for applications that use PMD for only some
operations. For example, an app that generates queues itself and uses
PMD just to configure flow rules.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: glue device and PD import
Michael Baum [Thu, 24 Feb 2022 23:25:07 +0000 (01:25 +0200)]
common/mlx5: glue device and PD import

Add support for rdma-core API to import device.
The API gets ibv_context file descriptor and returns an ibv_context
pointer that is associated with the given file descriptor.
Add also support for rdma-core API to import PD.
The API gets ibv_context and PD handle and returns a protection domain
(PD) that is associated with the given handle in the given context.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agocommon/mlx5: consider local functions as internal
Michael Baum [Thu, 24 Feb 2022 23:25:06 +0000 (01:25 +0200)]
common/mlx5: consider local functions as internal

The functions which are not explicitly marked as internal
were exported because the local catch-all rule was missing in the
version script.
After adding the missing rule, all local functions are hidden.
The function mlx5_get_device_guid is used in another library,
so it needs to be exported (as internal).

Because the local functions were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
An ABI exception is added for this library, considering that all
functions are either local or internal.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/mlx5: support matching GRE optional fields
Sean Zhang [Fri, 25 Feb 2022 01:14:17 +0000 (03:14 +0200)]
net/mlx5: support matching GRE optional fields

This patch adds matching on the optional fields (checksum/key/sequence)
of GRE header. The matching on checksum and sequence fields requests
support from rdma-core with the capability of misc5 and tunnel_header 0-3.

For patterns without checksum and sequence specified, keep using misc for
matching as before, but for patterns with checksum or sequence, validate
capability first and then use misc5 for the matching.

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: add GRE option flow item to feature list
Ferruh Yigit [Fri, 25 Feb 2022 18:27:59 +0000 (18:27 +0000)]
doc: add GRE option flow item to feature list

'gre_option' flow item was missing in the feature list, adding it.

Fixes: f61490bdf218 ("ethdev: support GRE optional fields")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2 years agoapp/testpmd: fix build without drivers
Thomas Monjalon [Fri, 25 Feb 2022 15:26:53 +0000 (16:26 +0100)]
app/testpmd: fix build without drivers

When ixgbe and bnxt are disabled, compilation was failing:

app/test-pmd/cmdline.c:9396:11: error:
variable 'vf_rxmode' set but not used

Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2 years agoapp/testpmd: fix raw encap of GENEVE option
Bing Zhao [Thu, 24 Feb 2022 07:02:14 +0000 (09:02 +0200)]
app/testpmd: fix raw encap of GENEVE option

The structure "rte_flow_item_geneve_opt" is not a protocol header of
geneve tunnel option from rfc8926. The field "data" is a pointer
which points to the actual variable-length option data. So the
structure is not packed.

There is 4 bytes hole before the pointer in a 64-bit system. The
option header is just 4 bytes. When using offsetof() to get the
fixed part's size of option header, the wrong value 8 was got. When
constructing the encap header, a wrong size and offset was used due
to this hole.

With this commit, the fixed part's size is calculated explicitly
based on all fields.

Fixes: 55c074f3ba1d ("app/testpmd: support GENEVE option item")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/i40e: fix unintentional integer overflow
Steve Yang [Fri, 25 Feb 2022 02:39:47 +0000 (02:39 +0000)]
net/i40e: fix unintentional integer overflow

Cast 1 to type uint64_t to avoid overflow.

CID 375812 (#1 of 1):
Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression 1 << 2 * i + 1
with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and
then used in a context that expects an expression of type uint64_t
(64 bits, unsigned).

Coverity issue: 375812
Fixes: 5fec01c35c49 ("net/i40e: support Linux VF to configure IRQ link list")
Cc: stable@dpdk.org
Signed-off-by: Steve Yang <stevex.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agonet/ice/base: support E824S and E825 devices
Robin Zhang [Fri, 25 Feb 2022 02:00:14 +0000 (02:00 +0000)]
net/ice/base: support E824S and E825 devices

Add support for E824S and E825 family devices.

This will be documented later in release notes since devices are not
mature yet to announce to users.

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2 years agocommon/cnxk: support CNF95xx B0 variant
Tomasz Duszynski [Thu, 24 Feb 2022 10:42:36 +0000 (11:42 +0100)]
common/cnxk: support CNF95xx B0 variant

Add CNF95xx B0 variant to the list of supported models.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: make inline inbound device usage as default
Vamsi Attunuru [Fri, 25 Feb 2022 06:54:45 +0000 (12:24 +0530)]
net/cnxk: make inline inbound device usage as default

Currently inline inbound device usage is not default for eventdev,
patch renames force_inl_dev dev arg to no_inl_dev and enables inline
inbound device by default.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: check SQ node before setting BP config
Satha Rao [Fri, 25 Feb 2022 04:59:26 +0000 (23:59 -0500)]
common/cnxk: check SQ node before setting BP config

Validate sq_node and parent before accessing their fields.
SQ was created without any associated TM node, this is valid negative
case, so return success while stopping TM without SQ node.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: enable packet marking callbacks
Satha Rao [Fri, 25 Feb 2022 04:59:25 +0000 (23:59 -0500)]
net/cnxk: enable packet marking callbacks

cnxk platform supports red/yellow packet marking based on TM
configuration. This patch set hooks to enable/disable packet
marking for VLAN DEI, IP DSCP and IP ECN. Marking enabled only
in scalar mode.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable packet marking
Satha Rao [Fri, 25 Feb 2022 04:59:24 +0000 (23:59 -0500)]
common/cnxk: enable packet marking

cnxk platforms supports packet marking when TM enabled with
valid shaper rates. VLAN DEI, IP ECN, or IP DSCP inside
packet will be updated based on mark flags selected.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support IP reassembly
Vidya Sagar Velumuri [Thu, 24 Feb 2022 18:29:01 +0000 (23:59 +0530)]
net/cnxk: support IP reassembly

Added capability and support for inline inbound IP reassembly
in cnxk driver. The IP reassembly offload is supported only
when the inline IPSec security offload is enabled.

In case of IP reassembly incomplete, the mbufs are attached
in the mbuf dynamic field and a dynamic flag is set accordingly.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: configure reassembly parameters
Vidya Sagar Velumuri [Thu, 24 Feb 2022 18:29:00 +0000 (23:59 +0530)]
common/cnxk: configure reassembly parameters

When reassembly is enabled by application, set corresponding
flags in SA during creation.

Provide ROC API to configure reassembly unit with active and
zombie limits and step size.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: align prefetches to CN10K cache model
Pavan Nikhilesh [Thu, 24 Feb 2022 16:10:12 +0000 (21:40 +0530)]
net/cnxk: align prefetches to CN10K cache model

Align prefetches for CN10K cache model for vWQE in Rx and Tx.
Move mbuf->next NULL assignment to Tx path and enabled it only
when multi segments offload is enabled to reduce L1 pressure.
Add macros to detect corrupted mbuf->next values when
MEMPOOL_DEBUG is set.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: optimize Rx packet size extraction
Pavan Nikhilesh [Thu, 24 Feb 2022 16:10:11 +0000 (21:40 +0530)]
net/cnxk: optimize Rx packet size extraction

In vWQE mode, the mbuf address is calculated without using the
IOVA list.

Packet length can also be calculated by using NIX_PARSE_S by
which we can completely eliminate reading 2nd cache line
depending on the offloads enabled.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support outbound soft expiry notification
Vamsi Attunuru [Thu, 24 Feb 2022 09:49:31 +0000 (15:19 +0530)]
net/cnxk: support outbound soft expiry notification

Add support for soft expiry notification mechanism in outbound
path by creating required number of ring buffers and a common poll
thread which polls for soft expiry events enqueued by microcode.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: extend log on model mismatch
Tomasz Duszynski [Thu, 24 Feb 2022 10:34:22 +0000 (11:34 +0100)]
common/cnxk: extend log on model mismatch

Model is uniquely identified by 4 numbers. Print them all in case
model being populated is not on a list of known models. This makes
debugging a bit easier.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: remove unused files after template rework
Nithin Dabilpuram [Thu, 24 Feb 2022 10:13:45 +0000 (15:43 +0530)]
net/cnxk: remove unused files after template rework

Remove unused files that were left over after Rx and Tx template
function rework.

Fixes: 5169508a68fa ("net/cnxk: add cn9k template Rx functions to build")
Fixes: dd8c20eee472 ("net/cnxk: add cn9k template Tx functions to build")
Fixes: be294749a12a ("net/cnxk: add cn10k template Rx functions to build")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: fix RSS RETA table update
Rakesh Kudurumalla [Thu, 24 Feb 2022 08:35:28 +0000 (14:05 +0530)]
net/cnxk: fix RSS RETA table update

RSS reta table is corrupted during rte_eth_dev_rss_reta_update().
Fix it by restoring previous table entries before updating.

Fixes: 00242a687de6 ("net/cnxk: support RETA and RSS hash")
Cc: stable@dpdk.org
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/mlx5: add header reformat HW steering action
Suanming Mou [Thu, 24 Feb 2022 13:40:51 +0000 (15:40 +0200)]
net/mlx5: add header reformat HW steering action

HW steering header reformat action can work under bulk mode. In
this case, when create the table, bulk size of header reformat
actions will be allocated in low level. Afterwards, when create
flow, just simply specify the action index in the bulk and the
encapsulation data to the action will be enough.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add indirect HW steering action
Suanming Mou [Thu, 24 Feb 2022 13:40:50 +0000 (15:40 +0200)]
net/mlx5: add indirect HW steering action

HW steering can support indirect action as well. With indirect action,
the flow can be created with more flexible shared RSS action selection.
This will can save the action template with different RSS actions.

This commit adds the flow queue operation callback for:
rte_flow_async_action_handle_create();
rte_flow_async_action_handle_destroy();
rte_flow_async_action_handle_update();

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add HW mark action
Suanming Mou [Thu, 24 Feb 2022 13:40:49 +0000 (15:40 +0200)]
net/mlx5: add HW mark action

The mark action is covered by tag action internally. While it is added
the HW will add a tag to the packet. The mark value can be set as fixed
or dynamic as the action mask indicates.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add queue and RSS HW steering action
Suanming Mou [Thu, 24 Feb 2022 13:40:48 +0000 (15:40 +0200)]
net/mlx5: add queue and RSS HW steering action

This commit adds the queue and RSS action. Similar to the jump action,
dynamic ones will be added to the action construct list.

Due to the queue and RSS action in template should not be destroyed
during port restart, the actions are created with standalone indirect
table as indirect action does. When port stops, detaches the indirect
table from action, when port starts, attaches the indirect table back
to the action.

One more change is made to accelerate the action creation. Currently
the mlx5_hrxq_get() function returns the object index instead of object
pointer. This introduced an extra converting the index to the object by
calling mlx5_ipool_get() in most of the case. And that extra converting
hurts multi-thread performance since mlx5_ipool_get() uses the global
lock inside. As the hash Rx queue object itself also contains the index,
returns the object directly will achieve better performance without the
global lock.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add flow jump action
Suanming Mou [Thu, 24 Feb 2022 13:40:47 +0000 (15:40 +0200)]
net/mlx5: add flow jump action

Jump action connects different level of flow tables and allows packet
handling in the chain of flows.

A new action construct data struct is also added in this commit to help
to handle not only the dynamic jump action but also for the other
generic dynamic actions. The actions with empty mask configuration means
dynamic action, and the dedicated action will be created with the flow
action configuration during flow creation. In that dynamic action case,
the action will be appended to the table template's action list during
table creation.
When creating the flows, traverse the action list and pick the dynamic
action configuration details from flow actions as the action construct
data struct describes, then create the dedicated dynamic actions.

This commit adds the jump action and the generic dynamic action
construct mechanism.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add flow flush
Suanming Mou [Thu, 24 Feb 2022 13:40:46 +0000 (15:40 +0200)]
net/mlx5: add flow flush

In case port is being stopped, all created flows should be flushed.
This commit adds the flow flush helper function.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add basic flow queue operation
Suanming Mou [Thu, 24 Feb 2022 13:40:45 +0000 (15:40 +0200)]
net/mlx5: add basic flow queue operation

The HW steering uses async queue-based flow rules management
mechanism. The matcher and part of the actions have been
prepared during flow table creation. Some remaining actions
will be constructed during flow creation if needed.

A flow postpone attribute bit describes if flow management
should be applied to the HW directly. An extra push function
is provided to force push all the cached flows to the HW.

Once the flow has been applied to the HW, the pull function
will be called to get the queued creation/destruction flows.

The DR rule flow memory is represented in PMD layer instead
of allocating from HW steering layer. While destroying the
flow, the flow rule memory can only be freed after the CQE
received.

The HW queue job descriptor is currently introduced to convey
the flow information and operation type between the flow
insertion/destruction in the pull function.

This commit adds the basic flow queue operation for:
rte_flow_async_create();
rte_flow_async_destroy();
rte_flow_push();
rte_flow_pull();

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add table management
Suanming Mou [Thu, 24 Feb 2022 13:40:44 +0000 (15:40 +0200)]
net/mlx5: add table management

Flow table is a group of flows with the same matching criteria
and the same actions defined for them. The table defines rules
that have the same matching fields but with different matching
values. For example, matching on 5 tuple, the table will be
(IPv4 source + IPv4 dest + s_port + d_port + next_proto)
while the values for each rule will be different.

The templates' relevant matching criteria and action instances
will be created in the table creation and saved in the table.
As table attributes indicate the supported flow number, the flow
memory will also be allocated at the same time.

This commit adds the table management functions.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add action template management
Suanming Mou [Thu, 24 Feb 2022 13:40:43 +0000 (15:40 +0200)]
net/mlx5: add action template management

The action template holds a list of action types that will be
used together on the same rule. The template's actions instances
will be created only when the template bind to the dedicated
group. And the created actions will be saved to each individual
group in order for best performance. The actions in a group will
not be shared with each other unless shared actions are specified.

This commit adds the action template management which stores the
flow action template.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add pattern template management
Suanming Mou [Thu, 24 Feb 2022 13:40:42 +0000 (15:40 +0200)]
net/mlx5: add pattern template management

The pattern template defines flows that have the same matching
fields but with different matching values.
For example, matching on 5 tuple TCP flow, the template will be
(eth(null) + IPv4(source + dest) + TCP(s_port + d_port) while
the values for each rule will be different.

Due to the pattern template can be used in different domains, the
items will only be cached in pattern template create stage, while
the template is bound to a dedicated table, the HW criteria will
be created and saved to the table. The pattern templates can be
used by multiple tables. But different tables create the same
criteria and will not share the matcher between each other in order
to have better performance.

This commit adds pattern template management.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add port flow configuration
Suanming Mou [Thu, 24 Feb 2022 13:40:41 +0000 (15:40 +0200)]
net/mlx5: add port flow configuration

The hardware steering is backend to support rte_flow_async API in
mlx5 PMD. The port configuration function creates the queues and
needed flow management resources.

The PMD layer configuration function allocates the queues' context
and per-queue job descriptor pool. The job descriptor pool size
is equal to the queue size, and the job descriptors will be popped
from pool with LIFO strategy to convey the flow information during
flow insertion/destruction. Then, while polling the queued operation
result, the flow information will be extracted from the job descriptor
and the descriptor will be pushed back to the LIFO pool.

The commit creates the flow port queues and the job descriptor pools.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: introduce hardware steering enable routine
Suanming Mou [Thu, 24 Feb 2022 13:40:40 +0000 (15:40 +0200)]
net/mlx5: introduce hardware steering enable routine

The new hardware steering engine relies on using dedicated steering WQEs
instead of writing to the low-level steering table entries directly.
In the first implementation the hardware steering engine supports the
new queue based Flow API, the existing synchronous non-queue based Flow
API is not supported.

A new dv_flow_en value 2 is added to manage mlx5 PMD steering engine:

dv_flow_en rte_flow API rte_flow_async API
------------------------------------------------
 0 support not support
 1 support not support
 2 not support support

This commit introduces the extra dv_flow_en = 2 to specify the new
flow initialize and manage operation routine.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: add HW steering low-level abstract stub
Suanming Mou [Thu, 24 Feb 2022 13:40:39 +0000 (15:40 +0200)]
net/mlx5: add HW steering low-level abstract stub

The HW steering low-level implementation will be added later in another
patch series. To avoid the linkage issues the abstract stub replacement
is provided currently.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: introduce hardware steering operation
Suanming Mou [Thu, 24 Feb 2022 13:40:38 +0000 (15:40 +0200)]
net/mlx5: introduce hardware steering operation

The Connect-X steering is a lookup hardware mechanism that accesses flow
tables, matches packets to the rules, and performs specified actions.
Historically, mlx5 PMD implements several software engines to manage
steering hardware facility:

   - FW Steering - Verbs/Direct Verbs, uses FW calls to manage flows
   - SW Steering - DevX/mlx5dv, uses WQEs to access table memory directly

However, there are still some disadvantages:

   - performance is limited, we should invoke firmware either to
     manage the entire flow, or to handle some internal steering objects

   - organizing and preparing flow infrastructure (actions, matchers,
     groups, etc.) on the flow inserting is sure to cause slow flow
     insertion

   - security, exposing the low-level steering entries directly to the
     userspace may cause security risks

A new hardware WQE based steering operation with codename "HW Steering"
is going to be introduced to get rid of the security risks. And it will
take advantage of the recently new introduced async queue-based rte_flow
APIs to prepare everything in advance to achieve high insertion rate.

In this new HW steering engine, the original SW steering rte_flow API
will not be supported in the first implementation, only the new async
queue-based flow operations is going to be supported. A new steering
mode parameter for dv_flow_en will be introduced and user will be
able to engage the new steering engine.

This commit adds the basic driver operation.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/cnxk: add SoC specific PTP timestamp read
Rakesh Kudurumalla [Thu, 24 Feb 2022 08:02:16 +0000 (13:32 +0530)]
net/cnxk: add SoC specific PTP timestamp read

Timestamp resolution for an incoming and outgoing packets
is different for CN10k and CN9K. Added SoC specific
callback to retrieve timestamp in correct format
when read by application.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: add CN10K specific xstats
Rahul Bhansali [Wed, 23 Feb 2022 12:51:04 +0000 (18:21 +0530)]
common/cnxk: add CN10K specific xstats

Add cn10k specific Rx xstats of bandwidth profile,
CPT and IPsec counters.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/mlx5: support wait on time in Tx
Viacheslav Ovsiienko [Thu, 24 Feb 2022 10:55:01 +0000 (12:55 +0200)]
net/mlx5: support wait on time in Tx

The hardware since ConnectX-7 supports waiting on
specified moment of time with new introduced wait
descriptor. A timestamp can be directly placed
into descriptor and pushed to sending queue.
Once hardware encounter the wait descriptor the
queue operation is suspended till specified moment
of time. This patch update the Tx datapath to handle
this new hardware wait capability.

PMD documentation and release notes updated accordingly.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: configure Tx queue with send on time offload
Viacheslav Ovsiienko [Thu, 24 Feb 2022 10:55:00 +0000 (12:55 +0200)]
net/mlx5: configure Tx queue with send on time offload

The wait on time configuration flag is copied to the Tx queue
structure due to performance considerations. Timestamp
mask is prepared and stored in queue structure as well.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: check send on time capability
Viacheslav Ovsiienko [Thu, 24 Feb 2022 10:54:59 +0000 (12:54 +0200)]
common/mlx5: check send on time capability

The patch provides check for send scheduling on time hardware capability.
With this capability enabled hardware is able to handle Wait WQEs
with directly specified timestamp values. No Clock Queue is needed
anymore to handle send scheduling.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agoapp/testpmd: add async indirect actions operations
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:40 +0000 (05:02 +0200)]
app/testpmd: add async indirect actions operations

Add testpmd support for the rte_flow_async_action_handle API.
Provide the command line interface for operations dequeue.
Usage example:
  flow queue 0 indirect_action 0 create action_id 9
    ingress postpone yes action rss / end
  flow queue 0 indirect_action 0 update action_id 9
    action queue index 0 / end
flow queue 0 indirect_action 0 destroy action_id 9

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoapp/testpmd: add flow queue pull operation
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:39 +0000 (05:02 +0200)]
app/testpmd: add flow queue pull operation

Add testpmd support for the rte_flow_pull API.
Provide the command line interface for pulling operations results.
Usage example: flow pull 0 queue 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoapp/testpmd: add flow queue push operation
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:38 +0000 (05:02 +0200)]
app/testpmd: add flow queue push operation

Add testpmd support for the rte_flow_push API.
Provide the command line interface for pushing operations.
Usage example: flow queue 0 push 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoapp/testpmd: add async flow create/destroy operations
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:37 +0000 (05:02 +0200)]
app/testpmd: add async flow create/destroy operations

Add testpmd support for the rte_flow_q_create/rte_flow_q_destroy API.
Provide the command line interface for enqueueing flow
creation/destruction operations. Usage example:
  testpmd> flow queue 0 create 0 postpone no
           template_table 6 pattern_template 0 actions_template 0
           pattern eth dst is 00:16:3e:31:15:c3 / end actions drop / end
  testpmd> flow queue 0 destroy 0 postpone yes rule 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoapp/testpmd: add flow table management
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:36 +0000 (05:02 +0200)]
app/testpmd: add flow table management

Add testpmd support for the rte_flow_table API.
Provide the command line interface for the flow
table creation/destruction. Usage example:
  testpmd> flow template_table 0 create table_id 6
    group 9 priority 4 ingress mode 1
    rules_number 64 pattern_template 2 actions_template 4
  testpmd> flow template_table 0 destroy table 6

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoapp/testpmd: add flow template management
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:35 +0000 (05:02 +0200)]
app/testpmd: add flow template management

Add testpmd support for the rte_flow_pattern_template and
rte_flow_actions_template APIs. Provide the command line interface
for the template creation/destruction. Usage example:
  testpmd> flow pattern_template 0 create pattern_template_id 2
           template eth dst is 00:16:3e:31:15:c3 / end
  testpmd> flow actions_template 0 create actions_template_id 4
           template drop / end mask drop / end
  testpmd> flow actions_template 0 destroy actions_template 4
  testpmd> flow pattern_template 0 destroy pattern_template 2

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoapp/testpmd: add flow engine configuration
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:34 +0000 (05:02 +0200)]
app/testpmd: add flow engine configuration

Add testpmd support for the rte_flow_configure API.
Provide the command line interface for the Flow management.
Usage example: flow configure 0 queues_number 8 queues_size 256

Implement rte_flow_info_get API to get available resources:
Usage example: flow info 0

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
2 years agoethdev: bring in async indirect actions operations
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:33 +0000 (05:02 +0200)]
ethdev: bring in async indirect actions operations

Queue-based flow rules management mechanism is suitable
not only for flow rules creation/destruction, but also
for speeding up other types of Flow API management.
Indirect action object operations may be executed
asynchronously as well. Provide async versions for all
indirect action operations, namely:
rte_flow_async_action_handle_create,
rte_flow_async_action_handle_destroy and
rte_flow_async_action_handle_update.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: bring in async queue-based flow rules operations
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:32 +0000 (05:02 +0200)]
ethdev: bring in async queue-based flow rules operations

A new, faster, queue-based flow rules management mechanism is needed for
applications offloading rules inside the datapath. This asynchronous
and lockless mechanism frees the CPU for further packet processing and
reduces the performance impact of the flow rules creation/destruction
on the datapath. Note that queues are not thread-safe and the queue
should be accessed from the same thread for all queue operations.
It is the responsibility of the app to sync the queue functions in case
of multi-threaded access to the same queue.

The rte_flow_async_create() function enqueues a flow creation to the
requested queue. It benefits from already configured resources and sets
unique values on top of item and action templates. A flow rule is enqueued
on the specified flow queue and offloaded asynchronously to the hardware.
The function returns immediately to spare CPU for further packet
processing. The application must invoke the rte_flow_pull() function
to complete the flow rule operation offloading, to clear the queue, and to
receive the operation status. The rte_flow_async_destroy() function
enqueues a flow destruction to the requested queue.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: add flow item/action templates
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:31 +0000 (05:02 +0200)]
ethdev: add flow item/action templates

Treating every single flow rule as a completely independent and separate
entity negatively impacts the flow rules insertion rate. Oftentimes in an
application, many flow rules share a common structure (the same item mask
and/or action list) so they can be grouped and classified together.
This knowledge may be used as a source of optimization by a PMD/HW.

The pattern template defines common matching fields (the item mask) without
values. The actions template holds a list of action types that will be used
together in the same rule. The specific values for items and actions will
be given only during the rule creation.

A table combines pattern and actions templates along with shared flow rule
attributes (group ID, priority and traffic direction). This way a PMD/HW
can prepare all the resources needed for efficient flow rules creation in
the datapath. To avoid any hiccups due to memory reallocation, the maximum
number of flow rules is defined at the table creation time.

The flow rule creation is done by selecting a table, a pattern template
and an actions template (which are bound to the table), and setting unique
values for the items and actions.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agoethdev: introduce flow engine configuration
Alexander Kozyrev [Wed, 23 Feb 2022 03:02:30 +0000 (05:02 +0200)]
ethdev: introduce flow engine configuration

The flow rules creation/destruction at a large scale incurs a performance
penalty and may negatively impact the packet processing when used
as part of the datapath logic. This is mainly because software/hardware
resources are allocated and prepared during the flow rule creation.

In order to optimize the insertion rate, PMD may use some hints provided
by the application at the initialization phase. The rte_flow_configure()
function allows to pre-allocate all the needed resources beforehand.
These resources can be used at a later stage without costly allocations.
Every PMD may use only the subset of hints and ignore unused ones or
fail in case the requested configuration is not supported.

The rte_flow_info_get() is available to retrieve the information about
supported pre-configurable resources. Both these functions must be called
before any other usage of the flow API engine.

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2 years agonet/cnxk: fix build with GCC 12
Rakesh Kudurumalla [Wed, 23 Feb 2022 09:55:40 +0000 (15:25 +0530)]
net/cnxk: fix build with GCC 12

Resolve following compilation error with gcc 12 version.
error: storing the address of local variable message in *error.message

Fixes: 26b034f78ca7 ("net/cnxk: support to validate meter policy")
Cc: stable@dpdk.org
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add option to override outbound inline SA IV
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:11 +0000 (01:05 +0530)]
net/cnxk: add option to override outbound inline SA IV

Add option to override outbound inline SA IV for debug
purposes via environment variable. User can set env variable as:
export CN10K_ETH_SEC_IV_OVR="0x0, 0x0,..."

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add devargs for min-max SPI
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:10 +0000 (01:05 +0530)]
net/cnxk: add devargs for min-max SPI

Add support for inline inbound SPI range via devargs
instead of just max SPI value and range being 0..max.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: enable flow control by default on device configure
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:09 +0000 (01:05 +0530)]
net/cnxk: enable flow control by default on device configure

Enable flow control by default on device configuration
instead of basing it on Kernel behaviour.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: enable packet pool tail drop
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:08 +0000 (01:05 +0530)]
net/cnxk: enable packet pool tail drop

Enable packet pool tail drop on RQ when inbound security is not
enabled. This is only part of the configuration. It is a NOP if
tail drop is not enabled on NPA_AURA_CTX_S. And tail drop
on packet pool AURA is enabled only when that packet pool aura
is used by inline device RQ.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: use NPA batch burst free for meta buffers
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:07 +0000 (01:05 +0530)]
net/cnxk: use NPA batch burst free for meta buffers

Currently meta buffers are freed in bursts of one LMT line
i.e 15 pointers. Instead free them in bursts of 16 LMTlines
which is 240 ptrs for better perf.

Also mark mempool objects as get and put in missing places.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: fix inline IPsec security error handling
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:06 +0000 (01:05 +0530)]
net/cnxk: fix inline IPsec security error handling

Use raw mbuf free on inline security error to simulate
HW NPA free instead of doing rte_pktmbuf_free(). This
is needed as the callback will not be called from
DPDK lcore.

Fixes: 69daa9e5022b ("net/cnxk: support inline security setup for cn10k")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: realloc inline dev XAQ for security
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:05 +0000 (01:05 +0530)]
net/cnxk: realloc inline dev XAQ for security

Realloc inline dev XAQ when Rx/Tx security ie enabled with
new packet pool as XAQ should be large enough to hold all
mbufs if inline outbound reports error or all mbufs.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: register callback early to handle initial packets
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:04 +0000 (01:05 +0530)]
net/cnxk: register callback early to handle initial packets

Register callback early to handle initial error packets from
inline device.

Fixes: 69daa9e5022b ("net/cnxk: support inline security setup for cn10k")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: fix inline device RQ tag mask
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:03 +0000 (01:05 +0530)]
net/cnxk: fix inline device RQ tag mask

Fix inline device RQ  tagmask to get packets with receive errors
as type ETHDEV packets to callback handler so that packet buffers
can get freed. Currently only IPsec denied packets get the right
tag mask.

Fixes: ee48f711f3b0 ("common/cnxk: support NIX inline inbound and outbound setup")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: remove tracking of mark actions
Satha Rao [Tue, 22 Feb 2022 19:35:02 +0000 (01:05 +0530)]
common/cnxk: remove tracking of mark actions

Removed roc NPC APIs which tracks addition and deletion of
mark actions. It was earlier needed to track number of mark
actions added as part of flow rules. If mark actions count
is > 0, then the function pointer for Rx would get updated
to even read mark value from CQE/WQE and populate in mbuf.
Now the same switch is done based on new Rx meta data negotiate
ethdev API.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: add Rx metadata negotiate operation
Satha Rao [Tue, 22 Feb 2022 19:35:01 +0000 (01:05 +0530)]
net/cnxk: add Rx metadata negotiate operation

Added rx_metadata_negotiate API to enable mark update RX offload.
Removed software logic to enable/disable mark update inside flow
create/destroy APIs.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: allow force use of SSO device for outb inline
Nithin Dabilpuram [Tue, 22 Feb 2022 19:35:00 +0000 (01:05 +0530)]
common/cnxk: allow force use of SSO device for outb inline

Allow force use of SSO device even when inline dev is available
so that in case driver needs events directly delivered to
event device.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: use SSO time counter threshold for IRQ
Nithin Dabilpuram [Tue, 22 Feb 2022 19:34:59 +0000 (01:04 +0530)]
common/cnxk: use SSO time counter threshold for IRQ

Enable time counter based threshold for raising SSO
EXE_INT instead of IAQ threshold. Time counter based
threshold helps getting periodic interrupts and process
pkts in burst instead of getting HW to raise an interrupt
for every new work.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support enabling AURA tail drop for RQ
Nithin Dabilpuram [Tue, 22 Feb 2022 19:34:58 +0000 (01:04 +0530)]
common/cnxk: support enabling AURA tail drop for RQ

Add support to enable AURA tail drop via RQ specifically
for inline device RQ's pkt pool. This is better than RQ
RED drop as it can be applied to all RQ's that are not
having security enabled but using same packet pool.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: enable L3 header write back in SA
Vidya Sagar Velumuri [Tue, 22 Feb 2022 19:34:57 +0000 (01:04 +0530)]
common/cnxk: enable L3 header write back in SA

Enable the field in SA to write back L2, L3 headers in case
of errors during inline processing.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: use common SA init API for default options
Vidya Sagar Velumuri [Tue, 22 Feb 2022 19:34:56 +0000 (01:04 +0530)]
common/cnxk: use common SA init API for default options

Use common SA init API before doing initialization based on
params. This is better so that all HW specific default values
are at single place for lookaside and inline.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support inline device API without ROC NIX
Vidya Sagar Velumuri [Tue, 22 Feb 2022 19:34:55 +0000 (01:04 +0530)]
common/cnxk: support inline device API without ROC NIX

Update the inline device functions to work when roc_nix is NULL.
This is required, as IPsec driver have to use these APIs to work
with inline IPsec device, but the IPsec driver might not have roc_nix
information.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: adjust shaper rates to lower boundaries
Satha Rao [Tue, 22 Feb 2022 19:34:54 +0000 (01:04 +0530)]
common/cnxk: adjust shaper rates to lower boundaries

Provide a method to get floor values for a requested shaper rate,
which can assure packets should never be transmitted at a rate higher
than configured.

Keep the old API to get HW suggested values.
And introduce new parameter to select appropriate API.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: realloc inline device XAQ AURA
Nithin Dabilpuram [Tue, 22 Feb 2022 19:34:53 +0000 (01:04 +0530)]
common/cnxk: realloc inline device XAQ AURA

Add support to realloc inline device XAQ AURA with more
buffers of new packet pool AURA.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: increase SMQ resource count
Satha Rao [Tue, 22 Feb 2022 19:34:52 +0000 (01:04 +0530)]
common/cnxk: increase SMQ resource count

CN10K supports up to 832 resources at SMQ level, so increase
bitmap count to 1024.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agonet/cnxk: support priority flow control
Sunil Kumar Kori [Tue, 22 Feb 2022 10:37:50 +0000 (16:07 +0530)]
net/cnxk: support priority flow control

Adds support for priority flow control support for CNXK
platforms.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/cnxk: support priority flow control
Sunil Kumar Kori [Tue, 22 Feb 2022 10:37:49 +0000 (16:07 +0530)]
common/cnxk: support priority flow control

CNXK platforms support priority flow control(802.1qbb) to pause
respective traffic per class on that link.

Adds RoC interface to configure priority flow control on MAC
block i.e. CGX on cn9k and RPM on cn10k.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agomempool/cnxk: fix batch allocation failure path
Ashwin Sekhar T K [Fri, 18 Feb 2022 07:27:12 +0000 (12:57 +0530)]
mempool/cnxk: fix batch allocation failure path

Fix bug in batch alloc issue failure path where it was
enqueuing invalid pointers back to the pool. The code
should rightly be falling back to default dequeue path
in such cases.

Fixes: 91531e63f43b ("mempool/cnxk: add cn10k batch dequeue")
Cc: stable@dpdk.org
Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2 years agocommon/mlx5: update doorbell mapping parameter name
Michael Baum [Wed, 23 Feb 2022 13:48:34 +0000 (15:48 +0200)]
common/mlx5: update doorbell mapping parameter name

The "tx_db_nc" devarg forces doorbell register mapping to non-cached
region eliminating the extra write memory barrier. This argument was
used in creating the UAR for Tx and thus affected its performance.

Recently [1] its use has been extended to all UAR creation in all mlx5
drivers, and now its name is no longer so accurate.

This patch changes its name to "sq_db_nc" to suit any send queue that
uses it. The old name will still work for backward compatibility.

[1] commit 5dfa003db53f ("common/mlx5: fix post doorbell barrier")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: add shared guide for mlx5 drivers
Michael Baum [Wed, 23 Feb 2022 13:48:33 +0000 (15:48 +0200)]
doc: add shared guide for mlx5 drivers

Adds new documentation for MLX5 common driver that contains:
 - Its features list (doesn't exist for now).
 - Its devargs description.
 - Device configuration information and tutorial.
 - Quick Start Guide for Mellanox OFED/EN.

Move into this doc all shared information from other MLX5 PMD docs and
add them reference to new common doc.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: correct name of BlueField-2 in mlx5 guide
Michael Baum [Wed, 23 Feb 2022 13:48:32 +0000 (15:48 +0200)]
doc: correct name of BlueField-2 in mlx5 guide

Update "BlueField 2" -> "BlueField-2" in mlx5 docs.

Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: replace broken links in mlx guides
Michael Baum [Wed, 23 Feb 2022 13:48:31 +0000 (15:48 +0200)]
doc: replace broken links in mlx guides

Update links in both mlx4 and mlx5 doc.

Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agodoc: remove obsolete vector Tx explanations from mlx5 guide
Michael Baum [Wed, 23 Feb 2022 13:48:30 +0000 (15:48 +0200)]
doc: remove obsolete vector Tx explanations from mlx5 guide

Vectorized routines were removed in result of Tx datapath refactoring,
and devarg keys documentation was updated.

However, more updating should have been done. In environment variables
doc, there was explanation according to vectorized Tx which isn't
relevant anymore.

This patch removes this irrelevant explanation.

Fixes: a6bd4911ad93 ("net/mlx5: remove Tx implementation")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix E-Switch manager vport ID
Shun Hao [Tue, 22 Feb 2022 15:07:16 +0000 (17:07 +0200)]
net/mlx5: fix E-Switch manager vport ID

One of the E-Switch vports plays the special role - it is assigned as
"E-Switch manager" and has some special exclusive rights and duties - it
maintains all the representors, manages FDB domain flows, etc. By
default, the E-Switch vport index was supposed to be zero on standalone
NICs (regular ConnectX) and 0xFFFE SmartNIC (BlueField), but that was
not always correct - this index can be assigned with any value by
kernel/hypervisor.

Currently the E-Switch manager vport id is supposed to be default - 0
for standalone NICs, and 0xFFFE for the SmartNICs, and is deduced from
the device PCI id.

To handle this and do not suggest any default values, can use DevX API
to query E-Switch manager vport ID directly from the firmware during
initialization, and use that value by default. If the new method is not
provided (legacy firmware), fallback to use the PCI id approach.

Fixes: a564038699f9 ("net/mlx5: support E-Switch manager egress traffic match")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: optimize Rx queue creation
Michael Baum [Mon, 14 Feb 2022 09:00:10 +0000 (11:00 +0200)]
net/mlx5: optimize Rx queue creation

Recently shared RxQ has been introduced. All shared Rx queues with same
group and queue ID share the same rxq_ctrl, but each one has
mlx5_rxq_priv structure.
The mlx5_rx_queue_setup generates a new rxq_priv structure, and looks
for a rxq_ctrl structure to refer to. If there is already a compatible
rxq_ctrl structure it refers it, otherwise it calls the mlx5_rxq_new
function that generates a new one.

This patch makes mlx5_rxq_new function "standalone", it generates a
rxq_ctrl structure regardless to specific rxq_priv structure. All
operations on the rxq_ctrl structure that depend on the new rxq_priv
structure are performed in the mlx5_rx_queue_setup function, at the same
place for either a new rxq_ctrl structure or an existing rxq_ctrl
structure.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix entry in shared Rx queues list
Michael Baum [Mon, 14 Feb 2022 09:00:09 +0000 (11:00 +0200)]
net/mlx5: fix entry in shared Rx queues list

The mlx5_rxq_new function creates control structure and if it from
shared group, it is inserted into the shared RXQs list.

After that, there are some validations which in case they fail, RxQ
control object is released.
In these cases, invalid pointer to the object still in the list, and
access it may cause a crash.

Move the list insertion to the end of the function where the RxQ control
object is surely valid.

Fixes: 09c2555303be ("net/mlx5: support shared Rx queue")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: refactor getting counter action pointer
Haifei Luo [Mon, 21 Feb 2022 08:27:21 +0000 (10:27 +0200)]
net/mlx5: refactor getting counter action pointer

Previously API flow_dv_query_count_ptr is defined to get counter's
action pointer. This DV function is directly called and the better
way is by the callback.

Add one arg in API mlx5_counter_query and the related callback
counter_query. The added arg is for counter's action pointer.

Signed-off-by: Haifei Luo <haifeil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: fix meter sub-policy creation
Shun Hao [Fri, 18 Feb 2022 07:43:08 +0000 (09:43 +0200)]
net/mlx5: fix meter sub-policy creation

If meter policy action was RSS, the correct items were not provided
for sub-policy creation.

This fixes the issue by providing original items in meter split, so
the sub-policy creation gets the correct items.

Fixes: 3c481324baf3 ("net/mlx5: fix meter flow direction check")
Cc: stable@dpdk.org
Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: remove unused function
Suanming Mou [Tue, 15 Feb 2022 09:46:23 +0000 (11:46 +0200)]
net/mlx5: remove unused function

The mlx5_l3t_prepare_entry() function is not used anymore.
This commit removes the unused mlx5_l3t_prepare_entry() function.

Fixes: 92ef4b8f1688 ("ethdev: remove deprecated shared counter attribute")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agonet/mlx5: set flow error for hash list create
Suanming Mou [Tue, 15 Feb 2022 10:10:52 +0000 (12:10 +0200)]
net/mlx5: set flow error for hash list create

While mlx5_hlist_create() failed, the rte_flow_error was not filled
with the corresponding error information.

This commit adds the missing rte_flow_error_set() for the failure case.

Fixes: f3020a331dca ("net/mlx5: optimize hash list table allocate on demand")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2 years agocommon/mlx5: fix queue pair ack timeout configuration
Yajun Wu [Mon, 14 Feb 2022 06:03:19 +0000 (08:03 +0200)]
common/mlx5: fix queue pair ack timeout configuration

VDPA driver creates two QPs(1 queue pair include 1 send queue
and 1 receive queue) per virtio queue to get traffic events
from NIC to SW.
Two QPs(called FW QP and SW QP) are created as loopback QP
and FW QP'SQ is connected to SW QP'RQ internally.

When packet receive or send out, HW will send WQE by FW QP'SQ,
then SW will get CQE from the CQ of SW QP.

With large scale and heavy traffic, the SQ's request may fail
to get ACK from RQ HW, because HW is busy.
SQ will retry the request with qpc.retry_count times and each time
wait for 4.096 uS *2^(ack_timeout) for the response. If still can’t
get RQ’s HW response, SQ will go to an error state.

16 is experienced value. It should not be too high or too low.
Too high will make QP waits too long in case it’s packet drop.
Too low will cause QP to go to an error state(retry-exceeded) easily.

Fixes: 15c3807e86ab ("common/mlx5: support DevX QP operations")
Cc: stable@dpdk.org
Signed-off-by: Yajun Wu <yajunw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2 years agonet/ena: update version to 2.6.0
Michal Krawczyk [Wed, 23 Feb 2022 12:19:44 +0000 (13:19 +0100)]
net/ena: update version to 2.6.0

This release contains multiple bug fixes and improvements, including
  - Removal of the linearization function from the xmit Tx path. The
    DPDK assumes checking for the mbuf segments number in the Tx prepare
    function.
  - Extra logs, statistics, checks...
  - Cleanup of the unused variables and definitions.
  - Configurable Link Status event.
  - Improvements for the timer service and the reset.
  - Usage of the optimized memcpy on ARM.
  - MP awareness improvements - extra API support for the secondary
    processes (like reading basic statistics).
  - Support of the xstats API to get xstat names by ID.
  - Configurable Tx completions timeout.
  - Proper setting of the meta-descriptor's DF flag.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
2 years agonet/ena: fix checksum flag for L4
Michal Krawczyk [Wed, 23 Feb 2022 12:19:43 +0000 (13:19 +0100)]
net/ena: fix checksum flag for L4

Some HW may invalidly set checksum error bit for the valid L4 checksum.
To avoid drop of the packets in that situation, do not indicate bad
checksum for L4 Rx csum offloads. Instead, set it as unknown, so the
application will re-verify this value.

The statistics counters will still work as previously.

Fixes: 05817057faba ("net/ena: fix indication of bad L4 Rx checksums")
Cc: stable@dpdk.org
Signed-off-by: Michal Krawczyk <mk@semihalf.com>