dpdk.git
5 years agoapp/testpmd: add VXLAN-GPE
Qiming Yang [Fri, 5 Apr 2019 09:05:34 +0000 (17:05 +0800)]
app/testpmd: add VXLAN-GPE

This patch added new item "vxlan-gpe" to tunnel_type to
support new VXLAN-GPE packet type, and its classification.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/i40e: support VXLAN-GPE classification
Qiming Yang [Fri, 5 Apr 2019 09:05:33 +0000 (17:05 +0800)]
net/i40e: support VXLAN-GPE classification

Added VXLAN-GPE tunnel filter, supported filter to queue.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: support VXLAN-GPE
Qiming Yang [Fri, 5 Apr 2019 09:05:32 +0000 (17:05 +0800)]
net/i40e: support VXLAN-GPE

Add new protocol type VXLAN-GPE support for UDP tunnel.
inner IP/TCP/UDP checksum and RSS configuration shared
the same implementation of VXLAN.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agoethdev: add VXLAN-GPE tunnel type
Qiming Yang [Fri, 5 Apr 2019 09:05:31 +0000 (17:05 +0800)]
ethdev: add VXLAN-GPE tunnel type

This patch added VXLAN-GPE macro in rte_eth_tunnel_type.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ixgbevf: remove MTU setting limitation
David Harton [Wed, 3 Apr 2019 01:18:33 +0000 (21:18 -0400)]
net/ixgbevf: remove MTU setting limitation

Currently, if requested MTU is bigger than mbuf size and scattered
receive is not enabled, setting MTU to that value fails.

This patch allows setting this special MTU when device is stopped,
because scattered_rx will be re-configured during next port start
and driver may enable scattered receive according new MTU value.

After this patch, driver may select different receive function
automatically after MTU set, according MTU values selected.

Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/ice: send driver version to firmware
Qi Zhang [Fri, 29 Mar 2019 01:29:53 +0000 (09:29 +0800)]
net/ice: send driver version to firmware

The driver must send its version information to the firmware, so
the firmware knows the driver is up. Otherwise, it will cause unexpected
OS package downloading when multiple driver instances running on the
same device.

Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ixgbe: enable 10Mb/s link setup for X553
Wei Zhao [Mon, 1 Apr 2019 06:25:05 +0000 (14:25 +0800)]
net/ixgbe: enable 10Mb/s link setup for X553

This patch enable 10Mb/s link for ixgbe X553.
This new device has own device id of 0x15E4 and 0x15E5, so
ixgbe PMD driver need to special check when setup link for
these two types of device.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx5: share Direct Rules/Verbs flow related structures
Viacheslav Ovsiienko [Thu, 4 Apr 2019 13:04:25 +0000 (13:04 +0000)]
net/mlx5: share Direct Rules/Verbs flow related structures

Direct Rules/Verbs related structures are moved to
the shared context:
  - rx/tx namespaces, shared by master and representors
  - rx/tx flow tables
  - matchers
  - encap/decap action resources
  - flow tags (MARK actions)
  - modify action resources
  - jump tables

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add Direct Rules flow data alloc/free routines
Viacheslav Ovsiienko [Thu, 4 Apr 2019 13:04:24 +0000 (13:04 +0000)]
net/mlx5: add Direct Rules flow data alloc/free routines

We are going to share the Direct Rules and Direct Verbs flow
device data structures between master and representors in the
E-Switch configurations over multiport IB device.

The code of initializing and destroying these data is
moved to dedicated routines, this is just a preparation
step for actual data sharing.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/softnic: fix unchecked return value
Jasvinder Singh [Thu, 4 Apr 2019 15:45:42 +0000 (16:45 +0100)]
net/softnic: fix unchecked return value

Fix unchecked return value issue reported by Coverity.

Coverity issue: 336852
Fixes: a958a5c07f4b ("net/softnic: support service cores")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agonet: fix Tx VLAN flag for offload emulation
Bill Hong [Mon, 25 Mar 2019 15:05:41 +0000 (11:05 -0400)]
net: fix Tx VLAN flag for offload emulation

A PMD might use rte_vlan_insert to implement Tx VLAN offload. Typically
the PMD will insert the VLAN header in the transmit path and then
attempt to send the packets. If this fails, the packets are returned to
the application which may attempt to send these packets again. If the
PKT_TX_VLAN flag is not cleared, the transmit path may attempt to insert
the VLAN header again.

Fixes: 47aa48b969f8 ("net: fix stripped VLAN flag for offload emulation")
Cc: stable@dpdk.org
Signed-off-by: Bill Hong <bhong@brocade.com>
Signed-off-by: Chas Williams <chas3@att.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/af_xdp: introduce AF_XDP PMD
Xiaolong Ye [Thu, 4 Apr 2019 08:51:13 +0000 (16:51 +0800)]
net/af_xdp: introduce AF_XDP PMD

Add a new PMD driver for AF_XDP which is a proposed faster version of
AF_PACKET interface in Linux. More info about AF_XDP, please refer to [1]
[2].

This is the vanilla version PMD which just uses a raw buffer registered as
the umem.

