dpdk.git
4 years agobuild: generate Windows exports file
Bruce Richardson [Fri, 12 Apr 2019 08:29:00 +0000 (09:29 +0100)]
build: generate Windows exports file

Rather than having a separate version.map file for linux/BSD and an
exports definition file for windows for each library, generate the
latter from the former automatically at build time.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agotest: skip meson dependency checks if not required
Ilya Maximets [Thu, 30 May 2019 12:38:36 +0000 (15:38 +0300)]
test: skip meson dependency checks if not required

Don't need to check dependencies if test apps will not be built anyway.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agocrypto/aesni_mb: fix build with gcc 4.8.5
Bruce Richardson [Wed, 5 Jun 2019 14:11:23 +0000 (15:11 +0100)]
crypto/aesni_mb: fix build with gcc 4.8.5

On CentOS/RHEL 7, we get build errors reported due to a variable being
possibly uninitialized. Setting a default init value fixes this issue.

Fixes: c68d7aa354f6 ("crypto/aesni_mb: use architecture independent macros")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agobpf: fix pseudo calls for program loaded from ELF
Konstantin Ananyev [Fri, 17 May 2019 14:09:42 +0000 (15:09 +0100)]
bpf: fix pseudo calls for program loaded from ELF

clang 6.0 and onwards, for the external function call generates
BPF_PSEUDO_CALL instruction:
call pseudo +-off -> call another bpf function.
More details about that change: https://lwn.net/Articles/741773/
DPDK BPF implementation right now doesn't support multiple BPF
functions per module.
To overcome that problem, and preserve existing functionality
(ability to call allowed by user external functions),
bpf_elf_load() clears EBPF_PSEUDO_CALL value.
For details how to reproduce the issue:
https://bugs.dpdk.org/show_bug.cgi?id=259

Fixes: 5dba93ae5f2d ("bpf: add ability to load eBPF program from ELF object file")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agobpf: remove use of weak functions
Bruce Richardson [Wed, 10 Apr 2019 13:45:17 +0000 (14:45 +0100)]
bpf: remove use of weak functions

Weak functions don't work well with static libraries and require the use of
"whole-archive" flag to ensure that the correct function is used when
linking.  Since the weak function is only used as a placeholder within this
library alone, we can replace it with a non-weak version protected using
preprocessor ifdefs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoacl: remove use of weak functions
Bruce Richardson [Wed, 10 Apr 2019 13:45:16 +0000 (14:45 +0100)]
acl: remove use of weak functions

Weak functions don't work well with static libraries and require the use of
"whole-archive" flag to ensure that the correct function is used when
linking. Since the weak functions are only used as placeholders within
this library alone, we can replace them with non-weak functions using
preprocessor ifdefs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoexamples/multi_process: fix FreeBSD build
David Marchand [Wed, 5 Jun 2019 11:30:26 +0000 (13:30 +0200)]
examples/multi_process: fix FreeBSD build

Caught on FreeBSD 12:

/usr/include/netinet/ip.h:71:17: error: field 'ip_src' has incomplete type
  struct in_addr ip_src,ip_dst; /* source and dest address */
                 ^~~~~~

On FreeBSD, netinet/ip.h is not auto sufficient like on Linux.
But actually, this header is not used in the example, just remove it.

Fixes: 764bf26873b9 ("add FreeBSD support")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agorcu: fix format specifier in dump
Honnappa Nagarahalli [Mon, 3 Jun 2019 20:46:45 +0000 (15:46 -0500)]
rcu: fix format specifier in dump

Use %u to fix argument type mismatch in fprintf.

Coverity issue: 340074
Fixes: 64994b56cfd7 ("rcu: add RCU library supporting QSBR mechanism")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
4 years agotest/rcu: make global variable per core
Honnappa Nagarahalli [Thu, 16 May 2019 01:14:17 +0000 (20:14 -0500)]
test/rcu: make global variable per core

Each hash entry has a pointer to one uint32 memory location.
However, all the readers increment the same location causing
race conditions. Allocate memory for each thread so that each
thread will increment its own memory location.

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Tested-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: fix Linux guide for arm64 cross-compilation
Ruifeng Wang [Wed, 15 May 2019 08:41:23 +0000 (16:41 +0800)]
doc: fix Linux guide for arm64 cross-compilation

libnuma.so is needed to augment the cross toolchain with NUMA support.
This fixed meson cross compiling issue.

Command used:
meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc
ninja -C arm64-build

Compiling error:
.../aarch64-linux-gnu/bin/ld: lib/librte_eal.so.10.1: version node
not found for symbol numa_run_on_node_mask@@libnuma_1.2
.../aarch64-linux-gnu/bin/ld: failed to set dynamic section sizes:
Bad value
collect2: error: ld returned 1 exit status
[58/1370] Compiling C object 'lib/76b5a35@@rte_cmdline@sta/
librte_cmdline_cmdline_parse_string.c.o'.
ninja: build stopped: subcommand failed.

Fixes: 01add9da25cd ("doc: add cross compiling guide")
Cc: stable@dpdk.org
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodoc: update quick start guide for meson
Bruce Richardson [Wed, 29 May 2019 16:19:32 +0000 (17:19 +0100)]
doc: update quick start guide for meson

The build-sdk-meson.txt file is a little out of date, so update it with
information on the latest build requirements, and remove any content
no longer needed.

