dpdk.git
5 years agocrypto/caam_jr: fix shared descriptor endianness
Gagandeep Singh [Mon, 8 Apr 2019 08:59:28 +0000 (08:59 +0000)]
crypto/caam_jr: fix shared descriptor endianness

build a shared descriptor accordingly if core and
CAAM endianness is same or different

Fixes: 6ef6beca8844 ("crypto/caam_jr: add enqueue/dequeue operations")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/aesni_gcm: use architecture independent API
Pablo de Lara [Wed, 10 Apr 2019 00:41:34 +0000 (01:41 +0100)]
crypto/aesni_gcm: use architecture independent API

IPSec Multi-buffer library has recently added API
that sets pointers depending on the architecture, at initiliazation,
in version 0.52.

AESNI MB PMD was updated with these changes, but not
the AESNI GCM PMD, which also uses the same library.

This makes the PMD to be only compatible with version 0.52,
but makes both PMD consistent on version compatibility,
plus adds support for AVX512.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agodoc: add missing algorithms for AESNI-MB PMD
Pablo de Lara [Wed, 10 Apr 2019 01:36:17 +0000 (02:36 +0100)]
doc: add missing algorithms for AESNI-MB PMD

The supported algorithm tables for AESNI MB PMD were
missing some supported algorithms.

Fixes: 0e9f8507afcb ("crypto/aesni_mb: support AES-GCM algorithm")
Fixes: e5eecd3dc838 ("crypto/aesni_mb: support AES-GMAC")
Fixes: 11fdbf1b7866 ("crypto/aesni_mb: support plain SHA")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocryptodev: fix uninitialized session clear
Marko Kovacevic [Mon, 15 Apr 2019 15:04:49 +0000 (16:04 +0100)]
cryptodev: fix uninitialized session clear

added check to see if a session for a device
has been initialised if it has return 0.

Fixes: 5d6c73dd5938 ("cryptodev: add reference count to session private data")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agoexamples/fips_validation: fix CMAC test
Marko Kovacevic [Mon, 15 Apr 2019 15:04:48 +0000 (16:04 +0100)]
examples/fips_validation: fix CMAC test

As a result of the cmac test running the test where
PT len is 65536 it should give a result back to the
user USER1: Error -1: Prepare op USER1: PT len 65536
as this MSG len is not supported. Issue was
that the application was not freeing the op properly after
a while causing the app to fail.

CRYPTODEV: rte_cryptodev_sym_session_create() line 1340:
couldn't get object from session mempool
USER1: Error -12: test block
USER1: Error -12: Failed test CMAC/req/CMAC.req

Fixes: cd255ccf5764 ("examples/fips_validation: support AES parsing")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agoexamples/fips_validation: fix HMAC test
Marko Kovacevic [Mon, 15 Apr 2019 15:04:47 +0000 (16:04 +0100)]
examples/fips_validation: fix HMAC test

Application was failing as the HMAC and
Plain SHA fips request files are similar in a
way that they both have SHA- in the top section to
determine the hash algo and hash sizes. And HMAC having the
algo in the second line but the Plain SHA in the third
meant that when the HMAC files was used once it parsed the third
line Plain SHA was set as the algo and not HMAC.

USER1: Failed to get capability for cdev 0
USER1: Error -22: test block
[L=20 SHAAlg=SHA_2]
USER1: Error -22: Failed test /root/FIPS/HMAC/req/HMAC.req

Fixes: f4797bae0050 ("examples/fips_validation: support plain SHA")

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agoconfig: add Mellanox BlueField for meson cross-compilation
Yongseok Koh [Thu, 18 Apr 2019 11:49:03 +0000 (04:49 -0700)]
config: add Mellanox BlueField for meson cross-compilation

Mellanox BlueField is armv8 CPU having cortex-a72. The implementor ID is
0x41 (arm) and the primary part number is 0xd08 (cortex-a72).

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoconfig: change defaults of armv8
Yongseok Koh [Thu, 18 Apr 2019 11:49:01 +0000 (04:49 -0700)]
config: change defaults of armv8

