dpdk.git
6 years agonet/i40e: remove driver log
Beilei Xing [Tue, 18 Sep 2018 05:44:10 +0000 (13:44 +0800)]
net/i40e: remove driver log

Remove driver log when no interrupt event indicated
in alarm handler for both PF and VF, otherwise there
will be lots of prints which makes console unusable.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/i40e: add option to use latest vector path
Xiaoyun Li [Tue, 18 Sep 2018 02:22:40 +0000 (10:22 +0800)]
net/i40e: add option to use latest vector path

For IA, the AVX2 vector path is only recommended to be used on later
platforms (identified by AVX512 support, like SKL etc.) This is because
performance benchmark shows downgrade when running AVX2 vector path on
early platform (BDW/HSW) in some cases. But we still observe perf gain
with some real work loading.

So this patch introduced the new devarg use-latest-supported-vec to
force the driver always selecting the latest supported vec path. Then
apps are able to take AVX2 path on early platforms. And this logic can
be re-used if we will have AVX512 vec path in future.

This patch only affects IA platforms. The selected vec path would be
like the following:
  Without devarg/devarg = 0:
  Machine vPMD
  AVX512F AVX2
  AVX2 SSE4.2
  SSE4.2 SSE4.2
  <SSE4.2 Not Supported

  With devarg = 1
  Machine vPMD
  AVX512F AVX2
  AVX2 AVX2
  SSE4.2 SSE4.2
  <SSE4.2 Not Supported

Other platforms can also apply the same logic if necessary in future.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/mlx5: add bluefield VF support
Ori Kam [Sun, 2 Sep 2018 13:55:59 +0000 (13:55 +0000)]
net/mlx5: add bluefield VF support

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx4: support meson build
Nelio Laranjeiro [Fri, 31 Aug 2018 07:16:05 +0000 (09:16 +0200)]
net/mlx4: support meson build

Compile Mellanox driver when their external dependencies are met.  A
glue version of the driver can still be requested by using the
-Denable_driver_mlx_glue=true

Meson will try to find the required external libraries.  When they are
not installed system wide, they can be provided though CFLAGS, LDFLAGS
and LD_LIBRARY_PATH environment variables, example (considering
RDMA-Core is installed in /tmp/rdma-core):

 # CLFAGS=-I/tmp/rdma-core/build/include \
   LDFLAGS=-L/tmp/rdma-core/build/lib \
   LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   meson output
 # LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   ninja -C output install

Note: LD_LIBRARY_PATH before ninja is necessary when the meson
configuration has changed (e.g. meson configure has been called), in
such situation the LD_LIBRARY_PATH is necessary to invoke the
autoconfiguration script.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/mlx5: support meson build
Nelio Laranjeiro [Fri, 31 Aug 2018 07:16:05 +0000 (09:16 +0200)]
net/mlx5: support meson build

Compile Mellanox driver when its external dependencies are met.  A
glue version of the driver can still be requested by using the
-Denable_driver_mlx_glue=true

Meson will try to find the required external libraries.  When they are
not installed system wide, they can be provided though CFLAGS, LDFLAGS
and LD_LIBRARY_PATH environment variables, example (considering
RDMA-Core is installed in /tmp/rdma-core):

 # CLFAGS=-I/tmp/rdma-core/build/include \
   LDFLAGS=-L/tmp/rdma-core/build/lib \
   LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   meson output
 # LD_LIBRARY_PATH=/tmp/rdma-core/build/lib \
   ninja -C output install

Note: LD_LIBRARY_PATH before ninja is necessary when the meson
configuration has changed (e.g. meson configure has been called), in
such situation the LD_LIBRARY_PATH is necessary to invoke the
autoconfiguration script.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/e1000: fix queue number in RSS configuration
Beilei Xing [Thu, 13 Sep 2018 07:06:23 +0000 (15:06 +0800)]
net/e1000: fix queue number in RSS configuration

RSS configuration works for all e1000 NICs except 82576.
This patch fixes this issue by correcting queue number
in RSS configuration.

Fixes: 424ae915baf0 ("net/e1000: move RSS to flow API")
Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
6 years agodrivers/crypto: remove double assignment of driver
Shreyansh Jain [Fri, 28 Sep 2018 12:26:04 +0000 (17:56 +0530)]
drivers/crypto: remove double assignment of driver

Removing double copy of driver information. 04664e5c8346 has shifted
that from driver's probe to bus's probe.

Fixes: 04664e5c8346 ("drivers/bus: fill driver reference after NXP probing")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodrivers/net: remove double assignment of driver
Shreyansh Jain [Fri, 28 Sep 2018 12:26:03 +0000 (17:56 +0530)]
drivers/net: remove double assignment of driver

Removing double copy of driver information. 04664e5c8346 has shifted
that from driver's probe to bus's probe.

Fixes: 04664e5c8346 ("drivers/bus: fill driver reference after NXP probing")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodrivers/bus: fill driver reference after NXP probing
Thomas Monjalon [Mon, 24 Sep 2018 23:55:28 +0000 (01:55 +0200)]
drivers/bus: fill driver reference after NXP probing

The probing functions of NXP buses were missing to set
the driver used for successfully probing a device.

The NXP driver and the generic rte_driver are now set
in the device structures.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/ifpga: remove useless driver cast
Thomas Monjalon [Tue, 25 Sep 2018 22:02:20 +0000 (00:02 +0200)]
bus/ifpga: remove useless driver cast