Since the cross-compilation file quoted in the document is now considerably
longer and more complex than previous, replace the contents of the file
with a summary of it instead. This is shorter and more maintainable, and
the original file is available as part of the repo anyway if the user wants
to view it.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoipc: handle unsupported IPC in async request
Anatoly Burakov [Thu, 25 Apr 2019 12:45:19 +0000 (13:45 +0100)]
ipc: handle unsupported IPC in async request

Currently, IPC API will silently ignore unsupported IPC.
Fix the API call to explicitly handle unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoipc: handle unsupported IPC in sync request
Anatoly Burakov [Thu, 25 Apr 2019 12:45:18 +0000 (13:45 +0100)]
ipc: handle unsupported IPC in sync request

Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoipc: handle unsupported IPC in sendmsg
Anatoly Burakov [Thu, 25 Apr 2019 12:45:17 +0000 (13:45 +0100)]
ipc: handle unsupported IPC in sendmsg

Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoipc: do not unregister action if IPC unsupported
Anatoly Burakov [Thu, 25 Apr 2019 12:45:16 +0000 (13:45 +0100)]
ipc: do not unregister action if IPC unsupported

Currently, unregister will be attempted even if IPC wasn't
supported in the first place. It is harmless, but for
consistency reasons, update the unregister API call to
exit early when IPC is not supported.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoipc: handle unsupported IPC in action register
Anatoly Burakov [Thu, 25 Apr 2019 12:45:15 +0000 (13:45 +0100)]
ipc: handle unsupported IPC in action register

Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

For primary processes, it is OK to not have IPC because
there may not be any secondary processes in the first place,
and there are valid use cases that disable IPC support, so
all primary process usages are fixed up to ignore IPC
failures.

For secondary processes, IPC will be crucial, so leave all
of the error handling as is.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoipc: handle unsupported IPC in init
Anatoly Burakov [Thu, 25 Apr 2019 12:45:14 +0000 (13:45 +0100)]
ipc: handle unsupported IPC in init

Currently, IPC API will silently ignore unsupported IPC.
Fix the API call and its callers to explicitly handle
unsupported IPC cases.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoring: remove unnecessary forward declaration
Xiaolong Ye [Thu, 16 May 2019 07:28:56 +0000 (15:28 +0800)]
ring: remove unnecessary forward declaration

As memzone.h is introduced by
commit 38c9817ee1d8 ("mempool: adjust name size in related data types"),
forward declaration for rte_memzone is no longer needed.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agomem: ease init in a docker container
Nicolas Dichtel [Thu, 23 May 2019 09:52:31 +0000 (11:52 +0200)]
mem: ease init in a docker container

move_pages() is only used to get the numa node id, but this function
is not allowed by default in docker (it needs CAP_SYS_NICE and an update of
the seccomp profile).
get_mempolicy() also requires CAP_SYS_NICE but doesn't need any change in
the default seccomp profile.

Note that the returned value of move_pages() was not checked, thus some
errors could be hidden (if the requested id was 0).

Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime")
Cc: stable@dpdk.org
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Didier Pallard <didier.pallard@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoexamples/ip_fragmentation: fix Tx queues init
Ali Alnubani [Mon, 6 May 2019 09:49:10 +0000 (09:49 +0000)]
examples/ip_fragmentation: fix Tx queues init

The application tries to configure queue ids larger
than the maximum allowed by MAX_TX_QUEUE_PER_PORT. This
causes the startup error:

"
  ...
  Initializing port 0 on lcore 0... Address:7C:FE:90:12:23:0D
  txq=0,0 txq=1,1 txq=2,2 txq=3,3 txq=4,4 txq=5,5 txq=6,6 txq=7,7 txq=8,8
  txq=9,9 txq=10,10 txq=11,11 txq=12,12 txq=13,13 txq=14,14 txq=15,15
  txq=16,16 Invalid TX queue_id=16

  EAL: Error - exiting with code: 1
    Cause: rte_eth_tx_queue_setup: err=-22, port=0
"

The error reproduces when lcores aren't set, and when the
machine has more than 16 cores.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
4 years agoexamples/multi_process: build with meson
Ali Alnubani [Thu, 23 May 2019 17:40:39 +0000 (17:40 +0000)]
examples/multi_process: build with meson

This enables building the example multiprocess applications in
the subdirectory multi_process.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agoexamples: use child directory as name
Ali Alnubani [Thu, 23 May 2019 17:40:38 +0000 (17:40 +0000)]
examples: use child directory as name

This would allow correctly naming an application residing
in a subdirectory. For example, if the example is set to 'path/to/app',
then the name would be 'app'.
This doesn't affect the naming of an example that isn't in a subdirectory.

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agomaintainers: update Marvell PMDs
Liron Himi [Mon, 20 May 2019 16:35:12 +0000 (19:35 +0300)]
maintainers: update Marvell PMDs

Alan is no longer involved in PMDs maintenance hence
update the list.
Also append new active maintainer to the list.

Signed-off-by: Liron Himi <lironh@marvell.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
4 years agoconfig: add Marvell ARMADA based on armv8-a
Liron Himi [Sat, 18 May 2019 21:10:54 +0000 (00:10 +0300)]
config: add Marvell ARMADA based on armv8-a

This patch introduces armada target to address difference
in number of cores, no numa support

Signed-off-by: Liron Himi <lironh@marvell.com>
Reviewed-by: Alan Winkowski <walan@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
4 years agoconfig: disable armv8 crypto extension
Yongseok Koh [Tue, 7 May 2019 21:11:40 +0000 (14:11 -0700)]
config: disable armv8 crypto extension

