dpdk.git
6 years agobus/vdev: fix finding device by name
Nachiketa Prachanda [Mon, 12 Mar 2018 16:54:00 +0000 (09:54 -0700)]
bus/vdev: fix finding device by name

Use strcmp to compare device names as the strncmp in original code
causes find_vdev to return -EEXIST  for names that are prefix
of another. The creation of interfaces fails unpredictably based
on the order of their creation. An easy way hit this bug is to create
eth_vhost1 after eth_vhost11.

Fixes: dda987315ca2 ("vdev: make virtual bus use its device struct")
Cc: stable@dpdk.org
Signed-off-by: Nachiketa Prachanda <nprachan@vyatta.att-mail.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agokni: fix build on RHEL 7.5
Lee Roberts [Thu, 1 Mar 2018 23:20:35 +0000 (16:20 -0700)]
kni: fix build on RHEL 7.5

Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agometer: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:27 +0000 (11:26 +0000)]
meter: fix library version in meson build

Fixes: c06ddf9698e0 ("meter: add configuration profile")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agotable: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:25 +0000 (11:26 +0000)]
table: fix library version in meson build

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agopdump: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:24 +0000 (11:26 +0000)]
pdump: fix library version in meson build

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agomempool: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:23 +0000 (11:26 +0000)]
mempool: fix library version in meson build

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeventdev: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:22 +0000 (11:26 +0000)]
eventdev: fix library version in meson build

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agocryptodev: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:21 +0000 (11:26 +0000)]
cryptodev: fix library version in meson build

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobitratestats: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:20 +0000 (11:26 +0000)]
bitratestats: fix library version in meson build

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/null: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:18 +0000 (11:26 +0000)]
net/null: fix library version in meson build