The rte_afu_driver is assigned to rte_afu_device.driver during probing.
There is no need of accessing the rte_afu_driver via rte_device.driver
and type casting to its container.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Rosen Xu <rosen.xu@intel.com>
6 years agoeal/bsd: fix build
Anatoly Burakov [Thu, 20 Sep 2018 12:26:37 +0000 (13:26 +0100)]
eal/bsd: fix build

When compiling on FreeBSD, lots of warnings/errors are thrown for
unused parameter. Fix these by marking the parameters as unused
in the code.

Fixes: 1009ba1704f9 ("mem: add internal API to get and set segment fd")
Fixes: 3a44687139eb ("mem: allow querying offset into segment fd")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoip_frag: add function to delete expired entries
Alex Kiselev [Mon, 4 Jun 2018 10:13:02 +0000 (13:13 +0300)]
ip_frag: add function to delete expired entries

A fragmented packets is supposed to live no longer than max_cycles,
but the lib deletes an expired packet only occasionally when it scans
a bucket to find an empty slot while adding a new packet.
Therefore a fragment might sit in the table forever.

Signed-off-by: Alex Kiselev <alex@therouter.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agolpm6: add incremental update on delete
Alex Kiselev [Tue, 18 Sep 2018 10:57:17 +0000 (13:57 +0300)]
lpm6: add incremental update on delete

Rework the delete function and add additional
internal data structures to support incremental
LPM tree update rather than full tree rebuild.

Signed-off-by: Alex Kiselev <alex@therouter.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agolpm6: store rules in hash table
Alex Kiselev [Tue, 18 Sep 2018 10:57:09 +0000 (13:57 +0300)]
lpm6: store rules in hash table

Rework the lpm6 rule subsystem and replace
current rules algorithm complexity O(n)
with hashtables which allow dealing with
large (50k) rule sets.

Signed-off-by: Alex Kiselev <alex@therouter.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoconfig: remove unused parameter
Qi Zhang [Mon, 17 Sep 2018 07:39:32 +0000 (15:39 +0800)]
config: remove unused parameter

RTE_LIBRTE_I40E_ITR_INTERVAL is not used. So it should also be removed
in config/rte_config.h for meson+ninja build.

Fixes: 864a800d706d ("net/i40e: remove VF interrupt handler")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoapp/testpmd: optimize mbuf pool allocation
Phil Yang [Wed, 12 Sep 2018 01:54:26 +0000 (09:54 +0800)]
app/testpmd: optimize mbuf pool allocation

By default, testpmd will create membuf pool for all NUMA nodes and
ignore EAL configuration.

Count the number of available NUMA according to EAL core mask or core
list configuration. Optimized by only creating membuf pool for those
nodes.

Fixes: c9cafcc82de8 ("app/testpmd: fix mempool creation by socket id")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Acked-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agomem: support using memfd segments for in-memory mode
Anatoly Burakov [Tue, 4 Sep 2018 15:15:50 +0000 (16:15 +0100)]
mem: support using memfd segments for in-memory mode

Enable using memfd-created segments if supported by the system.

This will allow having real fd's for pages but without hugetlbfs
mounts, which will enable in-memory mode to be used with virtio.

The implementation is mostly piggy-backing on existing real-fd
code, except that we no longer need to unlink any files or track
per-page locks in single-file segments mode, because in-memory
mode does not support secondary processes anyway.

We move some checks from EAL command-line parsing code to memalloc
because it is now possible to use single-file segments mode with
in-memory mode, but only if memfd is supported.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agomem: allow querying offset into segment fd
Anatoly Burakov [Tue, 4 Sep 2018 15:15:49 +0000 (16:15 +0100)]
mem: allow querying offset into segment fd

In a few cases, user may need to query offset into fd for a
particular memory segment (for example, to selectively map
pages). This commit adds a new API to do that.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agomem: add external API to retrieve page fd
Anatoly Burakov [Tue, 4 Sep 2018 15:15:48 +0000 (16:15 +0100)]
mem: add external API to retrieve page fd

Now that we can retrieve page fd's internally, we can expose it
as an external API. This will add two flavors of API - thread-safe
and non-thread-safe. Fix up internal API's to return values we need
without modifying rte_errno internally if called from within EAL.

We do not want calling code to accidentally close an internal fd, so
we make a duplicate of it before we return it to the user. Caller is
therefore responsible for closing this fd.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agomem: add internal API to get and set segment fd
Anatoly Burakov [Tue, 4 Sep 2018 15:15:47 +0000 (16:15 +0100)]
mem: add internal API to get and set segment fd

Enable setting and retrieving segment fd's internally.

For now, retrieving fd's will not be used anywhere until we
get an external API, but it will be useful for things like
virtio, where we wish to share segment fd's.

Setting segment fd's will not be available as a public API
at this time, but internally it is needed for legacy mode,
because we're not allocating our hugepages in memalloc in
legacy mode case, and we still need to store the fd.

Another user of get segment fd API is memseg info dump, to
show which pages use which fd's.

Not supported on FreeBSD.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agomem: track page fd in non-single file mode
Anatoly Burakov [Tue, 4 Sep 2018 15:15:46 +0000 (16:15 +0100)]
mem: track page fd in non-single file mode