Per armv8 crypto extension support, make build always enable it by default
as long as compiler supports the feature while meson build only enables it
for 'default' machine of generic armv8 architecture.

It is known that not all the armv8 platforms have the crypto extension. For
example, Mellanox BlueField has a variant which doesn't have it. If crypto
enabled binary runs on such a platform, rte_eal_init() fails.

'+crypto' flag currently implies only '+aes' and '+sha2' and enabling it
will generate the crypto instructions only when crypto intrinsics are used.
For the devices supporting 8.2 crypto or newer, compiler could generate
such instructions beyond intrinsics or asm code. For example, compiler can
generate 3-way exclusive OR instructions if sha3 is supported. However, it
has to be enabled by adding '+sha3' as of today.

In DPDK, armv8 cryptodev is the only one which requires the crypto support.
As it even uses external library of Marvell which is compiled out of DPDK
with crypto support and there's run-time check for required cpuflags,
crypto support can be disabled in DPDK.

Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agonet/mlx: support IOVA VA mode
Yongseok Koh [Thu, 2 May 2019 09:07:54 +0000 (02:07 -0700)]
net/mlx: support IOVA VA mode

Set RTE_PCI_DRV_IOVA_AS_VA to driver's drv_flags as device's IOMMU takes
virtual address.

Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
4 years agobus/pci: add Mellanox kernel driver type
Yongseok Koh [Thu, 2 May 2019 09:07:53 +0000 (02:07 -0700)]
bus/pci: add Mellanox kernel driver type

When checking RTE_PCI_DRV_IOVA_AS_VA flag to determine IOVA mode,
pci_one_device_has_iova_va() returns true only if kernel driver of the
device is vfio. However, Mellanox mlx4/5 PMD doesn't need to be detached
from kernel driver and attached to VFIO/UIO. Control path still goes
through the existing kernel driver, which is mlx4_core/mlx5_core. In order
to make RTE_PCI_DRV_IOVA_AS_VA effective for mlx4/mlx5 PMD, a new kernel
driver type has to be introduced.

Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
4 years agoeal/x86: check rdrand and rdseed
Bruce Richardson [Tue, 14 May 2019 13:37:02 +0000 (14:37 +0100)]
eal/x86: check rdrand and rdseed

The meson build never checked for the presence of rdrand and rdseed
instructions, while make build never checked for rdseed. Ensure builds
always have the appropriate checks - and therefore defines - for these
instructions. For runtime, we also add in rdseed to the list of known
bits returned from cpuid() instruction, so we can confirm its presence at
application init time.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
4 years agoconfig: shorten code for x86 instruction detection
Bruce Richardson [Tue, 14 May 2019 13:37:01 +0000 (14:37 +0100)]
config: shorten code for x86 instruction detection

Rather than checking flag by flag individually, use a loop to make it
easier to check new flags.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agobuild: warn on unused parameter
Bruce Richardson [Wed, 15 May 2019 11:38:47 +0000 (12:38 +0100)]
build: warn on unused parameter

To improve code quality we want to turn on as many warnings as we can in
the DPDK code, so turn on the "unused-parameter" warning in meson builds to
match that of the make builds. To ensure correct compilation, disable the
warning selectively for driver base code that otherwise would have issues.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agobuild: add libatomic dependency for 32-bit clang
Bruce Richardson [Tue, 28 May 2019 11:07:48 +0000 (12:07 +0100)]
build: add libatomic dependency for 32-bit clang

When compiling with clang on 32-bit platforms, we are missing copies
of 64-bit atomic functions. We can solve this by linking against
libatomic for the drivers and libs which need those atomic ops.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agomem: mark unused function in 32-bit builds
Bruce Richardson [Tue, 28 May 2019 11:07:47 +0000 (12:07 +0100)]
mem: mark unused function in 32-bit builds

The get_socket_mem_size() function is only used in 64-bit builds,
causing clang to warn about it for 32-bit builds. Add the __rte_unused
attribute to the function to silence the warning.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agobuild: remove unnecessary large file support defines
Bruce Richardson [Tue, 28 May 2019 11:07:46 +0000 (12:07 +0100)]
build: remove unnecessary large file support defines

Since we now always use _FILE_OFFSET_BITS=64 flag when building
DPDK, we can remove the Makefile and C-file #defines setting it
individually for parts of the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agobuild: enable large file support on 32-bit
Bruce Richardson [Tue, 28 May 2019 11:07:45 +0000 (12:07 +0100)]
build: enable large file support on 32-bit

By default on 32-bit systems, file offsets are given as 32-bit values
which prevents support for large files. While this is unlikely to be
a problem, enabling large file support globally makes "make" and
"meson" builds consistent, since meson always enables large file
support, and without this change, the size of "struct stat" fields
will be different between the two builds.

The only location where this appears to be significant is in the
dpaax common code, where a printf needs to be updated for 32-bit
builds.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
4 years agonet/nfp: disable for 32-bit meson builds
Bruce Richardson [Tue, 28 May 2019 11:07:44 +0000 (12:07 +0100)]
net/nfp: disable for 32-bit meson builds

From comment in the build config for the make build-system:

 "NFP PMD is not supported on 32-bit"

Therefore disable NFP for 32-bit meson builds as well as for 32-bit
make ones.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agonet: replace IPv4/v6 constants with uppercase name
David Marchand [Wed, 29 May 2019 11:29:16 +0000 (13:29 +0200)]
net: replace IPv4/v6 constants with uppercase name