Current default cache line size for armv8 CPUs having Implementor ID of
0x41 is 128 bytes, changing it to 64 bytes. Also, the max number of lcores
is changed to 16 from 256.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agonet/mlx: fix library search in meson build
Yongseok Koh [Thu, 18 Apr 2019 11:49:02 +0000 (04:49 -0700)]
net/mlx: fix library search in meson build

If MLNX_OFED is installed, there's no .pc file installed for libraries and
dependency() can't find libraries by pkg-config. By adding fallback of
using cc.find_library(), libraries are properly located.

Fixes: e30b4e566f47 ("build: improve dependency handling")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodrivers/event: disable OcteonTx for buggy Arm compilers
Yongseok Koh [Thu, 18 Apr 2019 11:49:00 +0000 (04:49 -0700)]
drivers/event: disable OcteonTx for buggy Arm compilers

Disable octeontx for gcc 4.8.5 as compiler is emitting "internal compiler
error" for aarch64

Fixes: bd77f2d64c44 ("event/octeontx: build with meson")
Fixes: 4f760550a093 ("mk: disable OcteonTx for buggy compilers")
Fixes: f3af3e44a444 ("mk: disable OcteonTx for buggy compilers only on arm64")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agodoc: mention machine=default option for meson
Luca Boccassi [Thu, 18 Apr 2019 09:30:20 +0000 (10:30 +0100)]
doc: mention machine=default option for meson

Document the new value, as it's useful for distributions and users
who need to use a stable baseline -march

Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
5 years agobuild: use default flags for default Arm machine
Luca Boccassi [Wed, 20 Mar 2019 13:18:01 +0000 (13:18 +0000)]
build: use default flags for default Arm machine

When building for generic distribution we need a stable baseline
architecture, or depending on the build worker the result will vary.

Force the default flags if the user explicitly sets machine=default
at configuration time.

Fixes: b1d48c41189a ("build: support ARM with meson")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agotimer: add function to stop all timers in a list
Erik Gabriel Carrillo [Mon, 15 Apr 2019 21:41:28 +0000 (16:41 -0500)]
timer: add function to stop all timers in a list

Add a function to the timer API that allows a caller to traverse a
specified set of timer lists, stopping each timer in each list,
and invoking a callback function.

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agotimer: allow management in shared memory
Erik Gabriel Carrillo [Mon, 15 Apr 2019 21:41:27 +0000 (16:41 -0500)]
timer: allow management in shared memory

Currently, the timer library uses a per-process table of structures to
manage skiplists of timers presumably because timers contain arbitrary
function pointers whose value may not resolve properly in other
processes.

However, if the same callback is used handle all timers, and that
callback is only invoked in one process, then it woud be safe to allow
the data structures to be allocated in shared memory, and to allow
secondary processes to modify the timer lists.  This would let timers be
used in more multi-process scenarios.

The library's global variables are wrapped with a struct, and an array
of these structures is created in shared memory.  The original APIs
are updated to reference the zeroth entry in the array. This maintains
the original behavior for both primary and secondary processes since
the set intersection of their coremasks should be empty [1].  New APIs
are introduced to enable the allocation/deallocation of other entries
in the array.

New variants of the APIs used to start and stop timers are introduced;
they allow a caller to specify which array entry should be used to
locate the timer list to insert into or delete from.

Finally, a new variant of rte_timer_manage() is introduced, which
allows a caller to specify which array entry should be used to locate
the timer lists to process; it can also process multiple timer lists per
invocation.

[1] https://doc.dpdk.org/guides/prog_guide/multi_proc_support.html#multi-process-limitations

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agodevargs: promote experimental API as stable
Hemant Agrawal [Thu, 4 Apr 2019 11:45:45 +0000 (11:45 +0000)]
devargs: promote experimental API as stable

These APIs are available in DPDK for last 4 releases
and used by multiple drivers.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoexamples/l2fwd-cat: fix build on FreeBSD
Bruce Richardson [Tue, 9 Apr 2019 10:55:38 +0000 (11:55 +0100)]
examples/l2fwd-cat: fix build on FreeBSD