Previously, we were only tracking lock file fd's in single-file
segments mode, but did not track fd's in non-single file mode
because we didn't need to (mmap() call still kept the lock). Now
that we are going to expose these fd's to the world, we need to
have access to them, so track them even in non-single file
segments mode.

We don't need to close fd's after mmap() because we're still
tracking them in an fd list. Also, for anonymous hugepages mode,
fd will always be -1 so exit early on error.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agomem: rename lock list to fd list
Anatoly Burakov [Tue, 4 Sep 2018 15:15:45 +0000 (16:15 +0100)]
mem: rename lock list to fd list

Previously, we were only using lock lists to store per-page lock fd's
because we cannot use modern fcntl() file description locks to lock
parts of the page in single file segments mode.

Now, we will be using this list to store either lock fd's (along with
memseg list fd) in single file segments mode, or per-page fd's (and set
memseg list fd to -1), so rename the list accordingly.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agomem: raise maximum fd limit unconditionally
Anatoly Burakov [Tue, 4 Sep 2018 15:15:44 +0000 (16:15 +0100)]
mem: raise maximum fd limit unconditionally

Previously, when we allocated hugepages, we closed the fd's corresponding
to them after we've done our mappings. Since we did mmap(), we didn't
actually lose the reference, but file descriptors used for mmap() do not
count against the fd limit. Since we are going to store all of our fd's,
we will hit the fd limit much more often when using smaller page sizes.

Fix this to raise the fd limit to maximum unconditionally.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agoeal: do not allow legacy mode with --in-memory mode
Anatoly Burakov [Tue, 4 Sep 2018 15:15:43 +0000 (16:15 +0100)]
eal: do not allow legacy mode with --in-memory mode

In-memory mode was never meant to support legacy mode, because we
cannot sort anonymous pages anyway.

Fixes: 72b49ff623c4 ("mem: support --in-memory mode")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agofbarray: fix detach in --no-shconf mode
Anatoly Burakov [Tue, 4 Sep 2018 15:15:42 +0000 (16:15 +0100)]
fbarray: fix detach in --no-shconf mode

In noshconf mode, no shared files are created, but we're still trying
to unlink them, resulting in detach/destroy failure even though it
should have succeeded. Fix it by exiting early in noshconf mode.

Fixes: 3ee2cde248a7 ("fbarray: support --no-shconf mode")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agoeal: add strscpy function
Gaetan Rivet [Tue, 11 Sep 2018 15:00:49 +0000 (17:00 +0200)]
eal: add strscpy function

The strncpy function has long been deemed unsafe for use,
in favor of strlcpy or snprintf.

While snprintf is standard and strlcpy is still largely available,
they both have issues regarding error checking and performance.

Both will force reading the source buffer past the requested size
if the input is not a proper c-string, and will return the expected
number of bytes copied, meaning that error checking needs to verify
that the number of bytes copied is not superior to the destination
size.

This contributes to awkward code flow, unclear error checking and
potential issues with malformed input.

The function strscpy has been discussed for some time already and
has been made available in the linux kernel[1].

Propose this new function as a safe alternative.

[1]: http://git.kernel.org/linus/30c44659f4a3

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Juhamatti Kuusisaari <juhamatti.kuusisaari@coriant.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agombuf: remove deprecated segment free functions
David Marchand [Mon, 17 Sep 2018 12:45:09 +0000 (14:45 +0200)]
mbuf: remove deprecated segment free functions

__rte_mbuf_raw_free and __rte_pktmbuf_prefree_seg have been deprecated for
a long time now (early 17.05), are not part of the abi and are easily
replaced with existing api.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoevent/opdl: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:21 +0000 (15:58 +0100)]
event/opdl: add in meson build

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agoevent/opdl: rename map file to match library name
Luca Boccassi [Tue, 18 Sep 2018 14:58:20 +0000 (15:58 +0100)]
event/opdl: rename map file to match library name

So that it can be used from Meson as well

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agobaseband/null: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:19 +0000 (15:58 +0100)]
baseband/null: add in meson build

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agocrypto/scheduler: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:16 +0000 (15:58 +0100)]
crypto/scheduler: add in meson build

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agonet/vmxnet3: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:22 +0000 (15:58 +0100)]
net/vmxnet3: add in meson build

Note that the library built by meson will not have the _uio suffix:
librte_pmd_vmxnet3.so - as it follows the directory name, while the
legacy makefile rename it to librte_pmd_vmxnet3_uio.so.

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agonet/qede: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:18 +0000 (15:58 +0100)]
net/qede: add in meson build

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahed Shaikh <shahed.shaikh@cavium.com>
6 years agonet/vdev_netvsc: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:15 +0000 (15:58 +0100)]
net/vdev_netvsc: add in meson build

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agonet/tap: add in meson build
Luca Boccassi [Tue, 18 Sep 2018 14:58:14 +0000 (15:58 +0100)]
net/tap: add in meson build

Use same autoconf generation mechanism as the MLX4/5 PMDs

Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: generate API documentation with meson
Luca Boccassi [Tue, 11 Sep 2018 20:42:36 +0000 (21:42 +0100)]
build: generate API documentation with meson

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: use same version as make showversion in meson
Luca Boccassi [Tue, 11 Sep 2018 20:42:35 +0000 (21:42 +0100)]
build: use same version as make showversion in meson

