dpdk.git
4 years agotest/ipsec: fix a typo in function name
Thomas Monjalon [Wed, 19 Feb 2020 11:26:50 +0000 (12:26 +0100)]
test/ipsec: fix a typo in function name

The name of the static function check_cryptodev_capablity()
is fixed for the word "capability".
There is no functional change.

The same typo is fixed in a comment in ip_fragmentation example.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agoapp/crypto-perf: use common macros for min/max
Thomas Monjalon [Wed, 19 Feb 2020 10:38:48 +0000 (11:38 +0100)]
app/crypto-perf: use common macros for min/max

The macros RTE_MIN and RTE_MAX can be used in DPDK applications.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoci: enable more drivers in Travis builds
Thomas Monjalon [Tue, 18 Feb 2020 21:20:05 +0000 (22:20 +0100)]
ci: enable more drivers in Travis builds

The Travis compilation is missing some dependencies to build all PMDs.
More PMDs are enabled in Travis which runs Ubuntu Bionic Beaver (18.04):
- ipn3ke (libfdt)
- mlx (libibverbs)
The next Ubuntu LTS, Focal Fossa (20.04) will allow to support more:
- af_xdp (libbpf)
- Intel crypto (libipsec-mb 0.53)

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoci: remove redundant configs disabling kmods
Thomas Monjalon [Tue, 18 Feb 2020 21:20:04 +0000 (22:20 +0100)]
ci: remove redundant configs disabling kmods

The kernel modules are not built by default since below commit.
The Travis CI matrix can be simplified
by removing the redundant option enable_kmods=false,
and by removing some jobs which are redundant.

Note: there is no benefit in checking kmods in Travis Ubuntu.
Anyway different kernel versions and distributions are needed,
and the Technical Board is looking at moving the Linux kmods
out of this repository.

Fixes: 91a861e54164 ("config: disable Linux kernel modules by default")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoci: build and use libabigail 1.6
David Marchand [Tue, 18 Feb 2020 20:13:54 +0000 (21:13 +0100)]
ci: build and use libabigail 1.6

libabigail 1.2 (at least) reports changes in 'const' property as an ABI
breakage [1].
This was fixed upstream in libabigail 1.4 [2], and a bug has been opened
in launchpad [3].

But for now, build and use the last version 1.6 so that the ABI checks
can be kept.

1: https://travis-ci.com/DPDK/dpdk/jobs/287872118#L2242
2: https://sourceware.org/git/gitweb.cgi?p=libabigail.git;a=commitdiff;h=215b7eb4fe8b
3: https://bugs.launchpad.net/ubuntu/+source/libabigail/+bug/1863607

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Aaron Conole <aconole@redhat.com>
4 years agomempool/octeontx2: fix build
Tao Zhu [Mon, 17 Feb 2020 16:43:45 +0000 (16:43 +0000)]
mempool/octeontx2: fix build

Change the definition of C99 style to C90 style.
compile log as below:

otx2_mempool_ops.c: In function ‘otx2_npa_populate’:
drivers/mempool/octeontx2/otx2_mempool_ops.c:790:2: error:
‘for’ loop initial declarations are only allowed in C99 mode
  for (int i = 0; i < OTX2_L1D_NB_SETS; i++)
  ^
drivers/mempool/octeontx2/otx2_mempool_ops.c:790:2:
note: use option -std=c99 or -std=gnu99 to compile your code

Fixes: 9ed8e95c ("mempool/octeontx2: optimize for L1D cache architecture")

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
4 years agoversion: 20.02-rc3
Thomas Monjalon [Sun, 16 Feb 2020 21:28:51 +0000 (22:28 +0100)]
version: 20.02-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agousertools: fix telemetry client with python 3
Ciara Power [Tue, 21 Jan 2020 17:03:10 +0000 (17:03 +0000)]
usertools: fix telemetry client with python 3

The client script for use with the telemetry library did not support
Python3, as the data being sent over the socket was in string format.
Python3 requires the data be explicitly converted to bytes before being
sent. Similarly, the received bytes need to be decoded into string
format.

Fixes: 53f293c9a783 ("usertools: replace unsafe input function")
Fixes: fe35622659ed ("usertools: fix telemetry client with python 3")
Fixes: d1b94da4a4e0 ("usertools: add client script for telemetry")
Fixes: 4080e46c8078 ("telemetry: support global metrics")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
4 years agousertools: fix syntax warning in python 3.8
Thomas Faivre [Wed, 12 Feb 2020 12:31:56 +0000 (13:31 +0100)]
usertools: fix syntax warning in python 3.8

Silent the following warning when running script with python 3.8:

> /usr/bin/dpdk-pmdinfo:542: SyntaxWarning: "is" with a literal.
> Did you mean "=="?
>   if (autoload_path is None or autoload_path is ""):

As autoload_path can only be None or a string, directly check its bool
value.

Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information")
Cc: stable@dpdk.org
Signed-off-by: Thomas Faivre <thomas.faivre@6wind.com>
4 years agomempool/octeontx2: optimize for L1D cache architecture
Pavan Nikhilesh [Fri, 31 Jan 2020 17:23:36 +0000 (22:53 +0530)]
mempool/octeontx2: optimize for L1D cache architecture

OCTEON TX2 has 8 sets, 41 ways L1D cache, VA<9:7> bits dictate
the set selection.
Add additional padding to ensure that the element size always
occupies odd number of cachelines to ensure even distribution
of elements among L1D cache sets.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: improve destination lookup readability
Stephen Hemminger [Sun, 26 Jan 2020 01:09:11 +0000 (17:09 -0800)]
examples/l3fwd: improve destination lookup readability

The functions to lookup IPv4 and IPv6 were both using opaque
pointers (void *) when they should use a typed pointer instead.
The IP headers are not modified during lookup.