The definition of CPU_AND differs from Linux to BSD, so we need to use
RTE_CPU_AND instead.

Fixes: f6baccbc2b3b ("examples/l2fwd-cat: add sample application for PQoS CAT and CDP")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodistributor: skip building if power library not found
Bruce Richardson [Tue, 9 Apr 2019 10:55:37 +0000 (11:55 +0100)]
distributor: skip building if power library not found

The power library is not built on non-Linux systems, so skip the
distributor sample if it's not found, as it's a mandatory dependency.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: increase readability via shortcut variables
Bruce Richardson [Tue, 9 Apr 2019 10:55:36 +0000 (11:55 +0100)]
build: increase readability via shortcut variables

Define variables for "is_linux", "is_freebsd" and "is_windows"
to make the code shorter for comparisons and more readable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: simplify subdirectory detection for EAL
Bruce Richardson [Tue, 9 Apr 2019 10:55:35 +0000 (11:55 +0100)]
build: simplify subdirectory detection for EAL

Within EAL we had a series of if statements for selecting the EAL directory
to use. Now that the directory names match those of the OS's they are for
we can instead just use a generated subdirectory name, shortening the code.
To avoid strange errors, we still need to check for unsupported OS's, but
do this check up-front in the config meson.build file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodevtools: fix bash-isms in meson test
Bruce Richardson [Wed, 10 Apr 2019 20:52:24 +0000 (21:52 +0100)]
devtools: fix bash-isms in meson test

The use of "==" is non-standard extension from bash, so use "="
for comparisons instead.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodevtools: support older compilers with meson test
Bruce Richardson [Wed, 10 Apr 2019 20:52:23 +0000 (21:52 +0100)]
devtools: support older compilers with meson test

Older versions of GCC, such as on Redhat/CentOS 7, don't support
-march=nehalem, but need -march=corei7 instead.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodevtools: skip meson build for missing compilers
Bruce Richardson [Wed, 10 Apr 2019 20:52:22 +0000 (21:52 +0100)]
devtools: skip meson build for missing compilers

If either gcc or clang are missing, skip doing those builds.
This allows a setup to only do, e.g. gcc tests.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agotest: detect number of cores with meson
Aaron Conole [Fri, 12 Apr 2019 16:21:41 +0000 (12:21 -0400)]
test: detect number of cores with meson