[1] https://fosdem.org/2018/schedule/event/af_xdp/
[2] https://lwn.net/Articles/745934/

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agonet/mlx5: support jump action
Ori Kam [Thu, 4 Apr 2019 09:54:08 +0000 (09:54 +0000)]
net/mlx5: support jump action

When using Direct Rules we can add actions to jump between tables.
This is extra useful since rule insertion rate is much higher on other
tables compared to table zero.

If no group is selected the rule is added to group 0.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add Direct Rules API
Ori Kam [Thu, 4 Apr 2019 09:54:07 +0000 (09:54 +0000)]
net/mlx5: add Direct Rules API

Adds calls to the Direct Rules API inside the glue functions.
Due to difference in parameters between the Direct Rules and Direct
Verbs some of the glue functions API was updated.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: prepare Direct Verbs for Direct Rule
Ori Kam [Thu, 4 Apr 2019 09:54:06 +0000 (09:54 +0000)]
net/mlx5: prepare Direct Verbs for Direct Rule

This is the first patch of a series that is designed to enable the
Direct Rules API.

The main difference between Direct Verbs and Direct Rules from API
perspective is that in Direct Rules each action has it's own create
function and the object itself is of type void.

In this patch I'm adding functions to generate actions that currently
are done without create action, and I'm changing the action type to be
void *, so in next patches only the glue functions will need to change.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/sfc: support tunnel TSO on EF10 native Tx datapath
Ivan Malov [Tue, 2 Apr 2019 09:28:44 +0000 (10:28 +0100)]
net/sfc: support tunnel TSO on EF10 native Tx datapath

Handle VXLAN and GENEVE TSO on EF10 native Tx datapath.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: improve log about missing HW TSO support
Ivan Malov [Tue, 2 Apr 2019 09:28:43 +0000 (10:28 +0100)]
net/sfc: improve log about missing HW TSO support

Said message cannot be considered as warning since
the PMD anyway reports available offload capabilities
by means of device info interface. Make this log
message informational and improve its formatting
by placing the text itself on the same line.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: factor out function to get IPv4 packet ID for TSO
Ivan Malov [Tue, 2 Apr 2019 09:28:42 +0000 (10:28 +0100)]
net/sfc: factor out function to get IPv4 packet ID for TSO

As a result, code duplication will be avoided in the current
TSO implementations (EFX and EF10 native). The future patch to
add support for tunnel TSO will also reuse the new function.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: add TSO header length check to Tx prepare
Igor Romanov [Tue, 2 Apr 2019 09:28:41 +0000 (10:28 +0100)]
net/sfc: add TSO header length check to Tx prepare

Make Tx prepare function able to detect packets with invalid header
size when header linearization is required.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: introduce descriptor space check in Tx prepare
Igor Romanov [Tue, 2 Apr 2019 09:28:40 +0000 (10:28 +0100)]
net/sfc: introduce descriptor space check in Tx prepare

Add descriptor space check to Tx prepare function to inform a caller
that a packet that needs more than maximum Tx descriptors of a queue
can not be sent.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: move TSO header checks from Tx burst to Tx prepare
Igor Romanov [Tue, 2 Apr 2019 09:28:39 +0000 (10:28 +0100)]
net/sfc: move TSO header checks from Tx burst to Tx prepare

Tx offloads checks should be done in Tx prepare.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Tx preparation in EF10 simple datapath
Igor Romanov [Tue, 2 Apr 2019 09:28:38 +0000 (10:28 +0100)]
net/sfc: support Tx preparation in EF10 simple datapath

Implement tx_prepare callback. The implementation checks for anything
only in RTE debug mode. No checks are done otherwise because EF10
simple datapath ignores Tx offloads.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Tx preparation in EF10 datapath
Igor Romanov [Tue, 2 Apr 2019 09:28:37 +0000 (10:28 +0100)]
net/sfc: support Tx preparation in EF10 datapath

Implement tx_prepare callback and update Tx burst function accordingly.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: support Tx preparation in EFX datapath
Igor Romanov [Tue, 2 Apr 2019 09:28:36 +0000 (10:28 +0100)]
net/sfc: support Tx preparation in EFX datapath

Implement generic checks in Tx prepare function and update Tx burst
function accordingly.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: make TSO descriptor numbers EF10-specific
Igor Romanov [Tue, 2 Apr 2019 09:28:35 +0000 (10:28 +0100)]
net/sfc: make TSO descriptor numbers EF10-specific

Numbers of extra descriptors required for TSO are EF10-specific
in fact. Highlight it in define names.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: improve TSO header length check in EF10 datapath
Igor Romanov [Tue, 2 Apr 2019 09:28:34 +0000 (10:28 +0100)]
net/sfc: improve TSO header length check in EF10 datapath

Move the check inside xmit function to the branch in which
the check is mandatory. It makes case when TSO header is not
fragmented a bit more faster.

Fixes: 6bc985e41155 ("net/sfc: support TSO in EF10 Tx datapath")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: improve TSO header length check in EFX datapath
Igor Romanov [Tue, 2 Apr 2019 09:28:33 +0000 (10:28 +0100)]
net/sfc: improve TSO header length check in EFX datapath

Move the check inside xmit function to the branch in which
the check is mandatory. It makes case when TSO header is not
fragmented a bit more faster.