make showversion will print 18.11.0-rc0 but Meson sets 18.11-rc0,
causing among other things a difference in the generated documentation.

Fixes: 76b9d9de5c7d ("version: 18.11-rc0")

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agomk: use templated doxygen config
Luca Boccassi [Tue, 11 Sep 2018 20:42:34 +0000 (21:42 +0100)]
mk: use templated doxygen config

This will allow the same config file to be used from Meson.
The result has been verified to be identical via diffoscope.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agomk: use script to generate examples.dox
Luca Boccassi [Tue, 11 Sep 2018 20:42:33 +0000 (21:42 +0100)]
mk: use script to generate examples.dox

This will make it possible to generate the file in the same way from
Meson as well.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: fix compatibility with meson 0.41 onwards
Bruce Richardson [Tue, 18 Sep 2018 10:55:52 +0000 (11:55 +0100)]
build: fix compatibility with meson 0.41 onwards

Versions of meson prior to 0.47 flattened the parameters to the
"set_variable" function, which meant that the function could not take
array variables as a parameter. Therefore, we need to disable driver
tracking for those older versions, in order to maintain compatibility
with the minimum supported 0.41 version, and also v0.45 shipped in
Ubuntu 18.04 release.

Fixes: 806c45dd483d ("build: add configuration summary at end of config")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
6 years agodevtools: use shared libs to save space in build test
Bruce Richardson [Fri, 14 Sep 2018 16:17:17 +0000 (17:17 +0100)]
devtools: use shared libs to save space in build test

For usability, the default build type in meson is static, so that
binaries can be run from the build directory easily. However, static
builds take more space, so for build-testing purposes default to using
shared builds where possible.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agopdump: remove dependency on libpthread
Reshma Pattan [Tue, 7 Aug 2018 14:41:17 +0000 (15:41 +0100)]
pdump: remove dependency on libpthread

pdump library now uses generic multi process channel
and it is no more dependent on the pthreads, so remove
the dependency from the Makefile.

Fixes: 660098d61f57 ("pdump: use generic multi-process channel")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agobuild: add configuration summary at end of config
Bruce Richardson [Wed, 29 Aug 2018 16:19:20 +0000 (17:19 +0100)]
build: add configuration summary at end of config

After running meson to configure a DPDK build, it can be useful to know
what was automatically enabled or disabled. Therefore, print out by way of
summary a categorised list of libraries and drivers to be built.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: simplify logic for default library dependencies
Bruce Richardson [Thu, 19 Jul 2018 14:37:02 +0000 (15:37 +0100)]
build: simplify logic for default library dependencies

EAL is a standard dependency of all libraries, except for those built
before it. We can therefore simplify the logic by just checking if EAL
has been processed, and make it a standard dependency if so.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: create relative symlinks for PMDs in libdir
Luca Boccassi [Wed, 12 Sep 2018 17:21:34 +0000 (18:21 +0100)]
build: create relative symlinks for PMDs in libdir

Add -r option to ln, otherwise the link will be absolute and contain
the build path and break packaging among other things:

lrwxrwxrwx 1 bluca bluca     99 Sep 11 22:17 librte_mempool_dpaa.so.1.1
  -> /home/bluca/git/dpdk/testt4//usr/local/lib/x86_64-linux-gnu/dpdk/
     drivers/librte_mempool_dpaa.so.1.1

With -r:

lrwxrwxrwx 1 bluca bluca     35 Sep 12 18:13 librte_pmd_zlib.so.1.1
  -> dpdk/drivers/librte_pmd_zlib.so.1.1

Fixes: ed4d43d73e2b ("build: symlink drivers to library directory")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Tested-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: add ppc64 meson build
Luca Boccassi [Mon, 10 Sep 2018 11:32:43 +0000 (12:32 +0100)]
build: add ppc64 meson build

This has been only build-tested for now, on a native ppc64el POWER8E
machine running Debian sid.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoigb_uio: install module when building with meson
Luca Boccassi [Mon, 17 Sep 2018 09:01:27 +0000 (10:01 +0100)]
igb_uio: install module when building with meson

Install in $kerneldir/../extra/dpdk. Usually $kerneldir should something
like: /lib/modules/$kver/build, so this directory will match the default
one used by legacy makefiles.

Fixes: a52f4574f798 ("igb_uio: build with meson")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/i40e: use -Wno-error=format-security for meson
Luca Boccassi [Mon, 17 Sep 2018 09:01:26 +0000 (10:01 +0100)]
net/i40e: use -Wno-error=format-security for meson

This PMD is built with -Wno-format, which means GCC errors out if
-Wformat-security is used.

Fixes: e940646b20fa ("drivers/net: build Intel NIC PMDs with meson")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoraw/ifpga: use -Wno-error=format-security for meson
Luca Boccassi [Mon, 17 Sep 2018 09:01:25 +0000 (10:01 +0100)]
raw/ifpga: use -Wno-error=format-security for meson

This PMD is built with -Wno-format, which means GCC errors out if
-Wformat-security is used.

Fixes: 56bb54ea1bdf ("raw/ifpga/base: add Intel FPGA OPAE share code")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal: include missing hypervisor files in meson
Luca Boccassi [Mon, 17 Sep 2018 09:01:24 +0000 (10:01 +0100)]
eal: include missing hypervisor files in meson