The arguments being passed will cause failures on laptops that have,
for instance, 2 cores only.  Most of the tests don't require more
than a single core.  Some require multiple cores (but those tests
should be modified to 'SKIP' when the correct number of cores
aren't available).

The unit test results shouldn't be impacted by this change, but it
allows for a future enhancement to pass flags such as '--no-huge'.

Also include a fix to a reported issue with running on FreeBSD.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoci: add a distinguisher to the extra Travis builds
Aaron Conole [Fri, 12 Apr 2019 16:21:40 +0000 (12:21 -0400)]
ci: add a distinguisher to the extra Travis builds

This helps in two ways:
  1. When looking at travis page for dpdk, it's a visual distinction

  2. For ccache support, the build IDs include the 'env', so we get unique
     cache data.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoci: enable ccache in Travis
Aaron Conole [Fri, 12 Apr 2019 16:21:39 +0000 (12:21 -0400)]
ci: enable ccache in Travis

We try to make the planet happy travis builds dpdk.

Also, the 'sudo' flag was recently deprecated.  Drop it.

Suggested-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agodevtools: add git log checks for TPID, LACP and RETA
Ferruh Yigit [Mon, 8 Apr 2019 16:37:18 +0000 (17:37 +0100)]
devtools: add git log checks for TPID, LACP and RETA

Add case check to TPID, LACP and RETA abbreviations.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodevtools: accept experimental symbol promotion
David Marchand [Fri, 5 Apr 2019 08:17:47 +0000 (10:17 +0200)]
devtools: accept experimental symbol promotion

Currently, when symbols get promoted from the EXPERIMENTAL section to a
stable ABI section, the script complains they should go to the
EXPERIMENTAL section.

Example:
ERROR: symbol rte_devargs_add is added in the DPDK_19.05 section, but is
expected to be added in the EXPERIMENTAL section of the version map

This is legit.
Moving from a stable ABI to another is also allowed, but must have gone
through the proper process.

Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agoconfig: add octeontx2 machine
Jerin Jacob [Sat, 13 Apr 2019 20:19:46 +0000 (01:49 +0530)]
config: add octeontx2 machine

Optimized configuration for Marvell octeontx2 SoC.
Updated meson build to support Marvell octeontx2 SoC.
Added meson cross build target for octeontx2.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agoconfig: add thunderx2 machine
Jerin Jacob [Sat, 13 Apr 2019 20:19:45 +0000 (01:49 +0530)]
config: add thunderx2 machine

Optimized configuration for Marvell thunderx2 SoC.
Updated meson build to support Marvell thunderx2 SoC.
Added meson cross compile target.

Product details are here:

https://www.marvell.com/server-processors/thunderx2-arm-processors/

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agomeson: support Arm machine specific flags
Pavan Nikhilesh [Sat, 13 Apr 2019 20:19:44 +0000 (01:49 +0530)]
meson: support Arm machine specific flags

Currently, RTE_* flags are set based on the implementer ID but there might
be some micro arch specific differences from the same vendor
eg. CACHE_LINESIZE. Add support to set micro arch specific flags.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agomk: introduce helper to check compiler argument
Jerin Jacob [Sat, 13 Apr 2019 20:19:43 +0000 (01:49 +0530)]
mk: introduce helper to check compiler argument

Introduce rte_cc_has_argument() Makefile helper to
check a given argument is support by the compiler.

Example Usage:

include $(RTE_SDK)/mk/rte.helper.mk
MACHINE_CFLAGS += $(call rte_cc_has_argument, -mcpu=octeontx2)

This would allow adding -mcpu=octeontx2 in MACHINE_CFLAGS
if it is only supported by the compiler. The use case for such
scheme is to enable the mcpu optimization if the compiler
supports else it needs to compile the source code without
any errors.

This patch also moves inclusion of toolchain's rte.vars.mk
to before the machine's rte.vars.mk inclusion to make
correct CC available for the cross compile case.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agotest/ticketlock: fix autotest
Joyce Kong [Mon, 15 Apr 2019 09:04:39 +0000 (17:04 +0800)]
test/ticketlock: fix autotest

Add ticketlock_autotest implementation in python.

Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Tested-by: Phil Yang <phil.yang@arm.com>
5 years agodoc: add flow API to qede NIC features
Shahed Shaikh [Fri, 12 Apr 2019 10:12:37 +0000 (03:12 -0700)]
doc: add flow API to qede NIC features

Commit 267d32de46a8 ("net/qede: support generic flow API")
added a support for RTE_FLOW APIs but did not update the feature
support matrix.

Fixes: 267d32de46a8 ("net/qede: support generic flow API")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agodoc: fix spelling in testpmd guide
Stephen Hemminger [Wed, 10 Apr 2019 17:48:56 +0000 (10:48 -0700)]
doc: fix spelling in testpmd guide

Minor spelling errors found with aspell.

Fixes: e76d7a768ce0 ("doc: fix syntax in testpmd user guide")
Fixes: fb73e096110a ("app/testpmd: enable device hotplug monitoring")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/ice: stop LLDP by default
Qiming Yang [Fri, 12 Apr 2019 10:10:06 +0000 (18:10 +0800)]
net/ice: stop LLDP by default

This patch stopped LLDP by default to avoid the statistics error.

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/nfb: add new netcope driver
Rastislav Cernay [Sun, 7 Apr 2019 15:03:21 +0000 (17:03 +0200)]
net/nfb: add new netcope driver

Added new net driver for Netcope nfb cards

Signed-off-by: Rastislav Cernay <cernay@netcope.com>
5 years agonet/i40e: fix scattered Rx enabling
Qi Zhang [Wed, 27 Mar 2019 11:00:05 +0000 (19:00 +0800)]
net/i40e: fix scattered Rx enabling

No need to add additional vlan tag size for max packet size, since
for i40e, the queue's Rx Max Frame Size (rxq->max_pkt_len) already
includes the vlan header size.

Fixes: a3c83a2527e1 ("net/i40e: enable runtime queue setup")
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: c1715402df8f ("i40evf: fix jumbo frame support")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/bnxt: fix big endian build
Somnath Kotur [Wed, 10 Apr 2019 09:16:22 +0000 (14:46 +0530)]
net/bnxt: fix big endian build

The result of the endian conversion was not being used incorrectly.

Fixes: b11cceb83a34 ("net/bnxt: support timesync")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/enic: fix VLAN inner type matching for old hardware
Hyong Youb Kim [Wed, 10 Apr 2019 05:35:00 +0000 (22:35 -0700)]
net/enic: fix VLAN inner type matching for old hardware

The vlan pattern handler currently assumes the NIC always strips vlan
header from the L2 buffer, regardless of the vlan strip setting. But,
with older VIC models, the vlan header is actually present in the L2
buffer if stripping is disabled. So in this case, the inner ether type
needs to be shifted by that much.

Fixes: 6ced137607d0 ("net/enic: flow API for NICs with advanced filters enabled")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agoapp/testpmd: fix return value check
Chenbo Xia [Wed, 10 Apr 2019 02:46:36 +0000 (02:46 +0000)]
app/testpmd: fix return value check

Fix unchecked return value issue for rte_eth_dev_configure.

Coverity issue: 195021
Fixes: 2a977b891f99 ("app/testpmd: fix DCB configuration")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agoapp/testpmd: fix hex string parser support for flow API
Wei Zhao [Tue, 9 Apr 2019 08:41:31 +0000 (16:41 +0800)]
app/testpmd: fix hex string parser support for flow API

There is need for users to set configuration of HEX number for RSS
key. The key byte should be pass down as hex number not as char
string. This patch enable cmdline flow parse HEX number,
in order to not using string which pass ASIC number.

Fixes: f4d623f96119 ("app/testpmd: fix missing RSS fields in flow action")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/enic: fix raw item length check
Hyong Youb Kim [Tue, 9 Apr 2019 06:40:26 +0000 (23:40 -0700)]
net/enic: fix raw item length check

Currently, the raw item is always preceded by a UDP header, and both
land in the L4 pattern buffer. So consider the UDP header size when
checking if the raw spec fits in the L4 buffer.

Coverity issue: 336796, 336850
Fixes: 477959e6eeb0 ("net/enic: enable limited support for raw flow item")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/mlx4: remove device register remap
Yongseok Koh [Wed, 10 Apr 2019 18:41:18 +0000 (11:41 -0700)]
net/mlx4: remove device register remap

UAR (User Access Region) register does not need to be remapped for
primary process but it should be remapped only for secondary process.
UAR register table is in the process private structure in
rte_eth_devices[],
(struct mlx4_proc_priv *)rte_eth_devices[port_id].process_private

The actual UAR table follows the data structure and the table is used
for both Tx and Rx.

For Tx, BlueFlame in UAR is used to ring the doorbell.
MLX4_TX_BFREG(txq) is defined to get a register for the txq. Processes
access its own private data to acquire the register from the UAR table.

For Rx, the doorbell in UAR is required in arming CQ event. However, it
is a known issue that the register isn't remapped for secondary process.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: remove device register remap
Yongseok Koh [Wed, 10 Apr 2019 18:41:17 +0000 (11:41 -0700)]
net/mlx5: remove device register remap

UAR (User Access Region) register does not need to be remapped for
primary process but it should be remapped only for secondary process.
UAR register table is in the process private structure in
rte_eth_devices[],
(struct mlx5_proc_priv *)rte_eth_devices[port_id].process_private

The actual UAR table follows the data structure and the table is used
for both Tx and Rx.

For Tx, BlueFlame in UAR is used to ring the doorbell.
MLX5_TX_BFREG(txq) is defined to get a register for the txq. Processes
access its own private data to acquire the register from the UAR table.

For Rx, the doorbell in UAR is required in arming CQ event. However, it
is a known issue that the register isn't remapped for secondary process.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: remove redundant queue index
Yongseok Koh [Wed, 10 Apr 2019 18:41:16 +0000 (11:41 -0700)]
net/mlx5: remove redundant queue index

Queue index is redundantly stored for both Rx and Tx structures.
E.g. txq_ctrl->idx and txq->stats.idx. Both are consolidated to single
storage - rxq->idx and txq->idx.

Also, rxq and txq are moved to the beginning of its control structure
(rxq_ctrl and txq_ctrl) for cacheline alignment.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix recursive inclusion of header file
Yongseok Koh [Wed, 10 Apr 2019 18:41:15 +0000 (11:41 -0700)]
net/mlx5: fix recursive inclusion of header file

mlx5.h includes mlx5_rxtx.h and mlx5_rxtx.h includes mlx5.h recursively.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agoapp/testpmd: map anonymous memory for devices
Shahaf Shuler [Sun, 7 Apr 2019 05:02:26 +0000 (08:02 +0300)]
app/testpmd: map anonymous memory for devices

Mempools can be populated with anonymous memory when using command line
parameter --mp-alloc=anon.

Considering the mempools are going to be used by the net devices,
it is better to DMA map this memory.

This patch add such mapping now that we have the APIs in place[1].

[1] commit c33a675b6276 ("bus: introduce device level DMA memory mapping")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoapp/testpmd: support no IOVA contiguous mempools
Shahaf Shuler [Sun, 7 Apr 2019 05:02:25 +0000 (08:02 +0300)]
app/testpmd: support no IOVA contiguous mempools

providing a command line parameter to set the mempool flags accordingly.
This mode is relevant only when creating an empty mempool and then
populating with memory.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoapp/testpmd: fix mempool free on exit
Shahaf Shuler [Sun, 7 Apr 2019 05:02:24 +0000 (08:02 +0300)]
app/testpmd: fix mempool free on exit

Allocated mempools were never free. it is bad practice.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/ice: fix max frame size
Qi Zhang [Wed, 27 Mar 2019 11:38:50 +0000 (19:38 +0800)]
net/ice: fix max frame size

Max frame size setup should consider double VLAN case.

Fixes: ae2bdd0219cb ("net/ice: support MTU setting")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/mlx4: fix Tx doorbell register unmap
Yongseok Koh [Mon, 8 Apr 2019 18:23:13 +0000 (11:23 -0700)]
net/mlx4: fix Tx doorbell register unmap

If rdma-core library doesn't support remapping UAR registers, the register
shouldn't be unmapped on device stop.

Fixes: 0203d33a1059 ("net/mlx4: support secondary process")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix build on Arm
Ori Kam [Mon, 8 Apr 2019 12:43:10 +0000 (12:43 +0000)]
net/mlx5: fix build on Arm

In case of cross compilation on aarch64 we must add include for
stdlib in order to use the free function.

Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agoapp/testpmd: fix packet headers in txonly mode
Pavan Nikhilesh [Tue, 9 Apr 2019 09:45:47 +0000 (09:45 +0000)]
app/testpmd: fix packet headers in txonly mode

Fix ether header size calculation in Tx only mode.

Coverity issue: 337684
Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/sfc: set min and max MTU
Andrew Rybchenko [Mon, 8 Apr 2019 14:04:05 +0000 (15:04 +0100)]
net/sfc: set min and max MTU

Advertise minimum and maximum MTU value in device information.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/nfp: fix resource leak on errors
Alejandro Lucero [Mon, 8 Apr 2019 11:02:04 +0000 (12:02 +0100)]
net/nfp: fix resource leak on errors

Not closing the socket implies a resource leak.

Coverity issue: 336865
Fixes: 29a62d1476b6 ("net/nfp: add CPP bridge as service")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/nfp: fix memory leak
Alejandro Lucero [Mon, 8 Apr 2019 10:49:39 +0000 (11:49 +0100)]
net/nfp: fix memory leak

Coverity issue: 32806
Fixes: ef28aa96e53b ("net/nfp: support multiprocess")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/nfp: fix memory leak
Alejandro Lucero [Mon, 8 Apr 2019 10:19:29 +0000 (11:19 +0100)]
net/nfp: fix memory leak

If errors, release the allocated structure.

Coverity issue: 277222
Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/nfp: check return value
Alejandro Lucero [Mon, 8 Apr 2019 09:59:49 +0000 (10:59 +0100)]
net/nfp: check return value

Call to CPP read (nfp_cpp_readl()) can fail, return 0 on fail.

If the call to _nfp6000_cppat_mu_locality fails, the function needs
to return with an error.

If the nfp_cpp_readl() call fails just returns 0.

Coverity issue: 277209, 277215, 277225
Fixes: c7e9729da6b5 ("net/nfp: support CPP")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/nfp: fix potential integer overflow
Alejandro Lucero [Mon, 8 Apr 2019 09:39:56 +0000 (10:39 +0100)]
net/nfp: fix potential integer overflow

Coverity issue: 277204
Fixes: defb9a5dd156 ("nfp: introduce driver initialization")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/nfp: fix file descriptor check
Alejandro Lucero [Mon, 8 Apr 2019 09:20:40 +0000 (10:20 +0100)]
net/nfp: fix file descriptor check

Although it is rather unlikely getting 0 as the descriptor handle, better
to contemplate that possibility.

Coverity issue: 195018
Fixes: 896c265ef954 ("net/nfp: use new CPP interface")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/ena: fix checksum feature flag
Michal Krawczyk [Mon, 8 Apr 2019 10:27:44 +0000 (12:27 +0200)]
net/ena: fix checksum feature flag

The boolean value was assigned to Tx flag twice, so it could cause bug
whenever Rx checksum will not be supported and Tx will be.

Coverity issue: 336831
Fixes: 117ba4a60488 ("net/ena: get device info statically")

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
5 years agonet/mlx5: fix sharing context destroy order
Viacheslav Ovsiienko [Fri, 5 Apr 2019 13:29:05 +0000 (13:29 +0000)]
net/mlx5: fix sharing context destroy order

At the mlx5 device closing the shared IB context was destroyed
before cleanup routines completion. As it was found on some
setups (Netlink fails with old kernel drivers and we have to use
sysfs to retrieve interface index, this requires IB device name,
which is stored in shared context) the mlx5_nl_mac_addr_flush()
requires IB device name, and if shared context is removed it
causes the segmentation fault.

Fixes: 17e19bc4dde7 ("net/mlx5: add IB shared context alloc/free functions")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix device probing for old kernel drivers
Viacheslav Ovsiienko [Fri, 5 Apr 2019 13:25:55 +0000 (13:25 +0000)]
net/mlx5: fix device probing for old kernel drivers

Retrieving network interface index via Netlink fails in
case of old ib_core kernel driver installed - mlx5_nl_ifindex()
routine fails due to RDMA_NLDEV_ATTR_NDEV_INDEX attribute is not
supported by the old driver.

The patch allowing to retrieve the network interface index and
name via Netlink [1]. So, the problem depends on ib_core module
version - 4.16 supports getting ifindex via Netlink, 4.15 does not.

This error was ignored in previous versions of MLX5 PMD probing
routine. For single device ifindex was retrieved via sysfs
and link control was not lost, so problem just was not noticed.
In order to support MLX5 PMD functioning over old kernel driver
this patch adds ifindex retrieving via sysfs into probing routine.
It is worth to note this method works for master/standalone
device only.

[1] https://www.spinics.net/lists/linux-rdma/msg62948.html
    Linux tree: 5b2cc79d (Leon Romanovsky 2018-03-27 20:40:49 +0300 270)

Fixes: ad74bc619504 ("net/mlx5: support multiport IB device during probing")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix typos in comments
Viacheslav Ovsiienko [Fri, 5 Apr 2019 08:55:30 +0000 (08:55 +0000)]
net/mlx5: fix typos in comments

Fixes: 299d7dc28c37 ("net/mlx5: add representor recognition on Linux 5.x")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agometer: replace color definitions
Jasvinder Singh [Thu, 11 Apr 2019 09:15:14 +0000 (10:15 +0100)]
meter: replace color definitions

This patch implements the changes proposed in the deprecation
note[1]. Replace multiple color definitions in various places such as
rte_meter.h, rte_tm.h and rte_mtr.h with single rte_color defined
in rte_meter.h.

This is simple search and replace exercise without any implementation
change.

[1] https://mails.dpdk.org/archives/dev/2019-January/123861.html

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agotable: fix arm64 hash function selection
Jerin Jacob [Sat, 6 Apr 2019 13:29:41 +0000 (13:29 +0000)]
table: fix arm64 hash function selection

Use CRC32 instruction only when it is available to avoid
the build issue like below.

{standard input}:16: Error:
selected processor does not support `crc32cx w3,w3,x0'

Fixes: ea7be0a0386e ("lib/librte_table: add hash function headers")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agoversion: 19.05-rc1
Thomas Monjalon [Fri, 5 Apr 2019 19:58:09 +0000 (21:58 +0200)]
version: 19.05-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoapp/testpmd: allocate txonly packets per bulk
Pavan Nikhilesh [Tue, 2 Apr 2019 09:53:36 +0000 (09:53 +0000)]
app/testpmd: allocate txonly packets per bulk

Use mempool bulk get ops to alloc burst of packets and process them.
If bulk get fails fallback to rte_mbuf_raw_alloc.

Tested-by: Yingya Han <yingyax.han@intel.com>
Suggested-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: move txonly prepare in separate function
Pavan Nikhilesh [Tue, 2 Apr 2019 09:53:33 +0000 (09:53 +0000)]
app/testpmd: move txonly prepare in separate function

Move the packet prepare logic into a separate function so that it
can be reused later.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: allocate txonly segments per bulk
Pavan Nikhilesh [Tue, 2 Apr 2019 09:53:29 +0000 (09:53 +0000)]
app/testpmd: allocate txonly segments per bulk

Use bulk ops for allocating segments instead of having a inner loop
for every segment.
This reduces the number of calls to the mempool layer.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: move header generation outside txonly loop
Pavan Nikhilesh [Tue, 2 Apr 2019 09:53:25 +0000 (09:53 +0000)]
app/testpmd: move header generation outside txonly loop

Testpmd txonly copies the src/dst mac address of the port being
processed to ethernet header structure on the stack for every packet.
Move it outside the loop and reuse it.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/sfc: improve Rx free threshold default
Andrew Rybchenko [Fri, 5 Apr 2019 12:05:07 +0000 (13:05 +0100)]
net/sfc: improve Rx free threshold default

Rx refill in one bulk (which is just 8 descriptors) by default is too
aggressive and makes too many MMIO writes (Rx doorbells) if packet rate
is high. Setting default to 1/8 of Rx descriptors number shows good
performance results. Anyway it is a default value which may be
overridden by Rx configuration provided by application.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: document mask requirements for RETA
Tom Barbette [Fri, 5 Apr 2019 13:13:37 +0000 (15:13 +0200)]
ethdev: document mask requirements for RETA

Clarify the fact that mask bits should be set in rte_eth_reta_query.

Signed-off-by: Tom Barbette <barbette@kth.se>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: fix Tx QinQ set
Nithin Dabilpuram [Fri, 5 Apr 2019 07:36:24 +0000 (07:36 +0000)]
app/testpmd: fix Tx QinQ set

Enable DEV_TX_OFFLOAD_VLAN_INSERT also along with
DEV_TX_OFFLOAD_VLAN_QINQ in tx_qinq_set() as it takes
both vlan id's as arguments.

Fixes: 597f9fafe13b ("app/testpmd: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: fix Tx VLAN and QinQ dependency
Nithin Dabilpuram [Fri, 5 Apr 2019 07:36:21 +0000 (07:36 +0000)]
app/testpmd: fix Tx VLAN and QinQ dependency

Tx VLAN & QinQ insert enable need not depend on
Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. For Tx VLAN
insert enable, error check is now to see if QinQ was enabled
but only single VLAN id is set.

Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx VLAN")
Cc: stable@dpdk.org
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
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>