Fixes: fec33d5bb3eb ("net/sfc: support firmware-assisted TSO")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/mlx5: fix flow counters using devx
Ori Kam [Tue, 2 Apr 2019 07:04:06 +0000 (07:04 +0000)]
net/mlx5: fix flow counters using devx

The API that was defined in OFED 4.5 was replaced both in OFED 4.6 and
in upstream.

This commit updates the API to match the upstream one.

Fixes: f5bf91de738a ("net/mlx5: support flow counters using devx")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agoapp/testpmd: use port sibling iterator in device cleanup
Thomas Monjalon [Mon, 1 Apr 2019 02:27:00 +0000 (04:27 +0200)]
app/testpmd: use port sibling iterator in device cleanup

When removing a rte_device on a port-based request,
all the sibling ports must be marked as closed.
The iterator loop can be simplified by using the dedicated macro.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agonet/mlx5: use port sibling iterators
Thomas Monjalon [Mon, 1 Apr 2019 02:26:59 +0000 (04:26 +0200)]
net/mlx5: use port sibling iterators

Iterating over siblings was done with RTE_ETH_FOREACH_DEV()
which skips the owned ports.
The new iterators RTE_ETH_FOREACH_DEV_SIBLING()
and RTE_ETH_FOREACH_DEV_OF() are more appropriate and more correct.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agoethdev: add siblings iterators
Thomas Monjalon [Mon, 1 Apr 2019 02:26:58 +0000 (04:26 +0200)]
ethdev: add siblings iterators

If multiple ports share the same hardware device (rte_device),
they are siblings and can be found thanks to the new functions
and loop macros.
One iterator takes a port id as reference,
while the other one directly refers to the parent device.

The ownership is not checked because siblings may have
different owners.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agoethdev: simplify port state comparisons
Thomas Monjalon [Mon, 1 Apr 2019 02:26:57 +0000 (04:26 +0200)]
ethdev: simplify port state comparisons

There are three states for an ethdev port.
Checking that the port is unused looks simpler than
checking it is neither attached nor removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
5 years agonet/mlx4: enable secondary process to register DMA memory
Yongseok Koh [Mon, 1 Apr 2019 21:17:57 +0000 (14:17 -0700)]
net/mlx4: enable secondary process to register DMA memory

The Memory Region (MR) for DMA memory can't be created from secondary
process due to lib/driver limitation. Whenever it is needed, secondary
process can make a request to primary process through the EAL IPC
channel (rte_mp_msg) which is established on initialization. Once a MR
is created by primary process, it is immediately visible to secondary
process because the MR list is global per a device. Thus, secondary
process can look up the list after the request is successfully returned.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: add control of excessive memory pinning by kernel
Yongseok Koh [Mon, 1 Apr 2019 21:17:56 +0000 (14:17 -0700)]
net/mlx4: add control of excessive memory pinning by kernel

A new PMD parameter (mr_ext_memseg_en) is added to control extension of
memseg when creating a MR. It is enabled by default.

If enabled, mlx4_mr_create() tries to maximize the range of MR
registration so that the LKey lookup tables on datapath become smalle
and get the best performance. However, it may worsen memory utilization
because registered memory is pinned by kernel driver. Even if a page in
the extended chunk is freed, that doesn't become reusable until the
entire memory is freed and the MR is destroyed.

To make freed pages available immediately, this parameter has to be
turned off but it could drop performance.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: enable secondary process to register DMA memory
Yongseok Koh [Mon, 1 Apr 2019 21:17:55 +0000 (14:17 -0700)]
net/mlx5: enable secondary process to register DMA memory

The Memory Region (MR) for DMA memory can't be created from secondary
process due to lib/driver limitation. Whenever it is needed, secondary
process can make a request to primary process through the EAL IPC
channel (rte_mp_msg) which is established on initialization. Once a MR
is created by primary process, it is immediately visible to secondary
process because the MR list is global per a device. Thus, secondary
process can look up the list after the request is successfully returned.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add control of excessive memory pinning by kernel
Yongseok Koh [Mon, 1 Apr 2019 21:17:54 +0000 (14:17 -0700)]
net/mlx5: add control of excessive memory pinning by kernel

A new PMD parameter (mr_ext_memseg_en) is added to control extension of
memseg when creating a MR. It is enabled by default.

If enabled, mlx5_mr_create() tries to maximize the range of MR
registration so that the LKey lookup tables on datapath become smaller
and get the best performance. However, it may worsen memory utilization
because registered memory is pinned by kernel driver. Even if a page in
the extended chunk is freed, that doesn't become reusable until the
entire memory is freed and the MR is destroyed.

To make freed pages available immediately, this parameter has to be
turned off but it could drop performance.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix external memory registration
Yongseok Koh [Mon, 1 Apr 2019 21:17:53 +0000 (14:17 -0700)]
net/mlx5: fix external memory registration

Secondary process is not allowed to register MR due to a restriction of
library and kernel driver.