Since we change these macros, we might as well avoid triggering complaints
from checkpatch because of mixed case.

old=RTE_IPv4
new=RTE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv4
new=RTE_ETHER_TYPE_IPV4
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

old=RTE_ETHER_TYPE_IPv6
new=RTE_ETHER_TYPE_IPV6
git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g"

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
4 years agonet/tap: revert rte prefixing
David Marchand [Wed, 29 May 2019 11:29:15 +0000 (13:29 +0200)]
net/tap: revert rte prefixing

This source is compiled as a bpf program out of dpdk.
Revert to structures/macros coming from libc.

Fixes: 6d13ea8e8e49 ("net: add rte prefix to ether structures")
Fixes: 24ac604ef746 ("net: add rte prefix to IP defines")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
4 years agotest/table: remove duplicate macro
David Marchand [Wed, 29 May 2019 11:29:14 +0000 (13:29 +0200)]
test/table: remove duplicate macro

No need for this macro here, take it from librte_net.

Fixes: 24ac604ef746 ("net: add rte prefix to IP defines")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
4 years agotest: use lcore accessors
Stephen Hemminger [Fri, 31 May 2019 15:37:02 +0000 (17:37 +0200)]
test: use lcore accessors

Don't refer to lcore_config directly.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/bond: use lcore accessors
Stephen Hemminger [Fri, 31 May 2019 15:37:01 +0000 (17:37 +0200)]
examples/bond: use lcore accessors

Referring to lcore_config directly is no longer recommended.
Also remove unnecessary assignment of slave_core_id.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agodrivers/bus: use lcore accessors
Stephen Hemminger [Fri, 31 May 2019 15:37:00 +0000 (17:37 +0200)]
drivers/bus: use lcore accessors

The lcore_config structure will be hidden in future release.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal: add lcore accessors
Stephen Hemminger [Fri, 31 May 2019 15:36:59 +0000 (17:36 +0200)]
eal: add lcore accessors

The fields of the internal EAL core configuration are currently
laid bare as part of the API. This is not good practice and limits
fixing issues with layout and sizes.

Make new accessor functions for the fields used by current drivers
and examples.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal: use unsigned int in lcore API prototypes
Stephen Hemminger [Fri, 31 May 2019 15:36:58 +0000 (17:36 +0200)]
eal: use unsigned int in lcore API prototypes

Purely cosmetic change, use unsigned int instead of unsigned alone.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agotest/rcu: use existing lcore API
David Marchand [Wed, 22 May 2019 15:06:57 +0000 (17:06 +0200)]
test/rcu: use existing lcore API

Prefer the existing apis rather than direct access lcore_config that is
going to disappear.

Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agotest/hash: use existing lcore API
David Marchand [Wed, 22 May 2019 15:06:56 +0000 (17:06 +0200)]
test/hash: use existing lcore API

Prefer the existing apis rather than direct access the configuration
structure.

test_hash_multi_add_lookup() currently starts n readers and N writers
using rte_eal_remote_launch().
It then waits for the N writers to complete with a custom
multi_writer_done[] array to synchronise over.
Jump on the occasion to use rte_eal_wait_lcore() so that the code is
more straightforward:
- we start n readers with rte_eal_remote_launch(),
- we start N writers with rte_eal_remote_launch(),
- we wait for N writers to join with rte_eal_wait_lcore(),
- we wait for n readers to join with rte_eal_wait_lcore(),

Fixes: c7eb0972e74b ("test/hash: add lock-free r/w concurrency")
Fixes: 3f9aab961ed3 ("test/hash: check lock-free extendable bucket")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoexamples/qos_sched: do not dereference global config struct
David Marchand [Wed, 15 May 2019 07:54:22 +0000 (09:54 +0200)]
examples/qos_sched: do not dereference global config struct

Prefer the existing apis rather than direct access the configuration
structure.

Fixes: de3cfa2c9823 ("sched: initial import")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoexamples/multi_process: do not dereference global config struct
David Marchand [Wed, 15 May 2019 07:54:21 +0000 (09:54 +0200)]
examples/multi_process: do not dereference global config struct

Prefer the existing apis rather than direct access the configuration
structure.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/softnic: do not dereference global config struct
David Marchand [Wed, 15 May 2019 07:54:20 +0000 (09:54 +0200)]
net/softnic: do not dereference global config struct

Prefer the existing apis rather than direct access the configuration
structure.

Fixes: a958a5c07f4b ("net/softnic: support service cores")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/cxgbe: do not dereference global config struct
David Marchand [Wed, 15 May 2019 07:54:19 +0000 (09:54 +0200)]
net/cxgbe: do not dereference global config struct

Prefer the existing apis rather than direct access the configuration
structure.

Fixes: 92c8a63223e5 ("cxgbe: add device configuration and Rx support")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agokernel/linux: remove unneeded meson variables
Bruce Richardson [Fri, 17 May 2019 13:45:29 +0000 (14:45 +0100)]
kernel/linux: remove unneeded meson variables

The local variables for the error message aren't needed, since the messages
aren't used more than once, and the indent levels are now such that the
lines printing the message are not much longer than the lines defining the
variables to hold the messages themselves. Therefore the use of the
variables is pointless.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agokernel/linux: reduce unneeded indents in meson file
Bruce Richardson [Fri, 17 May 2019 13:45:28 +0000 (14:45 +0100)]
kernel/linux: reduce unneeded indents in meson file