They are built by the legacy makefiles but not by Meson.

Fixes: 8f40ee0734c8 ("eal/x86: get hypervisor name")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agocompat: fix symbol version support with meson
Bruce Richardson [Mon, 17 Sep 2018 08:18:00 +0000 (09:18 +0100)]
compat: fix symbol version support with meson

For meson builds, the define to enable the symbol version
macros in rte_compat.h was missing. This led to symbols being
omitted from shared objects. For example, checking rte_distributor.so
with objdump and comparing make and meson built versions:

$ objdump -T make-build/lib/librte_distributor.so | grep _flush
 0000000000001b60 g    DF .text 00000000000000a7 (DPDK_2.0)   rte_distributor_flush
 0000000000003f10 g    DF .text 0000000000000434  DPDK_17.05  rte_distributor_flush
$ objdump -T meson-build/lib/librte_distributor.so | grep _flush
 0000000000001d50 g    DF .text 00000000000000fb  DPDK_2.0    rte_distributor_flush

Adding in the missing define fixes this.

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Reported-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Luca Boccassi <bluca@debian.org>
6 years agocrypto/openssl: replace macros by static inline functions
Ashish Gupta [Tue, 31 Jul 2018 14:16:25 +0000 (19:46 +0530)]
crypto/openssl: replace macros by static inline functions

Replace macros by static inline functions in openssl version
compatibility layer

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agoexamples/ipsec-secgw: support 3DES-CBC
Hemant Agrawal [Wed, 25 Jul 2018 09:49:43 +0000 (15:19 +0530)]
examples/ipsec-secgw: support 3DES-CBC

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agoapp/bbdev: fix inputs mbuf creation
Kamil Chalupnik [Fri, 17 Aug 2018 07:19:19 +0000 (09:19 +0200)]
app/bbdev: fix inputs mbuf creation

Omitting inputs and outputs mbuf creation for BaseBand Null Device
as inputs and outputs data do not exist for Null Device

Fixes: b2a4654f082b ("mempool: check for zero size creation")
Cc: stable@dpdk.org
Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agocompress/qat: use compression specific driver name
Fiona Trahe [Fri, 10 Aug 2018 15:18:01 +0000 (16:18 +0100)]
compress/qat: use compression specific driver name

The QAT compression driver was named "qat".
Rename to compress_qat for consistency with other compressdev drivers
and with crypto_qat.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocrypto/qat: fix typo
Fiona Trahe [Fri, 10 Aug 2018 15:18:39 +0000 (16:18 +0100)]
crypto/qat: fix typo

Fixes: f9a3d7f68f05 ("crypto/qat: move code into appropriate files")

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agodoc: describe qat build config options
Fiona Trahe [Fri, 10 Aug 2018 14:10:53 +0000 (15:10 +0100)]
doc: describe qat build config options

Added description of the build configuration options for QAT.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agodoc: update build instructions for qat PMDs
Fiona Trahe [Fri, 10 Aug 2018 14:10:52 +0000 (15:10 +0100)]
doc: update build instructions for qat PMDs

Update PMD build section.
Linked to kernel dependency section and refactored text
between those 2 sections.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agodoc: add overview of qat guide
Fiona Trahe [Fri, 10 Aug 2018 14:10:51 +0000 (15:10 +0100)]
doc: add overview of qat guide

Add overview of QAT doc sections and link between them.
Indent to next level all sections within
the crypto and common sections.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agodoc: correct typo and cosmetic changes in qat guide
Fiona Trahe [Fri, 10 Aug 2018 14:10:50 +0000 (15:10 +0100)]
doc: correct typo and cosmetic changes in qat guide

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agodoc: add how to test in qat crypto guide
Fiona Trahe [Fri, 10 Aug 2018 14:10:49 +0000 (15:10 +0100)]
doc: add how to test in qat crypto guide

Add section to common QAT part of doc about
which tests can be used to exercise
QAT compress and crypto PMDS

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agodoc: add limitations to qat compressdev guide
Fiona Trahe [Fri, 10 Aug 2018 14:10:48 +0000 (15:10 +0100)]
doc: add limitations to qat compressdev guide

Add two missing limitations to QAT compressdev documentation.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agonet/i40e: remove invalid comment
Ferruh Yigit [Thu, 13 Sep 2018 11:21:01 +0000 (12:21 +0100)]
net/i40e: remove invalid comment

Comments says "no csum error report support" but there is no check
related csum offloads. Removing the comment.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agoapp/testpmd: show errno along with flow API errors
Adrien Mazarguil [Fri, 31 Aug 2018 09:10:56 +0000 (11:10 +0200)]
app/testpmd: show errno along with flow API errors

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/netvsc: support integrated VF
Stephen Hemminger [Thu, 30 Aug 2018 22:35:12 +0000 (15:35 -0700)]
net/netvsc: support integrated VF

Integrate accelerated networking support into netvsc PMD.
This allows netvsc to manage VF without using failsafe or vdev_netvsc.
For the exception vswitch path some tests like transmit
get a 22% increase in packets/sec.
For the VF path, the code is slightly shorter but has no
real change in performance.

Pro:
   * using netvsc is more like other DPDK NIC's
   * the exception packet uses less CPU
   * much smaller code size
   * no locking required on VF transmit/receive path
   * no legacy Linux network device to get mangled by userspace
   * much simpler (1K vs 9K) LOC
   * unified extended statistics

