Tonghao Zhang [Tue, 23 Jan 2018 16:17:34 +0000 (08:17 -0800)]
igb_uio: print IRQ as decimal number
The kernel uses the '%d' or '%ld' to print irq num.
But igb_uio may use the '%lx', then the log may confuse
the user what irq num has been used. The log is show as
below.
igb_uio 0000:00:03.0: irq 24 for MSI/MSI-X
igb_uio 0000:00:03.0: uio device registered with irq 18
kernel version: 3.10.0-514.16.1.el7
For avoiding to be confused, change the igb_uio irq
print type.
Marko Kovacevic [Mon, 5 Feb 2018 15:45:31 +0000 (15:45 +0000)]
mk: fix external build
Code commit for 'make -f' support, breaks the build in cases where
entries in $(MAKEFILE_LIST) are absolute paths. This commit uses
notdir and firstword to ensure that only the local filename is used.
Fixes: 3a5c339d51a4 ("mk: support renamed Makefile in external project") Cc: stable@dpdk.org Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Vipin Varghese [Tue, 30 Jan 2018 12:17:02 +0000 (17:47 +0530)]
doc: add procinfo restriction with shared library
added note category to procinfo guide, to intimate users in shared
library mode. Procinfo requires same NIC libraries to probe the NIC
devices as Primary Application.
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com> Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Junjie Chen [Wed, 29 Nov 2017 17:17:13 +0000 (12:17 -0500)]
doc: add a restriction to multi-process support
This patch add a restriction to multi-process support: secondary
processes should only run alongside primary process with same DPDK
version, so that secondary processes can use the same hugepage mmap
layout as primary process.
Signed-off-by: Junjie Chen <junjie.j.chen@intel.com> Acked-by: John McNamara <john.mcnamara@intel.com>
Bruce Richardson [Tue, 23 Jan 2018 14:11:33 +0000 (14:11 +0000)]
event/opdl: fix license header and SPDX tags
This patch ensures that the OPDL files all contain correct SPDX tags.
The following changes were made to achieve this:
* replace license text with SPDX tag
* correct occurences where SPDX tag was not on first line of file
* ensure license years were correct
Fixes: 4236ce9bf5bf ("event/opdl: add OPDL ring infrastructure library") Fixes: 3c7f3dcfb099 ("event/opdl: add PMD main body and helper function") Fixes: d548ef513cd7 ("event/opdl: add unit tests") Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Liang Ma <liang.j.ma@intel.com>
Radu Nicolau [Wed, 24 Jan 2018 13:16:46 +0000 (13:16 +0000)]
examples/bond: check mbuf allocation
Coverity issue: 257008 Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
David Coyle [Tue, 23 Jan 2018 14:14:15 +0000 (14:14 +0000)]
examples/vm_power_manager: fix set VF MAC address
Current code only sets mac address of first VF. Fix code so that it
continues through the loop and sets the mac address of each VF.
Fixes: c9a4779135c9 ("examples/vm_power_mgr: set MAC address of VF") Cc: stable@dpdk.org Signed-off-by: David Coyle <david.coyle@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Hemant Agrawal [Thu, 18 Jan 2018 06:12:58 +0000 (11:42 +0530)]
kni: support MAC address change
This patch adds following:
1. Option to configure the mac address during create. Generate random
address only if the user has not provided any valid address.
2. Inform usespace, if mac address is being changed in linux.
3. Implement default handling of mac address change in the corresponding
ethernet device.
Pavan Nikhilesh [Tue, 30 Jan 2018 18:51:54 +0000 (00:21 +0530)]
lpm: fix allocation of an existing object
Fix rte_lpm_create_*() functions to return NULL and set rte_errno to
EEXIST when lpm object name already exists.
This is the behavior described in the API documentation in the header
file.
Yong Wang [Thu, 25 Jan 2018 06:53:04 +0000 (01:53 -0500)]
crypto/qat: fix allocation check and leak
There are several func calls to rte_zmalloc() which don't do null
point check on the return value. And before return, the memory is not
freed. Fix it by adding null point check and rte_free().
Vipin Varghese [Fri, 26 Jan 2018 22:27:26 +0000 (03:57 +0530)]
net/tap: remove speed argument
TAP is a virtual device created on Kernel. The speed of interface is
set by Kernel to a fixed static value. But this does not prevent using
RX or TX to rate limit. Hence removing the option from user arguments.
Radu Nicolau [Thu, 25 Jan 2018 16:26:26 +0000 (16:26 +0000)]
examples/bond: fix vdev name
Fixes: 73db5bad ("net: align ethdev and eal driver names") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau <radu.nicolau@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Ophir Munk [Tue, 30 Jan 2018 16:00:29 +0000 (16:00 +0000)]
net/tap: fix eBPF RSS map key handling
This commit addresses a case of RSS and non RSS flows mixture.
In the corrupted code, if a non-RSS flow is destroyed, it has an eBPF map
index 0 (initialized upon flow creation). This might unintentionally remove
RSS entry 0 from eBPF map.
To fix this issue, add an offset to the real index during a KEY_CMD_GET
operation, and subtract this offset during a KEY_CMD_RELEASE operation, in
order to restore the real index.
Thus, if a non RSS flow is falsely trying to release map entry 0 - The
offset subtraction will calculate the real map index as an
out-of-range value, and the release operation will be silently ignored.
Ophir Munk [Tue, 30 Jan 2018 16:00:28 +0000 (16:00 +0000)]
net/tap: fix eBPF file descriptors leakage
When a user creates an RSS rule, the tap PMD dynamically allocates
a 'flow' data structure, and uploads BPF programs (represented by file
descriptors) to the kernel.
The kernel might reject the rule (due to filters overlap, for example)
in which case, flow memory should be freed and BPF file descriptors
should be closed.
In the corrupted code there were scenarios where BPF file descriptors
were not closed.
The fix is to add a new function - tap_flow_free(), which will make sure
to always close BPF file descriptors before freeing the flow allocated
memory.
Adrien Mazarguil [Tue, 30 Jan 2018 15:34:58 +0000 (16:34 +0100)]
net/mlx5: spawn rdma-core dependency plug-in
When mlx5 is not compiled directly as an independent shared object (e.g.
CONFIG_RTE_BUILD_SHARED_LIB not enabled for performance reasons), DPDK
applications inherit its dependencies on libibverbs and libmlx5 through
rte.app.mk.
This is an issue both when DPDK is delivered as a binary package (Linux
distributions) and for end users because rdma-core then propagates as a
mandatory dependency for everything.
Application writers relying on binary DPDK packages are not necessarily
aware of this fact and may end up delivering packages with broken
dependencies.
This patch therefore introduces an intermediate internal plug-in
hard-linked with rdma-core (to preserve symbol versioning) loaded by the
PMD through dlopen(), so that a missing rdma-core does not cause unresolved
symbols, allowing applications to start normally.
Adrien Mazarguil [Tue, 30 Jan 2018 15:34:54 +0000 (16:34 +0100)]
net/mlx4: spawn rdma-core dependency plug-in
When mlx4 is not compiled directly as an independent shared object (e.g.
CONFIG_RTE_BUILD_SHARED_LIB not enabled for performance reasons), DPDK
applications inherit its dependencies on libibverbs and libmlx4 through
rte.app.mk.
This is an issue both when DPDK is delivered as a binary package (Linux
distributions) and for end users because rdma-core then propagates as a
mandatory dependency for everything.
Application writers relying on binary DPDK packages are not necessarily
aware of this fact and may end up delivering packages with broken
dependencies.
This patch therefore introduces an intermediate internal plug-in
hard-linked with rdma-core (to preserve symbol versioning) loaded by the
PMD through dlopen(), so that a missing rdma-core does not cause unresolved
symbols, allowing applications to start normally.
Wei Zhao [Fri, 26 Jan 2018 08:46:51 +0000 (16:46 +0800)]
net/i40e: fix flow RSS return error
This patch fixes issues reported by Coverity check. Function
parse_rss_action and i40e_config_rss_filter might return at wrong
time which will cause error for RSS configuration and parser. Hash
function variable with 32 bits width might also cause error when
it needs more than 32 bits, so change this variable to 64 bits.
This patch moves the definition of 3 variables in testpmd.h
into the respective .c file. The idea behind this move is
to allow external applications to compile against testpmd
without throwing compilation errors related to multiple
definition of variables.
Also, an extern dcb_q_mapping in testpmd.h is removed
since it appears that this variable is not defined
elsewhere in the tree.
Remy Horton [Fri, 19 Jan 2018 13:27:22 +0000 (13:27 +0000)]
app/testpmd: fix port id size
The word size of port_id is now 16 bits, but there were parsing directives
that assumed it was still of type UINT8, resulting in incorrect commandline
parse results.
Fixes: f14a210a65fe ("app: fix port id type") Cc: stable@dpdk.org Signed-off-by: Remy Horton <remy.horton@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Jiayu Hu [Thu, 25 Jan 2018 02:13:44 +0000 (10:13 +0800)]
app/testpmd: fix SW checksum calculation enabling
In current design, we can't enable SW checksum calculation
for the devices which don't have checksum offloading abilities
via the command "csum set ip|tcp|udp|sctp|outer-ip sw <port_id>".
But SW checksum calculation shouldn't depend on HW offloading
abilities. This patch is to fix this issue.
Moti Haimovsky [Wed, 31 Jan 2018 17:32:03 +0000 (19:32 +0200)]
app/testpmd: disable Rx VLAN offloads by default
Removed the hardcoded preconfigured Rx VLAN offload configuration
from testpmd and changed the Rx offload command line parameters from
disable to enable.
It has been decided by the Technical Board that testers who wish to
use these offloads will now have to explicitly write them in the
command-line when running testpmd.
The agreement is to keep two exceptions enabled by default in 18.02:
Rx CRC strip and Tx fast free.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Matan Azrad [Tue, 30 Jan 2018 14:13:40 +0000 (14:13 +0000)]
app/testpmd: fix invalid port detach
Using registration to all ports includes also the ports which should not
be used by the application.
It is nice to print each port event by testpmd but in case of RMV
event, testpmd tries to detach the port and this case is problematic
when the port should not be used by the application.
Check the port validation before detach API calling.
Matan Azrad [Tue, 30 Jan 2018 14:13:39 +0000 (14:13 +0000)]
app/testpmd: fix port validation
rte_eth_dev_is_valid_port() API validates each valid port from ethdev
point of view and may validate ports which should not be used by the
application.
Testpmd should use only the ports available through the
RTE_ETH_FOREACH_DEV iterator.
Replace rte_eth_dev_is_valid_port() usage by RTE_ETH_FOREACH_DEV
iterator usage for testpmd ports validation.
Fixes: 7d89b2610353 ("app/testpmd: use ethdev iterator to list devices") Cc: stable@dpdk.org Signed-off-by: Matan Azrad <matan@mellanox.com>
Matan Azrad [Mon, 22 Jan 2018 16:38:22 +0000 (16:38 +0000)]
net/failsafe: use ownership mechanism for slaves
Fail-safe PMD sub devices management is based on ethdev port mechanism.
So, the sub-devices management structures are exposed to other DPDK
entities which may use them in parallel to fail-safe PMD.
Use the new port ownership mechanism to avoid multiple managments of
fail-safe PMD sub-devices.
Matan Azrad [Mon, 22 Jan 2018 16:38:20 +0000 (16:38 +0000)]
ethdev: synchronize port allocation
Ethernet port allocation was not thread safe, means 2 threads which tried
to allocate a new port at the same time might get an identical port
identifier and caused to memory overwrite.
Actually, all the port configurations were not thread safe from ethdev
point of view.
The port ownership mechanism added to the ethdev is a good point to
redefine the synchronization rules in ethdev:
1. The port allocation and port release synchronization will be
managed by ethdev.
2. The port usage synchronization will be managed by the port owner.
3. The port ownership synchronization will be managed by ethdev.
Add port allocation synchronization to complete the new rules.
Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Matan Azrad [Mon, 22 Jan 2018 16:38:19 +0000 (16:38 +0000)]
ethdev: add port ownership
The ownership of a port is implicit in DPDK.
Making it explicit is better from the next reasons:
1. It will define well who is in charge of the port usage synchronization.
2. A library could work on top of a port.
3. A port can work on top of another port.
Also in the fail-safe case, an issue has been met in testpmd.
We need to check that the application is not trying to use a port which
is already managed by fail-safe.
A port owner is built from owner id(number) and owner name(string) while
the owner id must be unique to distinguish between two identical entity
instances and the owner name can be any name.
The name helps to logically recognize the owner by different DPDK
entities and allows easy debug.
Each DPDK entity can allocate an owner unique identifier and can use it
and its preferred name to owns valid ethdev ports.
Each DPDK entity can get any port owner status to decide if it can
manage the port or not.
The mechanism is synchronized for both the primary process threads and
the secondary processes threads to allow secondary process entity to be
a port owner.
Add a synchronized ownership mechanism to DPDK Ethernet devices to
avoid multiple management of a device by different DPDK entities.
The current ethdev internal port management is not affected by this
feature.
Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Matan Azrad [Mon, 22 Jan 2018 16:38:18 +0000 (16:38 +0000)]
ethdev: fix port id allocation
rte_eth_dev_find_free_port() found a free port by state checking.
The state field are in local process memory, so other DPDK processes
may get the same port ID because their local states may be different.
Replace the state checking by the ethdev port name checking,
so, if the name is an empty string the port ID will be detected as
unused.
Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model") Cc: stable@dpdk.org Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Matan Azrad [Mon, 22 Jan 2018 16:38:17 +0000 (16:38 +0000)]
ethdev: fix port data reset timing
rte_eth_dev_data structure is allocated per ethdev port and can be
used to get a data of the port internally.
rte_eth_dev_attach_secondary tries to find the port identifier using
rte_eth_dev_data name field comparison and may get an identifier of
invalid port in case of this port was released by the primary process
because the port release API doesn't reset the port data.
So, it will be better to reset the port data in release time instead of
allocation time.
Move the port data reset to the port release API.
Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model") Cc: stable@dpdk.org Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Ophir Munk [Wed, 31 Jan 2018 16:03:58 +0000 (16:03 +0000)]
net/tap: fix build on ARM32
This commit adds eBPF system call definitions for ARM architecture.
Old Linux header files may not define eBPF system call numbers.
In order to successful compile eBPF on all Linux platforms - the
missing ARM system call definition is explicitly added.
Amr Mokhtar [Wed, 31 Jan 2018 14:30:29 +0000 (14:30 +0000)]
examples/bbdev: fix memory leak in stats print
xstats and xstats_names buffers were allocated for
the purpose of printing eth_xstats, but were not
freed before exit.
A fix is added to free before exit points.
Shreyansh Jain [Wed, 31 Jan 2018 09:13:15 +0000 (14:43 +0530)]
raw/skeleton: introduce skeleton rawdev driver
Skeleton rawdevice driver, on the lines of eventdev skeleton, is for
showcasing the rawdev library. This driver implements some of the
operations of the library based on which a test module can be
developed.
Design of skeleton involves a virtual device which is plugged into
VDEV bus on initialization.
Also, enable compilation of rawdev skeleton driver.
Shreyansh Jain [Wed, 31 Jan 2018 09:13:11 +0000 (14:43 +0530)]
rawdev: add buffer stream IO
Introduce handlers for raw buffer enqueue and dequeue. A raw buffer
is essentially a void object which is transparently passed via the
library onto the driver.
Using a context field as argument, any arbitrary meta information
can be passed by application to the driver/implementation. This can
be any data on which driver needs to define the operation semantics.
For example, passing along a queue identifier can suggest the driver
the queue context to perform I/O on.
Shreyansh Jain [Wed, 31 Jan 2018 09:13:10 +0000 (14:43 +0530)]
rawdev: add attribute get and set
A rawdevice can have various attributes. This patch introduce support
for transparently setting attribute value or getting current attribute
state. This is done by allowing an opaque set of key and value to be
passed through rawdev library.
Shreyansh Jain [Wed, 31 Jan 2018 09:13:09 +0000 (14:43 +0530)]
rawdev: introduce raw device library
Each device in DPDK has a type associated with it - ethernet, crypto,
event etc. This patch introduces 'rawdevice' which is a generic
type of device, not currently handled out-of-the-box by DPDK.
A device which can be scanned on an installed bus (pci, fslmc, ...)
or instantiated through devargs, can be interfaced using
standardized APIs just like other standardized devices.
This library introduces an API set which can be plugged on the
northbound side to the application layer, and on the southbound side
to the driver layer.
The APIs of rawdev library exposes some generic operations which can
enable configuration and I/O with the raw devices. Using opaque
data (pointer) as API arguments, library allows a high flexibility
for application and driver implementation.
This patch introduces basic device operations like start, stop, reset,
queue and info support.
Subsequent patches would introduce other operations like buffer
enqueue/dequeue and firmware support.
Nipun Gupta [Tue, 23 Jan 2018 12:27:06 +0000 (17:57 +0530)]
bus/dpaa: check portal presence in the caller function
In the I/O path we were calling rte_dpaa_portal_init which
internally checks if a portal is affined to the core.
But this lead to calling of that non-static API in every call.
Instead check the portal affinity in the caller itself for
performance reasons
Shreyansh Jain [Tue, 23 Jan 2018 12:27:04 +0000 (17:57 +0530)]
bus/dpaa: fix port order shuffling
While scanning for devices, the order in which devices appear is
different as compared to MAC sequence.
This can cause confusion for users and automated scripts.
This patch create a sorted list of devices.