Since meson 0.46, meson has supported the subdir_done() function, which
allows us to abort processing of a file early. Using this we can reduce the
indentation in our files by eliminating unnecessary else blocks.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agokernel/linux: remove unnecessary meson version check
Bruce Richardson [Fri, 17 May 2019 13:45:27 +0000 (14:45 +0100)]
kernel/linux: remove unnecessary meson version check

The check for meson version 0.44 is redundant since the minimum
supported version for the project as a whole is 0.47.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agokni: remove ethtool support
Ferruh Yigit [Fri, 24 May 2019 16:55:20 +0000 (17:55 +0100)]
kni: remove ethtool support

Current design requires kernel drivers and they need to be probed by
Linux up to some level so that they can be usable by DPDK for ethtool
support, this requires maintaining the Linux drivers in DPDK.

Also ethtool support is limited and hard, if not impossible, to expand
to other PMDs.

Since KNI ethtool support is not used commonly, if not used at all,
removing the support for the sake of simplicity and maintenance.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodoc: update build command in BlueField guide
Yong Wang [Mon, 27 May 2019 05:18:36 +0000 (13:18 +0800)]
doc: update build command in BlueField guide

Since linuxapp in build configs has been changed to linux, change it
in the bluefield doc.

Fixes: 22d1d1ccc357 ("doc: add Mellanox BlueField platform guide")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
4 years agodoc: clean PDF config
Thomas Monjalon [Wed, 22 May 2019 09:24:54 +0000 (11:24 +0200)]
doc: clean PDF config

Some font options do not look necessary.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
4 years agodoc: fix PDF with greek letter
Thomas Monjalon [Wed, 22 May 2019 08:44:31 +0000 (10:44 +0200)]
doc: fix PDF with greek letter

For an unknown reason, the sign "ÎĽ" is not accepted by some environments,
probably due to the version of some Latex packages or dependencies.

! Package inputenc Error: Unicode character ÎĽ (U+03BC)
(inputenc)                not set up for use with LaTeX.

It is fixed by installing texlive-langgreek.

Fixes: d0dff9ba445e ("doc: sample application user guide")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
4 years agodoc: robustify PDF build
Thomas Monjalon [Wed, 22 May 2019 17:55:24 +0000 (19:55 +0200)]
doc: robustify PDF build

In some environment like the current dpdk.org server,
there can be some errors due to symbols in titles,
as it was the case before this commit in DPDK 18.05:
commit 551d148944dc ("doc: remove flow API migration section")

! LaTeX Error: Bad math environment delimiter.

It can be avoided thanks to the Latex command \robustify.

Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
4 years agodoc: fix helloworld build on Windows
Adham Masarwah [Mon, 20 May 2019 08:19:52 +0000 (11:19 +0300)]
doc: fix helloworld build on Windows

The option -Dexamples=helloworld is missing.
The helloworld binary name was wrong.
Forcing clang may be required in some environments.

Fixes: 196c650b8b63 ("doc: add guide for Windows")
Cc: stable@dpdk.org
Signed-off-by: Adham Masarwah <adham@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agofix off-by-one errors in snprintf
Michael Santana [Fri, 10 May 2019 14:53:12 +0000 (10:53 -0400)]
fix off-by-one errors in snprintf

snprintf guarantees to always correctly place a null terminator
in the buffer string. So manually placing a null terminator
in a buffer right after a call to snprintf is redundant code.

Additionally, there is no need to use 'sizeof(buffer) - 1' in snprintf as this
means we are not using the last character in the buffer. 'sizeof(buffer)' is
enough.

Cc: stable@dpdk.org
Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agonet/ixgbe/base: wait for link after copper MAC setup
Ashijeet Acharya [Fri, 24 May 2019 09:30:15 +0000 (11:30 +0200)]
net/ixgbe/base: wait for link after copper MAC setup

After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the
link does not get set up properly and as a result all the subsequent
calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail.

Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before
beginning to set up the external PHY link speed to ensure that the
controller can acquire the link.

Signed-off-by: Ashijeet Acharya <ashijeet.acharya@6wind.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/vmxnet3: fix uninitialized variable
Yogev Chaimovich [Thu, 16 May 2019 07:10:38 +0000 (07:10 +0000)]
net/vmxnet3: fix uninitialized variable

Coverity issue: 323479
Fixes: 30f77abecd38 ("net/vmxnet3: support stats reset")
Cc: stable@dpdk.org
Signed-off-by: Yogev Chaimovich <yogev@cgstowernetworks.com>
Acked-by: Yong Wang <yongwang@vmware.com>
4 years agonet/ixgbe: enable new device
Beilei Xing [Fri, 24 May 2019 00:28:24 +0000 (08:28 +0800)]
net/ixgbe: enable new device

This patch enables new device, the device id is 0x15B0.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bnxt: support bulk free of Tx mbufs
Ajit Khaparde [Wed, 15 May 2019 18:08:17 +0000 (11:08 -0700)]
net/bnxt: support bulk free of Tx mbufs

The driver currently uses rte_pktmbuf_free() to free each mbuf
after transmit completion. This is optimized to free multiple
mbufs using rte_mempool_put_bulk().

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
4 years agonet/bnxt: optimize Tx batching
Sriharsha Basavapatna [Wed, 15 May 2019 18:08:16 +0000 (11:08 -0700)]
net/bnxt: optimize Tx batching