Con:
   * using netvsc has more complex startup model
   * no bifurcated driver support
   * no flow support (since host does not have flow API).
   * no tunnel offload support
   * no receive interrupt support

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agonet/netvsc: implement link state change callback
Stephen Hemminger [Thu, 30 Aug 2018 22:35:11 +0000 (15:35 -0700)]
net/netvsc: implement link state change callback

Implement callback functionality on link state changes.
This is not really driven off of interrupt file descriptor like most other
PMD's. Instead, it happens when a link state change message arrives
in the common ring buffer.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agonet/netvsc: exhausting Tx descriptors is not an error
Stephen Hemminger [Thu, 30 Aug 2018 22:35:10 +0000 (15:35 -0700)]
net/netvsc: exhausting Tx descriptors is not an error

If application sends faster than vswitch can keep up, then the
transmit descriptor pool will be exhausted. This is not a failure
so change the name statistic and don't include it in oerrors.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agonet/netvsc: allow tuning latency with devargs
Stephen Hemminger [Thu, 30 Aug 2018 22:35:09 +0000 (15:35 -0700)]
net/netvsc: allow tuning latency with devargs

Allow overriding default guest to host latency on per device basis
with devargs.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agobus/vmbus: add devargs support
Stephen Hemminger [Thu, 30 Aug 2018 22:35:08 +0000 (15:35 -0700)]
bus/vmbus: add devargs support

Take device arguments from command line and put
them in the device devargs.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agoethdev: make default behavior CRC strip on Rx
Ferruh Yigit [Tue, 4 Sep 2018 10:12:56 +0000 (11:12 +0100)]
ethdev: make default behavior CRC strip on Rx

Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag.
Without any specific Rx offload flag, default behavior by PMDs is to
strip CRC.

PMDs that support keeping CRC should advertise DEV_RX_OFFLOAD_KEEP_CRC
Rx offload capability.

Applications that require keeping CRC should check PMD capability first
and if it is supported can enable this feature by setting
DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure()

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Jan Remes <remes@netcope.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
6 years agonet/bonding: do not ignore RSS key on device config
Igor Romanov [Wed, 29 Aug 2018 07:51:24 +0000 (08:51 +0100)]
net/bonding: do not ignore RSS key on device config

Bonding driver ignores the value of RSS key (that is set in the port RSS
configuration) in bond_ethdev_configure(). So the only way to set
non-default RSS key is by using rss_hash_update(). This is not an
expected behaviour.

Make the bond_ethdev_configure() set default RSS key only if
requested key is set to NULL.

Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
6 years agonet/bonding: use evenly distributed default RSS RETA
Igor Romanov [Wed, 29 Aug 2018 07:48:30 +0000 (08:48 +0100)]
net/bonding: use evenly distributed default RSS RETA

Default Redirection Table that is set in bonding driver is distributed
evenly over all Rx queues only within every RETA group (the first RETA
entries in every group are always start with zero). But in the most
drivers, default RETA is distributed over all Rx queues without sequence
resets in the beginning of a new group, which implies more balanced
per-core load.

Change the default RETA to be evenly distributed over all Rx queues
considering the whole table.

Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Chas Williams <chas3@att.com>
6 years agonet/sfc: support runtime Tx queue setup
Igor Romanov [Wed, 29 Aug 2018 07:35:34 +0000 (08:35 +0100)]
net/sfc: support runtime Tx queue setup

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: support runtime Rx queue setup
Igor Romanov [Wed, 29 Aug 2018 07:35:33 +0000 (08:35 +0100)]
net/sfc: support runtime Rx queue setup

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/cxgbe: add flow ops to match based on dest MAC
Shagun Agrawal [Mon, 27 Aug 2018 12:52:32 +0000 (18:22 +0530)]
net/cxgbe: add flow ops to match based on dest MAC

Add flow operations to match packets based on destination MAC address.
Allocate and program hardware MPS table with the destination MAC
address to be matched against. The returned MPS index is then used while
offloading flows to LETCAM (maskfull) and HASH (maskless) filter regions.

Also update existing mac_addr_set() to use the new MPS table API.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: add API to program hardware MPS table
Shagun Agrawal [Mon, 27 Aug 2018 12:52:31 +0000 (18:22 +0530)]
net/cxgbe: add API to program hardware MPS table

Add API to program and manage hardware Multi Port Switch table. MPS
holds destination MAC addresses to be matched against incoming packets
for further rule processing. Packets not matching any entry in MPS table
will be dropped by default, unless the underlying port is in promiscuous
mode.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: add flow operations to offload VLAN actions
Shagun Agrawal [Mon, 27 Aug 2018 12:52:30 +0000 (18:22 +0530)]
net/cxgbe: add flow operations to offload VLAN actions

Add flow API operations to offload vlan push, pop, and rewrite actions.
For vlan push or rewrite actions, allocate and program an entry from
L2T table. Use the L2T index to program vlan actions for LETCAM
(maskfull) and HASH (maskless) filters.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: add API to program hardware layer 2 table
Shagun Agrawal [Mon, 27 Aug 2018 12:52:29 +0000 (18:22 +0530)]
net/cxgbe: add API to program hardware layer 2 table

