dpdk.git
5 years agopower: fix frequency list buffer validation
Kevin Traynor [Wed, 6 Feb 2019 12:19:06 +0000 (12:19 +0000)]
power: fix frequency list buffer validation

The frequency list buffer was already validated in
power_acpi_cpufreq_freqs(), so the newly added check was redundant.
To keep consistency with power_pstate_cpufreq_freqs(), remove the
original check and update the log message.

Fixes: 2e6ccdb4e088 ("power: fix frequency list to handle null buffer")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
5 years agonet/dpaa2: support flow table flush
Hemant Agrawal [Tue, 26 Mar 2019 12:01:48 +0000 (12:01 +0000)]
net/dpaa2: support flow table flush

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/dpaa: delay fman device list to bus probe
Hemant Agrawal [Tue, 26 Mar 2019 12:01:46 +0000 (12:01 +0000)]
bus/dpaa: delay fman device list to bus probe

The fman device list need to be accessed across processes.
The hw device structures should be allocated with rte_calloc
instead of calloc. The rte_calloc is not available at the
time of bus scan, so better prepare the device list at probe.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agomempool/dpaa: allocate bp info for multiprocess
Akhil Goyal [Tue, 26 Mar 2019 12:01:45 +0000 (12:01 +0000)]
mempool/dpaa: allocate bp info for multiprocess

rte_dpaa_bpid_info shall be allocated with the hugepage memory
which can be shared across processes.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agobus/dpaa: save fq lookup table for secondary process
Akhil Goyal [Tue, 26 Mar 2019 12:01:44 +0000 (12:01 +0000)]
bus/dpaa: save fq lookup table for secondary process

A reference to qman_fq_lookup_table need to be saved in each
fq, so that it is retrieved while in running secondary process.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agobus/dpaa: fix Rx discard register mask
Shreyansh Jain [Fri, 22 Feb 2019 10:09:44 +0000 (10:09 +0000)]
bus/dpaa: fix Rx discard register mask

Current value of 'fmbm_rfsdm' register (0x010CE3F0) doesn't include
the bit to drop colored (red) packets. New value (0x010EE3F0) fixes
this.
Check with 'fmbm_rffc' register of fm_port_bmi_regs.

Fixes: 6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agobus/fslmc: remove unneeded strdup
Stephen Hemminger [Tue, 12 Mar 2019 17:11:52 +0000 (10:11 -0700)]
bus/fslmc: remove unneeded strdup

The fslmc bus code was duplicating the device name and
doing extra initialization. The code can be simplified
to just use the device name directly.

Compile tested only; do not have this hardware.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobus/fslmc: decrease log level for unsupported devices
Stephen Hemminger [Tue, 12 Mar 2019 17:11:51 +0000 (10:11 -0700)]
bus/fslmc: decrease log level for unsupported devices

When fslmc is built as part of a general distribution, the
bus code will log errors when other devices are present.

This could confuse users it is not an error.

Fixes: 50245be05d1a ("bus/fslmc: support device blacklisting")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
5 years agonet/netvsc: remove unnecessary format of MAC address
Stephen Hemminger [Fri, 8 Feb 2019 03:44:07 +0000 (19:44 -0800)]
net/netvsc: remove unnecessary format of MAC address

The ethernet address was being converted to a string but
the code using that is no longer present.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agobus/vmbus: refactor secondary mapping
Stephen Hemminger [Fri, 8 Feb 2019 03:44:06 +0000 (19:44 -0800)]
bus/vmbus: refactor secondary mapping

The secondary mapping function was duplicating the code
used to search the uio_resource list.

Skip the unwinding since map failure already makes device
unusable.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agobus/vmbus: map ring in secondary process
Stephen Hemminger [Fri, 8 Feb 2019 03:44:05 +0000 (19:44 -0800)]
bus/vmbus: map ring in secondary process

Need to remember primary channel in secondary process.
Then use it to iterate over subchannels in secondary
process mapping setup.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agobus/vmbus: stop mapping if empty resource found
Stephen Hemminger [Fri, 8 Feb 2019 03:44:04 +0000 (19:44 -0800)]
bus/vmbus: stop mapping if empty resource found

If vmbus is run on older kernel (without all the uio mappings),
then the bus driver should stop when it hits the missing mappings
rather than recording the empty values.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agobus/vmbus: fix check for mmap failure
Stephen Hemminger [Fri, 8 Feb 2019 03:44:03 +0000 (19:44 -0800)]
bus/vmbus: fix check for mmap failure

The code was testing the result of mmap incorrectly.
I.e the test that a local pointer is not MAP_FAILED would
always succeed and therefore hid any potential problems.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agonet/netvsc: fix VF support with secondary process
Stephen Hemminger [Fri, 8 Feb 2019 03:44:02 +0000 (19:44 -0800)]
net/netvsc: fix VF support with secondary process