Fixes: 7e43a32ee060 ("net/mlx5: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx: remove debug messages on datapath
Yongseok Koh [Mon, 1 Apr 2019 21:17:52 +0000 (14:17 -0700)]
net/mlx: remove debug messages on datapath

Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: support secondary process
Yongseok Koh [Mon, 1 Apr 2019 21:15:53 +0000 (14:15 -0700)]
net/mlx4: support secondary process

In order to support secondary process, a few features are required.

a) rdma-core library should allocate device resources using DPDK's
   memory allocator.

b) UAR should be remapped for secondary processes. Currently, in order
   not to use different data structure for secondary processes, PMD
   tries to reserve identical virtual address space for both primary
   and secondary processes.

c) IPC channel is necessary, which can be easily set with rte_mp APIs.
   Through the channel, Verbs command FD is delivered to the secondary
   process and the device stop/start event is also broadcast from
   primary process.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: add external allocator for Verbs object
Yongseok Koh [Mon, 1 Apr 2019 21:15:52 +0000 (14:15 -0700)]
net/mlx4: add external allocator for Verbs object

To support secondary process, the memory allocated by library such as
completion rings (CQ) and buffer rings (WQ) must be manageable by EAL,
in order to share it with secondary processes. With new changes in
rdma-core and kernel driver, it is possible to provide an external
allocator to the library layer for this purpose. All such resources
will now be allocated within DPDK framework.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: change device reference for secondary process
Yongseok Koh [Mon, 1 Apr 2019 21:15:51 +0000 (14:15 -0700)]
net/mlx4: change device reference for secondary process

rte_eth_devices[] is not shared between primary and secondary process,
but a static array to each process. The reverse pointer of device
(priv->dev) becomes invalid if mlx4 supports secondary process.
Instead, priv has the pointer to shared data of the device,
  struct rte_eth_dev_data *dev_data;

Two macros are added,
  #define PORT_ID(priv) ((priv)->dev_data->port_id)
  #define ETH_DEV(priv) (&rte_eth_devices[PORT_ID(priv)])

Cc: stable@dpdk.org
Suggested-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: sync stop/start with secondary process
Yongseok Koh [Mon, 1 Apr 2019 21:12:56 +0000 (14:12 -0700)]
net/mlx5: sync stop/start with secondary process

Rx/Tx burst function pointers are stored in the rte_eth_dev structure,
which is local to a process. Even though primary process replaces the
function pointers, secondary will not run the new ones. With rte_mp
APIs, primary can easily broadcast a request to stop/start the datapath
of secondary processes.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: rework PMD global data init
Yongseok Koh [Mon, 1 Apr 2019 21:12:55 +0000 (14:12 -0700)]
net/mlx5: rework PMD global data init

There's more need to have PMD global data structure. This should be
initialized once per a process regardless of how many PMD instances are
probed. mlx5_init_once() is called during probing and make sure all the
init functions are called once per a process. Currently, such global
data and its initialization functions are even scattered. Rather than
'extern'-ing such variables and calling such functions one by one making
sure it is called only once by checking the validity of such variables, it
will be better to have a global storage to hold such data and a
consolidated function having all the initializations. The existing shared
memory gets more extensively used for this purpose. As there could be
multiple secondary processes, a static storage (local to process) is also
added.

As the reserved virtual address for UAR remap is a PMD global resource,
this doesn't need to be stored in the device priv structure, but in the
PMD global data.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: replace IPC socket with EAL API
Yongseok Koh [Mon, 1 Apr 2019 21:12:54 +0000 (14:12 -0700)]
net/mlx5: replace IPC socket with EAL API

Socket API is used for IPC in order for secondary process to acquire
Verb command file descriptor. The FD is used to remap UAR address.
The multi-process APIs (rte_mp) in EAL are newly introduced.
mlx5_socket.c is replaced with mlx5_mp.c, which uses the new APIs.

As it is PMD global infrastructure, only one IPC channel is established.
All the IPC message types may have port_id in the message if there is
need to reference a specific device.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix memory event on secondary process
Yongseok Koh [Mon, 1 Apr 2019 21:12:53 +0000 (14:12 -0700)]
net/mlx5: fix memory event on secondary process

As the memory event is propagated to secondary processes, the event is
processed redundantly. This should be processed once because the data
structure used for MR and the event is global across the processes.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agoethdev: fix typo in error messages
Dekel Peled [Sun, 31 Mar 2019 10:46:48 +0000 (13:46 +0300)]
ethdev: fix typo in error messages

Correct minor typing mistake:
pre-queue ==> per-queue

Fixes: bea1e0c70cfc ("ethdev: convert static log type usage to dynamic")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoapp/testpmd: fix typo in comment
Dekel Peled [Sun, 31 Mar 2019 10:36:11 +0000 (13:36 +0300)]
app/testpmd: fix typo in comment

Correct minor typing mistake:
then ==> the

Fixes: 79bec05b32b7 ("app/testpmd: add ability to split outgoing packets")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agodoc: fix typos in testpmd user guide
Dekel Peled [Sun, 31 Mar 2019 10:20:55 +0000 (13:20 +0300)]
doc: fix typos in testpmd user guide

Correct typing mistakes in several places.
1) "Those command will" ==> "These commands will"
2) icmp6_nd_opt_sla_eth ==> icmp6_nd_opt_tla_eth
   (change 's' to 't' for 'target' where applicable)