Add API to program and manage hardware Layer 2 Table. L2T holds
information necessary to rewrite specific fields in packet, such
as destination MAC address and vlan id.

Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agoexamples/vhost_crypto: support multi-core
Fan Zhang [Fri, 22 Jun 2018 12:36:05 +0000 (13:36 +0100)]
examples/vhost_crypto: support multi-core

Originally vhost_crypto sample application only supports single
core. This patch adds the multi-core support with more flexible
options.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agoethdev: fix missing names in Tx offload name array
Dekel Peled [Wed, 12 Sep 2018 08:28:02 +0000 (11:28 +0300)]
ethdev: fix missing names in Tx offload name array

Patch 5355f443 added two definitions of DEV_TX_OFFLOAD_xxx.
If new Tx offload capabilities are defined, they also must be mentioned
in rte_tx_offload_names in rte_ethdev.c file.

This patch adds the required lines in array rte_tx_offload_names.

Fixes: 5355f4439e2e ("ethdev: introduce generic IP/UDP tunnel checksum and TSO")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/i40e: stop LLDP before setting local LLDP MIB
Chas Williams [Mon, 6 Aug 2018 20:05:45 +0000 (16:05 -0400)]
net/i40e: stop LLDP before setting local LLDP MIB

>From the Intel Ethernet Controller X710/XXV710/XL710 Specification
Update:

    Starting from NVM 5.02, if the Set Local LLDP MIB command is
    received while the DCBx specific agent is stopped, the command
    returns an EPERM error. If the command is received while the
    LLDP agent is stopped, it sets the local MIB without exchanging
    LLDP with peer, and returns SUCCESS.

This results in the harmless, but annoying, diagnostic:

    default dcb config fails. err = -53, aq_err = 1.

So, if possible (older firmwares cannot safely stop LLDP), stop the
LLDP daemon when we are in software mod before we attempt to call
i40e_set_dcb_config.

Signed-off-by: Chas Williams <chas3@att.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: add alarm handler
Beilei Xing [Tue, 11 Sep 2018 03:35:41 +0000 (11:35 +0800)]
net/i40e: add alarm handler

This patch adds alarm handler, and then i40e
PF will use alarm handler instead of interrupt
handler when device is started and Rx interrupt
mode is disabled. This way will save CPU cycles
during receiving packets.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agovhost: fix return value on enqueue path
Tiwei Bie [Thu, 6 Sep 2018 04:59:27 +0000 (12:59 +0800)]
vhost: fix return value on enqueue path

Fixes: 62250c1d0978 ("vhost: extract split ring handling from Rx and Tx functions")
Fixes: a922401f35cc ("vhost: add Rx support for packed ring")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost-user: drop connection on message handling failures
Ilya Maximets [Mon, 3 Sep 2018 10:12:24 +0000 (13:12 +0300)]
vhost-user: drop connection on message handling failures

There are a lot of cases where vhost-user massage handling
could fail and end up in a fully not recoverable state. For
example, allocation failures of shadow used ring and batched
copy array are not recoverable and leads to the segmentation
faults like this on the receiving/transmission path:

  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 0x7f913fecf0 (LWP 43625)]
  in copy_desc_to_mbuf () at /lib/librte_vhost/virtio_net.c:760
  760       batch_copy[vq->batch_copy_nb_elems].dst =

This could be easily reproduced in case of low memory or big
number of vhost-user ports.

Fix that by propagating error to the upper layer which will
end up with disconnection in case we can not report to
the message sender when the error happens.

Fixes: f689586bc060 ("vhost: shadow used ring update")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agovhost: fix vhost interrupt support
Tiwei Bie [Tue, 4 Sep 2018 23:55:55 +0000 (07:55 +0800)]
vhost: fix vhost interrupt support

When VIRTIO_RING_F_EVENT_IDX is negotiated, we need to
update the avail event to enable the notification.

Fixes: 3f8ff12821e4 ("vhost: support interrupt mode")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/virtio-user: check negotiated features before set
Eric Zhang [Wed, 29 Aug 2018 15:55:21 +0000 (11:55 -0400)]
net/virtio-user: check negotiated features before set

This patch checks negotiated features to see if necessary to offload
before set the tap device offload capabilities. It also checks if kernel
support the TUNSETOFFLOAD operation.

Fixes: 5e97e4202563 ("net/virtio-user: enable offloading")
Cc: stable@dpdk.org
Signed-off-by: Eric Zhang <eric.zhang@windriver.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
6 years agovhost: fix zmbufs array leak after NUMA realloc
Ilya Maximets [Wed, 15 Aug 2018 14:54:39 +0000 (17:54 +0300)]
vhost: fix zmbufs array leak after NUMA realloc

'numa_realloc()' allocates 'zmbufs' even if zero copy mode
is not configured. This leads to memory leak, because array
is freed only for zero copy case.

Fixes: 2651726defb7 ("vhost: do deep copy while reallocating queue")
CC: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
6 years agoexamples/vhost: remove unnecessary constant
Rami Rosen [Sat, 25 Aug 2018 19:22:40 +0000 (22:22 +0300)]
examples/vhost: remove unnecessary constant

This patch removes an unnecessary definition of MAX_PRINT_BUFF
in examples/vhost/main.c, since it is no longer being used.