Get rid of unnecessary cast on the return from the function.
Replace complex trigraph expression with simple if to improve
readability.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoexamples/l3fwd: make route array constant
Stephen Hemminger [Sun, 26 Jan 2020 01:09:10 +0000 (17:09 -0800)]
examples/l3fwd: make route array constant

The initial route setup array is unmodified by the lpm code
and can be made constant. This depends on earlier patch to
fix the rte_lpm6 to use const.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoexamples/l3fwd: make lookup struct static
Stephen Hemminger [Sun, 26 Jan 2020 01:09:09 +0000 (17:09 -0800)]
examples/l3fwd: make lookup struct static

The lookup structure is only used in the lpm code and does
not have to be global.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agolpm6: make IPv6 address immutable
Stephen Hemminger [Sun, 26 Jan 2020 01:09:07 +0000 (17:09 -0800)]
lpm6: make IPv6 address immutable

Both the table setup and lookup do no modify their arguments.
Therefore the parameter should be constant.

This is not actually an API breakage since programs can be
recompiled without change. This is not an ABI breakage because
old programs will still run.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agoapp/test-fib: add test application for FIB
Vladimir Medvedkin [Wed, 11 Dec 2019 18:45:04 +0000 (18:45 +0000)]
app/test-fib: add test application for FIB

Introduce new application to provide user to evaluate and perform
custom functional and performance tests for FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agotest: fix build without ring PMD
Reshma Pattan [Mon, 23 Dec 2019 06:53:05 +0000 (06:53 +0000)]
test: fix build without ring PMD

Some unit tests has dependency on RING PMD,
so this patch is trying to fix those and other
closely related issues.

1)pdump, latency, bitrate, ring PMD and test_event_eth_tx_adapter
unit tests are dependent on ring PMD, so compile those
tests only when ring PMD is enabled else ignore.

2)get rid of make file error which was added by bond unit test
for ring PMD disabled case which is not necessary.

3)Tx adapter UT is dependent on RING PMD, but it was
observed that it was missing from the run in meson
build, so added it. TX adapter UT uses 'sw event and
'null' pmd drivers, so for shared builds the drivers .so
path has to be passed to the test args of meson UT run.

Fixes: 086eb64db3 ("test/pdump: add unit test for pdump library")
Fixes: fdeb30fa71 ("test/bitrate: add unit tests for bitrate library")
Fixes: 1e3676a06e ("test/latency: add unit tests for latencystats library")
Fixes: 46cf97e4bb ("eventdev: add test for eth Tx adapter")
Fixes: d23e09e0ef ("app/test: link with ring pmd when needed")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Nikhil Rao <nikhil.rao@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agomaintainers: set QoS git tree for some ethdev files
Thomas Monjalon [Wed, 22 Jan 2020 22:03:22 +0000 (23:03 +0100)]
maintainers: set QoS git tree for some ethdev files

The tree dpdk-next-tm does not exist anymore.
Traffic management and metering APIs, which are part of ethdev,
can be merged in the existing tree dpdk-next-qos.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agodoc: add a guide to run unit tests with meson
Hari Kumar Vemula [Mon, 12 Aug 2019 12:40:25 +0000 (13:40 +0100)]
doc: add a guide to run unit tests with meson

Add a programmer's guide section for meson ut

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Michael Santana <msantana@redhat.com>
4 years agodoc: update building and running FreeBSD apps
Bruce Richardson [Fri, 3 Jan 2020 15:32:56 +0000 (15:32 +0000)]
doc: update building and running FreeBSD apps

Update the documentation on building and running apps on FreeBSD, taking
account of having used meson for building. We can also update the section
on the command-line parameters, rather than claiming to be a complete list
of parameters, it should describe how to get the complete list and only
cover a few important ones.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodoc: update loading FreeBSD kernel modules
Bruce Richardson [Fri, 3 Jan 2020 15:32:55 +0000 (15:32 +0000)]
doc: update loading FreeBSD kernel modules

The kernel modules are now installed in the correct system location on
install when using meson and ninja, so update the documentation to remove
any references to the "kmod" directory. Also, make a few additional updates
to improve clarity.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: add meson install instructions for FreeBSD
Bruce Richardson [Fri, 3 Jan 2020 15:32:54 +0000 (15:32 +0000)]
doc: add meson install instructions for FreeBSD

Update the FreeBSD GSG doc with instructions for installing
using meson and ninja rather than make.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodoc: add installing from FreeBSD package
Bruce Richardson [Fri, 3 Jan 2020 15:32:53 +0000 (15:32 +0000)]
doc: add installing from FreeBSD package

Update the FreeBSD GSG to cover installing from the pre-built package as
well as installing from a port.

Also, since the port is now based on meson, update the instructions for
compiling and running the example applications.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: update introduction to FreeBSD guide
Bruce Richardson [Fri, 3 Jan 2020 15:32:52 +0000 (15:32 +0000)]
doc: update introduction to FreeBSD guide

Update the introduction section note, to add in the fact that DPDK is now
packaged in FreeBSD, i.e. available as a pre-built binary package, as well
as being in the ports collection for manual building.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: add dependency on header files for API doxygen
Bruce Richardson [Fri, 17 Jan 2020 11:22:36 +0000 (11:22 +0000)]
doc: add dependency on header files for API doxygen

Generate a dependency file for the header files used in the API guide
so that the docs can be rebuilt if a header changes.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agodoc: add dependency on examples for API doxygen
Bruce Richardson [Fri, 17 Jan 2020 11:22:35 +0000 (11:22 +0000)]
doc: add dependency on examples for API doxygen

For the doxygen API for the examples folder, we can generate a build
dependency file when we generate the examples.dox file. This allows
correct rebuilds if the files in examples change.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
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>