Fixes: 1960be7d32f8 ("app/testpmd: add VXLAN encap/decap")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agodoc: fix typos in mlx5 guide
Dekel Peled [Sun, 31 Mar 2019 10:12:09 +0000 (13:12 +0300)]
doc: fix typos in mlx5 guide

Correct typing mistakes:
appiled ==> applied
tarffic ==> traffic

Fixes: 0280f2812284 ("doc: add mlx5 E-Switch VXLAN tunnels limitations")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix errno typos in comments
Dekel Peled [Sun, 31 Mar 2019 09:02:41 +0000 (12:02 +0300)]
net/mlx5: fix errno typos in comments

Correct typing mistake in several locations:
ernno ==> errno

Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: revert mbuf address calculation for x86
Yongseok Koh [Mon, 25 Mar 2019 19:13:10 +0000 (12:13 -0700)]
net/mlx5: revert mbuf address calculation for x86

When replenishing mbufs on Rx, buffer address (mbuf->buf_addr) should be
loaded. non-x86 processors (mostly RISC such as ARM and Power) are more
vulnerable to load stall. For x86, reducing the number of instructions
seems to matter most.

For x86, this is simply a load but for other architectures, it is
calculated from the address of mbuf structure by rte_mbuf_buf_addr()
without having to load the first cacheline of the mbuf.

Fixes: 12d468a62bc1 ("net/mlx5: fix instruction hotspot on replenishing Rx buffer")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: update LTS section
Kevin Traynor [Thu, 7 Feb 2019 15:39:58 +0000 (15:39 +0000)]
doc: update LTS section

Update the LTS section to mention the branch and how LTS support ends.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: note validation and timeline required for stables
Kevin Traynor [Wed, 27 Mar 2019 17:22:06 +0000 (17:22 +0000)]
doc: note validation and timeline required for stables

If a stable branch for a specific DPDK release is to proceed,
along with needing a maintainer, there should also be commitment
from major contributors for validation of the releases.

Also, as decided in the March 27th techboard, to facilitate user
planning, a release should be designated as a stable release
no later than 1 month after it's initial master release.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agocfgfile: replace strcat with strlcat
Chaitanya Babu Talluri [Fri, 8 Mar 2019 12:45:50 +0000 (12:45 +0000)]
cfgfile: replace strcat with strlcat

Replace strcat with strlcat to avoid buffer overflow.

Fixes: a6a47ac9c2 ("cfgfile: rework load function")
Cc: stable@dpdk.org
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix ABI check script examples
David Marchand [Tue, 19 Mar 2019 14:05:18 +0000 (15:05 +0100)]
doc: fix ABI check script examples

The doc examples are not aligned on the script following the
incriminated commit.

Fixes: c4a5fe3bf832 ("devtools: rework ABI checker script")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agodoc: fix two typos in contributing guide
Rami Rosen [Fri, 15 Mar 2019 09:19:00 +0000 (11:19 +0200)]
doc: fix two typos in contributing guide

This patch fixes two typos in the coding style part of
DPDK contributing guide:

- The header entry should have .h file instead of .c file.
- The will->This will

Fixes: 44a6dface13b ("doc: describe how to add new components")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: fix links to doxygen and sphinx sites
Dekel Peled [Wed, 3 Apr 2019 11:04:11 +0000 (14:04 +0300)]
doc: fix links to doxygen and sphinx sites

Update broken links, replace with valid links.

Fixes: 7798f17a0d62 ("doc: add documentation guidelines")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
5 years agoeal: fix typo in comment of vector function
Dekel Peled [Mon, 1 Apr 2019 11:06:20 +0000 (14:06 +0300)]
eal: fix typo in comment of vector function

Remove redundant item 'a4' in comment.

Fixes: 86c743cf9140 ("eal: define generic vector types")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
5 years agomaintainers: add switch doc to ethdev section
Dekel Peled [Mon, 1 Apr 2019 11:05:14 +0000 (14:05 +0300)]
maintainers: add switch doc to ethdev section

This patch adds file to "Ethernet API" section of MAINTAINERS file:
F: doc/guides/prog_guide/switch_representation.rst

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agotest/hash: replace sprintf with snprintf
Pallantla Poornima [Tue, 26 Mar 2019 10:27:23 +0000 (10:27 +0000)]
test/hash: replace sprintf with snprintf

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used.

Fixes: 473d1bebce ("hash: allow to store data in hash table")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agotest/distributor: replace sprintf with strlcpy
Pallantla Poornima [Thu, 14 Feb 2019 09:45:49 +0000 (09:45 +0000)]
test/distributor: replace sprintf with strlcpy

sprintf function is not secure as it doesn't check the length of string.
replaced sprintf with strlcpy.

Fixes: f74df2c57e ("test/distributor: test single and burst API")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agopower: remove unused variable
Pallantla Poornima [Fri, 15 Feb 2019 10:28:44 +0000 (10:28 +0000)]
power: remove unused variable

Variable pfi_str is removed since it is unused.

Fixes: 450f0791312c ("power: add traffic pattern aware power control")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoraw/dpaa2_qdma: support non prefetch mode
Hemant Agrawal [Thu, 4 Apr 2019 11:50:28 +0000 (11:50 +0000)]
raw/dpaa2_qdma: support non prefetch mode

