Jerin Jacob [Wed, 29 May 2019 03:38:14 +0000 (09:08 +0530)]
net/octeontx2: add device configure operation
Add device configure operation. This would call lf_alloc
mailbox to allocate a NIX LF and upon return, AF will
return the attributes for the select LF.
Andy Pei [Thu, 4 Jul 2019 01:38:39 +0000 (09:38 +0800)]
net/i40e: fix crash when TxQ/RxQ set to 0 in VF
Testpmd would stuck and result in core dump when user specifies an
invalid VF queue number, for example when setting txq or rxq to 0.
When txq or rxq is set to 0, pointer of pointer rxq or txq in
function i40evf_configure_vsi_queues is NULL. The usage of txq[i]
or rxq[0] is valid. This patch fixes this issue.
Fixes: d6b19729093e ("i40evf: support configurable crc stripping") Cc: stable@dpdk.org Signed-off-by: Andy Pei <andy.pei@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
The definition of ipsec and rsc offloads was incorrect.
Neither one of these is used by current driver, but the values
should be fixed now for future RSC support.
Due to position change, cannot be a full time maintainer anymore.
The git tree dpdk-next-net-mlx will be managed by Raslan,
as approved by the DPDK Technical Board.
For mlx5 PMD, Slava is added as additional maintainer.
Will continue to be involved in the DPDK community in different ways.
Having version and ihl set to 0 would result in a
corrupted/incorrect encapsulating packet for MPLS,
this commit sets these fields to 4 and 5 respectively
as defined in librte_net/rte_ip.h.
Define IPv4 Minimum IHL and VHL according to rfc791 (see [1])
"The Version field indicates the format of the
internet header."
"Internet Header Length (ihl) is the length of the
internet header in 32 bit words, and thus points
to the beginning of the data. Note that
the minimum value for a correct header is 5."
In current implementation, an action which requires parameters
must accept them enclosed in a structure.
Some actions require a single, trivial type parameter, but it still
must be enclosed in a structure.
This obligation results in multiple, action-specific structures, each
containing a single trivial type parameter.
This patch introduces a new approach, allowing an action configuration
object of any type, trivial or a structure.
Krzysztof Kanas [Mon, 24 Jun 2019 14:32:00 +0000 (16:32 +0200)]
net/af_packet: set default block size to page size
Kernel validates block size to be aligned to page size. Code works on
platforms with page size 4k, but on others e.g. Arm64 fails with default
parameters.
Signed-off-by: Krzysztof Kanas <kkanas@marvell.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This patch implements additional actions of packet header
modifications.
Add actions:
- INC_TCP_SEQ - Increase sequence number in the outermost TCP header.
- DEC_TCP_SEQ - Decrease sequence number in the outermost TCP header.
- INC_TCP_ACK - Increase acknowledgment number in the outermost TCP
header.
- DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP
header.
app/testpmd: add actions to modify TCP header fields
Add actions:
- INC_TCP_SEQ - Increase sequence number in the outermost TCP header.
- DEC_TCP_SEQ - Decrease sequence number in the outermost TCP header.
- INC_TCP_ACK - Increase acknowledgment number in the outermost TCP
header.
- DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP
header.
Original work by Xiaoyu Min.
This patch uses the new approach introduced by [1], using a new
macro ARG_ENTRY_HTON to pass a single integer argument to each of
the new actions.
Add actions:
- INC_TCP_SEQ - Increase sequence number in the outermost TCP header.
- DEC_TCP_SEQ - Decrease sequence number in the outermost TCP header.
- INC_TCP_ACK - Increase acknowledgment number in the outermost TCP
header.
- DEC_TCP_ACK - Decrease acknowledgment number in the outermost TCP
header.
Original work by Xiaoyu Min.
This patch uses the new approach introduced by [1], using a simple
integer instead of using an action-specific structure for each of
the new actions.
Andrew Rybchenko [Fri, 21 Jun 2019 09:40:40 +0000 (10:40 +0100)]
net/sfc: ensure that device is closed on removal
PCI device may be unplugged when ethdev is not closed yet.
Fixes: aaa3f5f0f79d ("net/sfc: add configure and close stubs") Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Andrew Rybchenko [Fri, 21 Jun 2019 09:40:39 +0000 (10:40 +0100)]
ethdev: avoid error on PCI unplug of closed port
If PCI Ethernet device driver removes it on close
(RTE_ETH_DEV_CLOSE_REMOVE) and later PCI device itself is unplugged,
it should not fail because of Ethernet device is already removed.
Fixes: 23ea57a2a0ce ("ethdev: complete closing of port") Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru> Reported-by: David Marchand <david.marchand@redhat.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
The latest versions of meson don't build targets when build_by_default is
false but install is true, unlike older versions. We can fix this by having
both build_by_default and install settings come from the build-time option.
Bugzilla ID: 303 Fixes: d02a2dab2dfb ("doc: support building HTML guides with meson") Fixes: 720b14db3ae2 ("build: generate API documentation with meson") Cc: stable@dpdk.org Reported-by: Ali Alnubani <alialnu@mellanox.com> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>
Currently, whenever timer library is initialized, the memory
is leaked because there is no telling when primary or secondary
processes get to use the state, and there is no way to
initialize/deinitialize timer library state without race
conditions [1] because the data itself must live in shared memory.
Add a spinlock to the shared mem config to have a way to
exclusively initialize/deinitialize the timer library without
any races, and implement the synchronization mechanism based
on this lock in the timer library.
Also, update the API doc. Note that the behavior of the API
itself did not change - the requirement to call init in every
process was simply not documented explicitly.
[1] See the following email thread:
https://mails.dpdk.org/archives/dev/2019-May/131498.html
Fixes: c0749f7096c7 ("timer: allow management in shared memory") Cc: stable@dpdk.org Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
eal: prevent different primary/secondary process versions
Currently, nothing stops DPDK to attempt to run primary and
secondary processes while having different versions. This
can lead to all sorts of weird behavior and makes it harder
to maintain compatibility without breaking ABI every once
in a while.
Fix it by explicitly disallowing running different DPDK
versions as primary and secondary processes.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: David Marchand <david.marchand@redhat.com>
Currently, each EAL will update internal/shared config in their
own way at init, resulting in needless duplication of code and
OS-dependent behavior. Move the functions to a common file and
add missing FreeBSD steps.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
Currently, mcfg completion function exists in two independent
implementations doing the same thing, which is bug prone.
Unify the two functions and move them into one place.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
There is no reason to pack the memconfig structure, and doing so
gives out warnings in some static analyzers. Fix it by removing
the packed attributed.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
Now that everything that has ever accessed the shared memory
config is doing so through the public API's, we can make it
internal. Since we're removing quite a few headers from
rte_eal_memconfig.h, we need to add them back in places
where this header is used.
This bumps the ABI, so also change all build files and make
update documentation.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
Currently, in order to lock access to the mempool list, a direct
access to the shared memory structure is needed. Add an API to do
the same, and search-and-replace all usages.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
Currently, locking/unlocking the TAILQ list requires direct
access to the shared memory config. Add an API to do the same,
and search-and-replace all usages.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
Currently, the memory hotplug is locked automatically by all
memory-related _walk() functions, but sometimes locking the
memory subsystem outside of them is needed. There is no
public API to do that, so it creates a dependency on shared
memory config to be public. Fix this by introducing a new
API to lock/unlock the memory hotplug subsystem.
Create a new common file for all things mem config, and a
new API namespace rte_mcfg_*, and search-and-replace all
usages of the locks with the new API.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: David Marchand <david.marchand@redhat.com>
Ben Walker [Fri, 14 Jun 2019 09:39:17 +0000 (11:39 +0200)]
bus/pci: consider only usable devices for IOVA mode
When selecting the preferred IOVA mode of the pci bus, the current
heuristic ("are devices bound?", "are devices bound to UIO?", "are pmd
drivers supporting IOVA as VA?" etc..) should honor the device
white/blacklist so that an unwanted device does not impact the decision.
There is no reason to consider a device which has no driver available.
This applies to all OS, so implements this in common code then call a
OS specific callback.
On Linux side:
- the VFIO special considerations should be evaluated only if VFIO
support is built,
- there is no strong requirement on using VA rather than PA if a driver
supports VA, so defaulting to DC in such a case.
Signed-off-by: Ben Walker <benjamin.walker@intel.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Ben Walker [Fri, 14 Jun 2019 09:39:16 +0000 (11:39 +0200)]
eal: compute IOVA mode based on PA availability
Currently, if the bus selects IOVA as PA, the memory init can fail when
lacking access to physical addresses.
This can be quite hard for normal users to understand what is wrong
since this is the default behavior.
Catch this situation earlier in eal init by validating physical addresses
availability, or select IOVA when no clear preferrence had been expressed.
The bus code is changed so that it reports when it does not care about
the IOVA mode and let the eal init decide.
In Linux implementation, rework rte_eal_using_phys_addrs() so that it can
be called earlier but still avoid a circular dependency with
rte_mem_virt2phys().
In FreeBSD implementation, rte_eal_using_phys_addrs() always returns
false, so the detection part is left as is.
If librte_kni is compiled in and the KNI kmod is loaded,
- if the buses requested VA, force to PA if physical addresses are
available as it was done before,
- else, keep iova as VA, KNI init will fail later.
Signed-off-by: Ben Walker <benjamin.walker@intel.com> Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
When using _mm_set_epi64() rather than _mm_set_epi64x() intrinsic, ICC
tries to use the x87 floating point registers, leading to warnings about
not properly clearing value when switching between x87 and SSE/AVX modes.
error #13203: No EMMS instruction before call to function
Fix this by using the set64x() intrinsic.
Fixes: 0a92e63fc4cd ("raw/ioat: add local API to perform copies") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Harry van Haaren <harry.van.haaren@intel.com> Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Xiaoyun Li [Tue, 2 Jul 2019 06:25:21 +0000 (14:25 +0800)]
examples/ntb: add example for NTB
Enable an example for rawdev ntb. Support interactive mode to send
file on one host and receive file from another host. The command line
would be 'send [filepath]' and 'receive [filepath]'.
But since the FIFO is not enabled right now, use rte_memcpy as the enqueue
and dequeue functions and only support transmitting file no more than 4M.
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Jingjing Wu <jingjing.wu@intel.com> Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Send message to PF to stop DMA queue when device close is
called from application.
Defined the required data structures to support enqueue and
dequeue APIs.
Register dev_configure API to configure DPI PCI devices.
After successful initialization send message to PF to open
corresponding DPI DMA queue. At present hardware doesn't
support mail box for DPI, so PMD to PF communication uses
pre build kernel devfs.
The ARMv8.1 CASP instruction works with even register pairs and since
there no register constraint in older versions of GCC/Clang, use
explicit register allocation to satisfy CASP requirements.
Remove function level optimization specification as Clang doesn't have
support for it and explicit register allocation removes the need for it.
Fixes build issue with arm64-armv8a-linux-clang.
Fixes: ee338015e7a9 ("mempool/octeontx2: add optimized dequeue operation for arm64") Reported-by: Gavin Hu <gavin.hu@arm.com> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
test/hash: init parameters in the correct function
Each test case initializes its hash parameters in the test case
function. To be consistent, generate keys function should initialize
hash parameters similarly.
Added unit test cases for EAL flags --proc-type=auto and
--create-uio-dev in order to cover the below functions
eal_proc_type_detect()
rte_eal_create_uio_dev()
On some systems when dpdk test is executed with make test command
autotest_runner crashes in first_cpu_on_node. This happens when list
of available cpus contains something that is not a cpu as first element.
Fixed by removing all non-cpu values from list of available cpus.
Unit test table_autotest results in segmentation fault.
Crash occurs in test_table_lpm_ipv6_combined().
Variable 'nht_pos0' used as array subscript is not initialized
in rte_table_lpm_ipv6_entry_add(). It will not be assigned,
if a rule does not exist.
In such case a junk number or invalid array index might result in
segmentation fault due to array out of bounds when
lpm->nht_users is used with such invalid array index.
Fix is to initialize the variables used for array subscript.
Bugzilla ID: 285 Fixes: d89a5bce1d ("lpm6: extend next hop field") Cc: stable@dpdk.org Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com> Tested-by: David Marchand <david.marchand@redhat.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Gage Eads [Thu, 20 Jun 2019 22:07:35 +0000 (17:07 -0500)]
doc: add a note for multi-process in mempool guide
The mempool library assigns handler ops indexes based on the dynamic load
order of mempool handlers. Indexes are used so a mempool can be used by
multiple processes, but this only works if all processes agree on the
mapping from index to mempool handler.
When using the '-d' argument, it's possible for different processes to load
mempool handlers in different orders, and thus have different
index->handler mappings. Using a mempool in multiple of such processes will
result in undefined behavior.
This commit adds a note to the mempool library programmer's guide warning
users against this.
Fixes: 449c49b93a6b ("mempool: support handler operations") Cc: stable@dpdk.org Signed-off-by: Gage Eads <gage.eads@intel.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Suppress the unaligned packed member address warnings by extending
the telemetry library build flags with -Wno-address-of-packed-member
option, through the WERROR_FLAGS makefile variable.
With this change additional warnings are turned on to be treated as errors,
which causes the following build issues to be seen:
- no previous prototype [-Werror=missing-prototypes]
- initialization discards ‘const’ qualifier from pointer target type
[-Werror=discarded-qualifiers]
- old-style function definition [-Werror=old-style-definition]
- variable may be used before its value is set (when using icc compiler).
Fixes: 0fe3a37924d4 ("telemetry: format json response when sending stats") Fixes: ee5ff0d3297e ("telemetry: add client feature and sockets") Fixes: 8877ac688b52 ("telemetry: introduce infrastructure") Fixes: 1b756087db93 ("telemetry: add parser for client socket messages") Fixes: fff6df7bf58e ("telemetry: fix using ports of different types") Fixes: 4080e46c8078 ("telemetry: support global metrics") Cc: stable@dpdk.org Signed-off-by: Reshma Pattan <reshma.pattan@intel.com> Signed-off-by: Flavia Musatescu <flavia.musatescu@intel.com> Acked-by: Kevin Laatz <kevin.laatz@intel.com>
event/octeontx2: 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.
The vlan_insert() is buggy when it tries to handle the shared mbufs,
instead don't support inserting VLAN tag into shared mbufs and return
an error for that case.
Andy Pei [Wed, 22 May 2019 06:36:34 +0000 (14:36 +0800)]
raw/ifpga: fix unintentional integer overflow
cast unsigned int ports_per_retimer, unsigned int nums_retimer,
unsigned int nums_fvl and unsigned int ports_per_fvl to uint64_t
before multiply operation, to avoid Unintentional integer overflow.
Coverity issue: 337924, 337926 Fixes: d1cd4eb2d48e ("raw/ifpga: support ipn3ke") Cc: stable@dpdk.org Signed-off-by: Andy Pei <andy.pei@intel.com> Acked-by: Rosen Xu <rosen.xu@intel.com>
Tianfei Zhang [Fri, 21 Jun 2019 08:40:17 +0000 (16:40 +0800)]
raw/ifpga/base: fix retimer link status
Fix the readout retimer link status incorrectly when we
remove the linux intel-fpga-driver and run the DPDK application.
The linux driver will stop the retimer when remove the kernel
modules.
eval_call() blindly calls eval_max_bound() for external function
return value for all return types.
That causes wrong estimation for returned pointer min and max boundaries.
So any attempt to dereference that pointer value causes verifier to fail
with error message: "memory boundary violation at pc: ...".
To fix - estimate min/max boundaries based on the return value type.
Bugzilla ID: 298
Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program") Cc: stable@dpdk.org Reported-by: Michel Machado <michel@digirati.com.br> Suggested-by: Michel Machado <michel@digirati.com.br> Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Add local APIs to trigger data copies, and retrieve handle values once
those copies are completed. Included are unit tests to validate the data
is copies correctly.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Add stats functions to track what is happening in the driver, and put
unit tests to check those.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Allow initializing a driver instance. Include selftest to validate these
functions.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Add in the "info_get" function to the driver, to allow us to query the
device. This allows us to have the unit test pick up the presence of
supported hardware or not.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
raw/ioat: create device on probe and destroy on release
Add the create/destroy driver functions so that we can actually allocate
a rawdev and destroy it when done. No rawdev API functions are actually
implemented at this point.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
In order to allow binding/unbinding of devices for use by the
ioat_rawdev, we need to update the devbind script to add a new class
of device, and add device ids for the specific HW instances.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Add stubs for ioat rawdev driver support in DPDK, specifically:
* makefile and meson build hooks
* initial public header file
* rawdev main C file, with probe and release functions
* release note update announcing the driver
* initial documentation for the new section in the rawdev doc
* unit test stubs for device unit tests
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Acked-by: Jiayu Hu <jiayu.hu@intel.com> Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
rawdev: allow devices to skip extra memory allocation
Some device drivers want to allocate their own private memory, and should
be allowed to do so. Therefore skip memory allocation and associated error
checks if zero-length private memory is requested.
While adjusting the code for new indent level, fix incorrect error
message.
With Debian and Ubuntu, the default installation path for the 64-bit
libraries is set to e.g. /usr/local/lib/x86_64-linux-gnu/, compared to
/usr/local/lib64 on Fedora and Redhat distributions. This causes issues
when using "pkg-config --define-prefix" since pkg-config assumes the prefix
to be the grandparent of where the .pc file is. On Ubuntu we then get the
cflags include path as being "/path/to/install-root/usr/local/lib/include"
i.e. with an extra "lib" in the path.
This issue only applies for test installs on Ubuntu and similar distros,
and is not a problem for regular installs since the --define-prefix
parameter would not be passed to pkg-config in those cases.
The workaround for this in our test build script is to explicitly make
"lib" the "libdir" setting for the install, overriding the distro-provided
default.
Fixes: 7f80a2102bbb ("devtools: test pkg-config file") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Luca Boccassi <bluca@debian.org>