dpdk.git
4 years agodoc: update ring guide
Honnappa Nagarahalli [Fri, 31 Jan 2020 03:59:29 +0000 (21:59 -0600)]
doc: update ring guide

Changed the rte_ring chapter in programmer's guide to reflect
the addition of rte_ring_xxx_elem APIs. References to pointers
as ring elements is changed to generic term 'objects'.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoring: fix API documentation
Honnappa Nagarahalli [Fri, 31 Jan 2020 03:59:28 +0000 (21:59 -0600)]
ring: fix API documentation

Correct the documentation for obj_table in rte_ring_xxx_elem APIs.

Fixes: cc4b218790f6 ("ring: support configurable element size")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agodoc: fix release notes for custom ring element size
Honnappa Nagarahalli [Sun, 26 Jan 2020 17:40:29 +0000 (11:40 -0600)]
doc: fix release notes for custom ring element size

Added introduction of rte_ring_xxx_elem APIs to release notes.

Fixes: cc4b218790f6 ("ring: support configurable element size")

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agomaintainers: update for NFP
Heinrich Kuhn [Tue, 11 Feb 2020 12:23:54 +0000 (14:23 +0200)]
maintainers: update for NFP

Jan is no longer with Netronome.
Remove him as maintainer for the Netronome PMD

Signed-off-by: Heinrich Kuhn <heinrich.kuhn@netronome.com>
4 years agoexamples/l2fwd-event: fix core allocation in poll mode
Pavan Nikhilesh [Mon, 3 Feb 2020 04:46:18 +0000 (10:16 +0530)]
examples/l2fwd-event: fix core allocation in poll mode

Skip master lcore when assigning cores to rx_queues as it is only used
to print stats.

Fixes: 4ff457986f76 ("examples/l2fwd-event: add default poll mode routines")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoapp/eventdev: fix pipeline test with meson build
Pavan Nikhilesh [Mon, 3 Feb 2020 04:52:59 +0000 (10:22 +0530)]
app/eventdev: fix pipeline test with meson build

Add missing pipeline test to meson build.