This patch add support for non prefetch mode in Rx functions.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoraw/dpaa2: remove logs from datapath
Nipun Gupta [Thu, 4 Apr 2019 11:50:27 +0000 (11:50 +0000)]
raw/dpaa2: remove logs from datapath

The runtime traces shall not be present in datapath

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agoraw/dpaa2_qdma: support RBP mode
Hemant Agrawal [Thu, 4 Apr 2019 11:50:25 +0000 (11:50 +0000)]
raw/dpaa2_qdma: support RBP mode

Add support for route by port mode. The route by port
feature in HW helps in translating the PCI address
of connected device.

Signed-off-by: Minghuan Lian <minghuan.lian@nxp.com>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoraw/dpaa2_qdma: support burst mode
Hemant Agrawal [Thu, 4 Apr 2019 11:50:23 +0000 (11:50 +0000)]
raw/dpaa2_qdma: support burst mode

This patch adds support the batch processing for the qdma jobs

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Yi Liu <yi.liu@nxp.com>
5 years agoraw/dpaa2_qdma: fix to support multiprocess execution
Shreyansh Jain [Thu, 4 Apr 2019 11:50:21 +0000 (11:50 +0000)]
raw/dpaa2_qdma: fix to support multiprocess execution

Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agoraw/dpaa2_qdma: remove experimental tag from APIs
Hemant Agrawal [Thu, 4 Apr 2019 11:50:19 +0000 (11:50 +0000)]
raw/dpaa2_qdma: remove experimental tag from APIs

These APIs has been in the DPDK for few release now.
This patch removes the experimental tags for the APIs.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoconfig: increase maximum number of raw devices to 64
Hemant Agrawal [Thu, 4 Apr 2019 11:50:18 +0000 (11:50 +0000)]
config: increase maximum number of raw devices to 64

The current value is 10, which is not sufficient for many use-cases.
e.g. NXP LX2 with raw qdma devices can use 32-48 raw devices in some
use-cases. So, making it to 64 to cover various cases.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodoc: bump NXP SDK support version for dpaa2
Shreyansh Jain [Thu, 4 Apr 2019 07:23:25 +0000 (07:23 +0000)]
doc: bump NXP SDK support version for dpaa2

With the change in MC firmware, minimum supported version of
the Layerscape SDK too needs to be changed.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/dpaa2: update MC firmware version for FSLMC bus
Shreyansh Jain [Thu, 4 Apr 2019 07:23:24 +0000 (07:23 +0000)]
net/dpaa2: update MC firmware version for FSLMC bus

MC firmware is the core component of FSLMC bus and DPAA2 devices.
Prior to this patch, MC firmware supported 10.10.x version. This
patch bumps the min supported version to 10.14.x.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: cleanup unused firmware code
Shreyansh Jain [Thu, 4 Apr 2019 07:23:22 +0000 (07:23 +0000)]
bus/fslmc: cleanup unused firmware code

Removes some unused firmware code which was added in last bump
of the firmware version. No current features uses these APIs.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agoreplace snprintf with strlcpy
Bruce Richardson [Wed, 3 Apr 2019 14:45:05 +0000 (15:45 +0100)]
replace snprintf with strlcpy

Do a global replace of snprintf(..."%s",...) with strlcpy, adding in the
rte_string_fns.h header if needed.  The function changes in this patch were
auto-generated via command:

  spatch --sp-file devtools/cocci/strlcpy.cocci --dir . --in-place

and then the files edited using awk to add in the missing header:

  gawk -i inplace '/include <rte_/ && ! seen { \
   print "#include <rte_string_fns.h>"; seen=1} {print}'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoreplace snprintf with strlcpy without adding extra include
Bruce Richardson [Wed, 3 Apr 2019 14:45:04 +0000 (15:45 +0100)]
replace snprintf with strlcpy without adding extra include

For files that already have rte_string_fns.h included in them, we can
do a straight replacement of snprintf(..."%s",...) with strlcpy. The
changes in this patch were auto-generated via command:

spatch --sp-file devtools/cocci/strlcpy-with-header.cocci --dir . --in-place

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodevtools/cocci: create safer version of strlcpy script
Bruce Richardson [Wed, 3 Apr 2019 14:45:03 +0000 (15:45 +0100)]
devtools/cocci: create safer version of strlcpy script

The existing cocci script for coccinelle replaces all matching instances
of snprintf() with strlcpy() without regards to header inclusion. To allow
changes without build errors, we create a safer version of this script
that only makes changes when the rte_string_fns.h header is already
included.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodevtools/cocci: make strlcpy replacement smarter
Bruce Richardson [Wed, 3 Apr 2019 14:45:02 +0000 (15:45 +0100)]
devtools/cocci: make strlcpy replacement smarter

The original coccinelle script worked by replacing instances of
snprintf(.."%s",...) with strlcpy(), but only where the source and dest
parameters were plain identifiers. Allowing expressions for those params
opens up a wide range of other possible changes.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/bonding: fix buffer length when printing strings
Bruce Richardson [Wed, 3 Apr 2019 14:45:01 +0000 (15:45 +0100)]
net/bonding: fix buffer length when printing strings