Fixes: efd5d1a8d8dd ("drivers/net: build some vdev PMDs with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/ring: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:19 +0000 (11:26 +0000)]
net/ring: fix library version in meson build

Fixes: efd5d1a8d8dd ("drivers/net: build some vdev PMDs with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/i40e: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:16 +0000 (11:26 +0000)]
net/i40e: fix library version in meson build

Fixes: e940646b20fa ("drivers/net: build Intel NIC PMDs with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/ixgbe: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:17 +0000 (11:26 +0000)]
net/ixgbe: fix library version in meson build

Fixes: e940646b20fa ("drivers/net: build Intel NIC PMDs with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/bonding: fix library version in meson build
Andrew Rybchenko [Tue, 20 Mar 2018 11:26:15 +0000 (11:26 +0000)]
net/bonding: fix library version in meson build

Fixes: a0ace286a60b ("net/bonding: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agopci: remove duplicated symbol from map file
Ferruh Yigit [Thu, 15 Mar 2018 16:48:54 +0000 (16:48 +0000)]
pci: remove duplicated symbol from map file

Remove duplicated symbol rte_pci_device_name from .map file.

Also sort the map file to be able to detect any possible duplication
easier in the future.

Fixes: 0e3ef055bee5 ("pci: fix namespace prefix of new functions")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agomove kernel modules directories
Hemant Agrawal [Thu, 22 Feb 2018 06:09:05 +0000 (11:39 +0530)]
move kernel modules directories

This patch moves the kernel modules code from EAL to a common place.
 - Separate the kernel module code from user space code.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodoc: adapt features tables header height
Thomas Monjalon [Tue, 20 Feb 2018 17:11:12 +0000 (18:11 +0100)]
doc: adapt features tables header height

The length of the longest header name is used to adjust the padding
of the header row automatically, instead of fixed length.
The previous length (10) was too short for vdev_netvsc.

Fixes: 6086ab3bb3d2 ("net/vdev_netvsc: introduce Hyper-V platform driver")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: reduce features tables column width
Thomas Monjalon [Tue, 20 Feb 2018 17:00:34 +0000 (18:00 +0100)]
doc: reduce features tables column width

The font size of the header row is reduced in order to shrink
the column size of the tables.
It is required for the NICs features table which is too large to fit
in the page width.

Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agomaintainers: resign from GSO lib
Mark Kavanagh [Tue, 27 Feb 2018 11:01:24 +0000 (11:01 +0000)]
maintainers: resign from GSO lib

I will not be directly working on the DPDK project anymore.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
6 years agomaintainers: resign from vhost/virtio
Yuanhan Liu [Mon, 12 Feb 2018 08:51:58 +0000 (16:51 +0800)]
maintainers: resign from vhost/virtio

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agomaintainers: update for vhost lib and PMD
Jianfeng Tan [Sun, 11 Feb 2018 01:04:51 +0000 (01:04 +0000)]
maintainers: update for vhost lib and PMD

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agodrivers: rename bbdev directory to baseband
Thomas Monjalon [Fri, 9 Mar 2018 20:56:06 +0000 (21:56 +0100)]
drivers: rename bbdev directory to baseband

The drivers directory contains some sub-directories
for each kind of device (or bus, mem):
net, crypto, event, raw
They are not suffixed with "dev" because it is obvious.

For consistency, the sub-directory drivers/bbdev/
is renamed to drivers/baseband/.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agovfio: fix headers for C++ support
Anatoly Burakov [Thu, 22 Feb 2018 17:13:59 +0000 (17:13 +0000)]
vfio: fix headers for C++ support

Fixes: 279b581c897d ("vfio: expose functions")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoeal: ignore IPC messages until init is complete
Anatoly Burakov [Tue, 13 Mar 2018 17:42:40 +0000 (17:42 +0000)]
eal: ignore IPC messages until init is complete

If we receive messages that don't have a callback registered for
them, and we haven't finished initialization yet, it can be reasonably
inferred that we shouldn't have gotten the message in the first
place. Therefore, send requester a special message telling them to
ignore response to this request, as if this process wasn't there.

Since it is not possible for primary process to receive any messages
during initialization, this change in practice only applies to
secondary processes.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: simplify IPC sync request timeout
Anatoly Burakov [Tue, 13 Mar 2018 17:42:39 +0000 (17:42 +0000)]
eal: simplify IPC sync request timeout

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: lock IPC directory on init and send
Anatoly Burakov [Tue, 13 Mar 2018 17:42:38 +0000 (17:42 +0000)]
eal: lock IPC directory on init and send

When sending IPC messages, prevent new sockets from initializing.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: do not hardcode socket filter value in IPC
Anatoly Burakov [Tue, 13 Mar 2018 17:42:37 +0000 (17:42 +0000)]
eal: do not hardcode socket filter value in IPC

Currently, filter value is hardcoded and disconnected from actual
value returned by eal_mp_socket_path(). Fix this to generate filter
value by deriving it from eal_mp_socket_path() instead.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: abstract away IPC socket path generation
Anatoly Burakov [Tue, 13 Mar 2018 17:42:36 +0000 (17:42 +0000)]
eal: abstract away IPC socket path generation

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: add internal flag of init completed
Anatoly Burakov [Tue, 13 Mar 2018 17:42:35 +0000 (17:42 +0000)]
eal: add internal flag of init completed

Currently, primary process initialization is finalized by setting
the RTE_MAGIC value in the shared config. However, it is not
possible to check whether secondary process initialization has
completed. Add such a value to internal config.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal: fix race condition in IPC request
Anatoly Burakov [Fri, 2 Mar 2018 08:41:37 +0000 (08:41 +0000)]
eal: fix race condition in IPC request

Unlocking the action list before sending message and locking it
again afterwards introduces a window where a response might
arrive before we have a chance to start waiting on a condition,
resulting in timeouts on valid messages.

Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: fix errno handling in IPC
Anatoly Burakov [Fri, 2 Mar 2018 08:41:36 +0000 (08:41 +0000)]
eal: fix errno handling in IPC

Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: fix IPC request socket path
Anatoly Burakov [Fri, 2 Mar 2018 08:41:35 +0000 (08:41 +0000)]
eal: fix IPC request socket path

Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: fix IPC socket path
Anatoly Burakov [Fri, 2 Mar 2018 08:41:34 +0000 (08:41 +0000)]
eal: fix IPC socket path

Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoeal: fix IPC timeout
Anatoly Burakov [Fri, 2 Mar 2018 08:41:33 +0000 (08:41 +0000)]
eal: fix IPC timeout

Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agobuild: add meson cross-compilation config for dpaaX
Hemant Agrawal [Wed, 14 Mar 2018 07:56:06 +0000 (13:26 +0530)]
build: add meson cross-compilation config for dpaaX

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobuild: add meson support for dpaaX platforms
Hemant Agrawal [Wed, 14 Mar 2018 07:56:05 +0000 (13:26 +0530)]
build: add meson support for dpaaX platforms

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoconfig: add dpaaX build for all Linux platforms
Hemant Agrawal [Wed, 14 Mar 2018 07:56:04 +0000 (13:26 +0530)]
config: add dpaaX build for all Linux platforms

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/fslmc: enable compilation for other platforms
Hemant Agrawal [Wed, 14 Mar 2018 07:56:03 +0000 (13:26 +0530)]
bus/fslmc: enable compilation for other platforms

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: enable compilation for other platforms
Hemant Agrawal [Wed, 14 Mar 2018 07:56:02 +0000 (13:26 +0530)]
bus/dpaa: enable compilation for other platforms

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/fslmc: add 32-bit functional support for ARM
Hemant Agrawal [Wed, 14 Mar 2018 07:56:01 +0000 (13:26 +0530)]
bus/fslmc: add 32-bit functional support for ARM

This patch adds the functional logic to make the dpaa2 drivers
work on 32bit machine.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agodpaa2: prepare for 32-bit build
Hemant Agrawal [Wed, 14 Mar 2018 07:56:00 +0000 (13:26 +0530)]
dpaa2: prepare for 32-bit build

This patch prepare the dpaa2 drivers for compilation on 32 bit machine.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agodpaa: prepare for 32-bit build
Hemant Agrawal [Wed, 14 Mar 2018 07:55:59 +0000 (13:25 +0530)]
dpaa: prepare for 32-bit build

This patch prepares the dpaa drivers for compilation on 32 bit machine.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: fix big endian build
Hemant Agrawal [Wed, 14 Mar 2018 07:55:58 +0000 (13:25 +0530)]
bus/dpaa: fix big endian build

The array pointers were used without index.

Fixes: b9083ea5e084 ("net/dpaa: further push mode optimizations")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agoevent/dpaa: fix header include
Hemant Agrawal [Wed, 14 Mar 2018 07:55:57 +0000 (13:25 +0530)]
event/dpaa: fix header include

rte_cycles.h shall be included instead of rte_cycles_64.h

dpaa_eventdev.c:32:27:
fatal error: rte_cycles_64.h: No such file or directory

Fixes: 9caac5dd1e7f ("event/dpaa: introduce PMD")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/pcap: simplify dependency checking using meson
Bruce Richardson [Thu, 22 Feb 2018 17:20:33 +0000 (17:20 +0000)]
net/pcap: simplify dependency checking using meson

Rather than trying to use meson's build-in detection for libpcap, and
having to special-case cross-building, just check for the presence of
pcap.h and the pcap library.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/virtio: add to meson build
Bruce Richardson [Fri, 16 Feb 2018 17:21:19 +0000 (17:21 +0000)]
net/virtio: add to meson build

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agoapp: add all remaining apps to meson build
Bruce Richardson [Fri, 16 Feb 2018 16:53:36 +0000 (16:53 +0000)]
app: add all remaining apps to meson build

Add remaining subdirectories in the app folder to the meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agoapp/procinfo: rename folder to remove underscore
Bruce Richardson [Fri, 16 Feb 2018 16:53:35 +0000 (16:53 +0000)]
app/procinfo: rename folder to remove underscore

All other apps in the app folder use "-" rather than "_" to separate words
in the app name, so rename proc_info to be consistent.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agoapp: generalize meson build
Bruce Richardson [Fri, 16 Feb 2018 16:53:34 +0000 (16:53 +0000)]
app: generalize meson build

Since most apps are built in largely the same way, generalize the logic
into a foreach loop in app/meson.build file.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agomk: fix dependencies of dpaaX drivers
Hemant Agrawal [Fri, 23 Feb 2018 09:58:03 +0000 (15:28 +0530)]
mk: fix dependencies of dpaaX drivers

This  patch fixes the build dependency of various
dpaaX components, when the dpaa or fslmc bus is disabled,
or VFIO is disabled.

Fixes: 1ee9569576f6 ("config: enable dpaaX drivers for generic ARMv8")
Cc: stable@dpdk.org
Reported-by: Yongseok Koh <yskoh@mellanox.com>
Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoapp/testpmd: fix DPAA shared library dependency
Hemant Agrawal [Fri, 23 Feb 2018 09:58:02 +0000 (15:28 +0530)]
app/testpmd: fix DPAA shared library dependency

The dynamic link is broken for ARM platform because the dependencies
of the DPAA PMD are not declared.

Fixes: 83c82e15e1c0 ("app/testpmd: support loopback config for DPAA")
Cc: stable@dpdk.org
Reported-by: Marco Varlese <mvarlese@suse.de>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoeal/ppc: remove braces in SMP memory barrier macro
Gowrishankar Muthukrishnan [Tue, 27 Feb 2018 15:13:58 +0000 (20:43 +0530)]
eal/ppc: remove braces in SMP memory barrier macro

This patch fixes the compilation problem with rte_smp_mb,
when there is else clause following it, as in test_barrier.c.

Fixes: 05c3fd7110 ("eal/ppc: atomic operations for IBM Power")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
6 years agoexamples: fix build with meson
Bruce Richardson [Mon, 12 Mar 2018 15:25:21 +0000 (15:25 +0000)]
examples: fix build with meson

The ip_pipeline and qos_meter example apps now use experimental APIs so
this fact needs to be flagged in their meson.build files.

Fixes: c06ddf9698e0 ("meter: add configuration profile")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agometer: add configuration profile
Cristian Dumitrescu [Mon, 8 Jan 2018 15:43:56 +0000 (15:43 +0000)]
meter: add configuration profile

This patch adds support for meter configuration profiles.
Benefits: simplified configuration procedure, improved performance.

Q1: What is the configuration profile and why does it make sense?
A1: The configuration profile represents the set of configuration
    parameters for a given meter object, such as the rates and sizes for
    the token buckets. The configuration profile concept makes sense when
    many meter objects share the same configuration, which is the typical
    usage model: thousands of traffic flows are each individually metered
    according to just a few service levels (i.e. profiles).

Q2: How is the configuration profile improving the performance?
A2: The performance improvement is achieved by reducing the memory
    footprint of a meter object, which results in better cache utilization
    for the typical case when large arrays of meter objects are used. The
    internal data structures stored for each meter object contain:
       a) Constant fields: Low level translation of the configuration
          parameters that does not change post-configuration. This is
          really duplicated for all meters that use the same
          configuration. This is the configuration profile data that is
          moved away from the meter object. Current size (implementation
          dependent): srTCM = 32 bytes, trTCM = 32 bytes.
       b) Variable fields: Time stamps and running counters that change
          during the on-going traffic metering process. Current size
          (implementation dependent): srTCM = 24 bytes, trTCM = 32 bytes.
          Therefore, by moving the constant fields to a separate profile
          data structure shared by all the meters with the same
          configuration, the size of the meter object is reduced by ~50%.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoversion: 18.05-rc0
Thomas Monjalon [Mon, 19 Feb 2018 20:54:26 +0000 (21:54 +0100)]
version: 18.05-rc0

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: add template release notes for 18.05
John McNamara [Thu, 15 Feb 2018 13:04:08 +0000 (13:04 +0000)]
doc: add template release notes for 18.05

Add template release notes for DPDK 18.05 with inline
comments and explanations of the various sections.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
6 years agoversion: 18.02.0
Thomas Monjalon [Wed, 14 Feb 2018 18:11:02 +0000 (19:11 +0100)]
version: 18.02.0

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: update release notes for 18.02
John McNamara [Wed, 14 Feb 2018 13:50:43 +0000 (13:50 +0000)]
doc: update release notes for 18.02

Fix grammar, spelling and formatting of DPDK 18.02 release notes.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: add virtio guest announce support to release notes
Xiao Wang [Fri, 9 Feb 2018 14:27:50 +0000 (22:27 +0800)]
doc: add virtio guest announce support to release notes

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: add tested platforms with Mellanox NICs
Raslan Darawsheh [Wed, 14 Feb 2018 14:30:14 +0000 (16:30 +0200)]
doc: add tested platforms with Mellanox NICs

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
6 years agodoc: fix outdated link to IPsec white paper
Pablo de Lara [Wed, 14 Feb 2018 17:14:06 +0000 (17:14 +0000)]
doc: fix outdated link to IPsec white paper

Fixes: 924e84f87306 ("aesni_mb: add driver for multi buffer based crypto")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agodoc: remove reference to old distro in Linux guide
Harry van Haaren [Wed, 14 Feb 2018 16:16:00 +0000 (16:16 +0000)]
doc: remove reference to old distro in Linux guide

Remove reference to Fedora 18 which is EOL-ed, reword
surrounding sentences to read correctly.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: announce ethdev API fix for port id size
Ferruh Yigit [Fri, 9 Feb 2018 09:53:58 +0000 (09:53 +0000)]
doc: announce ethdev API fix for port id size

Fix rte_eth_dev_get_sec_ctx() parameter port_id storage size,
from uint8_t to uint16_t.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agodoc: announce ethdev ABI change for filter structs
Kirill Rybalchenko [Fri, 12 Jan 2018 10:29:46 +0000 (10:29 +0000)]
doc: announce ethdev ABI change for filter structs

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: announce ethdev API changes for callbacks
Ferruh Yigit [Fri, 9 Feb 2018 10:18:18 +0000 (10:18 +0000)]
doc: announce ethdev API changes for callbacks

Ethdev APIs to add callback return the callback object as "void *",
update return type to actual object type
"struct rte_eth_rxtx_callback *"

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agodoc: announce ethdev API change for default MAC
Olivier Matz [Mon, 29 Jan 2018 17:13:39 +0000 (18:13 +0100)]
doc: announce ethdev API change for default MAC

Announce internal PMD API change in the function to set the default MAC
address. The objective is to be able to notify errors occurring in the
PMD.

Link: https://dpdk.org/dev/patchwork/patch/32284/
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: announce ethdev API change for VF representors
Shahaf Shuler [Wed, 14 Feb 2018 12:32:44 +0000 (14:32 +0200)]
doc: announce ethdev API change for VF representors

This is following the RFC being discussed and targets 18.05

http://dpdk.org/ml/archives/dev/2018-January/085716.html

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Remy Horton <remy.horton@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@intl.att.com>
Acked-by: Alex Zelezniak <alexz@att.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agodoc: announce ethdev API change for preferred burst size
Shreyansh Jain [Mon, 5 Feb 2018 06:22:22 +0000 (11:52 +0530)]
doc: announce ethdev API change for preferred burst size

rte_eth_rx_burst(..,nb_pkts) function has semantic that if return value
is smaller than requested, application can consider it end of packet
stream. Some hardware can only support smaller burst sizes which need
to be advertised. Similar is the case for Tx burst.

This patch adds deprecation notice for rte_eth_dev_info structure as
new members, for preferred Rx and Tx burst and ring size would be
added - impacting the size of the structure.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: announce ethdev API change for RSS configuration
Xueming Li [Tue, 6 Feb 2018 07:38:48 +0000 (15:38 +0800)]
doc: announce ethdev API change for RSS configuration

Update deprecation notice for the new rss_level field of
rte_eth_rss_conf.

Link: http://www.dpdk.org/dev/patchwork/patch/31891
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agodoc: announce mbuf sched field change
Cristian Dumitrescu [Fri, 9 Feb 2018 16:45:16 +0000 (16:45 +0000)]
doc: announce mbuf sched field change

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agodoc: announce control mbuf removal
Olivier Matz [Mon, 29 Jan 2018 09:30:27 +0000 (10:30 +0100)]
doc: announce control mbuf removal

Link: http://dpdk.org/ml/archives/dev/2017-July/069813.html
Link: http://dpdk.org/dev/patchwork/patch/32041/
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: announce mempool API changes
Andrew Rybchenko [Tue, 23 Jan 2018 13:23:04 +0000 (13:23 +0000)]
doc: announce mempool API changes

An API/ABI changes are planned for 18.05 [1]:

 * Allow to customize how mempool objects are stored in memory.
 * Deprecate mempool XMEM API.
 * Add mempool driver ops to get information from mempool driver and
   dequeue contiguous blocks of objects if driver supports it.

[1] http://dpdk.org/ml/archives/dev/2018-January/088698.html

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agodoc: announce EAL function removal for default mempool
Hemant Agrawal [Fri, 2 Feb 2018 08:31:42 +0000 (14:01 +0530)]
doc: announce EAL function removal for default mempool

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agodoc: announce memory hotplug changes
Anatoly Burakov [Thu, 18 Jan 2018 10:32:28 +0000 (10:32 +0000)]
doc: announce memory hotplug changes

Due to coming changes outlined in memory hotplug RFC, there will
be several API/ABI changes.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jonas Pfefferle <pepperjo@japf.ch>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agodoc: announce EAL ABI change for NUMA node count
Anatoly Burakov [Tue, 16 Jan 2018 17:53:40 +0000 (17:53 +0000)]
doc: announce EAL ABI change for NUMA node count

There will be a new function added in v18.05 that will return
number of detected sockets, which will change the ABI.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jonas Pfefferle <pepperjo@japf.ch>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: announce EAL API change to lcore role function
Erik Gabriel Carrillo [Fri, 12 Jan 2018 20:45:35 +0000 (14:45 -0600)]
doc: announce EAL API change to lcore role function

This an API/ABI change notice for DPDK 18.05 announcing a change in
the meaning of the return values of the rte_lcore_has_role() function.

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: update deprecation notice for devargs
Gaetan Rivet [Wed, 7 Feb 2018 09:26:10 +0000 (10:26 +0100)]
doc: update deprecation notice for devargs

The declaration and identification of devices will change in v18.05.

Remove the precedent deprecation notice.

Add new one reflecting the planned changes more accurately,
updated for v18.05.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agonet/failsafe: fix Rx interrupt reinstallation
Matan Azrad [Wed, 14 Feb 2018 14:47:26 +0000 (14:47 +0000)]
net/failsafe: fix Rx interrupt reinstallation

Fail-safe dev_start() operation can be called by both the application
and the hot-plug alarm mechanism.

The installation of Rx interrupt are triggered from dev_start() in any
time it is called while actually the Rx interrupt should be installed
only by the application calls.

So, each plug-in event causes reinstallation which causes memory leak
and spoils the fail-safe Rx interrupt mechanism.

Trigger the Rx interrupt installation only when it does not exist.

Fixes: 9e0360aebf23 ("net/failsafe: register as Rx interrupt mode")

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agonet/tap: fix promiscuous rules double insertions
Ophir Munk [Wed, 14 Feb 2018 11:32:19 +0000 (11:32 +0000)]
net/tap: fix promiscuous rules double insertions

Running testpmd command "port stop all" followed by command "port start
all" may result in a TAP error:
PMD: Kernel refused TC filter rule creation (17): File exists

Root cause analysis: during the execution of "port start all" command
testpmd calls rte_eth_promiscuous_enable() while during the execution
of "port stop all" command testpmd does not call
rte_eth_promiscuous_disable().
As a result the TAP PMD is trying to add tc (traffic control command)
promiscuous rules to the remote netvsc device consecutively. From the
kernel point of view it is seen as an attempt to add the same rule more
than once. In recent kernels (e.g. version 4.13) this attempt is rejected
with a "File exists" error. In less recent kernels (e.g. version 4.4) the
same rule may have been successfully accepted twice, which is undesirable.

In the corrupted code every tc promiscuous rule included a different
handle number parameter. If instead an identical handle number is
used for all tc promiscuous rules - all kernels will reject the second
identical rule with a "File exists" error, which is easy to identify and
to silently ignore.

Fixes: 2bc06869cd94 ("net/tap: add remote netdevice traffic capture")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
6 years agomaintainers: update for stable branches
Luca Boccassi [Tue, 13 Feb 2018 23:31:07 +0000 (23:31 +0000)]
maintainers: update for stable branches

I am maintaining 16.11 until November 2018

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agodoc: add maintainers section to the contributors guide
Ciara Power [Tue, 13 Feb 2018 09:08:32 +0000 (09:08 +0000)]
doc: add maintainers section to the contributors guide

Add a maintainers section to the contributors guide to have a low tech
location to check/link to the current maintainers. This file is included
dynamically from the MAINTAINERS file in the root directory of the DPDK
source when the docs are built. This also allows us to link to the file
from other sections of the docs.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: improve HTML spacing in release notes
Thomas Monjalon [Mon, 12 Feb 2018 17:13:44 +0000 (18:13 +0100)]
doc: improve HTML spacing in release notes

Vertical spacing is lower before an item title than after.
So the items with paragraphs are not well separated.

A custom CSS is added to override the rtd theme.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: add vhost live migration features to release notes
Jiayu Hu [Fri, 9 Feb 2018 07:47:24 +0000 (15:47 +0800)]
doc: add vhost live migration features to release notes

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: add VxLAN GRO to release notes
Jiayu Hu [Fri, 9 Feb 2018 05:28:37 +0000 (13:28 +0800)]
doc: add VxLAN GRO to release notes

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: add note for shared library in NICs guide
Vipin Varghese [Thu, 8 Feb 2018 18:19:59 +0000 (23:49 +0530)]
doc: add note for shared library in NICs guide

Add note information to intimate about use of option '-d' for shared
library in DPDK application.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agoexamples/cmdline: convert to SPDX license tag
Lee Daly [Tue, 23 Jan 2018 16:43:52 +0000 (16:43 +0000)]
examples/cmdline: convert to SPDX license tag

This updates the license on files in examples to be the standard
BSD-3-Clause license used for the rest of DPDK,
bringing the files in compliance with the DPDK licensing policy.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoexamples/ip_pipeline: convert dual-license to SDPX
Lee Daly [Wed, 7 Feb 2018 16:43:59 +0000 (16:43 +0000)]
examples/ip_pipeline: convert dual-license to SDPX

This updates the Intel and Oliver Matz licenses on a file in examples
to be the standard BSD-3-Clause license used for the rest of DPDK,
bringing the files in compliance with the DPDK licensing policy.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoexamples/performance-thread: update lthread license
Lee Daly [Tue, 13 Feb 2018 15:12:00 +0000 (15:12 +0000)]
examples/performance-thread: update lthread license

This updates Hasan Alayli's license to be the standard BSD-3-Clause
license used for the rest of DPDK, bringing the files in compliance
with the DPDK licensing policy.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoexamples/ipsec-secgw: fix printed crypto name
Radu Nicolau [Fri, 9 Feb 2018 10:40:05 +0000 (10:40 +0000)]
examples/ipsec-secgw: fix printed crypto name

When AES-256 was used aes-128 was printed in the console

Fixes: fa9088849e12 ("examples/ipsec-secgw: support AES 256")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
6 years agoexamples/exception_path: align stats on cache line
Dustin Lundquist [Tue, 13 Feb 2018 16:58:56 +0000 (08:58 -0800)]
examples/exception_path: align stats on cache line

Align stats structure to cache line to prevent bouncing per CPU stats
structure between cache lines.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Dustin Lundquist <dustin@null-ptr.net>
Acked-by: Remy Horton <remy.horton@intel.com>
6 years agonet/failsafe: fix FreeBSD build
Thomas Monjalon [Tue, 13 Feb 2018 21:23:35 +0000 (22:23 +0100)]
net/failsafe: fix FreeBSD build

The type pthread_t is not portable because it is freely defined.
On Linux, it is an unsigned long int which can be printed with %l.
On FreeBSD, it is a pointer which can be printed with %p.

That's why there was this error:
drivers/net/failsafe/failsafe_private.h:377:53: error:
format specifies type 'unsigned long' but the argument has
type 'pthread_t' (aka 'struct pthread *')

Fixes: 655fcd68c7d2 ("net/failsafe: fix hotplug races")

Reported-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Matan Azrad <matan@mellanox.com>
6 years agonet/virtio-user: fix interrupts with kernel vhost
Jianfeng Tan [Mon, 12 Feb 2018 03:20:28 +0000 (03:20 +0000)]
net/virtio-user: fix interrupts with kernel vhost

intr_handle->fd was wrongly initialized as 0 (usually as the stdio fd)
when virtio-user is used with vhost-kernel. So the interrupt thread
might wrongly treat stdin events as LSC interrupts.

Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/virtio-user: fix start with kernel vhost
Jianfeng Tan [Mon, 12 Feb 2018 03:20:27 +0000 (03:20 +0000)]
net/virtio-user: fix start with kernel vhost

After reset owner in below patch, we failed to set owner before
sending further vhost messages. It is OK with vhost user implemented
DPDK/VPP/Contrail, but it sees "Operation not permitted" error when
used with vhost kernel.

We fix this by setting owner every time the device is started.

Fixes: 0d6a8752ac9d ("net/virtio-user: fix crash as features change")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/vhost: fix log messages on create/destroy
Jianfeng Tan [Mon, 12 Feb 2018 03:20:26 +0000 (03:20 +0000)]
net/vhost: fix log messages on create/destroy

The original words are not accurate. For example, as destroy_device
callback gets called, it does not necessarily mean that the connection
is closed.

Fixes: ee584e9710b9 ("vhost: add driver on top of the library")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: do not take lock on owner reset
Maxime Coquelin [Mon, 12 Feb 2018 15:46:12 +0000 (16:46 +0100)]
vhost: do not take lock on owner reset

A deadlock happens when handling VHOST_USER_RESET_OWNER request
for the same reason the lock is not taken for
VHOST_USER_GET_VRING_BASE.

It is safe not to take the lock, as the queues are no more used
by the application when the virtqueues and the device are reset.

Fixes: a3688046995f ("vhost: protect active rings from async ring changes")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agonet/virtio: fix resuming port with Rx vector path
Maxime Coquelin [Mon, 12 Feb 2018 15:46:11 +0000 (16:46 +0100)]
net/virtio: fix resuming port with Rx vector path

Since commit efc83a1e7fc3 ("net/virtio: fix queue setup consistency"),
when resuming a virtio port, the rx rings are refilled with new mbufs
until they are full (vq->vq_free_cnt == 0). This is done without
ensuring that the descriptor index remains a multiple of
RTE_VIRTIO_VPMD_RX_REARM_THRESH, which is a prerequisite when using the
vector mode. This can cause an out of bound access in the rx ring.

This commit changes the vector refill method from
virtqueue_enqueue_recv_refill_simple() to virtio_rxq_rearm_vec(), which
properly checks that the refill is done by batch of
RTE_VIRTIO_VPMD_RX_REARM_THRESH.

As virtqueue_enqueue_recv_refill_simple() is no more used, this
patch also removes the function.

Fixes: efc83a1e7fc3 ("net/virtio: fix queue setup consistency")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agonet/virtio: fix mbuf data offset for simple Rx
Olivier Matz [Mon, 12 Feb 2018 15:46:10 +0000 (16:46 +0100)]
net/virtio: fix mbuf data offset for simple Rx

The mbuf->data_off was was not properly set for the first received
mbufs. Fix this by setting it in virtqueue_enqueue_recv_refill_simple(),
which is used to enqueue the first mbuf in the ring.

The function virtio_rxq_rearm_vec(), which is used to rearm the ring
with new mbufs, is valid and does not need to be updated.

Fixes: cab0461234e7 ("virtio: fill Rx avail ring with blank mbufs")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/failsafe: fix reconfiguration
Matan Azrad [Sun, 11 Feb 2018 17:27:34 +0000 (17:27 +0000)]
net/failsafe: fix reconfiguration

Fail-safe PMD manages the states of its sub-devices gradually:
DEV_UNDEFINED, DEV_PARSED, DEV_PROBED, DEV_ACTIVE, DEV_STARTED.

When the sub-device arguments successfully was parsed, the state is
raised from DEV_UNDEFINED to DEV_PARSED.
When the sub-device successfully was probed, the state is raised from
DEV_PARSED to DEV_PROBED.
When the sub-device successfully was configured by
rte_eth_dev_configure(), the state is raised from DEV_PROBED to
DEV_ACTIVE.
When the sub-device successfully was started by rte_eth_dev_start(), the
state is raised from DEV_ACTIVE to DEV_STARTED.

When the sub-device successfully was stopped by rte_eth_dev_stop(), the
state is degraded from DEV_STARTED to DEV_ACTIVE.
When the sub-device successfully was closed by rte_eth_dev_close(), the
state is degraded from DEV_ACTIVE to DEV_PROBED.
When the sub-device successfully was removed by
rte_eal_hotplug_remove(), the state is degraded from DEV_PROBED to
DEV_UNDEFINED.

Fail-safe dev_configure() operation calls to its sub-devices
dev_configure() operation, but only for sub-devices which are in
DEV_PROBED state, means that sub-devices which are in DEV_ACTIVE state
because the application triggered dev_stop() operation cannot be
reconfigured again by dev_configure() operation which is really
problematic when application wants to reconfigure its ports.
Actually, the application may get success report when some of the
sub-devices are not in the wanted configuration.

The current behavior of fail-safe dev_configure() is correct only for
the first time dev_configure() is triggered by the application or for
sub-device synchronization in plug-in event, but it ignores the option
for reconfiguration from application side.

Allow calling to sub-devices dev_configure() operations also in
DEV_ACTIVE state when the call was triggered by the application.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agonet/failsafe: fix hotplug races
Matan Azrad [Mon, 12 Feb 2018 20:51:42 +0000 (20:51 +0000)]
net/failsafe: fix hotplug races

Fail-safe uses a periodic alarm mechanism, running from the host
thread, to manage the hot-plug events of its sub-devices. This
management requires a lot of sub-devices PMDs operations
(stop, close, start, configure, etc.).

While the hot-plug alarm runs in the host thread, the application may
call fail-safe operations, which directly trigger the sub-devices PMDs
operations as well. This call may occur from any thread decided by the
application (probably the master thread).

Thus, more than one operation can be executed to a sub-device at the
same time. This can initiate a lot of races in the sub-PMDs.

Moreover, some control operations update the fail-safe internal
databases, which can be used by the alarm mechanism at the same time.
This can also initiate races and crashes.

Fail-safe is the owner of its sub-devices and must synchronize their
use according to the ETHDEV ownership rules.

Synchronize hot-plug management by a new lock mechanism uses a mutex to
atomically defend each critical section in the fail-safe hot-plug
mechanism and control operations to prevent any races between them.

Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agonet/failsafe: fix removal scope
Matan Azrad [Mon, 12 Feb 2018 20:51:41 +0000 (20:51 +0000)]
net/failsafe: fix removal scope

The fail-safe PMD uses a per sub-device flag called "remove" to
indicate the scope where the sub-device was removed physically and
whether its software resources should be released.

This flag is set when the fail-safe receives an RMV notification
about the physical removal of the sub-device, and should be unset when
all the sub-device resources are released.

The previous code wrongly unsets the flag in dev_configure(), instead
of when the software resources release is completed.

Change the remove flag unsetting to take action in the end of the
software resources release.

Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>