Fixes: 68363d85857d ("examples/vhost: remove the non-working zero copy code")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
6 years agodoc: fix wrong usage of bind command
Rami Rosen [Fri, 24 Aug 2018 07:43:02 +0000 (10:43 +0300)]
doc: fix wrong usage of bind command

This patch fixes wrong usage of bind command in vhost.rst.
Using "dpdk-devbind.py -b=uio_pci_generic 0000:00:04.0" gives
an error of "unbind failed". It should be "-b uio_pci_generic" so
it will work correctly.

Fixes: a971c509a523 ("doc: update vhost sample guide")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
6 years agonet/mlx5: fix interrupt completion queue index wrapping
Xueming Li [Thu, 23 Aug 2018 23:10:33 +0000 (07:10 +0800)]
net/mlx5: fix interrupt completion queue index wrapping

Rxq cq_ci was 16 bits while hardware is expecting to wrap
around 24 bits, this caused interrupt failure after burst of packets.

Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/ixgbe: do not return internal code
Luca Boccassi [Mon, 3 Sep 2018 14:18:11 +0000 (15:18 +0100)]
net/ixgbe: do not return internal code

In case of a temporary failure the ixgbe driver can return the internal
error IXGBE_ERR_RESET_FAILED to the application. Instead, return
-EAGAIN as per the public API specification.

Fixes: cddaf87a1ecb ("lib: fix unused values")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/cxgbe: fix memory access when parsing flow match items
Shagun Agrawal [Mon, 27 Aug 2018 12:53:31 +0000 (18:23 +0530)]
net/cxgbe: fix memory access when parsing flow match items

Coverity issue: 293096
Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org
Signed-off-by: Shagun Agrawal <shaguna@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/e1000: fix Tx offload capability typos
Yaroslav Brustinov [Wed, 8 Aug 2018 09:45:21 +0000 (12:45 +0300)]
net/e1000: fix Tx offload capability typos

Fix rx/tx typos in igb_get_tx_port_offloads_capa and
igb_get_tx_queue_offloads_capa.

Fixes: e5c05e6590ea ("net/e1000: convert to new Tx offloads API")
Cc: stable@dpdk.org
Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agodoc: update i40e guide for GTPv1 package release
Beilei Xing [Mon, 3 Sep 2018 05:40:56 +0000 (13:40 +0800)]
doc: update i40e guide for GTPv1 package release

Add link of GTPv1 package release.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/bonding: fix buffer corruption in packets
Jia Yu [Mon, 20 Aug 2018 05:18:45 +0000 (22:18 -0700)]
net/bonding: fix buffer corruption in packets

When bond slave devices cannot transmit all packets in bufs array,
tx_burst callback shall merge the un-transmitted packets back to
bufs array. Recent merge logic introduced a bug which causes
invalid mbuf addresses being written to bufs array.
When caller frees the un-transmitted packets, due to invalid addresses,
application will crash.

The fix is avoid shifting mbufs, and directly write un-transmitted
packets back to bufs array.

Fixes: 09150784a776 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org
Signed-off-by: Jia Yu <jyu@vmware.com>
Acked-by: Chas Williams <chas3@att.com>
6 years agoethdev: fix port ownership logs
Stephen Hemminger [Thu, 16 Aug 2018 22:37:14 +0000 (15:37 -0700)]
ethdev: fix port ownership logs

The rte_eth_dev_owner_unset function always generates a log
message because the unset value for owner id is 0.

Also, when rte_eth_dev_owner_delete is called with a valid
owner id, the log message should be at NOTICE not ERROR
severity.

Fixes: 5b7ba31148a8 ("ethdev: add port ownership")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Matan Azrad <matan@mellanox.com>
6 years agonet/nfp: fix live MAC changes not supported
Alejandro Lucero [Fri, 24 Aug 2018 14:25:36 +0000 (15:25 +0100)]
net/nfp: fix live MAC changes not supported

Some NFP firmwares support live changes to the MAC address, but
this is not always true and the firmware advertises it accordingly.

This patch checks if firmware does not support live changes and
sets RTE_ETH_DEV_NOLIVE_MAC_ADDR in that case.

Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
6 years agoethdev: fix MAC changes when live change not supported
Alejandro Lucero [Fri, 24 Aug 2018 14:25:35 +0000 (15:25 +0100)]
ethdev: fix MAC changes when live change not supported

Current code assumes a MAC change can occur when the port has been
started. In fact, there are some NICs which require this port state
for being successful, but other NICs not always support MAC change
in that case.

This patch supports a new device flag for a device advertising this
limitation, and if the flag is set, the MAC is changed before the
port starts.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/mvpp2: support VLAN for parser offload
Natalie Samsonov [Fri, 24 Aug 2018 18:30:03 +0000 (20:30 +0200)]
net/mvpp2: support VLAN for parser offload

Add VLAN packet type support for parser offload.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Shlomi Gridish <sgridish@marvell.com>
Reviewed-by: Dmitri Epshtein <dima@marvell.com>
Reviewed-by: Yuval Caduri <cyuval@marvell.com>
6 years agonet/mvpp2: make private variables static
Natalie Samsonov [Fri, 24 Aug 2018 18:30:02 +0000 (20:30 +0200)]
net/mvpp2: make private variables static

Mark internal variables static to avoid potential redefinition
errors later on.

Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
Reviewed-by: Yelena Krivosheev <yelena@marvell.com>