The VF device management in netvsc was using a pointer to the
rte_eth_devices. But the actual rte_eth_devices array is likely to
be place in the secondary process; which causes a crash.

The solution is to record the port of the VF (instead of a pointer)
and find the device in the per process array as needed.

Fixes: dc7680e8597c ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agobus/vmbus: fix secondary process setup
Stephen Hemminger [Fri, 8 Feb 2019 03:44:01 +0000 (19:44 -0800)]
bus/vmbus: fix secondary process setup

The secondary process doesn't correctly map the second
and later resources because it doesn't change the offset.

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agomalloc: fix IPC message initialization
Anatoly Burakov [Fri, 29 Mar 2019 10:56:15 +0000 (10:56 +0000)]
malloc: fix IPC message initialization

The memset size for an IPC message is set incorrectly. Fix it to
cover the entire IPC message.

Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agofbarray: fix init unlock without lock
Anatoly Burakov [Fri, 29 Mar 2019 10:57:08 +0000 (10:57 +0000)]
fbarray: fix init unlock without lock

Certain failure paths of rte_fbarray_init() will unlock the
mem area lock without locking it first. Fix this by properly
handling the failures.

Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agofbarray: fix attach deadlock
Darek Stojaczyk [Fri, 29 Mar 2019 09:52:39 +0000 (10:52 +0100)]
fbarray: fix attach deadlock

rte_fbarray_attach() currently locks its internal
spinlock, but never releases it. Secondary processes
won't even start if there is more than one fbarray
to be attached to - the second rte_fbarray_attach()
would be just stuck.

Fix it by releasing the lock at the end of
rte_fbarray_attach(). I believe this was the original
intention.

Fixes: 5b61c62cfd76 ("fbarray: add internal tailq for mapped areas")

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agodrivers: fix SPDX license id consistency
Stephen Hemminger [Wed, 6 Feb 2019 22:27:57 +0000 (14:27 -0800)]
drivers: fix SPDX license id consistency