Using the size of the source string is incorrect when printing using
snprintf. Instead pass in the buffer size to be used appropriately.

Fixes: 457ecf2953fc ("bond: add debug info for mode 6")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoeal: tighten permissions on shared memory files
Bruce Richardson [Wed, 3 Apr 2019 16:00:34 +0000 (17:00 +0100)]
eal: tighten permissions on shared memory files

When creating files on disk, e.g. for EAL configuration or shared memory
locks, etc., there is no need to grant any permissions on those files to
other users. All directories are already created with 0700 permissions, so
we should create all files with 0600 permissions.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodrivers: remove Linux EAL from include path
David Marchand [Wed, 3 Apr 2019 08:52:19 +0000 (10:52 +0200)]
drivers: remove Linux EAL from include path

None of those drivers require EAL linux specific headers.

Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agoring: fix namesize macro documentation block
Gage Eads [Thu, 4 Apr 2019 12:34:54 +0000 (07:34 -0500)]
ring: fix namesize macro documentation block

'/**<' style comments apply to the previous member, which caused doxygen to
emit the RTE_RING_NAMESIZE documentation for RTE_RING_MZ_PREFIX.

Fixes: 38c9817ee1d8 ("mempool: adjust name size in related data types")
Cc: stable@dpdk.org
Signed-off-by: Gage Eads <gage.eads@intel.com>
5 years agomempool/stack: add lock-free stack mempool handler
Gage Eads [Wed, 3 Apr 2019 23:20:20 +0000 (18:20 -0500)]
mempool/stack: add lock-free stack mempool handler

This commit adds support for lock-free (linked list based) stack mempool
handler.

In mempool_perf_autotest the lock-based stack outperforms the
lock-free handler for certain lcore/alloc count/free count
combinations*, however:
- For applications with preemptible pthreads, a standard (lock-based)
  stack's worst-case performance (i.e. one thread being preempted while
  holding the spinlock) is much worse than the lock-free stack's.
- Using per-thread mempool caches will largely mitigate the performance
  difference.

*Test setup: x86_64 build with default config, dual-socket Xeon E5-2699 v4,
running on isolcpus cores with a tickless scheduler. The lock-based stack's
rate_persec was 0.6x-3.5x the lock-free stack's.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agotest/stack: check lock-free implementation
Gage Eads [Wed, 3 Apr 2019 23:20:19 +0000 (18:20 -0500)]
test/stack: check lock-free implementation

This commit adds lock-free stack variants of stack_autotest
(stack_lf_autotest) and stack_perf_autotest (stack_lf_perf_autotest), which
differ only in that the lock-free versions pass the RTE_STACK_F_LF flag to
all rte_stack_create() calls.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agostack: add C11 atomic implementation
Gage Eads [Wed, 3 Apr 2019 23:20:18 +0000 (18:20 -0500)]
stack: add C11 atomic implementation

This commit adds an implementation of the lock-free stack push, pop, and
length functions that use __atomic builtins, for systems that benefit from
the finer-grained memory ordering control.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agostack: add lock-free implementation
Gage Eads [Wed, 3 Apr 2019 23:20:17 +0000 (18:20 -0500)]
stack: add lock-free implementation

This commit adds support for a lock-free (linked list based) stack to the
stack API. This behavior is selected through a new rte_stack_create() flag,
RTE_STACK_F_LF.

The stack consists of a linked list of elements, each containing a data
pointer and a next pointer, and an atomic stack depth counter.

The lock-free push operation enqueues a linked list of pointers by pointing
the tail of the list to the current stack head, and using a CAS to swing
the stack head pointer to the head of the list. The operation retries if it
is unsuccessful (i.e. the list changed between reading the head and
modifying it), else it adjusts the stack length and returns.

The lock-free pop operation first reserves num elements by adjusting the
stack length, to ensure the dequeue operation will succeed without
blocking. It then dequeues pointers by walking the list -- starting from
the head -- then swinging the head pointer (using a CAS as well). While
walking the list, the data pointers are recorded in an object table.

This algorithm stack uses a 128-bit compare-and-swap instruction, which
atomically updates the stack top pointer and a modification counter, to
protect against the ABA problem.

The linked list elements themselves are maintained in a lock-free LIFO
list, and are allocated before stack pushes and freed after stack pops.
Since the stack has a fixed maximum depth, these elements do not need to be
dynamically created.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agotest/stack: check stack performance
Gage Eads [Wed, 3 Apr 2019 23:20:16 +0000 (18:20 -0500)]
test/stack: check stack performance

stack_perf_autotest tests the following with one lcore:
- Cycles to attempt to pop an empty stack
- Cycles to push then pop a single object
- Cycles to push then pop a burst of 32 objects

It also tests the cycles to push then pop a burst of 8 and 32 objects with
the following lcore combinations (if possible):
- Two hyperthreads
- Two physical cores
- Two physical cores on separate NUMA nodes
- All available lcores

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agotest/stack: check stack API
Gage Eads [Wed, 3 Apr 2019 23:20:15 +0000 (18:20 -0500)]
test/stack: check stack API