This patch adds a few optimizations to Tx batching. Instead of
specifying 'cmpl_next' to bnxt_start_xmit() as a hint to enable
completion for a given packet, request for completion on the last
successfully enqueued TxBD. This takes care of both success and
error cases. It eliminates 'cmpl_next' arg and related per-packet
condition checks around it.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Cc: stable@dpdk.org
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix Tx batching
Sriharsha Basavapatna [Wed, 15 May 2019 18:08:15 +0000 (11:08 -0700)]
net/bnxt: fix Tx batching

This patch addresses the following issues with Tx batching:

1. Tx stall observed in some conditions:

The batching code doesn't request for a completion when only a partial
chain of packets is transmitted due to mbuf allocation errors. Because
of this, Tx consumer index is not updated correctly and it eventually
leads to qfull condition. Fix this by requesting a completion for the
last packet in the partial chain that is transmitted successfully.

2. Tx stall seen with Jumbo frames:

With jumbo frames, number of TxBDs is > 1. While setting up these
additional BDs in bnxt_start_xmit(), the flags field is being set using
the OR-assignment operator. We end up using a stale value of the flags
field (from a previous use of that descriptor). This results in an
invalid completion and eventually leads to tx stall. Fix this to just
assign the flags field with the right value.

Fixes: 5735eb241947 ("net/bnxt: support Tx batching")
Cc: stable@dpdk.org
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: check for error conditions in Tx path
Ajit Khaparde [Wed, 15 May 2019 18:08:14 +0000 (11:08 -0700)]
net/bnxt: check for error conditions in Tx path

The HW can have limits on the minimum packet size it can support,
or the maximum number of segments it can support. Check for such
possibilities. Also check if we are going to have a 0 length buffer.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
4 years agonet/bnxt: support updating IPID
Ajit Khaparde [Wed, 15 May 2019 18:08:13 +0000 (11:08 -0700)]
net/bnxt: support updating IPID

Add support to update ipid during TSO.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
4 years agonet/bnxt: fix TSO
Ajit Khaparde [Wed, 15 May 2019 18:08:12 +0000 (11:08 -0700)]
net/bnxt: fix TSO

We wrongly update lflags in the Tx descriptor; avoid it.
Also, instead of calculating the last producer index to see if mbuf
segments are chained, check if the pointer is NULL to iterate through
the segment list.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
4 years agonet/mlx5: fix memory free on queue create error
Dekel Peled [Mon, 20 May 2019 08:07:26 +0000 (11:07 +0300)]
net/mlx5: fix memory free on queue create error

In function mlx5_rxq_ibv_new(), pointer *tmpl allocation is attempted
at the start, but not validated or freed in case of error.
In function mlx5_txq_ibv_new(), pointer *txq_ibv allocation is
attempted at the start, but not freed in case of error.

This patch adds pointers initialization, validation and freeing.

Fixes: 09cb5b581762 ("net/mlx5: separate DPDK from verbs Rx queue objects")
Fixes: faf2667fe8d5 ("net/mlx5: separate DPDK from verbs Tx queue objects")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/mlx5: remove redundant size calculation macro
Dekel Peled [Wed, 15 May 2019 10:11:38 +0000 (13:11 +0300)]
net/mlx5: remove redundant size calculation macro

Patch [1] added, among other definitions, the macro MLX5_ST_SZ_DB.
Patch [2] added later the macro MLX5_ST_SZ_BYTES, which is exactly
the same macro with a different name.
Each of these macros was used in very few places.

This patch removes the definition of MLX5_ST_SZ_DB, and replaces it
with MLX5_ST_SZ_BYTES wherever it was used.
Macro MLX5_ST_SZ_BYTES was preffered since it is the same macro
name used in kernel code, see [3].

[1] http://patches.dpdk.org/patch/45254/
[2] http://patches.dpdk.org/patch/49403/
[3] https://lists.openwall.net/netdev/2014/10/02/75

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
4 years agonet/mlx5: support match on TCP flags
Jack Min [Thu, 9 May 2019 06:11:09 +0000 (06:11 +0000)]
net/mlx5: support match on TCP flags

Add support to match all TCP control bits (flags)
except "NS (ECN-nonce)" via Direct Verbs (DV) or Direct Rule (DR)
engine.

Signed-off-by: Jack Min <jackmin@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/mlx4: use dynamic log type
Stephen Hemminger [Fri, 24 May 2019 16:03:16 +0000 (09:03 -0700)]
net/mlx4: use dynamic log type

This driver should use dynamic log level not RTE_LOGTYPE_PMD.
Other drivers were converted back in 18.02.

This is really a bug, all other drivers use dynamic log levels
by now.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: move locally used functions to static
Dekel Peled [Wed, 8 May 2019 08:29:41 +0000 (11:29 +0300)]
net/mlx5: move locally used functions to static

Multiple functions were declared in header file mlx5_rxtx.h,
implemented in mlx5_rxq.c, and called only in mlx5_rxq.c.

This patch moves all these functions declarations into mlx5_rxq.c,
as static functions.
Some functions implementation was copied higher in the file to
precede the functions calls.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: fix description of return value
Dekel Peled [Wed, 8 May 2019 08:29:40 +0000 (11:29 +0300)]
net/mlx5: fix description of return value

Return value of function mlx5_rxq_releasable() was not described
correctly in function description.