All drivers should have SPDX on the first line of the source
files in the format
  /* SPDX-License-Identifier: ...

Several files used minor modifications which were inconsistent
with the pattern. Fix it to make scanning tools easier.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agovfio: document multiprocess limitation for container API
Anatoly Burakov [Wed, 27 Feb 2019 15:41:24 +0000 (15:41 +0000)]
vfio: document multiprocess limitation for container API

Currently, there is no support for sharing custom VFIO containers
between multiple processes, but it is not documented.

Document this limitation.

Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: remove redundant atomic API description
Thomas Monjalon [Tue, 19 Mar 2019 21:16:00 +0000 (22:16 +0100)]
eal: remove redundant atomic API description

Atomic functions are described in doxygen of the file
lib/librte_eal/common/include/generic/rte_atomic.h
The copies in arch-specific files are redundant
and confuse readers about the genericity of the API.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agoeal/ppc: fix global memory barrier
Dekel Peled [Mon, 18 Mar 2019 12:58:13 +0000 (14:58 +0200)]
eal/ppc: fix global memory barrier

From previous patch description: "to improve performance on PPC64,
use light weight sync instruction instead of sync instruction."

Excerpt from IBM doc [1], section "Memory barrier instructions":
"The second form of the sync instruction is light-weight sync,
or lwsync.
This form is used to control ordering for storage accesses to system
memory only. It does not create a memory barrier for accesses to
device memory."

This patch removes the use of lwsync, so calls to rte_wmb() and
rte_rmb() will provide correct memory barrier to ensure order of
accesses to system memory and device memory.

[1] https://www.ibm.com/developerworks/systems/articles/powerpc.html

Fixes: d23a6bd04d72 ("eal/ppc: fix memory barrier for IBM POWER")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
5 years agomem: count overcommit hugepages as available
Michał Mirosław [Mon, 25 Feb 2019 20:57:28 +0000 (21:57 +0100)]
mem: count overcommit hugepages as available

With nr_overcommit_hugepages > 0 application may be able to allocate
hugepages even when free_hugepages == 0. Take this into account when
counting available hugepages.

Signed-off-by: Michał Mirosław <michal.miroslaw@atendesoftware.pl>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agomem: attempt multiple hugepage allocations at init
Anatoly Burakov [Fri, 22 Feb 2019 16:14:03 +0000 (16:14 +0000)]
mem: attempt multiple hugepage allocations at init

When requesting memory with ``-m`` or ``--socket-mem`` flags,
currently the init will fail if the requested memory amount was
bigger than any one memseg list, even if total amount of
available memory was sufficient.

Fix this by making EAL to attempt to allocate pages multiple
times, until we either fulfill our memory requirements, or run
out of hugepages to allocate.

Bugzilla ID: 95

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agomem: improve best-effort allocation
Anatoly Burakov [Fri, 22 Feb 2019 16:14:02 +0000 (16:14 +0000)]
mem: improve best-effort allocation

Previously, when using non-exact allocation, we were requesting
N pages to be allocated, but allowed the memory subsystem to
allocate less than requested. However, we were still expecting
to see N contigous free pages in the memseg list.

This presents a problem because there is no way to try and
allocate as many pages as possible, even if there isn't
enough contiguous free entries in the list.

To address this, use the new "find biggest" fbarray API's when
allocating non-exact number of pages. This way, we will first
check how many entries in the list are actually available, and
then try to allocate up to that number.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agofbarray: add API to find biggest used or free chunks
Anatoly Burakov [Fri, 22 Feb 2019 16:14:01 +0000 (16:14 +0000)]
fbarray: add API to find biggest used or free chunks

Currently, while there is a way to find total amount of used/free
space in an fbarray, there is no way to find biggest contiguous
chunk. Add such API, as well as unit tests to test this API.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agofbarray: add internal tailq for mapped areas
Anatoly Burakov [Tue, 26 Feb 2019 17:13:11 +0000 (17:13 +0000)]
fbarray: add internal tailq for mapped areas

Currently, there are numerous reliability issues with fbarray,
such as:
- There is no way to prevent attaching to overlapping memory
  areas
- There is no way to prevent double-detach
- Failed destroy leaves fbarray in an invalid state (fbarray
  itself is valid, but its backing memory area is already
  detached)

In addition, on FreeBSD, doing mmap() on a file descriptor
does not keep the lock, so we also need to store the fd
in order to keep the lock.

This patch improves upon fbarray to address both of these
issues by adding an internal tailq to track allocated areas
and their respective file descriptors.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoservice: fix parameter type for attribute
Nikhil Rao [Thu, 28 Mar 2019 06:29:03 +0000 (11:59 +0530)]
service: fix parameter type for attribute

The type of value parameter to rte_service_attr_get
should be uint64_t *, since the attributes
are of type uint64_t.

Fixes: 4d55194d76a4 ("service: add attribute get function")

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
5 years agohash: optimize signature compare for Arm NEON
Ruifeng Wang [Tue, 12 Feb 2019 07:01:04 +0000 (15:01 +0800)]
hash: optimize signature compare for Arm NEON

Implemented signature compare function based on neon intrinsic.
Hash bulk lookup had 3% - 6% performance gain after optimization.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agotest/timer: replace config macro with runtime log level
Dharmik Thakkar [Tue, 26 Feb 2019 23:02:29 +0000 (17:02 -0600)]
test/timer: replace config macro with runtime log level

This patch replaces macro with log-level based approach to print debug
information. Need to set timer log type to debug  using the following
eal parameter: --log-level=test.timer:debug

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agotest/efd: replace config macro with runtime log level
Dharmik Thakkar [Tue, 26 Feb 2019 23:02:28 +0000 (17:02 -0600)]
test/efd: replace config macro with runtime log level

This patch enables compilation of print_key_info() always using
log-level based approach instead of a macro. Need to set efd log type
to debug to print debug information, using the following eal parameter:
--log-level=test.efd:debug

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agotest/hash: replace config macro with runtime log level
Dharmik Thakkar [Tue, 26 Feb 2019 23:02:27 +0000 (17:02 -0600)]
test/hash: replace config macro with runtime log level

Need to set hash log type to debug to print debug information, using
following eal parameter: --log-level=test.hash:debug

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agotest/ticketlock: add test cases
Joyce Kong [Mon, 25 Mar 2019 11:11:09 +0000 (19:11 +0800)]
test/ticketlock: add test cases

Add test cases for ticket lock, recursive ticket lock,
and ticket lock performance.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoticketlock: enable generic ticketlock on all arch
Joyce Kong [Mon, 25 Mar 2019 11:11:08 +0000 (19:11 +0800)]
ticketlock: enable generic ticketlock on all arch

Let all architectures use generic ticketlock implementation.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoticketlock: introduce fair ticket based locking
Joyce Kong [Mon, 25 Mar 2019 11:11:07 +0000 (19:11 +0800)]
ticketlock: introduce fair ticket based locking

The spinlock implementation is unfair, some threads may take locks
aggressively while leaving the other threads starving for long time.

This patch introduces ticketlock which gives each waiting thread a
ticket and they can take the lock one by one. First come, first serviced.
This avoids starvation for too long time and is more predictable.

Suggested-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/rwlock: amortize the cost of getting time
Joyce Kong [Mon, 25 Mar 2019 09:14:59 +0000 (17:14 +0800)]
test/rwlock: amortize the cost of getting time

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

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
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>