stack_autotest performs positive and negative testing of the stack API, and
exercises the push and pop datapath functions with all available lcores.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agomempool/stack: use stack library
Gage Eads [Wed, 3 Apr 2019 23:20:14 +0000 (18:20 -0500)]
mempool/stack: use stack library

The new rte_stack library is derived from the mempool handler, so this
commit removes duplicated code and simplifies the handler by migrating it
to this new API.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agostack: introduce stack library
Gage Eads [Wed, 3 Apr 2019 23:20:13 +0000 (18:20 -0500)]
stack: introduce stack library

The rte_stack library provides an API for configuration and use of a
bounded stack of pointers. Push and pop operations are MT-safe, allowing
concurrent access, and the interface supports pushing and popping multiple
pointers at a time.

The library's interface is modeled after another DPDK data structure,
rte_ring, and its lock-based implementation is derived from the stack
mempool handler. An upcoming commit will migrate the stack mempool handler
to rte_stack.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agoeal/x86: fix pedantic build
Thomas Monjalon [Thu, 4 Apr 2019 12:53:05 +0000 (14:53 +0200)]
eal/x86: fix pedantic build

When enabling pedantic compilation with CONFIG_RTE_LIBRTE_MLX5_DEBUG,
the compiler complains about non standard 128-bit integer type:

include/rte_atomic_64.h:223:3: error:
ISO C does not support ‘__int128’ types [-Werror=pedantic]

It must be marked as an extension of the standard C language
to be accepted in pedantic compilation.

Fixes: 640c5f09ef2c ("eal/x86: add 128-bit atomic compare exchange")
Cc: gage.eads@intel.com
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Gage Eads <gage.eads@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: update supported algorithms in IPsec guide
Fan Zhang [Wed, 3 Apr 2019 11:03:24 +0000 (12:03 +0100)]
doc: update supported algorithms in IPsec guide

This patch updates the ipsec library programmer's guide with
the additional algorithms which are now supported.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agodoc: announce cryptodev xform API change
Fan Zhang [Fri, 22 Mar 2019 16:34:31 +0000 (16:34 +0000)]
doc: announce cryptodev xform API change

This patch adds the deprecation notice of changing Cryptodev
symmetric xform structure. The proposed change is to making
key pointers in the crypto xforms (cipher, auth, aead) to
indicate neither the library or the drivers will not change
the content of the key buffer.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
5 years agodoc: add IPsec library in release notes
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:44 +0000 (09:34 +0100)]
doc: add IPsec library in release notes

Add librte_ipsec into 'Shared Library Versions' list in the release notes.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: de-duplicate crypto op prepare
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:43 +0000 (09:34 +0100)]
ipsec: de-duplicate crypto op prepare

For sym_crypto_op prepare move common code into a separate function(s).

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: reorder packet process for ESP inbound
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:42 +0000 (09:34 +0100)]
ipsec: reorder packet process for ESP inbound

Change the order of operations for esp inbound post-process:
- read mbuf metadata and esp tail first for all packets in the burst
  first to minimize stalls due to load latency.
- move code that is common for both transport and tunnel modes into
  separate functions to reduce code duplication.
- add extra check for packet consitency

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: reorder packet check for ESP inbound
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:41 +0000 (09:34 +0100)]
ipsec: reorder packet check for ESP inbound

Right now check for packet length and padding is done inside cop_prepare().
It makes sense to have all necessary checks in one place at early stage:
inside pkt_prepare().
That allows to simplify (and later hopefully) optimize cop_prepare() part.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: move inbound and outbound code
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:40 +0000 (09:34 +0100)]
ipsec: move inbound and outbound code

sa.c becomes too big, so decided to split it into 3 chunks:
 - sa.c - control path related functions (init/fini, etc.)
 - esp_inb.c - ESP inbound packet processing
 - esp_outb.c - ESP outbound packet processing

Plus few changes in internal function names to follow the same
code convention.
No functional changes introduced.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: change the way unprocessed mbufs are accounted
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:39 +0000 (09:34 +0100)]
ipsec: change the way unprocessed mbufs are accounted

As was pointed in one of previous reviews - we can avoid updating
contents of mbuf array for successfully processed packets.
Instead store indexes of failed packets, to move them beyond the good
ones later.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: change order in filling crypto op
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:38 +0000 (09:34 +0100)]
ipsec: change order in filling crypto op

Right now we first fill crypto_sym_op part of crypto_op,
then in a separate cycle we fill crypto op fields.
It makes more sense to fill whole crypto-op in one go instead.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoipsec: add Tx offload template into SA
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:37 +0000 (09:34 +0100)]
ipsec: add Tx offload template into SA

Operations to set/update bit-fields often cause compilers
to generate suboptimal code. To avoid such negative effect,
use tx_offload raw value and mask to update l2_len and l3_len
fields within mbufs.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agombuf: add function to generate raw Tx offload value
Konstantin Ananyev [Tue, 2 Apr 2019 08:34:36 +0000 (09:34 +0100)]
mbuf: add function to generate raw Tx offload value

Operations to set/update bit-fields often cause compilers
to generate suboptimal code.
To help avoid such situation for tx_offload fields:
introduce new enum for tx_offload bit-fields lengths and offsets,
and new function to generate raw tx_offload value.
Add new test-case into UT for introduced function.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>