This patch updates the description to correctly describe the optional
return values.

Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: fix missing validation of null pointer
Dekel Peled [Wed, 8 May 2019 08:29:39 +0000 (11:29 +0300)]
net/mlx5: fix missing validation of null pointer

Function mlx5_rxq_ibv_release() is called in several places.
Before each call except one, the input parameter is validated to make
sure it is not null.

This patch adds the validation where it is missing.
It also changes a priv_ prefix, left in a comment, to mlx5_ prefix.

Fixes: af4f09f28294 ("net/mlx5: prefix all functions with mlx5")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/mlx5: remove unused functions
Dekel Peled [Wed, 8 May 2019 08:29:38 +0000 (11:29 +0300)]
net/mlx5: remove unused functions

Functions implemented but never called:
mlx5_rxq_ibv_releasable()
mlx5_rxq_cleanup()
mlx5_txq_ibv_releasable()

Function declared but not implemented:
rxq_alloc_mprq_buf()

This patch removes these functions from code and header file.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
4 years agonet/i40e: support MARK and RSS flow action
Mesut Ali Ergin [Thu, 16 May 2019 04:28:03 +0000 (21:28 -0700)]
net/i40e: support MARK and RSS flow action

Currently, i40e Flow Director action parser only allows following nine
action combinations: (QUEUE, PASSTHRU, DROP, QUEUE + MARK, PASSTHRU +
MARK, DROP + MARK, QUEUE + FLAG, PASSTHRU + FLAG, DROP + FLAG)

Using the existing Cloud Filter profile on the NIC, it is possible to
add support for two more combinations as: (MARK + RSS, MARK + FLAG +
RSS)

Addition of these new combinations would allow more applications to
utilize DPDK rte_flow to implement hardware flow offloads with Intel
Ethernet 700 series network adapters, including but not limited to the
existing OVS DPDK partial hardware flow offload feature.

Signed-off-by: Mesut Ali Ergin <mesut.a.ergin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agodoc: announce network API change
Olivier Matz [Tue, 21 May 2019 16:13:15 +0000 (18:13 +0200)]
doc: announce network API change

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to UDP structure
Olivier Matz [Tue, 21 May 2019 16:13:14 +0000 (18:13 +0200)]
net: add rte prefix to UDP structure

Add 'rte_' prefix to structures:
- rename struct udp_hdr as struct rte_udp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to TCP structure
Olivier Matz [Tue, 21 May 2019 16:13:13 +0000 (18:13 +0200)]
net: add rte prefix to TCP structure

Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to SCTP structure
Olivier Matz [Tue, 21 May 2019 16:13:12 +0000 (18:13 +0200)]
net: add rte prefix to SCTP structure

Add 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to IP defines
Olivier Matz [Tue, 21 May 2019 16:13:11 +0000 (18:13 +0200)]
net: add rte prefix to IP defines