Fixes: 2ff67267b049 ("app/eventdev: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodoc: fix service core mask in l3fwd guide
Pavan Nikhilesh [Fri, 7 Feb 2020 05:33:55 +0000 (11:03 +0530)]
doc: fix service core mask in l3fwd guide

Service core mask should be a hexadecimal value rather than a range of
lcores.

Bugzilla ID: 392
Fixes: 55499896d91a ("doc: add event mode to l3fwd guide")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoexamples/l2fwd-event: fix error checking
Sunil Kumar Kori [Thu, 30 Jan 2020 08:19:12 +0000 (13:49 +0530)]
examples/l2fwd-event: fix error checking

Patch fixes coverity issues which handle return values from API
calling.

Coverity issue: 350588, 350594, 350598, 350599

Fixes: 3b5476db4823 ("examples/l2fwd-event: setup event queue and port")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
4 years agoevent/dpaa2: set number of order sequences
Nipun Gupta [Sat, 8 Feb 2020 04:50:19 +0000 (10:20 +0530)]
event/dpaa2: set number of order sequences

This patch sets the number of atomic ordered sequences
supported by the driver.

Fixes: dbf63bd43afa ("event/dpaa2: support ordered queue")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/octeontx2: fix flow control initial state
Vamsi Attunuru [Thu, 6 Feb 2020 04:27:13 +0000 (09:57 +0530)]
net/octeontx2: fix flow control initial state

Currently when application requests for RTE_FC_NONE earlier
than PMD's internal fc mode update, flow control set routine
is returning without updating the flow control state.

Patch updates the PMD's internal fc mode details during
dev_configure to ensure any flow control set requests
issued later are handled properly.

Fixes: 609945f1ce90 ("net/octeontx2: support flow control")
Cc: stable@dpdk.org
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodoc: fix release notes for ixgbe
Jiaqi Min [Fri, 14 Feb 2020 04:50:00 +0000 (04:50 +0000)]
doc: fix release notes for ixgbe

Added support for API rte_eth_tx_done_cleanup.
Added support setting VF MAC address by PF driver.
Added support for setting the link to specific speed.

Fixes: 26e9c3e20180 ("net/ixgbe: cleanup Tx buffers")
Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")
Fixes: 34e736096068 ("net/ixgbe: set fixed flag for exact link speed")

Signed-off-by: Jiaqi Min <jiaqix.min@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: fix release notes for ice
Jiaqi Min [Fri, 14 Feb 2020 04:21:45 +0000 (04:21 +0000)]
doc: fix release notes for ice

Added support for API rte_eth_tx_done_cleanup.

Fixes: ab7cfe1fe3d7 ("net/ice: cleanup Tx buffers")

Signed-off-by: Jiaqi Min <jiaqix.min@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agodoc: fix release notes for i40e
Jiaqi Min [Fri, 14 Feb 2020 04:09:21 +0000 (04:09 +0000)]
doc: fix release notes for i40e

Added support for API rte_eth_tx_done_cleanup.
Added support for VF multiple queues interrupt.
Added support for setting the link to specific speed.

Fixes: 6a8defc552b1 ("net/i40e: cleanup Tx buffers")
Fixes: 40163f9e1756 ("net/i40e: fix multi-queue Rx interrupt for VF")
Fixes: dc73db27bb61 ("net/i40e: set fixed flag for exact link speed")

Signed-off-by: Jiaqi Min <jiaqix.min@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/i40e: fix unchecked Tx cleanup error
Beilei Xing [Wed, 12 Feb 2020 12:36:01 +0000 (20:36 +0800)]
net/i40e: fix unchecked Tx cleanup error

Coverity complains of unchecked return value warning of
i40e_xmit_cleanup, while this cleanup is opportunistic and will not
cause problems if it fails. So instead of checking the return value of
i40e_xmit_cleanup and return in case of cleanup failure, we directly
cast it to void function to make the Coverity happy.

Coverity issue: 353617
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix unchecked Tx cleanup error
Sunil Pai G [Wed, 12 Feb 2020 05:37:10 +0000 (05:37 +0000)]
net/ice: fix unchecked Tx cleanup error

Coverity complains of unchecked return value warning of
ice_xmit_cleanup, while this cleanup is opportunistic and will not cause
problems if it fails. So instead of checking the return value of
ice_xmit_cleanup and return in case of cleanup failure, we directly cast
it to void function to make the Coverity happy.

Coverity issue: 353623
Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agoapp/testpmd: update Rx offload after setting MTU
Wei Hu (Xavier) [Thu, 13 Feb 2020 01:57:43 +0000 (09:57 +0800)]
app/testpmd: update Rx offload after setting MTU

Currently, Rx offload capabilities and max_rx_pkt_len in the struct
variable named rte_port are not updated after setting mtu successfully
in port_mtu_set function by 'port config mtu <port_id> <value>' command.
This may lead to reconfig mtu to the initial value in the driver when
recalling rte_eth_dev_configure API interface.

This patch updates Rx offload capabilities and max_rx_pkt_len after
setting mtu successfully when configuring mtu.

Fixes: ae03d0d18adf ("app/testpmd: command to configure MTU")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: fix hot-unplug detaching
Thomas Monjalon [Thu, 13 Feb 2020 15:52:26 +0000 (16:52 +0100)]
app/testpmd: fix hot-unplug detaching

There is a possible race condition in the hotplug path
in rmv_port_callback(). If a port is created between
close_port(port_id) and detach_port_device(port_id),
then the port_id will have been reallocated to a different
device which will be wrongly detached.

Since a check was added in detach_port_device() for
manual detach case, the hotplug path was even more broken.
It became impossible to run because the new check prevented
to run detach_port_device() after the port is closed.

The solution for both issues is to not rely on the port_id
for detaching the rte_device.
The function detach_port_device() is split to allow calling
detach_device() directly with the rte_device pointer, saved
before closing the port.

Fixes: 43d0e304980a ("app/testpmd: fix invalid port detaching")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: rename function for detaching by devargs
Thomas Monjalon [Thu, 13 Feb 2020 15:52:25 +0000 (16:52 +0100)]
app/testpmd: rename function for detaching by devargs

There is a function detach_port_device() which takes a port_id,
and a function detach_device() which takes a devargs string.
In order to add a third function accepting a rte_device pointer,
the function detach_device() is renamed into detach_devargs().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoapp/testpmd: add port check before manual detach
Thomas Monjalon [Thu, 13 Feb 2020 14:50:23 +0000 (15:50 +0100)]
app/testpmd: add port check before manual detach

User may try to run "port detach <port_id>"
for an already detached device.
It has been decided to protect from such usage in testpmd,
so a check was added to detach_port_device() in DPDK 19.11.
This check might be removed to allow hotplug path detaching
the device of a closed port.
Whatever will be decided in future, this check is also added
before the call to detach_port_device().

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agovhost: protect log address translation in IOTLB update
Adrian Moreno [Thu, 13 Feb 2020 10:04:58 +0000 (11:04 +0100)]
vhost: protect log address translation in IOTLB update

Currently, the log address translation only  happens in the vhost-user's
translate_ring_addresses(). However, the IOTLB update handler is not
checking if it was mapped to re-trigger that translation.

Since the log address mapping could fail, check it on iotlb updates.
Also, check it on vring_translate() so we do not dirty pages if the
logging address is not yet ready.

Additionally, properly protect the accesses to the iotlb structures.

Fixes: fbda9f145927 ("vhost: translate incoming log address to GPA")
Cc: stable@dpdk.org
Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: fix inflight resubmit check
Jin Yu [Wed, 25 Dec 2019 14:18:35 +0000 (22:18 +0800)]
vhost: fix inflight resubmit check

The frontend may not send the get_inflight_fd and
set_inflight_fd although we negotiate the protocol
feature. When we meet this situation just return OK.

Fixes: ad0a4ae491fe ("vhost: checkout resubmit inflight information")
Cc: stable@dpdk.org
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agodoc: fix release notes for virtio
Cheng Jiang [Thu, 13 Feb 2020 01:41:40 +0000 (01:41 +0000)]
doc: fix release notes for virtio

Add release notes for the notification data feature of virtio-PMD.

Fixes: 7e72f3ec1a8a ("net/virtio: support packed ring notification data")

Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoexamples/vhost_blk: fix check of device path
Jin Yu [Wed, 12 Feb 2020 12:54:46 +0000 (20:54 +0800)]
examples/vhost_blk: fix check of device path

Fix the time of check time of use warning in example code.
Ignore the errno of unlink failure. There are two situations.
The first one is that file doesn't exist the unlink fails and
it's ok to ignore. The second one is that unlink fails to remove
file but the next bind() would fail too.

Coverity issue: 350589, 158663
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/vhost: remove an unused member
Itsuro Oda [Thu, 6 Feb 2020 01:39:36 +0000 (10:39 +0900)]
net/vhost: remove an unused member

This patch removes an unused member from pmd_internal.

Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/vhost: fix probing in secondary process
Itsuro Oda [Thu, 6 Feb 2020 01:39:35 +0000 (10:39 +0900)]
net/vhost: fix probing in secondary process

This patch adds lacking member setting and makes secondary
probe complete.

Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Cc: stable@dpdk.org
Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/vhost: delay driver setup
Itsuro Oda [Thu, 6 Feb 2020 01:39:34 +0000 (10:39 +0900)]
net/vhost: delay driver setup

Vhost driver setup is delayed at eth_dev configuration
in order to be able to set it from a secondary process.

Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Cc: stable@dpdk.org
Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/vhost: allocate interface name from heap
Itsuro Oda [Thu, 6 Feb 2020 01:39:33 +0000 (10:39 +0900)]
net/vhost: allocate interface name from heap

This patch allocates iface_name of pmd_internal from heap
in order to be able to refer from secondary processes.

Fixes: 4852aa8f6e21 ("drivers/net: enable hotplug on secondary process")
Cc: stable@dpdk.org
Signed-off-by: Itsuro Oda <oda@valinux.co.jp>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: check message header size read
Maxime Coquelin [Wed, 5 Feb 2020 15:05:29 +0000 (16:05 +0100)]
vhost: check message header size read

This patch adds a check to ensure the read size of
the Vhost-user message header is not smaller than
the expected size.

In case of unexpected read size, report an error
and close file descriptors passed with the message,
if any.

Fixes: 8f972312b8f4 ("vhost: support vhost-user")
Cc: stable@dpdk.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
4 years agonet/mlx: fix overlinking with meson and glue dlopen
Thomas Monjalon [Wed, 12 Feb 2020 22:07:08 +0000 (23:07 +0100)]
net/mlx: fix overlinking with meson and glue dlopen

If ibverbs_link is dlopen, the PMD and application should not
be linked with ibverbs, but the glue library is.
Unfortunately the ibverbs dependency was exported in the
variable ext_deps, so there were overlinking.

It is fixed by not exporting the dependency in ext_deps,
and recreating a limited dependency object for cflags only.

Fixes: 1dd7c7e38c19 ("net/mlx4: support meson build")
Fixes: 96d7c62a70c7 ("net/mlx5: support meson build")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agonet/mlx: rename meson variable for dlopen option
Thomas Monjalon [Wed, 12 Feb 2020 22:07:07 +0000 (23:07 +0100)]
net/mlx: rename meson variable for dlopen option

The name of the variable pmd_dlopen is confusing because
it can be understood as true if the PMD is dlopen,
whereas it means the ibverbs glue layer is a dlopen library.
That's why it is renamed dlopen_ibverbs.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agonet/mlx: workaround static linkage with meson
Thomas Monjalon [Wed, 12 Feb 2020 22:07:06 +0000 (23:07 +0100)]
net/mlx: workaround static linkage with meson

If ibverbs_link is static and the application choose to link DPDK
as static libraries, both PMD and ibverbs libraries must be linked
as static libraries. And the dependencies of ibverbs (netlink) must
still be linked as shared libraries.

Unfortunately, meson forget about the static requirement for ibverbs
when generating the .pc file.
As a result, libibverbs, libmlx4, libmlx5 are listed in Requires.private
section (allowing to be linked as shared libraries) and libnl is missing.

A fix is in progress for meson, but anyway we will have to live without
such a fix until a better version of meson is widely available:
https://github.com/mesonbuild/meson/pull/6393

In order to avoid meson suggesting shared libraries in the section
Requires.private of the .pc file, the dependency object is recreated
with declare_dependency():
- cflags are extracted the libibverbs.pc
- ldflags, from libibverbs.pc, are processed to force
static flavor of ibverbs libraries, thanks to this syntax:
-l:libfoo.a

Fixes: 6affeabaf321 ("net/mlx: add static ibverbs linkage with meson")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agobuildtools: get static mlx dependencies for meson
Thomas Monjalon [Wed, 12 Feb 2020 22:07:05 +0000 (23:07 +0100)]
buildtools: get static mlx dependencies for meson

The shell script options-ibverbs-static.sh was used with make
in forcing static linkage of ibverbs libraries.

When choosing to link with a static dependency in meson,
the generated .pc file will not force such static linkage.
The solution will rely on using this script in meson.

If linking with libraries installed in a non-standard path,
an option -L is provided via EXTRA_LDFLAGS in case of using make.
With meson, tuning PKG_CONFIG_PATH for pkg-config should be enough.
When statically linking an application, the .pc file must save the
-L path so the application link will work without any extra option.
That's why --libs-only-l is replaced with --libs which includes -L.
Options which are neither -l or -L are filtered out because not needed
and can cause compilation issues with the legacy system using make.

The other change in this script is to drop the first occurrences of the
main library file (libiverbs.a). Only the last occurrence is kept.
It fixes some undefined references when linking a static application
using libdpdk.pc.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agonet/mlx: add static ibverbs linkage with meson
Thomas Monjalon [Wed, 12 Feb 2020 22:07:04 +0000 (23:07 +0100)]
net/mlx: add static ibverbs linkage with meson

The libibverbs (and libmlx4/5) can be statically embedded
in the shared PMD library, or in the application with the static PMD.
It was supported with make build system in
commit 2c0dd7b69fb0 ("config: add static linkage of mlx dependency").

The same feature is enabled with meson when using pkg-config
(i.e. only if the call to dependency() is successful).
The fallback method for searching library with cc.find_library()
is not supported because the dependencies of the found library
would not be linked (no such info in .a file unlike .so).

The main difference, in meson build system, is the generated .pc file
giving arguments to link DPDK with the application.
Unfortunately the .pc file will not keep memory of the static linkage
option for libibverbs.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodrivers: cleanup meson build variable
Thomas Monjalon [Wed, 12 Feb 2020 22:07:03 +0000 (23:07 +0100)]
drivers: cleanup meson build variable

The variable build is already initialized as true in
drivers/meson.build. Duplicate initializations can be removed from mlx.

When the variable build is set to false, it is easier to call
subdir_done() than branch the rest of the code on build condition.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Rosen Xu <rosen.xu@intel.com>
4 years agocommon/mlx5: fix glue dlopen with meson build
Matan Azrad [Mon, 10 Feb 2020 12:27:34 +0000 (12:27 +0000)]
common/mlx5: fix glue dlopen with meson build

The glue shared library name was created by the common class FMT name,
driver_name_fmt = 'rte_common_@0@', which is not correlated with
LIB_GLUE_BASE = 'librte_pmd_mlx5_glue.so'.

This causes the dynamic linkage of the glue library to fail what
remained mlx5 drivers outside the PCI driver list.

The command:
MLX5_GLUE_PATH=$(pwd)/build-meson/drivers/common/mlx5
build-meson/app/dpdk-testpmd -n 4  -w 0000:00:05.0 -w 0000:00:06.0 -- -i

The log:
common_mlx5: Cannot load glue library:
/usr/local/lib64/dpdk/pmds-20.0.1-glue/librte_pmd_mlx5_glue.so.20.02.0:
cannot open shared object file: No such file or directory

Adjust the shared library name to the LIB_GLUE_BASE definition.

Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")

Signed-off-by: Matan Azrad <matan@mellanox.com>
4 years agonet/af_xdp: fix maximum MTU
Ciara Loftus [Thu, 13 Feb 2020 08:49:14 +0000 (08:49 +0000)]
net/af_xdp: fix maximum MTU

The maximum MTU for af_xdp zero copy is equal to the page size less the
frame overhead introduced by AF_XDP (XDP HR = 256) and DPDK (frame
headroom = 320). The patch updates this value to reflect this.

This change also makes it possible to remove unneeded constants for both
zero-copy and copy mode.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/af_xdp: fix fill queue addresses
Ciara Loftus [Thu, 13 Feb 2020 08:49:13 +0000 (08:49 +0000)]
net/af_xdp: fix fill queue addresses

The fill queue addresses should start at the beginning of the mempool
object instead of the beginning of the mbuf. This is because the umem
frame headroom includes the mp hdrobj size. Starting at this point
ensures AF_XDP doesn't write past the available room in the frame, in
the case of larger packets which are close to the size of the mbuf.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/af_xdp: fix umem frame size and headroom
Ciara Loftus [Thu, 13 Feb 2020 08:49:12 +0000 (08:49 +0000)]
net/af_xdp: fix umem frame size and headroom

The previous frame size calculation incorrectly used
mb_pool->private_data_size and didn't include mb_pool->header_size.
Instead of performing a manual calculation, use the
rte_mempool_calc_obj_size API to determine the frame size.

The previous frame headroom calculation also incorrectly used
mb_pool->private_data_size and didn't include mb_pool->header_size or
the mbuf priv size. Fix this.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agoapp/testpmd: add --portlist option
Hariprasad Govindharajan [Wed, 12 Feb 2020 10:29:47 +0000 (10:29 +0000)]
app/testpmd: add --portlist option

In current version, we are setting the ports
using portmask. With portmask, we can use only
up to 64 ports. This portlist option enables the user
to use more than 64 ports.
Now we can specify the ports in 2 different ways
 - Using portmask (-p [0x]nnn): mask must be in hex format
 - Using portlist in the following format
 --portlist <p1>[-p2][,p3[-p4],...]

 --portmask 0x2 is same as --portlist 1
 --portmask 0x3 is same as --portlist 0-1

Signed-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
4 years agonet/mlx5: fix meter header modify before decap
Suanming Mou [Thu, 6 Feb 2020 04:14:25 +0000 (06:14 +0200)]
net/mlx5: fix meter header modify before decap

The meter flows are split into three subflows each, the prefix subflow
with meter action color the packet, the meter subflow filters out the
colored packets, the suffix subflow applies all the remaining actions
to the passed packets. The tag header modify action is added to the
prefix subflow to make the suffix subflow to match the packets from the
prefix subflow.

Currently, the tag header modify action is added at the beginning in the
prefix subflow even before decap action. The header modify action does
not make sense to the later decap action, so the flow create will be
validated as incorrect flow rule and failed.

Move the tag header modify action just before meter action in the prefix
subflow to make the flow with decap action to do the decap first, then
do the tag and meter to fix that issue.

Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
Cc: stable@dpdk.org
Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix VLAN match for DV mode
Dekel Peled [Tue, 11 Feb 2020 11:05:11 +0000 (13:05 +0200)]
net/mlx5: fix VLAN match for DV mode

Currently MLX5 PMD can't match on untagged packets specifically.
Tagged traffic still hits the flows intended for untagged packets.
If the flow has ETH, it will catch all matching packets, tagged
and untagged.
The solution is to use cvlan_tag bit.
If mask=1 and value=0 it matches on untagged traffic.
If mask=1 and value=1 it matches on tagged traffic.
This is the kernel implementation.

This patch updated MLX5 PMD to set cvlan_tag mask and value according
to flow rule contents.
This update is relevant when using DV flow engine (dv_flow_en=1).

See example at https://doc.dpdk.org/guides/nics/mlx5.html#limitations.

Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix blocker for push VLAN on Rx
Wisam Jaddo [Tue, 11 Feb 2020 13:20:06 +0000 (15:20 +0200)]
net/mlx5: fix blocker for push VLAN on Rx

The blocker should take FDB into consideration, since FDB all directions
have transfer ingress in it.

Fixes: 55060e62e4d2 ("net/mlx5: block push VLAN action on Rx")
Cc: stable@dpdk.org
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Raslan Darawsheh <rasland@mellanox.com>
4 years agoapp/testpmd: fix txonly flow generation entropy
Viacheslav Ovsiienko [Sun, 9 Feb 2020 17:02:39 +0000 (17:02 +0000)]
app/testpmd: fix txonly flow generation entropy

The testpmd application in txonly forwarding mode has an option
to generate the packet flows by varying the destination IP address.
The patch increments the IP for each packet sent, this improves
the entropy and RSS distribution on the peer receiving size
is getting more uniform.

Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ixgbe: remove dead code
Shougang Wang [Tue, 11 Feb 2020 09:26:22 +0000 (09:26 +0000)]
net/ixgbe: remove dead code

This patch fixes (Logically dead code) coverity issue.

Coverity issue: 353624
Fixes: ba7b12dd64e4 ("net/ixgbe: fix link up in FreeBSD")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/mlx: replace hardcoded value with macro
Thomas Monjalon [Sun, 9 Feb 2020 21:17:25 +0000 (22:17 +0100)]
net/mlx: replace hardcoded value with macro

Replace checking against 65535 limit,
with a simpler form using RTE_MIN and UINT16_MAX macros.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix legacy multi-packet write session
Viacheslav Ovsiienko [Sun, 9 Feb 2020 22:54:53 +0000 (22:54 +0000)]
net/mlx5: fix legacy multi-packet write session

To provide the better PCIe bandwidth utilization the ConnectX-4LX
NIC supports the multi-packet write (MPW) sessions allowing to
pack multiple packets into one descriptor (WQE). This is legacy
feature and it has some limitations on the packets and data
description segments. To provide the best performance all inline
packets must be put into shared data segment and the total length
of MPW session must be limited. The limit is controlled with
txq_inline_mpw devarg.

Fixes: 82e75f8323bf ("net/mlx5: fix legacy multi-packet Tx descriptors")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agodoc: split versions table in i40e guide
Zhaoyan Chen [Tue, 4 Feb 2020 03:35:09 +0000 (11:35 +0800)]
doc: split versions table in i40e guide

Split recommended mapping table for X710/XL710/XXV710 and X722,
since they have different firmware versions.

Signed-off-by: Zhaoyan Chen <zhaoyan.chen@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agocommon/iavf: fix ABI version
Haiyue Wang [Thu, 6 Feb 2020 12:04:42 +0000 (20:04 +0800)]
common/iavf: fix ABI version

The new symbols should be in ABI version 20.0.1.

Fixes: 89214fe915b8 ("net/iavf/base: move to drivers common directory")

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/mlx5: fix encap/decap validation
Matan Azrad [Sun, 9 Feb 2020 15:19:16 +0000 (15:19 +0000)]
net/mlx5: fix encap/decap validation

The encapsulation and decapsulation actions are divided into 2 types:
L2 and L3.
In order to configure L3 xcapsulation actions the user should use both
RAW_DECAP and RAW_ENCAP and setting the appropriated data sizes in
their action configuration structures.

The PMD flow validation wrongly didn't detect the RAW_DECAP
and RAW_ENCAP combination to distinguish between L3_DECAP and L3_ENCAP.
Thus, some xcapsulation related validation failed.
For example, when configuring modify header action before L3_DECAP.

Simplify the xcapsulation defines and fix the L3 xcapsulation detection
using the action configuration data sizes.

By the way, add the hairpin validation in this area.

Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows")
Fixes: 8ba9eee4ce32 ("net/mlx5: add raw data encap/decap to Direct Verbs")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/netvsc: initialize link state
Stephen Hemminger [Fri, 7 Feb 2020 18:08:16 +0000 (10:08 -0800)]
net/netvsc: initialize link state

If application is using link state interrupt, the correct link state
needs to be filled in when device is started. This is similar to
how virtio updates link information.

Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org
Reported-by: Mohammed Gamal <mgamal@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Mohammed Gamal <mgamal@redhat.com>
4 years agonet/i40e: fix ESP flow creation
Bernard Iremonger [Tue, 28 Jan 2020 13:48:45 +0000 (13:48 +0000)]
net/i40e: fix ESP flow creation

Merge of ESP and L2TP code in i40e_fdir.c added checks on
cus_pctype->index which caused flow creation for ESP to fail.

Added fill_ipv4_function()
Refactored code to have one path for customized and non customized
pctype's.

Fixes: c5f8365bc85d ("net/i40e: support flow director for L2TPv3 over IP")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Rory Sexton <rory.sexton@intel.com>
4 years agonet/ixgbe: remove dead code
Guinan Sun [Mon, 10 Feb 2020 04:15:25 +0000 (04:15 +0000)]
net/ixgbe: remove dead code

This patch fixes (Logically dead code) coverity issue.

Coverity issue: 353613
Fixes: 3c4270187518 ("net/ixgbe: support VF MAC address add/remove")

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice: fix flow director passthru
Yahui Cao [Tue, 21 Jan 2020 02:25:59 +0000 (10:25 +0800)]
net/ice: fix flow director passthru

The original PASSTHRU implementation is forwarding to queue 0. The
corrected implementation is forwarding to the next stage filter.

Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
Cc: stable@dpdk.org
Signed-off-by: Yahui Cao <yahui.cao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agodoc: fix release notes for bnxt
Ajit Khaparde [Thu, 6 Feb 2020 18:29:55 +0000 (10:29 -0800)]
doc: fix release notes for bnxt

Fixes: 94eb699bc82e ("net/bnxt: support flow mark action")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix buffer allocation reattempt
Santoshkumar Karanappa Rastapur [Thu, 6 Feb 2020 16:33:14 +0000 (22:03 +0530)]
net/bnxt: fix buffer allocation reattempt

In case of a buffer allocation failure, we reattempt buffer allocation
before the Rx handler exits. We were not attempting this when producer
index is greater than the number of buffers to allocate. Fixed it with
correct checks.

Fixes: d9dd0b29ed31 ("net/bnxt: fix Rx handling and buffer allocation logic")
Cc: stable@dpdk.org
Signed-off-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
4 years agonet/bnxt: make locally used functions static
Kalesh AP [Thu, 6 Feb 2020 16:33:13 +0000 (22:03 +0530)]
net/bnxt: make locally used functions static

bnxt_rss_ctxts() function is declared in header file bnxt.h,
implemented in bnxt_ethdev.c, and called only in bnxt_ethdev.c.

Also many functions are declared in header file bnxt_hwrm.h,
implemented in bnxt_hwrm.c, and called only in bnxt_hwrm.c.

This patch moves these function declarations into bnxt_ethdev.c
and bnxt_hwrm.c, as static functions.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix port stop on error recovery failure
Kalesh AP [Thu, 6 Feb 2020 16:33:12 +0000 (22:03 +0530)]
net/bnxt: fix port stop on error recovery failure

During live FW upgrade or error recovery, if restoring the filter
settings fail after port start, driver invokes bnxt_uninit_resources()
only. Fix it to invoke bnxt_dev_stop_op() first before calling
bnxt_uninit_resources().

Fixes: df6cd7c1f73a ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
4 years agonet/bnxt: register for debug notification from FW
Kalesh AP [Thu, 6 Feb 2020 16:33:11 +0000 (22:03 +0530)]
net/bnxt: register for debug notification from FW

PF driver has to register for the debug notification async event
with firmware in the HWRM_FUNC_DRV_RGTR command.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: log firmware debug notifications
Kalesh AP [Thu, 6 Feb 2020 16:33:10 +0000 (22:03 +0530)]
net/bnxt: log firmware debug notifications

The debug notifications are not functional in nature, they should
only have diagnostic value. Other than logging to system log,
drivers shall not take any other functional action based on this
async event.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix default timeout for getting FW version
Rahul Gupta [Thu, 6 Feb 2020 16:33:09 +0000 (22:03 +0530)]
net/bnxt: fix default timeout for getting FW version

Initially when driver is loading, there is no HWRM timeout configured
by FW, the VER_GET command needs use default timeout as 500ms and
while recovering from fatal/non-fatal FW error, it should use timeout
as 50ms.

Fixes: 458f0360e8dc ("net/bnxt: get default HWRM command timeout from FW")
Cc: stable@dpdk.org
Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix unnecessary delay in port stop
Kalesh AP [Thu, 6 Feb 2020 16:33:08 +0000 (22:03 +0530)]
net/bnxt: fix unnecessary delay in port stop

VFs and multifunction PFs do not have the privilege to change
link configuration. We force the physical link down as a part
of device stop only for single physical function(SPF).

This change also helps in eliminating the logs when a VF port
is stopped:

"Port 0: link state change event"
"bnxt_print_link_info(): Port 0 Link Up - speed 25000 Mbps - full-duplex"

Fixes: 316e412299fd ("net/bnxt: fix crash when closing")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agodrivers/crypto: fix session-less mode
Junxiao Shi [Mon, 27 Jan 2020 18:32:11 +0000 (11:32 -0700)]
drivers/crypto: fix session-less mode

When OpenSSL or AESNI-MB cryptodev is being used in sessionless mode
for symmetric crypto operation (e.g. SHA256 hash), the driver prints
error message:

    CRYPTODEV: set_sym_session_private_data() line 489:
               Set private data for driver 0 not allowed

Then, AESNI-MB driver segfaults in post_process_mb_job().

Bugzilla ID: 377
Fixes: b3bbd9e5f2 ("cryptodev: support device independent sessions")
Fixes: c68d7aa354 ("crypto/aesni_mb: use architecture independent macros")
Cc: stable@dpdk.org
Signed-off-by: Junxiao Shi <git@mail1.yoursunny.com>
4 years agotest/crypto: add CPU crypto mode cases
Marcin Smoczynski [Fri, 7 Feb 2020 14:28:04 +0000 (15:28 +0100)]
test/crypto: add CPU crypto mode cases

This patch adds ability to run unit tests in cpu crypto mode for AESNI
GCM cryptodev.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoexamples/ipsec-secgw: add missing SPDX license tag
Marcin Smoczynski [Tue, 11 Feb 2020 10:36:27 +0000 (11:36 +0100)]
examples/ipsec-secgw: add missing SPDX license tag

Add missing BSD-3 license tag to inline fallback testing scripts.

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agodoc: add cycle-count mode in compression perf tool
Artur Trybula [Wed, 12 Feb 2020 12:06:49 +0000 (13:06 +0100)]
doc: add cycle-count mode in compression perf tool

This commit adds release notes and updates documentation for
the cycle-count mode added to the compression performance tool.

Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool")

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
4 years agotest/compress: replace test vector
Artur Trybula [Thu, 6 Feb 2020 09:37:35 +0000 (10:37 +0100)]
test/compress: replace test vector

This patch replaces an existing test vector with a new one containing
public domain text only. This is to avoid any potential issues
re-licensing content as BSD-3 which has no clear original license.

Fixes: b06aa643cac4 ("test/compress: add initial unit tests")
Cc: stable@dpdk.org
Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
4 years agodoc: add missing release notes for QAT
Arek Kusztal [Fri, 31 Jan 2020 07:28:48 +0000 (08:28 +0100)]
doc: add missing release notes for QAT

Updated release notes for the changes done in QAT for DPDK 20.02
Original commits for these features are as follows.

Fixes: 026f21c0b951 ("common/qat: support dual threads for enqueue/dequeue")
Fixes: 6cde900bd59d ("common/qat: remove tail write coalescing")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
4 years agocryptodev: fix doxygen of CPU crypto API
Marcin Smoczynski [Thu, 6 Feb 2020 12:36:02 +0000 (13:36 +0100)]
cryptodev: fix doxygen of CPU crypto API

Add missing doxygen comment of rte_crypto_mbuf_to_vec's fields.

Fixes: 7adf992fb9bf ("cryptodev: introduce CPU crypto API")

Signed-off-by: Marcin Smoczynski <marcinx.smoczynski@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agocrypto/ccp: fix queue alignment
David Marchand [Fri, 7 Feb 2020 14:06:00 +0000 (15:06 +0100)]
crypto/ccp: fix queue alignment

Caught by compiling with -fno-common.
A ____cacheline_aligned symbol can be found in the crypto/ccp driver
object files.

Looking at this driver source, the ____cacheline_aligned (kernel?)
alignment macro is undefined.
The compiler treats this as a symbol definition and generates a global
symbol.

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agocrypto/octeontx2: add kmod dependency info
Thierry Herbelot [Mon, 10 Feb 2020 07:35:12 +0000 (08:35 +0100)]
crypto/octeontx2: add kmod dependency info

Like for OCTEON TX, the OCTEON TX2 crypto engines must
first be unbound from their kernel module, then rebound to
vfio-pci, before being used in DPDK.

As this capability is detected at runtime by dpdk-pmdinfo,
add the info in the PMD registering directives.

Then an external script can be used for bind and unbind.

Fixes: 2f8a1b963eb77 ("crypto/octeontx2: add PMD skeleton")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
4 years agolib: fix unnecessary double negation
Ciara Power [Fri, 14 Feb 2020 16:17:25 +0000 (16:17 +0000)]
lib: fix unnecessary double negation

An equality expression already returns either 0 or 1.
There is no need to use double negation for these cases.

Fixes: ea672a8b1655 ("mbuf: remove the rte_pktmbuf structure")
Fixes: a0fd91cefcc0 ("mempool: rename functions with confusing names")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agoexamples/fips_validation: fix AES-GCM cipher length parsing
Fan Zhang [Fri, 14 Feb 2020 11:41:18 +0000 (11:41 +0000)]
examples/fips_validation: fix AES-GCM cipher length parsing

This patch fixes the cipher len keyword typo.

Fixes: 07f5e4553293 ("examples/fips_validation: fix cipher length for AES-GCM")

Suggested-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/l3fwd-power: fix interrupt disable
Xiao Wang [Tue, 21 Jan 2020 03:06:57 +0000 (22:06 -0500)]
examples/l3fwd-power: fix interrupt disable

Since all related queues' interrupts are turned on before epoll, we need
to turn off all the interrupts after wakeup. This patch fixes the issue
of only turning off the interrupted queues.

Fixes: b736d64787fc ("examples/l3fwd-power: disable Rx interrupt when waking up")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Tested-by: Harman Kalra <hkalra@marvell.com>
Reviewed-by: Liang Ma <liang.j.ma@intel.com>
Tested-by: Liang Ma <liang.j.ma@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
4 years agoexamples/l3fwd-power: fix a typo
Xiao Wang [Tue, 21 Jan 2020 03:06:56 +0000 (22:06 -0500)]
examples/l3fwd-power: fix a typo

Fixes: aee3bc79cc34 ("examples/l3fwd-power: enable one-shot Rx interrupt and polling switch")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
4 years agokni: fix not contiguous FIFO
Scott Wasson [Fri, 14 Feb 2020 10:00:52 +0000 (10:00 +0000)]
kni: fix not contiguous FIFO

KNI requires FIFO to be physically contiguous, with existing
'rte_memzone_reserve()' API this is not guaranteed by default and as a
result KNI rings and packet delivery may be broken if reserved memory
is not physically contiguous.

Fixing it by providing 'RTE_MEMZONE_IOVA_CONTIG' flag to ask physically
contiguous memory.

Bugzilla ID: 389
Fixes: 23fa86e529e4 ("memzone: enable IOVA-contiguous reserving")
Cc: stable@dpdk.org
Signed-off-by: Scott Wasson <scott_wasson@affirmednetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: remove major in designation of normal releases
Thomas Monjalon [Mon, 5 Aug 2019 12:30:12 +0000 (14:30 +0200)]
doc: remove major in designation of normal releases

The word "major" was used to differentiate with release candidates
or stable maintenance releases.
However the word "major" can be understood as "LTS",
so it is less confusing to avoid this word.

Reported-by: Ori Kam <orika@mellanox.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
4 years agofix Mellanox copyright and SPDX tag
Thomas Monjalon [Sun, 9 Feb 2020 21:14:52 +0000 (22:14 +0100)]
fix Mellanox copyright and SPDX tag

Mellanox owns Tilera and EZchip, so the copyrights can be converted.
At the same time, the license header is switched to SPDX tag format,
and a typo is fixed in another copyright line.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoexamples/kni: add SIGTERM signal handling
Vamsi Attunuru [Thu, 6 Feb 2020 11:53:57 +0000 (17:23 +0530)]
examples/kni: add SIGTERM signal handling

SIGTERM handling is added for graceful application exit.
Useful when application is terminated without specifying
any signal on 'kill' command.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agokni: fix build with Linux 5.6
Ferruh Yigit [Wed, 12 Feb 2020 17:14:24 +0000 (17:14 +0000)]
kni: fix build with Linux 5.6

With the following Linux commit a new parameter 'txqueue' has been added
to 'ndo_tx_timeout' ndo:
commit 0290bd291cc0 ("netdev: pass the stuck queue to the timeout handler")

The change reflected to the KNI with version check.

Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples/power: fix ack for enable/disable turbo
David Hunt [Tue, 11 Feb 2020 10:50:08 +0000 (10:50 +0000)]
examples/power: fix ack for enable/disable turbo

When a VM sends a command through virtio-serial to enable/disable
turbo, it is successfully enabled or disabled, yet the response to the
VM is NACK. This is because all the library frequency change APIs return
1 for success (change in frequency), 0 for success (no change in
frequency) and -1 for failure. However the turbo enable/disable APIs just
return 0 for success and -1 for failure.

Fix the handling of the return code to treat ">= 0" as success, and
send an ACK. Only send NACK when < 0 (failure).

Fixes: 0de94bcac7fc ("examples/vm_power: send confirmation cmd to guest")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Lei Yao <lei.a.yao@intel.com>
4 years agoexamples/ioat: fix invalid link status check
Ciara Power [Fri, 7 Feb 2020 10:24:02 +0000 (10:24 +0000)]
examples/ioat: fix invalid link status check

The return value of the get link function call was not checked, and
could return a negative value indicating a failure. This meant the
link_status of the link being checked is invalid, because the link was
not filled with data. The return value is now checked, and if the return
value is not 0 for success, the loop continues with the next port.

To avoid confusion between variable names, the existing retval variable
is renamed to link_status, to better represent its use.

Coverity issue: 350348
Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ioat: fix failure check for ioat dequeue
Ciara Power [Tue, 4 Feb 2020 16:00:06 +0000 (16:00 +0000)]
examples/ioat: fix failure check for ioat dequeue

The nb_dq return value from the ioat dequeue is negative in failure
cases, however the variable was an unsigned int, causing the condition
where nb_dq <= 0 to never be true. This is now cast to a signed int,
which will successfully reflect the -1 value to be used in this
conditional check.

Coverity issue: 350342
Coverity issue: 350349
Fixes: 92c981637ffc ("examples/ioat: handle failure case for ioat dequeue")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ioat: fix unchecked return value
Praveen Shetty [Thu, 28 Nov 2019 11:27:14 +0000 (11:27 +0000)]
examples/ioat: fix unchecked return value

patch checks the return value of function rte_eth_dev_info_get,
if return value is negative error message printed on the console.

Coverity issue: 350361
Fixes: c8e6ceecebc1 ("examples/ioat: add new sample app for ioat driver")
Cc: stable@dpdk.org
Signed-off-by: Praveen Shetty <praveen.shetty@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/ethtool: fix unchecked return value
Gargi Sau [Mon, 9 Dec 2019 06:37:56 +0000 (06:37 +0000)]
examples/ethtool: fix unchecked return value

This checks the return value from the function
rte_eth_dev_set_vlan_offload.

Coverity issue: 350358
Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Cc: stable@dpdk.org
Signed-off-by: Gargi Sau <gargi.sau@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agotest/acl: add 32-bit range test case
Konstantin Ananyev [Wed, 12 Feb 2020 13:47:45 +0000 (13:47 +0000)]
test/acl: add 32-bit range test case

Add new test-case to improve test coverage for 32-bit range fields.

Suggested-by: Ido Goshen <ido@cgstowernetworks.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoacl: fix 32-bit match for range field
Konstantin Ananyev [Wed, 12 Feb 2020 13:47:44 +0000 (13:47 +0000)]
acl: fix 32-bit match for range field

ACL build phase for range fields that are bigger then
16 bits might generate wrong trie.
For more details please refer to:
https://bugs.dpdk.org/show_bug.cgi?id=307

Bugzilla ID: 307
Fixes: dc276b5780c2 ("acl: new library")
Cc: stable@dpdk.org
Reported-by: Ido Goshen <ido@cgstowernetworks.com>
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoeal/windows: support command line options parsing
Pallavi Kadam [Fri, 7 Feb 2020 03:14:37 +0000 (19:14 -0800)]
eal/windows: support command line options parsing

Adding specific logic for eal.c to support parsing on
Windows.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal/windows: support more common files
Pallavi Kadam [Fri, 7 Feb 2020 03:14:36 +0000 (19:14 -0800)]
eal/windows: support more common files

Added support for additional common files in meson build
to expand Windows EAL and to support the lcore parsing
feature on Windows.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal: disable syslog and dlopen on Windows
Pallavi Kadam [Fri, 7 Feb 2020 03:14:35 +0000 (19:14 -0800)]
eal: disable syslog and dlopen on Windows

Excluding syslog/ dlfcn definitions and parameters
from Windows by adding #ifndef RTE_EXEC_ENV_WINDOWS.

Note: This is a temporary change. In future, separate
'unix' directory will be created for unix specific functions.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal/x86: include SSE4 support on Windows
Pallavi Kadam [Fri, 7 Feb 2020 03:14:34 +0000 (19:14 -0800)]
eal/x86: include SSE4 support on Windows

Modified common/include/arch/x86/rte_vect.h
to include SSE4 header for Windows.

Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal/windows: detect process type
Pallavi Kadam [Fri, 7 Feb 2020 03:14:33 +0000 (19:14 -0800)]
eal/windows: detect process type

Adding a function to detect process type, also included
header files to contain suitable function declarations
and to support extra warning flags.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal/windows: add getopt implementation
Pallavi Kadam [Fri, 7 Feb 2020 03:14:32 +0000 (19:14 -0800)]
eal/windows: add getopt implementation

Adding getopt files to support parsing option on
Windows.

The original contribution is under BSD-2 license.
https://github.com/greenplum-db/libusual/blob/master/usual/getopt.c
https://github.com/greenplum-db/libusual/blob/master/usual/getopt.h

Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal/windows: add some basic functions and macros
Pallavi Kadam [Fri, 7 Feb 2020 03:14:31 +0000 (19:14 -0800)]
eal/windows: add some basic functions and macros

Adding additional function definitions for pthread, cpuset
implementation, asprintf implementation, in order to support
common code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agoeal/windows: add dirent implementation
Pallavi Kadam [Fri, 7 Feb 2020 03:14:30 +0000 (19:14 -0800)]
eal/windows: add dirent implementation

Adding dirent.h on Windows to support common code.
eal_common_options.c includes this file.

The original contribution is under MIT license.
https://github.com/tronkko/dirent

Signed-off-by: Antara Ganesh Kolar <antara.ganesh.kolar@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Reviewed-by: Keith Wiles <keith.wiles@intel.com>
Reviewed-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
Acked-by: Narcisa Ana Maria Vasile <narcisa.vasile@microsoft.com>
4 years agolicense: add exceptions for Windows
Pallavi Kadam [Fri, 7 Feb 2020 03:14:29 +0000 (19:14 -0800)]
license: add exceptions for Windows

The Governing Board and Tech Board have provided exceptions for
MIT and BSD-2-Clause license files for DPDK support on Windows.

Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
Reviewed-by: Ranjit Menon <ranjit.menon@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodevtools: enable more config options in build test
Thomas Monjalon [Tue, 11 Feb 2020 23:57:24 +0000 (00:57 +0100)]
devtools: enable more config options in build test

The Linux kernel modules kni and igb_uio were disabled by default
so they need a new option (+kmods) for testing compilation.

Some recent features were not enabled in compilation testing:
- mlx5 vDPA (depends on libibverbs)
- ifpga (depends on libfdt)
- ipn3ke (depends on libfdt)
- Arm WFE

Check on libfdt availability is added, and not considered as a fix.

Fixes: 91a861e54164 ("config: disable Linux kernel modules by default")
Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver")
Fixes: 1be7855d7739 ("eal: add wait until equal API")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoconfig: deduplicate options
Thomas Monjalon [Tue, 11 Feb 2020 23:57:23 +0000 (00:57 +0100)]
config: deduplicate options

Some config options are overwritten with the same value
as the one inherited from its template parent.
Such duplicates which have no meaningful comments are removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agovdpa/mlx5: fix ABI version
Matan Azrad [Tue, 11 Feb 2020 19:48:47 +0000 (19:48 +0000)]
vdpa/mlx5: fix ABI version

Changed the ABI version to 20.0.1.

Fixes: 95276abaaf0a ("vdpa/mlx5: introduce Mellanox vDPA driver")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agocommon/mlx5: fix ABI version
Matan Azrad [Tue, 11 Feb 2020 19:48:46 +0000 (19:48 +0000)]
common/mlx5: fix ABI version

Changed the ABI version to 20.0.1.

Fixes: 7b4f1e6bd367 ("common/mlx5: introduce common library")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agobuild: remove redundant config include
Thomas Monjalon [Mon, 10 Feb 2020 09:53:34 +0000 (10:53 +0100)]
build: remove redundant config include

The header file rte_config.h is always included by make or meson.
If required in an exported API header file, it must be included
in the public header file for external applications.
In the internal files, explicit include of rte_config.h is useless,
and can be removed.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>