dpdk.git
5 years agotest/rwlock: benchmark on all available cores
Joyce Kong [Mon, 25 Mar 2019 09:14:58 +0000 (17:14 +0800)]
test/rwlock: benchmark on all available cores

Add performance test on all available cores to benchmark
the scaling up performance of rw_lock.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Suggested-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agorwlock: reimplement with atomic builtins
Joyce Kong [Mon, 25 Mar 2019 09:14:57 +0000 (17:14 +0800)]
rwlock: reimplement with atomic builtins

The __sync builtin based implementation generates full memory
barriers ('dmb ish') on Arm platforms. Using C11 atomic builtins
to generate one way barriers.

Here is the assembly code of __sync_compare_and_swap builtin.
__sync_bool_compare_and_swap(dst, exp, src);
   0x000000000090f1b0 <+16>:    e0 07 40 f9 ldr x0, [sp, #8]
   0x000000000090f1b4 <+20>:    e1 0f 40 79 ldrh    w1, [sp, #6]
   0x000000000090f1b8 <+24>:    e2 0b 40 79 ldrh    w2, [sp, #4]
   0x000000000090f1bc <+28>:    21 3c 00 12 and w1, w1, #0xffff
   0x000000000090f1c0 <+32>:    03 7c 5f 48 ldxrh   w3, [x0]
   0x000000000090f1c4 <+36>:    7f 00 01 6b cmp w3, w1
   0x000000000090f1c8 <+40>:    61 00 00 54 b.ne    0x90f1d4
<rte_atomic16_cmpset+52>  // b.any
   0x000000000090f1cc <+44>:    02 fc 04 48 stlxrh  w4, w2, [x0]
   0x000000000090f1d0 <+48>:    84 ff ff 35 cbnz    w4, 0x90f1c0
<rte_atomic16_cmpset+32>
   0x000000000090f1d4 <+52>:    bf 3b 03 d5 dmb ish
   0x000000000090f1d8 <+56>:    e0 17 9f 1a cset    w0, eq  // eq = none

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Tested-by: Joyce Kong <joyce.kong@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agospinlock: reimplement with atomic one-way barrier
Gavin Hu [Fri, 8 Mar 2019 07:56:37 +0000 (15:56 +0800)]
spinlock: reimplement with atomic one-way barrier

The __sync builtin based implementation generates full memory barriers
('dmb ish') on Arm platforms. Using C11 atomic builtins to generate one way
barriers.

Here is the assembly code of __sync_compare_and_swap builtin.
__sync_bool_compare_and_swap(dst, exp, src);
   0x000000000090f1b0 <+16>:    e0 07 40 f9 ldr x0, [sp, #8]
   0x000000000090f1b4 <+20>:    e1 0f 40 79 ldrh    w1, [sp, #6]
   0x000000000090f1b8 <+24>:    e2 0b 40 79 ldrh    w2, [sp, #4]
   0x000000000090f1bc <+28>:    21 3c 00 12 and w1, w1, #0xffff
   0x000000000090f1c0 <+32>:    03 7c 5f 48 ldxrh   w3, [x0]
   0x000000000090f1c4 <+36>:    7f 00 01 6b cmp w3, w1
   0x000000000090f1c8 <+40>:    61 00 00 54 b.ne    0x90f1d4
<rte_atomic16_cmpset+52>  // b.any
   0x000000000090f1cc <+44>:    02 fc 04 48 stlxrh  w4, w2, [x0]
   0x000000000090f1d0 <+48>:    84 ff ff 35 cbnz    w4, 0x90f1c0
<rte_atomic16_cmpset+32>
   0x000000000090f1d4 <+52>:    bf 3b 03 d5 dmb ish
   0x000000000090f1d8 <+56>:    e0 17 9f 1a cset    w0, eq  // eq = none

The benchmarking results showed constant improvements on all available
platforms:
1. Cavium ThunderX2: 126% performance;
2. Hisilicon 1616: 30%;
3. Qualcomm Falkor: 13%;
4. Marvell ARMADA 8040 with A72 cores on macchiatobin: 3.7%

Here is the example test result on TX2:
$sudo ./build/app/test -l 16-27 -- i
RTE>>spinlock_autotest

*** spinlock_autotest without this patch ***
Test with lock on 12 cores...
Core [16] Cost Time = 53886 us
Core [17] Cost Time = 53605 us
Core [18] Cost Time = 53163 us
Core [19] Cost Time = 49419 us
Core [20] Cost Time = 34317 us
Core [21] Cost Time = 53408 us
Core [22] Cost Time = 53970 us
Core [23] Cost Time = 53930 us
Core [24] Cost Time = 53283 us
Core [25] Cost Time = 51504 us
Core [26] Cost Time = 50718 us
Core [27] Cost Time = 51730 us
Total Cost Time = 612933 us

*** spinlock_autotest with this patch ***
Test with lock on 12 cores...
Core [16] Cost Time = 18808 us
Core [17] Cost Time = 29497 us
Core [18] Cost Time = 29132 us
Core [19] Cost Time = 26150 us
Core [20] Cost Time = 21892 us
Core [21] Cost Time = 24377 us
Core [22] Cost Time = 27211 us
Core [23] Cost Time = 11070 us
Core [24] Cost Time = 29802 us
Core [25] Cost Time = 15793 us
Core [26] Cost Time = 7474 us
Core [27] Cost Time = 29550 us
Total Cost Time = 270756 us

In the tests on ThunderX2, with more cores contending, the performance gain
was even higher, indicating the __atomic implementation scales up better
than __sync.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/spinlock: amortize the cost of getting time
Gavin Hu [Fri, 8 Mar 2019 07:56:36 +0000 (15:56 +0800)]
test/spinlock: amortize the cost of getting time

Instead of getting timestamps per iteration, amortize its overhead
can help getting more precise benchmarking results.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/spinlock: remove delay for correct benchmarking
Gavin Hu [Fri, 8 Mar 2019 07:56:35 +0000 (15:56 +0800)]
test/spinlock: remove delay for correct benchmarking

The test is to benchmark the performance of spinlock by counting the
number of spinlock acquire and release operations within the specified
time.
A typical pair of lock and unlock operations costs tens or hundreds of
nano seconds, in comparison to this, delaying 1 us outside of the locked
region is too much, compromising the goal of benchmarking the lock and
unlock performance.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoring: enforce reading tail before slots
Gavin Hu [Tue, 12 Mar 2019 16:58:53 +0000 (00:58 +0800)]
ring: enforce reading tail before slots

In weak memory models, like arm64, reading the prod.tail may get
reordered after reading the ring slots, which corrupts the ring and
stale data is observed.

This issue was reported by NXP on 8-A72 DPAA2 board. The problem is most
likely caused by missing the acquire semantics when reading
prod.tail (in SC dequeue) which makes it possible to read a
stale value from the ring slots.

For MP (and MC) case, rte_atomic32_cmpset() already provides the required
ordering. For SP case, the control depependency between if-statement (which
depends on the read of r->cons.tail) and the later stores to the ring slots
make RMB unnecessary. About the control dependency, read more at:
https://www.cl.cam.ac.uk/~pes20/ppc-supplemental/test7.pdf

This patch is adding the required read barrier to prevent reading the ring
slots get reordered before reading prod.tail for SC case.

Fixes: c9fb3c62896f ("ring: move code in a new header file")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Tested-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoeal: roundup TSC frequency when estimating
Pavan Nikhilesh [Sat, 16 Mar 2019 19:01:54 +0000 (19:01 +0000)]
eal: roundup TSC frequency when estimating

When estimating tsc frequency using sleep/gettime round it up to the
nearest multiple of 10Mhz for more accuracy.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
5 years agoeal: add macro to align value to the nearest multiple
Pavan Nikhilesh [Sat, 16 Mar 2019 19:01:50 +0000 (19:01 +0000)]
eal: add macro to align value to the nearest multiple

Add macro to align value to the nearest multiple of the given value,
resultant value might be greater than or less than the first parameter
whichever difference is the lowest.
Update unit test to include the new macro.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agouse appropriate EAL macro for constructors
Jerin Jacob [Mon, 18 Mar 2019 04:15:56 +0000 (04:15 +0000)]
use appropriate EAL macro for constructors

Use eal's RTE_INIT abstraction for defining constructors.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: add pending interrupt callback unregister
Jakub Grajciar [Fri, 22 Mar 2019 11:52:36 +0000 (12:52 +0100)]
eal: add pending interrupt callback unregister

use case: if callback is used to receive message form socket,
and the message received is disconnect/error, this callback needs
to be unregistered, but cannot because it is still active.

With this patch it is possible to mark the callback to be
unregistered once the interrupt process is done with this
interrupt source.

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
5 years agoeal/linux: fix log levels for pagemap reading failure
Kevin Traynor [Thu, 14 Feb 2019 17:56:56 +0000 (17:56 +0000)]
eal/linux: fix log levels for pagemap reading failure

Commit cdc242f260e7 says:
    For Linux kernel 4.0 and newer, the ability to obtain
    physical page frame numbers for unprivileged users from
    /proc/self/pagemap was removed. Instead, when an IOMMU
    is present, simply choose our own DMA addresses instead.

In this case the user still sees error messages, so adjust
the log levels. Later, other checks will ensure that errors
are logged in the appropriate cases.

Fixes: cdc242f260e7 ("eal/linux: support running as unprivileged user")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agodoc: deprecate KNI ethtool support
Ferruh Yigit [Mon, 18 Feb 2019 12:30:02 +0000 (12:30 +0000)]
doc: deprecate KNI ethtool support

Announce removal of KNI ethtool support.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Igor Ryzhov <iryzhov@nfware.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: add deprecation marker usage
Ferruh Yigit [Fri, 1 Mar 2019 17:32:50 +0000 (17:32 +0000)]
doc: add deprecation marker usage

Define '__rte_deprecated' usage process.

Suggests keeping old API with '__rte_deprecated' marker including
next LTS, they will be removed just after the LTS release.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
5 years agodoc: make RTE_NEXT_ABI optional in guidelines
Ferruh Yigit [Fri, 1 Mar 2019 17:32:49 +0000 (17:32 +0000)]
doc: make RTE_NEXT_ABI optional in guidelines

Initial process requires oncoming changes described in deprecation
notice should be implemented in a RTE_NEXT_ABI gated way.

This has been discussed in technical board, and since this can cause a
multiple #ifdef blocks in multiple locations of the code, can be
confusing specially for the modifications that requires data structure
changes. Anyway this was not happening in practice.

Making RTE_NEXT_ABI usage more optional based on techboard decision:
http://mails.dpdk.org/archives/dev/2019-January/123519.html

The intention with using RTE_NEXT_ABI was to provide more information
to the user about planned changes, and force developer to think more in
coding level. Since RTE_NEXT_ABI become optional, now the preferred way
to do this is, if possible, sending changes, described in deprecation
notice, as a separate patch and reference it in deprecation notice.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
5 years agodoc: clean ABI/API policy guide
Ferruh Yigit [Fri, 1 Mar 2019 17:32:48 +0000 (17:32 +0000)]
doc: clean ABI/API policy guide

The original document written from the point of ABI versioning but later
additions make document confusing, convert document into a ABI/API
policy documentation and organize the document in subsections:
- ABI/API Deprecation
- Experimental APIs
- Library versioning
- ABI versioning

Aim to clarify confusion between deprecation versioned ABI and overall
ABI/API deprecation, also ABI versioning and Library versioning by
organizing the sections.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
5 years agodoc: update DPDK LTS versions
Kevin Traynor [Fri, 22 Mar 2019 11:29:35 +0000 (11:29 +0000)]
doc: update DPDK LTS versions

Support for 16.11 has ended. 17.11 and 18.11 are the current LTSs.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agomalloc: fix documentation of realloc function
Anatoly Burakov [Fri, 22 Feb 2019 15:29:29 +0000 (15:29 +0000)]
malloc: fix documentation of realloc function

The documentation for rte_realloc claims that the resized area
will always reside on the same NUMA node. This is not actually
the case - while *resized* area will be on the same NUMA node,
if resizing the area is not possible, then the memory will be
reallocated using rte_malloc(), which can allocate memory on
another NUMA node, depending on which lcore rte_realloc() was
called from and which NUMA nodes have memory available.

Fix the API doc to match the actual code of rte_realloc().

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agomem: poison memory when freed
Stephen Hemminger [Sat, 16 Feb 2019 01:50:16 +0000 (17:50 -0800)]
mem: poison memory when freed

DPDK malloc library allows broken programs to work because
the semantics of zmalloc and malloc are the same.

This patch enables a  more secure model which will catch
(and crash) programs that reuse memory already freed if
RTE_MALLOC_DEBUG is enabled.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoacl: fix compiler flags with meson and AVX2 runtime
Andrius Sirvys [Mon, 11 Mar 2019 15:18:11 +0000 (15:18 +0000)]
acl: fix compiler flags with meson and AVX2 runtime

When compiling the ACL library on a system without AVX2 support,
the flags used to compile the AVX2-specific code for later run-time
use were not based on the regular cflags for the rest of the library.
This can cause errors due to symbols being missed/undefined
due to incorrect flags. For example,
when testing compilation on Alpine linux, we got:
error: unknown type name 'cpu_set_t'
due to _GNU_SOURCE not being defined in the cflags.

This issue can be fixed by appending "-mavx2" to
the cflags rather than replacing them with it.

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoeal: remove unneeded version logic
Bruce Richardson [Fri, 15 Mar 2019 18:20:22 +0000 (18:20 +0000)]
eal: remove unneeded version logic

The version number in the DPDK_VERSION file will never have an offset
that needs to be subtracted, so remove that logic from the version
string generation.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: use version number from config file
Bruce Richardson [Fri, 15 Mar 2019 18:20:21 +0000 (18:20 +0000)]
build: use version number from config file

Since we have the version number in a separate file at the root level,
we should not need to duplicate this in rte_version.h too. Best
approach here is to move the macros for specifying the year/month/etc.
parts from the version header file to the build config file - leaving
the other utility macros for e.g. printing the version string, where they
are.

For "make", this is done by having a little bit of awk parse the version
file and pass the results through to the preprocessor for the config
generation stage.

For "meson", this is done by parsing the version and adding it to the
standard dpdk_conf object.

In both cases, we need to append a large number - in this case "99",
previously 16 in original code - to the version number when we want to do
version number comparisons. Without this, the release version e.g. 19.05.0
will compare as less than it's RC's e.g. 19.05.0-rc4. With it, the
comparison is correct as "19.05.0.99 > 19.05.0-rc4.99".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agobuild: move meson version handling to config directory
Bruce Richardson [Fri, 15 Mar 2019 18:20:20 +0000 (18:20 +0000)]
build: move meson version handling to config directory

To keep the top-level meson.build file as clean and clear as possible, we
move the version handling to the config/meson.build file, where the rest of
the build configuration is already being set up.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: add single source of DPDK version number
Bruce Richardson [Fri, 15 Mar 2019 18:20:19 +0000 (18:20 +0000)]
build: add single source of DPDK version number

Add a new file VERSION to hold the current DPDK version number.
Have meson use this file for it's project version, and have make use
it for reporting out "showversion" and "showversionum".

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agousertools: add octeontx2 SSO and NPA PCIe devices
Jerin Jacob [Tue, 26 Feb 2019 12:29:20 +0000 (12:29 +0000)]
usertools: add octeontx2 SSO and NPA PCIe devices

Add the Marvell's octeontx2's SSO and NPA PCIe devices as
eventdev, mempool devices in devbind script.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
5 years agotest: fix build without pdump
Reshma Pattan [Wed, 20 Mar 2019 11:33:19 +0000 (11:33 +0000)]
test: fix build without pdump

pdump unit test has dependency on pthread code
in test.c and process.h to run send_pkts(),
this code should be enabled only when
CONFIG_RTE_LIBRTE_PDUMP is enabled.

Bugzilla ID: 222

Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agoapp/pipeline: fix dependency for FreeBSD
Bruce Richardson [Mon, 25 Mar 2019 15:38:09 +0000 (15:38 +0000)]
app/pipeline: fix dependency for FreeBSD

When building on FreeBSD, the compiler emitted an error due to being
unable to find rte_pci.h. This was due to missing dependencies for the
application.

Fixes: 474572d2ae5a ("app/pipeline: move from test directory")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodevtools: fix config check when building tags
Bruce Richardson [Wed, 13 Mar 2019 15:09:58 +0000 (15:09 +0000)]
devtools: fix config check when building tags

The check for a valid configuration in build-tags.sh relied on the output
of "make showconfig" rather than checking directly for a config file of
that name. This broke when as part of the rename of the linuxapp/bsdapp
configs to just linux/freebsd, as we stopped advertising the old names
even if they worked. Changing the code to just look for the config
file by name fixes this issue while shortening the code too.

Fixes: 218c4e68c1d9 ("mk: use linux and freebsd in config names")
Fixes: aafaea3d3b70 ("devtools: add tags and cscope index generation")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agodoc: update cross Arm toolchain in Linux guide
Joyce Kong [Mon, 11 Mar 2019 03:05:14 +0000 (11:05 +0800)]
doc: update cross Arm toolchain in Linux guide

Update cross build tool links as newer cross build tools
version are provided on Linaro, and attempts to download
the old one give permission denied.

Fixes: 01add9da25cd ("doc: add cross compiling guide")
Cc: stable@dpdk.org
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Acked-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agobuild: remove meson warning for Arm
Jerin Jacob [Tue, 19 Mar 2019 17:22:20 +0000 (17:22 +0000)]
build: remove meson warning for Arm

Remove the following warning by comparing string to string.

config/arm/meson.build:153: WARNING: Trying to compare values of
different types (list, str) using ==.

Fixes: c6e536e38437 ("build: add more implementers IDs and PNs for ARM")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: move variable for drivers to top level
Andrius Sirvys [Mon, 25 Mar 2019 10:34:59 +0000 (10:34 +0000)]
build: move variable for drivers to top level

If for debugging we disable the driver directory in the meson.build file,
we get an error because the variable "driver_classes" does not exist.
This is because driver_classes is only defined in the
drivers/meson.build file. Defining driver_classes in dpdk/meson.build file
will make it easier for compiling separate directories.

In the process, we rename driver_classes to dpdk_driver_classes for
consistency with the other variables.

Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: use integer for max ethdev ports option
Luca Boccassi [Fri, 1 Mar 2019 15:46:51 +0000 (15:46 +0000)]
build: use integer for max ethdev ports option

max_ethports was merged after the other patch was written:

e04ea7fcf03c ("build: use integers for numerical options")

So convert this one too like the others have already been.

Fixes: d5555fc900a9 ("build: add option to override max ethdev ports")

Signed-off-by: Luca Boccassi <bluca@debian.org>
5 years agoci: introduce Travis builds for GitHub repositories
Michael Santana [Mon, 25 Mar 2019 15:32:08 +0000 (11:32 -0400)]
ci: introduce Travis builds for GitHub repositories

GitHub is a service used by developers to store repositories.  GitHub
provides service integrations that allow 3rd party services to access
developer repositories and perform actions.  One of these services is
Travis-CI, a simple continuous integration platform.

This series introduces the ability for any github mirrors of the DPDK
project, including developer mirrors, to kick off builds under the
travis CI infrastructure.  For now, this just means compilation - no
other kinds of automated run exists yet.  In the future, this can be
expanded to execute and report results for any test-suites that might
exist.

This is a simple initial implementation of a travis build for the DPDK
project.  It doesn't require any changes from individual developers to
enable, but will allow those developers who opt-in to GitHub and the
travis service to get automatic builds for every push they make.

The files added under .ci/ exist so that in the future, other CI
support platforms (such as cirrus, appveyor, etc.) could have a common
place to put their requisite scripts without polluting the main tree.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agocompressdev: add flag to specify where processing is done
Fiona Trahe [Thu, 17 Jan 2019 17:36:23 +0000 (17:36 +0000)]
compressdev: add flag to specify where processing is done

A new device feature flag, RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE
is added. A PMD should set this if the bulk of the
processing is done during the dequeue. It should leave it
cleared if the bulk of the processing is done during the
enqueue (default).
Applications can use this as a hint for tuning.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agoexamples/ipsec-secgw: add test scripts for 3DES-CBC
Fan Zhang [Wed, 20 Mar 2019 15:38:37 +0000 (15:38 +0000)]
examples/ipsec-secgw: add test scripts for 3DES-CBC

This patch adds the functional test scripts to ipsec-secgw
sample application for both transport and tunnel working
mode.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoipsec: support 3DES-CBC
Fan Zhang [Wed, 20 Mar 2019 15:38:36 +0000 (15:38 +0000)]
ipsec: support 3DES-CBC

This patch adds triple-des CBC mode cipher algorithm to ipsec
library.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: add test scripts for AES-CTR
Fan Zhang [Wed, 20 Mar 2019 15:38:35 +0000 (15:38 +0000)]
examples/ipsec-secgw: add test scripts for AES-CTR

This patch adds the functional test scripts to ipsec-secgw
sample application for both transport and tunnel working
mode.

Updated a bit on common_defs to use "mktemp" instead of "tempfile"
as Fedora does not like the command.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoipsec: support AES-CTR
Fan Zhang [Wed, 20 Mar 2019 15:38:34 +0000 (15:38 +0000)]
ipsec: support AES-CTR

This patch adds AES-CTR cipher algorithm support to ipsec
library.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agocryptodev: remove XTS comment duplication
Damian Nowak [Wed, 13 Mar 2019 14:52:13 +0000 (15:52 +0100)]
cryptodev: remove XTS comment duplication

This patch removes duplicated text about AES-XTS
mode.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/qat: support XTS
Damian Nowak [Wed, 13 Mar 2019 14:52:12 +0000 (15:52 +0100)]
crypto/qat: support XTS

This patch adds XTS capabilities and enables
XTS cipher mode on QAT.
It also updates the documentation for newly
supported AES XTS mode on QAT.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: add tests for XTS on QAT
Damian Nowak [Wed, 13 Mar 2019 14:52:11 +0000 (15:52 +0100)]
test/crypto: add tests for XTS on QAT

This patch adds test vectors for AES XTS mode
on QAT. It uses different plaintext sizes
and AES keys sizes of 128 and 256 bits.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/crypto: fix possible overflow using strlcat
Chaitanya Babu Talluri [Mon, 18 Mar 2019 12:36:36 +0000 (12:36 +0000)]
test/crypto: fix possible overflow using strlcat

strcat does not check the destination length and there might be
chances of string overflow so instead of strcat, strlcat is used.

Fixes: 6f4eec2565 ("test/crypto: enhance scheduler unit tests")
Cc: stable@dpdk.org
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/fips_validation: support plain SHA
Damian Nowak [Tue, 19 Mar 2019 09:43:48 +0000 (10:43 +0100)]
examples/fips_validation: support plain SHA

This patch enables plain SHA algorithm CAVP test support
in fips_validation sample application.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agocrypto/octeontx: move device specific code to driver
Anoob Joseph [Fri, 1 Mar 2019 18:42:32 +0000 (18:42 +0000)]
crypto/octeontx: move device specific code to driver

Moving upper level enqueue/dequeue routines to driver. The h/w interface
used to submit request has enough differences to substantiate the need
for separate routines.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
5 years agocommon/cpt: redesign propagation of error
Anoob Joseph [Fri, 1 Mar 2019 18:42:27 +0000 (18:42 +0000)]
common/cpt: redesign propagation of error

The check for prep_req is good enough to flag error. The return var
passed around is redundant. Fixing this. Also making the functions
return correct error values in case of various failures.

In addition, adding unlikely flag for all error checks.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
5 years agocommon/cpt: improve structures used in datapath
Anoob Joseph [Fri, 1 Mar 2019 18:42:20 +0000 (18:42 +0000)]
common/cpt: improve structures used in datapath

Making cpt_request_info structure cache aligned. This structure is
used from data path.

Also rearranging the pending queue structure to
prevent hole in between members.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
5 years agocryptodev: fix driver name comparison
Anoob Joseph [Mon, 11 Mar 2019 05:55:44 +0000 (05:55 +0000)]
cryptodev: fix driver name comparison

The string compare to the length of driver name might give false
positives when there are drivers with similar names (one being the
subset of another).

Following is such a naming which could result in false positive.
1. crypto_driver
2. crypto_driver1

When strncmp with len = strlen("crypto_driver") is done, it could give
a false positive when compared against "crypto_driver1". For such cases,
'strlen + 1' is done, so that the NULL termination also would be
considered for the comparison.

Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")
Cc: stable@dpdk.org
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: fix debug logs
Bernard Iremonger [Thu, 7 Mar 2019 10:34:52 +0000 (10:34 +0000)]
examples/ipsec-secgw: fix debug logs

Improve debug code in esp.c, sa.c and ipsec-secgw.c

Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")
Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: fix AES-CTR block size
Fan Zhang [Tue, 5 Mar 2019 14:40:41 +0000 (14:40 +0000)]
examples/ipsec-secgw: fix AES-CTR block size

This patch fixes the incorrect block size for AES-CTR in
legacy mode. Originally, wrong block size will cause
esp_inbound() drop AES-CTR encrypted packets if the payload
sizes not equal to multiple times of 16.

Fixes: 4470c22de2e1 ("examples/ipsec-secgw: add AES-CTR")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocompress/qat: add fallback to fixed compression
Tomasz Jozwiak [Fri, 15 Feb 2019 09:44:32 +0000 (10:44 +0100)]
compress/qat: add fallback to fixed compression

This patch adds fallback to fixed compression
feature during dynamic compression, when the input data size
is greater than IM buffer size / 1.1. This feature doesn't
stop compression proccess when IM buffer can be too small
to handle produced data.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocompress/isal: add version display
Tomasz Cel [Mon, 11 Feb 2019 09:18:52 +0000 (10:18 +0100)]
compress/isal: add version display

Display information about ISA-L lib version in UTs.

Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agocompress/qat: fix setup inter buffers
Marko Kovacevic [Thu, 24 Jan 2019 15:03:04 +0000 (15:03 +0000)]
compress/qat: fix setup inter buffers

This patch fixes qat comp setup inter_buffers
memory allocation size to a broader size
then just 2MB

Fixes: a124830a6f00 ("compress/qat: enable dynamic huffman encoding")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest: add result field to mod exp and inv
Arek Kusztal [Fri, 8 Feb 2019 11:13:38 +0000 (12:13 +0100)]
test: add result field to mod exp and inv

This patch adds result field to modular exponentiation and
modular multiplicative inverse tests

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agocrypto/openssl: add result field to mod exp and inv
Arek Kusztal [Fri, 8 Feb 2019 11:13:37 +0000 (12:13 +0100)]
crypto/openssl: add result field to mod exp and inv

This patch adds result field to modular exponentiation and modular
multiplicative inverse operations in openssl pmd functions

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
5 years agocryptodev: add result field to mod exp and inv
Arek Kusztal [Fri, 8 Feb 2019 11:13:36 +0000 (12:13 +0100)]
cryptodev: add result field to mod exp and inv

This commit adds result field to be used when modular exponentiation or
modular multiplicative inverse operation is used

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agocryptodev: restore crypto op alignment and layout
Konstantin Ananyev [Thu, 7 Mar 2019 14:13:14 +0000 (14:13 +0000)]
cryptodev: restore crypto op alignment and layout

in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
As it also was included into rte_crypto_op, it caused implicit change
in rte_crypto_op layout and alignment: now rte_crypto_op is cache-line
aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
It looks like unintended ABI breakage, plus such change can cause
negative performance effects:
- now status and sym[0].m_src lies on different cache-lines, so
  post-process code would need extra cache-line read.
- new alignment causes grow of the space requirements and cache-line
  reads/updates for structures that contain rte_crypto_op inside.
As there seems no actual need to have rte_crypto_asym_op cache-line
aligned, and rte_crypto_asym_op is not intended to be used on it's own -
the simplest fix is just to remove cache-line alignment for it.
As the immediate positive effect: on IA ipsec-secgw performance increased
by 5-10% (depending on the crypto-dev and algo used).
My guess that on machines with 128B cache-line and lookaside-protocol
capable crypto devices the impact will be even more noticeable.

Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agodrivers/net: fix possible overflow using strlcat
Chaitanya Babu Talluri [Fri, 22 Mar 2019 07:51:42 +0000 (07:51 +0000)]
drivers/net: fix possible overflow using strlcat

strcat does not check the destination length and there might be
chances of string overflow so instead of strcat, strlcat is used.

Fixes: 540a211084a7 ("bnx2x: driver core")
Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info")
Cc: stable@dpdk.org
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agonet/bonding: fix queue index types
David Marchand [Wed, 20 Mar 2019 11:47:22 +0000 (12:47 +0100)]
net/bonding: fix queue index types

Caught by code review, rxq and txq indexes are on 16bits.

Fixes: d1d1e664c6c4 ("bonding: free queue memory when closing")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix packet count type for LACP
David Marchand [Wed, 20 Mar 2019 11:47:21 +0000 (12:47 +0100)]
net/bonding: fix packet count type for LACP

Caught by code review, those variables are supposed to be on 16bits to
avoid endless loops in the (unlikely?) case where the application asks
for receiving more than 256 packets and the accumulated num_rx_total
count reaches 256:

uint16_t num_rx_total = 0;
uint8_t j, k;

j = num_rx_total;
num_rx_total += rte_eth_rx_burst();

for (k = j; k < 2 && k < num_rx_total; k++)
rte_prefetch0(rte_pktmbuf_mtod(bufs[k], void *));

while (j < num_rx_total) {
j++;
}

Fixes: 46fb43683679 ("bond: add mode 4")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix slave id types
David Marchand [Wed, 20 Mar 2019 11:47:20 +0000 (12:47 +0100)]
net/bonding: fix slave id types

Caught by code review, with port id conversion to 16bits, the slave id
have been extended to 16bits as well (both slave index and count).

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix port id types
David Marchand [Wed, 20 Mar 2019 11:47:19 +0000 (12:47 +0100)]
net/bonding: fix port id types

Following the port id conversion to 16bits, two references to bonding
port id have been missed.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix examples in bonding guide
David Marchand [Wed, 20 Mar 2019 11:47:18 +0000 (12:47 +0100)]
doc: fix examples in bonding guide

Removed incorrect space character and fixed PCI addresses.

Fixes: fc1f2750a3ec ("doc: programmers guide")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/cxgbe: fix missing checksum flags and packet type
Vishal Kulkarni [Wed, 20 Mar 2019 11:48:21 +0000 (17:18 +0530)]
net/cxgbe: fix missing checksum flags and packet type

Checksum good offload flags are not being set and some of the
packet type flags are missing on received packets. So, rework
Rx path to set proper ol_flags and packet_type in mbufs.

Fixes: 78fc1a716ae8 ("cxgbe: improve Rx performance")
Cc: stable@dpdk.org
Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: remove unused code in Rx path
Vishal Kulkarni [Wed, 20 Mar 2019 11:49:16 +0000 (17:19 +0530)]
net/cxgbe: remove unused code in Rx path

All Rx packet handling is done in process_responses() and hence
t4_ethrx_handler() never gets called. So, remove it.

Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/bonding: fix LACP negotiation
Liang Zhang [Thu, 21 Mar 2019 10:22:47 +0000 (18:22 +0800)]
net/bonding: fix LACP negotiation

When monitor(port-mirroring) traffic from other LACP port-channel,
rx_machine_update may be receiving other LACP negotiation packets.
Thus bond mode 4 negotiation will fail.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
Cc: stable@dpdk.org
Signed-off-by: Liang Zhang <zhangliang@bigo.sg>
Acked-by: Chas Williams <chas3@att.com>
5 years agoethdev: check for invalid device name
Stephen Hemminger [Thu, 14 Mar 2019 16:20:47 +0000 (09:20 -0700)]
ethdev: check for invalid device name

Do not allow creating an Ethernet device with a name over the
allowed maximum (or zero length).
This is safer than silently truncating which is what happens now.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ali Alnubani <alialnu@mellanox.com>
5 years agonet/sfc: fix speed capabilities reported in device info
Andrew Rybchenko [Tue, 19 Mar 2019 16:36:00 +0000 (16:36 +0000)]
net/sfc: fix speed capabilities reported in device info

Phy capabilities are bit offsets in libefx, but was used as bit masks.

Fixes: d23f3a89ab54 ("net/sfc: support link speed and duplex settings")
Fixes: f82e33afbbb9 ("net/sfc: support link speeds up to 100G")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/dpaa2: accept packets with checksum error
Shreyansh Jain [Tue, 19 Mar 2019 13:10:55 +0000 (13:10 +0000)]
net/dpaa2: accept packets with checksum error

Until now, DPAA2 driver was configured to drop any packet which
was marked as malformed by hardware - which included those with
wrong checksum.
With this patch, that configuration has been removed - hereafter,
all packets arriving on a DPMAC link would be forwarded to a DPNI
and further processing would be done as configured for a standard
packet path.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/tap: fix getting max iovec
Oleg Polyakov [Mon, 18 Mar 2019 18:20:47 +0000 (14:20 -0400)]
net/tap: fix getting max iovec

If the value _SC_IOV_MAX is missing, sysconf returns -1.
In this case, iov_max is set to a default value of 1024.
This should never happen except for redhat bug:
   https://bugzilla.redhat.com/show_bug.cgi?id=1504165

Fixes: ec12df9504fe ("net/tap: fix support for large Rx queues")
Cc: stable@dpdk.org
Signed-off-by: Oleg Polyakov <olegp123@walla.co.il>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agonet/nfp: fix possible buffer overflow
Pallantla Poornima [Fri, 8 Mar 2019 10:28:05 +0000 (10:28 +0000)]
net/nfp: fix possible buffer overflow

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

Fixes: 896c265ef954 ("net/nfp: use new CPP interface")
Fixes: c4171b520b3f ("net/nfp: support PF multiport")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agoapp/testpmd: fix stdout flush after printing stats
Igor Romanov [Mon, 18 Mar 2019 11:35:47 +0000 (11:35 +0000)]
app/testpmd: fix stdout flush after printing stats

User can specify stats period(n). The statistics should be available
to user every n second. But the print_stats() function does not
force stdout to be flushed, so for instance, a user reading testpmd's
stdout through pipe will not be able to read it until the stdout
buffer is filled.

Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoethdev: highlight that all-multicast is retained on restart
Andrew Rybchenko [Wed, 19 Dec 2018 06:23:00 +0000 (06:23 +0000)]
ethdev: highlight that all-multicast is retained on restart

All-multicast is a part of receive mode configuration and it is
better to mention explicitly that it is retained across restart.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoethdev: advertise default MAC as retained on restart
Andrew Rybchenko [Wed, 19 Dec 2018 06:22:59 +0000 (06:22 +0000)]
ethdev: advertise default MAC as retained on restart

The documentation says MAC addresses array is retained and
it is logical to assume that default MAC address is retained
as well.

Also some PMDs do not allow to change the default MAC in
running state (see RTE_ETH_DEV_NOLIVE_MAC_ADDR).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoethdev: advertise MTU as retained across stop/start
Andrew Rybchenko [Wed, 19 Dec 2018 06:22:58 +0000 (06:22 +0000)]
ethdev: advertise MTU as retained across stop/start

Changing MTU in running state may return -EBUSY saying that
MTU cannot be changed when the port is running. It assumes
that changes may be done in stopped and started (but some
PMDs may reject it) state and it is logical to require that
changes done in any of these states are retained.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agonet/ice: speed up to retrieve EEPROM
Leyi Rong [Mon, 18 Mar 2019 05:50:39 +0000 (13:50 +0800)]
net/ice: speed up to retrieve EEPROM

Replace ice_read_sr_word with ice_read_sr_buf in ice_get_eeprom.

Fixes: d0dd1c8e1997 ("net/ice: support EEPROM information getting")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agovhost: support requests only handled by external backend
Maxime Coquelin [Tue, 19 Mar 2019 10:54:17 +0000 (11:54 +0100)]
vhost: support requests only handled by external backend

External backends may have specific requests to handle, and so
we don't want the vhost-user lib to handle these requests as
errors.

This patch also changes the experimental API by introducing
RTE_VHOST_MSG_RESULT_NOT_HANDLED so that vhost-user lib
can report an error if a message is handled neither by
the vhost-user library nor by the external backend.

The logic changes a bit so that if the callback returns
with ERR, OK or REPLY, it is considered the message
is handled by the external backend so it won't be
handled by the vhost-user library.
It is still possible for an external backend to listen
to requests that have to be handled by the vhost-user
library like SET_MEM_TABLE, but the callback have to
return NOT_HANDLED in that case.

Vhost-crypto backend is also adapted to this API change.

Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: add API to set protocol features flags
Maxime Coquelin [Tue, 19 Mar 2019 10:54:16 +0000 (11:54 +0100)]
vhost: add API to set protocol features flags

rte_vhost_driver_set_protocol_features API is to be used
by external backends to advertise vhost-user protocol
features it supports.

It has to be called after rte_vhost_driver_register() and
before rte_vhost_driver_start().

Example of usage to advertize VHOST_USER_PROTOCOL_F_FOOBAR
protocol feature:

const char *path = "/tmp/vhost-user";
uint64_t protocol_features;
rte_vhost_driver_register(path, 0);
rte_vhost_driver_get_protocol_features(path, &protocol_features);
protocol_features |= VHOST_USER_PROTOCOL_F_FOOBAR;
rte_vhost_driver_set_protocol_features(path, protocol_features);
rte_vhost_driver_start(path);

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: improve batching in standard Rx path
Tiwei Bie [Tue, 19 Mar 2019 06:43:12 +0000 (14:43 +0800)]
net/virtio: improve batching in standard Rx path

This patch improves descriptors refill by using the same
batching strategy as done in in-order and mergeable path.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add control queue helper for split ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:11 +0000 (14:43 +0800)]
net/virtio: add control queue helper for split ring

Add a helper for sending commands in split ring to make the
code consistent with the corresponding code in packed ring.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add interrupt helper for split ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:10 +0000 (14:43 +0800)]
net/virtio: add interrupt helper for split ring

Add a helper for disabling interrupts in split ring to make the
code consistent with the corresponding code in packed ring.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: drop unused field in Tx region structure
Tiwei Bie [Tue, 19 Mar 2019 06:43:09 +0000 (14:43 +0800)]
net/virtio: drop unused field in Tx region structure

Drop the unused field tx_indir_pq from virtio_tx_region
structure.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: drop redundant suffix in packed ring structure
Tiwei Bie [Tue, 19 Mar 2019 06:43:08 +0000 (14:43 +0800)]
net/virtio: drop redundant suffix in packed ring structure

Drop redundant suffix (_packed and _event) from the fields in
packed ring structure.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: refactor virtqueue structure
Tiwei Bie [Tue, 19 Mar 2019 06:43:07 +0000 (14:43 +0800)]
net/virtio: refactor virtqueue structure

Put split ring and packed ring specific fields into separate
sub-structures, and also union them as they won't be available
at the same time.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: optimize flags update for packed ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:06 +0000 (14:43 +0800)]
net/virtio: optimize flags update for packed ring

Cache the AVAIL, USED and WRITE bits to avoid calculating
them as much as possible. Note that, the WRITE bit isn't
cached for control queue.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add barrier in interrupt enable
Tiwei Bie [Tue, 19 Mar 2019 06:43:05 +0000 (14:43 +0800)]
net/virtio: add barrier in interrupt enable

Typically, after enabling Rx interrupt, a check should be done
to make sure that there is no new incoming packets before going
to sleep. So a barrier is needed to make sure that any following
check won't happen before the interrupt is actually enabled.

Fixes: c056be239db5 ("net/virtio: add Rx interrupt enable/disable functions")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix interrupt helper for packed ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:04 +0000 (14:43 +0800)]
net/virtio: fix interrupt helper for packed ring

When disabling interrupt, the shadow event flags should also be
updated accordingly. The unnecessary wmb is also dropped.

Fixes: e9f4feb7e622 ("net/virtio: add packed virtqueue helpers")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix typo in packed ring init
Tiwei Bie [Tue, 19 Mar 2019 06:43:03 +0000 (14:43 +0800)]
net/virtio: fix typo in packed ring init

The pointer to event structure should be cast to uintptr_t first.

Fixes: f803734b0f2e ("net/virtio: vring init for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix interrupt suppression for the split ring
Jiayu Hu [Sun, 17 Mar 2019 06:38:32 +0000 (14:38 +0800)]
vhost: fix interrupt suppression for the split ring

The VIRTIO_RING_F_EVENT_IDX feature of split ring might
be broken, as the value of signalled_used is invalid
after live migration, start up and virtio driver reload.
This patch fixes it by using signalled_used_valid.

In addition, this patch makes the VIRTIO_RING_F_EVENT_IDX
implementation of split ring match kernel backend to suppress
more interrupts.

Fixes: e37ff954405a ("vhost: support virtqueue interrupt/notification suppression")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio-user: fix multiqueue with vhost kernel
Tiwei Bie [Tue, 12 Mar 2019 07:13:07 +0000 (15:13 +0800)]
net/virtio-user: fix multiqueue with vhost kernel

The multiqueue support in virtio-user with vhost kernel backend
is broken when tap name isn't specified by users explicitly,
because the tap name returned by ioctl(TUNSETIFF) isn't saved
properly, and multiple tap interfaces will be created in this
case. Fix this by saving the dynamically allocated tap name
first before reusing the ifr structure. Besides, also make it
possible to support the format string in tap name (e.g. foo%d)
specified by users explicitly.

Fixes: 791b43e08842 ("net/virtio-user: specify MAC of the tap")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agovhost: prevent disabled rings to be processed with zero-copy
Maxime Coquelin [Thu, 28 Feb 2019 17:57:04 +0000 (18:57 +0100)]
vhost: prevent disabled rings to be processed with zero-copy

The vhost-user spec says that once the vring is disabled, the
client has to stop processing it. But it can happen when
dequeue zero-copy is enabled if outstanding descriptors buffers
are still being processed by an external NIC or another guest.

The fix consists in draining the zmbufs list to ensure no more
descriptors buffers are in the wild.

Note that this fix is only working in the case REPLY_ACK
protocol feature is enabled, which is not the case by default
for now (it is only enabled when IOMMU feature is enabled in
the vhost library).

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/octeontx: fix vdev name
Stephen Hemminger [Wed, 13 Mar 2019 21:58:15 +0000 (14:58 -0700)]
net/octeontx: fix vdev name

The octeontx driver is creating vdev with name  "OCTEONTX_PMD"
which is an artifact from how RTE_PMD_REGISTER_VDEV arguments
work.

Change to use the same convention as all the other network
drivers ie "net_octeontx").

Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agonet/enic: fix max MTU calculation
Hyong Youb Kim [Thu, 14 Mar 2019 11:05:32 +0000 (04:05 -0700)]
net/enic: fix max MTU calculation

The maximum packet length (max_pkt_len) from the firmware does not
include CRC, so do not subtract 4 when deriving the max MTU. This
change effectively increases the max MTU by 4B. Apps often assume max
MTU = max_rx_pkt_len - 14 (ethernet header), and attempt to set the
MTU to that value (i.e. set MTU to max HW value). This change
incidentally allows such apps to change MTU to max value successfully.

Fixes: bb34ffb848a0 ("net/enic: determine max egress packet size and max MTU")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agoexamples/ethtool: remove query of default config
Thomas Monjalon [Wed, 13 Mar 2019 10:09:09 +0000 (11:09 +0100)]
examples/ethtool: remove query of default config

The default config is used if the setup parameter is NULL.
No need to query the default config with rte_eth_dev_info_get().
The function call will be removed with another useless info.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/atlantic: fix xstats return
Igor Russkikh [Tue, 12 Mar 2019 15:25:10 +0000 (15:25 +0000)]
net/atlantic: fix xstats return

Max number of xstats items was returned instead of actual number
of filled in records.

Fixes: fbe059e87209 ("net/atlantic: implement device statistics")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix missing VLAN filter offload
Igor Russkikh [Tue, 12 Mar 2019 15:25:07 +0000 (15:25 +0000)]
net/atlantic: fix missing VLAN filter offload

Original vlan offload code declared callbacks, but did not
enable the feature offload bit

Fixes: f7c2c2c8c558 ("net/atlantic: implement VLAN filters and offloads")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: eliminate excessive log levels on Rx/Tx
Igor Russkikh [Tue, 12 Mar 2019 15:25:05 +0000 (15:25 +0000)]
net/atlantic: eliminate excessive log levels on Rx/Tx

Default rxtx logging used ERR level, that caused logger to always
trigger. That may cause perf degradation even if logger was not enabled
but compiled in.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix link configuration
Igor Russkikh [Tue, 12 Mar 2019 15:25:03 +0000 (15:25 +0000)]
net/atlantic: fix link configuration

In case link speed is re configured after port start, it does not
takes the requested speed value, but instead just sets full autoneg
mask.

Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt management")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix EEPROM get for small and uneven lengths
Pavel Belous [Tue, 12 Mar 2019 15:25:01 +0000 (15:25 +0000)]
net/atlantic: fix EEPROM get for small and uneven lengths

Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: use EEPROM magic as a device address
Pavel Belous [Tue, 12 Mar 2019 15:24:59 +0000 (15:24 +0000)]
net/atlantic: use EEPROM magic as a device address

Default dev addr is replaced with magic field from the request.
Length is allowed to be less than maximum.
SMBUS access bit definitions also better organised now.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: fix buffer overflow
Pavel Belous [Tue, 12 Mar 2019 15:24:57 +0000 (15:24 +0000)]
net/atlantic: fix buffer overflow

Found by Coverity scan. This is a real memory corruption.
There is no need in extra RTE_ALIGN macros since the
request/result structures are 4-byte aligned by definition.

Coverity issue: 323518, 323520
Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: remove extra checks for error codes
Igor Russkikh [Tue, 12 Mar 2019 15:24:55 +0000 (15:24 +0000)]
net/atlantic: remove extra checks for error codes

Found by Coverity scan. Checks are useless
because at these code places err is always zero.

Fixes: 86d36773bd42 ("net/atlantic: implement firmware operations")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>