Add 'RTE_' prefix to defines:
- rename IPv4( as RTE_IPv4(.
- rename IPV4_MAX_PKT_LEN as RTE_IPV4_MAX_PKT_LEN.
- rename IPV4_HDR_IHL_MASK as RTE_IPV4_HDR_IHL_MASK.
- rename IPV4_IHL_MULTIPLIER as RTE_IPV4_IHL_MULTIPLIER.
- rename IPV4_HDR_DF_SHIFT as RTE_IPV4_HDR_DF_SHIFT.
- rename IPV4_HDR_MF_SHIFT as RTE_IPV4_HDR_MF_SHIFT.
- rename IPV4_HDR_FO_SHIFT as RTE_IPV4_HDR_FO_SHIFT.
- rename IPV4_HDR_DF_FLAG as RTE_IPV4_HDR_DF_FLAG.
- rename IPV4_HDR_MF_FLAG as RTE_IPV4_HDR_MF_FLAG.
- rename IPV4_HDR_OFFSET_MASK as RTE_IPV4_HDR_OFFSET_MASK.
- rename IPV4_HDR_OFFSET_UNITS as RTE_IPV4_HDR_OFFSET_UNITS.
- rename IPV4_ANY as RTE_IPV4_ANY.
- rename IPV4_LOOPBACK as RTE_IPV4_LOOPBACK.
- rename IPV4_BROADCAST as RTE_IPV4_BROADCAST.
- rename IPV4_ALLHOSTS_GROUP as RTE_IPV4_ALLHOSTS_GROUP.
- rename IPV4_ALLRTRS_GROUP as RTE_IPV4_ALLRTRS_GROUP.
- rename IPV4_MAX_LOCAL_GROUP as RTE_IPV4_MAX_LOCAL_GROUP.
- rename IPV4_MIN_MCAST as RTE_IPV4_MIN_MCAST.
- rename IPV4_MAX_MCAST as RTE_IPV4_MAX_MCAST.
- rename IS_IPV4_MCAST as RTE_IS_IPV4_MCAST.
- rename IPV6_HDR_FL_SHIFT as RTE_IPV6_HDR_FL_SHIFT.
- rename IPV6_HDR_TC_SHIFT as RTE_IPV6_HDR_TC_SHIFT.
- rename IPV6_HDR_FL_MASK as RTE_IPV6_HDR_FL_MASK.
- rename IPV6_HDR_TC_MASK as RTE_IPV6_HDR_TC_MASK.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to IP structure
Olivier Matz [Tue, 21 May 2019 16:13:10 +0000 (18:13 +0200)]
net: add rte prefix to IP structure

Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ICMP defines
Olivier Matz [Tue, 21 May 2019 16:13:09 +0000 (18:13 +0200)]
net: add rte prefix to ICMP defines

Add 'RTE_' prefix to defines:
- rename IP_ICMP_ECHO_REPLY as RTE_IP_ICMP_ECHO_REPLY.
- rename IP_ICMP_ECHO_REQUEST as RTE_IP_ICMP_ECHO_REQUEST.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ICMP structure
Olivier Matz [Tue, 21 May 2019 16:13:08 +0000 (18:13 +0200)]
net: add rte prefix to ICMP structure

Add 'rte_' prefix to structures:
- rename struct icmp_hdr as struct rte_icmp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to GRE structure
Olivier Matz [Tue, 21 May 2019 16:13:07 +0000 (18:13 +0200)]
net: add rte prefix to GRE structure

Add 'rte_' prefix to structures:
- rename struct gre_hdr as struct rte_gre_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ESP structure
Olivier Matz [Tue, 21 May 2019 16:13:06 +0000 (18:13 +0200)]
net: add rte prefix to ESP structure

Add 'rte_' prefix to structures:
- rename struct esp_hdr as struct rte_esp_hdr.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ether defines
Olivier Matz [Tue, 21 May 2019 16:13:05 +0000 (18:13 +0200)]
net: add rte prefix to ether defines

Add 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ether functions
Olivier Matz [Tue, 21 May 2019 16:13:04 +0000 (18:13 +0200)]
net: add rte prefix to ether functions

Add 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ether structures
Olivier Matz [Tue, 21 May 2019 16:13:03 +0000 (18:13 +0200)]
net: add rte prefix to ether structures

Add 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.

Do not update the command line library to avoid adding a dependency to
librte_net.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ARP defines
Olivier Matz [Tue, 21 May 2019 16:13:02 +0000 (18:13 +0200)]
net: add rte prefix to ARP defines

Add 'RTE_' prefix to defines:
- rename ARP_HRD_ETHER as RTE_ARP_HRD_ETHER.
- rename ARP_OP_REQUEST as RTE_ARP_OP_REQUEST.
- rename ARP_OP_REPLY as RTE_ARP_OP_REPLY.
- rename ARP_OP_REVREQUEST as RTE_ARP_OP_REVREQUEST.
- rename ARP_OP_REVREPLY as RTE_ARP_OP_REVREPLY.
- rename ARP_OP_INVREQUEST as RTE_ARP_OP_INVREQUEST.
- rename ARP_OP_INVREPLY as RTE_ARP_OP_INVREPLY.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet: add rte prefix to ARP structures
Olivier Matz [Tue, 21 May 2019 16:13:01 +0000 (18:13 +0200)]
net: add rte prefix to ARP structures

Also rename arp_hrd, arp_pro, arp_hln, arp_pln and arp_op fields
to avoid conflict with the #defines in gnu libc.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ice: update RSS RETA size with supported values
Haiyue Wang [Mon, 20 May 2019 08:14:33 +0000 (16:14 +0800)]
net/ice: update RSS RETA size with supported values

Since ice can support 128, 512, 2K RSS RETA size value, change the
update API to set it to resize the RSS RETA table. And by default,
use 512 to sync with ETH_RSS_RETA_SIZE_x maximum value definition.
Also the flag ICE_FLAG_RSS_AQ_CAPABLE is missed to set.

Fixes: 690175ee51bf ("net/ice: support getting device information")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/i40e: enable new device
Beilei Xing [Wed, 15 May 2019 01:58:36 +0000 (09:58 +0800)]
net/i40e: enable new device

This patch removes ifdef to enable new device.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix Tx threshold setup
Qi Zhang [Sat, 4 May 2019 09:29:39 +0000 (17:29 +0800)]
net/ixgbe: fix Tx threshold setup

Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/ice: fix Tx threshold setup
Qi Zhang [Sat, 4 May 2019 09:29:38 +0000 (17:29 +0800)]
net/ice: fix Tx threshold setup

Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/i40e: fix Tx threshold setup
Qi Zhang [Sat, 4 May 2019 09:29:37 +0000 (17:29 +0800)]
net/i40e: fix Tx threshold setup

Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/fm10k: advertise supported RSS hash function
Xiao Wang [Mon, 6 May 2019 08:44:34 +0000 (16:44 +0800)]
net/fm10k: advertise supported RSS hash function

PMD should advertise supported RSS hash functions via
dev_info.flow_type_rss_offloads variable [1], otherwise upper level check
would fail on configuring RSS, leading to MQ RSS failure.

[1] commit aa1a6d87f15d ("ethdev: force RSS offload rules again")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix unexpected link handler
Yunjian Wang [Wed, 8 May 2019 12:51:38 +0000 (20:51 +0800)]
net/ixgbe: fix unexpected link handler

The nic's interrupt source has some active handler, which maybe call
ixgbe_dev_link_update() to set link handler. We should cancel the
link handler before remove dev to prevent executing the link handler.
It triggers segfault.

Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
4 years agonet/ice: set min and max MTU
Qi Zhang [Tue, 7 May 2019 01:53:46 +0000 (09:53 +0800)]
net/ice: set min and max MTU

This commit sets the min and max supported MTU values for ice devices
via the ice_dev_info_get() function. Min MTU supported is set to
ETHER_MIN_MTU and max mtu is calculated as the max packet length
supported minus the transport overhead.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>