dpdk.git
6 years agobuild: remove library special cases
Bruce Richardson [Fri, 3 Nov 2017 14:47:43 +0000 (14:47 +0000)]
build: remove library special cases

The EAL and compat libraries were special-cases in the library build
process, the former because of it's complexity, and the latter because
it only consists of a single header file.

By reworking the EAL meson.build files, we can eliminate the need for it to
be a special case, by having it build up and return the list of sources,
headers, and objects and return those to the higher level build file. This
should also simplify the building of EAL, as we can eliminate a number of
meson.build files that would no longer be needed, and have fewer, but
larger meson.build files (9 now vs 14 previous) - thereby making the logic
easier to follow and items easier to find.

Once done, we can pull eal into the main library loop, with some
modifications to support it. Compat can also be pulled it once we add in a
check to handle the case of an empty sources list.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agoexamples: use pkg-config in makefiles
Bruce Richardson [Mon, 9 Oct 2017 13:13:16 +0000 (14:13 +0100)]
examples: use pkg-config in makefiles

Change the example app Makefiles to query if DPDK is installed and
registered using pkg-config. If so, build directly using pkg-config info,
otherwise fall back to using the original build system with RTE_SDK and
RTE_TARGET

This commit changes the makefiles for the basic examples, i.e. those which
do not have multiple subdirectories underneath the main examples dir.
Examples not covered are:

* ethtool
* multi_process
* performance-thread
* quota_watermark
* netmap_compat
* server_node_efd
* vm_power_manager

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agoexamples: put app name and sources at top of makefiles
Bruce Richardson [Mon, 25 Sep 2017 16:28:49 +0000 (17:28 +0100)]
examples: put app name and sources at top of makefiles

Reorder the text in the makefiles, so that the app name and the source
files are listed first. This then will allow them to be shared later in a
combined makefile building with pkg-config and RTE_SDK-based build system.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agoexamples: build some samples with meson
Bruce Richardson [Tue, 12 Sep 2017 15:42:02 +0000 (16:42 +0100)]
examples: build some samples with meson

Add support for having selected example apps built as part of a meson,
ninja build. By default none are built, and those to be built should be
named directly in the -Dexamples='' meson configuration argument.

This is useful for developers working on a feature who want to use a
suitable example, or examples, to test that feature, as they can compile
everything up in one go, and run the example without having to do a ninja
install first.

This commit adds examples which don't consist of multiple apps in
subdirectories to the meson build, so they can be built by default by
passing -Dexamples parameter to meson.

Not included are the following examples:
* ethtool
* multi-process
* netmap_compat
* performance-thread
* quota_watermark
* server_node_efd
* vm_power_manager

To test the apps added here, use the following command, merged to one line,
to add them to your meson build (command to be run inside the build
directory):

meson configure -Dexamples=bbdev_app,bond,cmdline,distributor,\
eventdev_pipeline_sw_pmd, exception_path,helloworld,\
ip_fragmentation,ip_pipeline,ip_reassembly, ipsec-secgw,\
ipv4_multicast,kni,l2fwd-cat,l2fwd-crypto,l2fwd-jobstats,\
l2fwd-keepalive,l2fwd,l3fwd-acl,l3fwd-power,l3fwd-vf,l3fwd,\
link_status_interrupt,load_balancer,packet_ordering,ptpclient,\
qos_meter,qos_sched,rxtx_callbacks,skeleton,tep_termination,\
timer,vhost,vhost_scsi,vmdq,vmdq_dcb

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agonet/bonding: build with meson
Bruce Richardson [Wed, 13 Sep 2017 15:07:32 +0000 (16:07 +0100)]
net/bonding: build with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agodrivers/event: build skeleton and SW drivers with meson
Bruce Richardson [Thu, 7 Sep 2017 15:06:58 +0000 (16:06 +0100)]
drivers/event: build skeleton and SW drivers with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agolpm: install vector header files with meson
Bruce Richardson [Thu, 12 Oct 2017 10:50:28 +0000 (11:50 +0100)]
lpm: install vector header files with meson

The main rte_lpm.h header file also includes architecture specific headers,
depending on the architecture on which it is used. These also need to be
installed into the include directory as part of the "ninja install"
process. Thankfully, since the vector headers all have different names we
can just install all 3 of them in all cases, which avoids conflicts or
issues with multi-architecture installs, or the need to use
architecture-specific subdirectories.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: detect and use libnuma
Bruce Richardson [Thu, 12 Oct 2017 14:02:27 +0000 (15:02 +0100)]
build: detect and use libnuma

DPDK has an optional dependency on libnuma, so manage that through the
build system, by dynamically detecting the presence of the needed library
and header files. Since this library is used by both EAL and vhost, check
for the presence at the top level in the config directory.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: add maths library in pkg-config file
Bruce Richardson [Fri, 6 Oct 2017 10:43:11 +0000 (11:43 +0100)]
build: add maths library in pkg-config file

Since a number of libraries depend on the maths lib, as well as adding it
to the project args, we also need to add it to the pkgconfig file args.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agoeal/bsd: build modules with meson
Bruce Richardson [Thu, 21 Sep 2017 14:54:53 +0000 (15:54 +0100)]
eal/bsd: build modules with meson

Support compiling the FreeBSD kernel modules using meson and ninja.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agoapp/testpmd: fix rpath for drivers in meson build
Timothy Redaelli [Wed, 20 Sep 2017 16:41:28 +0000 (18:41 +0200)]
app/testpmd: fix rpath for drivers in meson build

This commit fixes the setting of relative rpath on dpdk-testpmd for
drivers ($libdir/dpdk/drivers) to the correct absolute rpath
($prefix$libdir/dpdk/drivers)

Fixes: a25a650be5f0 ("build: add infrastructure for meson and ninja builds")

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild/x86: add SSE flags
Bruce Richardson [Thu, 14 Sep 2017 11:11:20 +0000 (12:11 +0100)]
build/x86: add SSE flags

Previous code only added in AVX, and a few other non-SSE flags to the
compile-time cpuflags because all SSE instruction set levels are now
required for an x86 build. However, some apps may still be checking for the
existing SSE ones in the legacy build system, so add them here for
completeness and compatibility.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: fix driver install path
Bruce Richardson [Wed, 20 Sep 2017 10:40:15 +0000 (11:40 +0100)]
build: fix driver install path

To comply with the "hier" standard [Ref: man 7 hier], the driver .so files
should not be placed in $datadir. Therefore we install them in a
sub-directory of $libdir instead.

Fixes: a25a650be5f0 ("build: add infrastructure for meson and ninja builds")

Reported-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: sort meson options alphabetically
Bruce Richardson [Wed, 20 Sep 2017 10:28:55 +0000 (11:28 +0100)]
build: sort meson options alphabetically

Wrap each entry at the description value to avoid really long lines also.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agoeal: do not hard-code install path with meson
Luca Boccassi [Fri, 15 Sep 2017 17:36:12 +0000 (18:36 +0100)]
eal: do not hard-code install path with meson

Instead of hard-coding the install path of generic and exec-env headers
use the includedir option, so that it can be correctly overridden.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: add optional arch-specific headers install path
Luca Boccassi [Fri, 15 Sep 2017 17:36:11 +0000 (18:36 +0100)]
build: add optional arch-specific headers install path

A subset of the dpdk headers are arch-dependent, but have common names
and thus cause a clash in a multiarch installation.
For example, rte_config.h is different for each target.

Add a "include_subdir_arch"  option to allow a user to specify a
subdirectory for arch independent headers to fix multiarch support.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: rename pkgconfig to libdpdk.pc
Luca Boccassi [Fri, 15 Sep 2017 17:36:10 +0000 (18:36 +0100)]
build: rename pkgconfig to libdpdk.pc

In Debian and Ubuntu we have been shipping a pkgconfig file for DPDK
for more than a year now, and the filename is libdpdk.pc.
A few downstream projects, like OVS and Collectd, have adopted the
use of libdpdk.pc in their build systems as well.
In order to maintain backward compatibility, rename the file from
DPDK.pc to libdpdk.pc.

Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodoc: describe how to add new components
Bruce Richardson [Thu, 31 Aug 2017 16:10:16 +0000 (17:10 +0100)]
doc: describe how to add new components

Add to the contributors guide details on how to add libraries and drivers
and integrate them with the DPDK build system(s).

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agobuild: add option to version libs using DPDK version
Bruce Richardson [Thu, 31 Aug 2017 10:36:43 +0000 (11:36 +0100)]
build: add option to version libs using DPDK version

Normally, each library has it's own version number based on the ABI.
Add an option to have all libs just use the DPDK version number as the
.so version.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agousertools: install with meson
Bruce Richardson [Wed, 30 Aug 2017 14:29:15 +0000 (15:29 +0100)]
usertools: install with meson

Have the "usertools" scripts installed when doing a DPDK install using
ninja. They will be copies to $prefix/bin, generally /usr/local/bin,
alongside testpmd.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agoapp/testpmd: build with meson
Bruce Richardson [Wed, 30 Aug 2017 13:38:34 +0000 (14:38 +0100)]
app/testpmd: build with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agodrivers/net: build Intel NIC PMDs with meson
Bruce Richardson [Wed, 30 Aug 2017 11:31:35 +0000 (12:31 +0100)]
drivers/net: build Intel NIC PMDs with meson

Add the e1000, fm10k, i40e and ixgbe drivers to the meson & ninja build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agodrivers/net: build some vdev PMDs with meson
Bruce Richardson [Wed, 30 Aug 2017 10:18:49 +0000 (11:18 +0100)]
drivers/net: build some vdev PMDs with meson

Add the af_packet, null, pcap and ring PMDs to the meson build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agodrivers/net: add meson build infrastructure
Bruce Richardson [Wed, 30 Aug 2017 09:05:59 +0000 (10:05 +0100)]
drivers/net: add meson build infrastructure

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agocrypto/qat: build with meson
Bruce Richardson [Wed, 30 Aug 2017 09:00:46 +0000 (10:00 +0100)]
crypto/qat: build with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agocrypto/openssl: build with meson
Bruce Richardson [Wed, 30 Aug 2017 08:50:20 +0000 (09:50 +0100)]
crypto/openssl: build with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agocrypto/null: build with meson
Bruce Richardson [Tue, 29 Aug 2017 16:20:14 +0000 (17:20 +0100)]
crypto/null: build with meson

Add in a crypto driver class, and implement compiling the null crypto
instance.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agodrivers/mempool: build SW drivers with meson
Bruce Richardson [Tue, 29 Aug 2017 15:32:27 +0000 (16:32 +0100)]
drivers/mempool: build SW drivers with meson

With build infrastructure in place, add in mempool drivers to the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agobus/vdev: build with meson
Bruce Richardson [Wed, 15 Nov 2017 23:31:46 +0000 (23:31 +0000)]
bus/vdev: build with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobus/pci: build with meson
Bruce Richardson [Wed, 1 Nov 2017 11:23:03 +0000 (11:23 +0000)]
bus/pci: build with meson

Many drivers across the various device types rely on PCI infrastructure,
so the bus drivers should be the first driver class built.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodrivers: add infrastructure for meson build
Bruce Richardson [Tue, 29 Aug 2017 13:49:45 +0000 (14:49 +0100)]
drivers: add infrastructure for meson build

Add in the top-level drivers meson.build file to start adding in building
of PMDs. Since all PMDs are built in pretty much the same way, the logic
for building each PMD, including extracting the pmdinfo, is included in the
top level build file. This means that each individual driver class only
needs to specify its default dependencies and a few naming conventions, and
each driver only needs to specify it's source files, headers, etc.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agobuildtools: build with meson
Bruce Richardson [Tue, 29 Aug 2017 13:39:32 +0000 (14:39 +0100)]
buildtools: build with meson

Add the buildtools folder, and more specifically the pmdinfogen binary to
the meson and ninja build. This will be needed for building the PMDs in the
driver folder later, as the pmd info output from the tool needs to be
included in those libs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agolib: build with meson
Bruce Richardson [Tue, 17 Oct 2017 12:43:57 +0000 (13:43 +0100)]
lib: build with meson

Add non-EAL libraries to DPDK build. The compat lib is a special case,
along with the previously-added EAL, but all other libs can be build using
the same set of commands, where the individual meson.build files only need
to specify their dependencies, source files, header files and ABI versions.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agoigb_uio: build with meson
Bruce Richardson [Mon, 28 Aug 2017 16:00:52 +0000 (17:00 +0100)]
igb_uio: build with meson

Support building igb_uio using meson and ninja. For this, we still use the
kernel's kbuild system, by calling out to make, since it's safer and easier
than trying to reproduce that in meson. A list of suitable file
dependencies is given so that we have a reasonable chance of a rebuild when
necessary.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agoeal: build with meson
Bruce Richardson [Fri, 17 Nov 2017 19:37:54 +0000 (19:37 +0000)]
eal: build with meson

Support building the EAL with meson and ninja. This involves a number of
different meson.build files for iterating through all the different
subdirectories in the EAL. The library itself will be compiled on build but
the header files are only copied from their initial location once "ninja
install" is run. Instead, we use meson dependency tracking to ensure that
other libraries which use the EAL headers can find them in their original
locations.

Note: this does not include building kernel modules on either BSD or Linux

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agobuild: add infrastructure for meson and ninja builds
Bruce Richardson [Mon, 28 Aug 2017 10:57:12 +0000 (11:57 +0100)]
build: add infrastructure for meson and ninja builds

To build with meson and ninja, we need some initial infrastructure in
place. The build files for meson always need to be called "meson.build",
and options get placed in meson_options.txt

This commit adds a top-level meson.build file, which sets up the global
variables for tracking drivers, libraries, etc., and then includes other
build files, before finishing by writing the global build configuration
header file and a DPDK pkgconfig file at the end, using some of those same
globals.

From the top level build file, the only include file thus far is for the
config folder, which does some other setup of global configuration
parameters, including pulling in architecture specific parameters from an
architectural subdirectory. A number of configuration build options are
provided for the project to tune a number of global variables which will be
used later e.g. max numa nodes, max cores, etc. These settings all make
their way to the global build config header "rte_build_config.h". There is
also a file "rte_config.h", which includes "rte_build_config.h", and this
file is meant to hold other build-time values which are present in our
current static build configuration but are not normally meant for
user-configuration. Ideally, over time, the values placed here should be
moved to the individual libraries or drivers which want those values.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Luca Boccassi <luca.boccassi@gmail.com>
6 years agoconfig: enable dpaaX drivers for generic ARMv8
Hemant Agrawal [Tue, 30 Jan 2018 15:11:29 +0000 (20:41 +0530)]
config: enable dpaaX drivers for generic ARMv8

This patch enables the NXP DPAA & DPAA2 drivers for
ARMV8 targets. They can be used with standard armv8 config
with command line mempool argument or newly introduced
platform mempool internal registration mechanism.

Note that the dpaa(x) specific config files are still preserved
to continue customer support. They also contain some of the ARM
performance tuning flags. e.g the default ARM cache size of 128
is not optimal for NXP platforms.

However, these configs will eventually be removed once a dynamic
mechanisms are developed to detect the performance settings.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agocrypto/dpaa2_sec: fix enum conversion for GCM
Hemant Agrawal [Thu, 25 Jan 2018 09:53:29 +0000 (15:23 +0530)]
crypto/dpaa2_sec: fix enum conversion for GCM

dpaa2_sec/dpaa2_sec_dpseci.c:1287:25: error: implicit conversion from
enumeration type 'enum rte_crypto_aead_algorithm' to different enumeration
type 'enum rte_crypto_cipher_algorithm' [-Werror,-Wenum-conversion]
                session->cipher_alg = RTE_CRYPTO_AEAD_AES_GCM;

Fixes: 13273250eec5 ("crypto/dpaa2_sec: support AES-GCM and CTR")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agocrypto/dpaa_sec: fix enum conversion for GCM
Hemant Agrawal [Thu, 25 Jan 2018 09:53:30 +0000 (15:23 +0530)]
crypto/dpaa_sec: fix enum conversion for GCM

dpaa_sec/dpaa_sec.h:297:13: error: implicit conversion from enumeration
type 'enum rte_crypto_aead_algorithm' to different enumeration type 'enum
rte_crypto_auth_algorithm' [-Werror,-Wenum-conversion]
.algo = RTE_CRYPTO_AEAD_AES_GCM,

Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: fix clang warnings
Hemant Agrawal [Thu, 25 Jan 2018 09:53:27 +0000 (15:23 +0530)]
bus/dpaa: fix clang warnings

fman.c:570:15: error: format specifies type 'unsigned short'
but the argument has type 'int'

fman/netcfg_layer.c:80:1: error: unused function 'get_num_netcfg_interfaces'

Fixes: 919eeaccb2ba ("bus/dpaa: introduce NXP DPAA bus driver skeleton")
Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoeal: add synchronous multi-process communication
Jianfeng Tan [Tue, 30 Jan 2018 06:58:09 +0000 (06:58 +0000)]
eal: add synchronous multi-process communication

We need the synchronous way for multi-process communication,
i.e., blockingly waiting for reply message when we send a request
to the peer process.

We add two APIs rte_eal_mp_request() and rte_eal_mp_reply() for
such use case. By invoking rte_eal_mp_request(), a request message
is sent out, and then it waits there for a reply message. The caller
can specify the timeout. And the response messages will be collected
and returned so that the caller can decide how to translate them.

The API rte_eal_mp_reply() is always called by an mp action handler.
Here we add another parameter for rte_eal_mp_t so that the action
handler knows which peer address to reply.

       sender-process                receiver-process
   ----------------------            ----------------

    thread-n
     |_rte_eal_mp_request() ----------> mp-thread
        |_timedwait()                    |_process_msg()
                                           |_action()
                                               |_rte_eal_mp_reply()
        mp_thread  <---------------------|
                  |_process_msg()
                     |_signal(send_thread)
    thread-m <----------|
     |_collect-reply

 * A secondary process is only allowed to talk to the primary process.
 * If there are multiple secondary processes for the primary process,
   it will send request to peer1, collect response from peer1; then
   send request to peer2, collect response from peer2, and so on.
 * When thread-n is sending request, thread-m of that process can send
   request at the same time.
 * For pair <action_name, peer>, we guarantee that only one such request
   is on the fly.

Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoeal: add channel for multi-process communication
Jianfeng Tan [Tue, 30 Jan 2018 06:58:08 +0000 (06:58 +0000)]
eal: add channel for multi-process communication

Previouly, there are three channels for multi-process
(i.e., primary/secondary) communication.
  1. Config-file based channel, in which, the primary process writes
     info into a pre-defined config file, and the secondary process
     reads the info out.
  2. vfio submodule has its own channel based on unix socket for the
     secondary process to get container fd and group fd from the
     primary process.
  3. pdump submodule also has its own channel based on unix socket for
     packet dump.

It'd be good to have a generic communication channel for multi-process
communication to accommodate the requirements including:
  a. Secondary wants to send info to primary, for example, secondary
     would like to send request (about some specific vdev to primary).
  b. Sending info at any time, instead of just initialization time.
  c. Share FDs with the other side, for vdev like vhost, related FDs
     (memory region, kick) should be shared.
  d. A send message request needs the other side to response immediately.

This patch proposes to create a communication channel, based on datagram
unix socket, for above requirements. Each process will block on a unix
socket waiting for messages from the peers.

Three new APIs are added:

  1. rte_eal_mp_action_register() is used to register an action,
     indexed by a string, when a component at receiver side would like
     to response the messages from the peer processe.
  2. rte_eal_mp_action_unregister() is used to unregister the action
     if the calling component does not want to response the messages.
  3. rte_eal_mp_sendmsg() is used to send a message, and returns
     immediately. If there are n secondary processes, the primary
     process will send n messages.

Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agocrypto/dpaa2_sec: fix build with GCC < 7
Hemant Agrawal [Tue, 30 Jan 2018 09:23:30 +0000 (14:53 +0530)]
crypto/dpaa2_sec: fix build with GCC < 7

This patch fixes the compilation with compiler GCC < 7

dpaa2_sec/hw/rta/operation_cmd.h:12:32: error: unknown option after
 ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"

Fixes: 2ab9a9483196 ("crypto/dpaa2_sec: fix build with GCC 7")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoeal/ppc: remove the braces in memory barrier macros
Gowrishankar Muthukrishnan [Tue, 30 Jan 2018 10:53:18 +0000 (16:23 +0530)]
eal/ppc: remove the braces in memory barrier macros

Calling rte_smp_{w/r}mb macro expands into a compound block, which
would break compiling a else clause following it, if that calling
place has been terminated already with ";", as in below code.
This patch adds { } around this macro to allow compiling else too.

Fixes: d23a6bd04d ("eal/ppc: fix memory barrier for IBM POWER")
Fixes: 05c3fd7110 ("eal/ppc: atomic operations for IBM Power")
Cc: stable@dpdk.org
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
6 years agonet/tap: fix build on ppc
Gowrishankar Muthukrishnan [Tue, 30 Jan 2018 07:05:13 +0000 (12:35 +0530)]
net/tap: fix build on ppc

This patch defines __NR_bpf for powerpc architecture and hence,
fixes compiling tap driver for this architecture.

Fixes: b02d85e1 ("net/tap: add eBPF API")

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
6 years agonet/mlx4: fix removal detection of stopped port
Moti Haimovsky [Mon, 29 Jan 2018 08:34:37 +0000 (10:34 +0200)]
net/mlx4: fix removal detection of stopped port

In failsafe device start can be called for ports/devices that
had been plugged out.
The mlx4 PMD detects device removal by listening to the device RMV
events, when the mlx4 port is being stopped, the PMD no longer
listens to these events causing the PMD to stop detecting device
removals.
This patch fixes this issue by moving installation of the interrupt
handler to device configuration, and toggle only the Rx-queue
interrupts on start/stop.

Fixes: a6e8b01c3c26 ("net/mlx4: compact interrupt functions")
Cc: stable@dpdk.org
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/qede: update PMD version
Rasesh Mody [Sat, 27 Jan 2018 21:15:35 +0000 (13:15 -0800)]
net/qede: update PMD version

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/qede: add check for null return
Shahed Shaikh [Sat, 27 Jan 2018 21:15:34 +0000 (13:15 -0800)]
net/qede: add check for null return

Test the return value of ecore_ptt_acquire for NULL.

Coverity issue: 257049
Fixes: d378cefab84e ("net/qede: add support for GENEVE tunneling offload")

Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
6 years agodoc: update bnx2x guide
Rasesh Mody [Sat, 27 Jan 2018 21:15:33 +0000 (13:15 -0800)]
doc: update bnx2x guide

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agodoc: update qede guide
Rasesh Mody [Sat, 27 Jan 2018 21:15:32 +0000 (13:15 -0800)]
doc: update qede guide

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/qede: fix clearing of queue stats
Rasesh Mody [Sat, 27 Jan 2018 21:15:31 +0000 (13:15 -0800)]
net/qede: fix clearing of queue stats

Add support to clear the per queue statistics thereby clearing xstats
counters.
Fixes: 7634c5f91569 ("net/qede: add queue statistics")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/qede: fix MTU set and max Rx length
Rasesh Mody [Sat, 27 Jan 2018 21:15:30 +0000 (13:15 -0800)]
net/qede: fix MTU set and max Rx length

This patch fixes issues related to MTU set and max_rx_pkt_len usage.
 - Adjust MTU during device configuration when jumbo is enabled

 - In qede_set_mtu():
   Return not supported for VF as currently we do not support it.

   Cache new mtu value in mtu_new for proper update.

   Add check for RXQ allocation before calculating RX buffer size
   if not allocated defer RX buffer size calculation till RXQ setup.

   Add check for before performing device start/stop.

 - Use max_rx_pkt_len appropriately

 - Change QEDE_ETH_OVERHEAD macro to adjust driver specifics

Fixes: 4c4bdadfa9e7 ("net/qede: refactoring multi-queue implementation")
Fixes: 9a6d30ae6d46 ("net/qede: refactoring vport handling code")
Fixes: 1ef4c3a5c1f7 ("net/qede: prevent crash while changing MTU dynamically")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/qede: remove debug config option
Rasesh Mody [Sat, 27 Jan 2018 21:15:29 +0000 (13:15 -0800)]
net/qede: remove debug config option

With dynamic logging, we no longer need DEBUG INFO config option.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
6 years agonet/qede: fix tunnel header size in Tx BD configuration
Harish Patil [Sat, 27 Jan 2018 21:15:28 +0000 (13:15 -0800)]
net/qede: fix tunnel header size in Tx BD configuration

- Fix incorrect header size. In the tunnel case, the outer L2/L3 lengths
should be included to calculate tunnel header_size.
- In TSO case, skip manipulating TX BD1 and TX BD2 data buffer fields
since those fields are already updated with header and payload lengths
respectively.
- Update TX BD debug data collection.

Fixes: 3d4bb4411683 ("net/qede: add fastpath support for VXLAN tunneling")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@cavium.com>
6 years agonet/qede: check tunnel L3 header
Harish Patil [Sat, 27 Jan 2018 21:15:27 +0000 (13:15 -0800)]
net/qede: check tunnel L3 header

- Add a check to verify tunnel IP header checksum is valid and mark MBUF
flag as appropriate.
- Bit of refactoring so that inner frame handling for tunneled packets can
be made common as regular (non-tunneled) packets.
- make qede_tunn_exist() as inline.
- remove RTE_PTYPE_L2_ETHER as default L2 pkt_type.

Fixes: 3d4bb4411683 ("net/qede: add fastpath support for VXLAN tunneling")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@cavium.com>
6 years agonet/qede: initialize VF tunnel as enabled on start
Harish Patil [Sat, 27 Jan 2018 21:15:26 +0000 (13:15 -0800)]
net/qede: initialize VF tunnel as enabled on start

By default, the PF driver enables tunnel offload for its child VF.
So mark tunnel offloads as enabled in the VF driver to reflect the
actual state.

Fixes: 52d94b57e1c7 ("net/qede: add slowpath support for VXLAN tunneling")
Fixes: d378cefab84e ("net/qede: add support for GENEVE tunneling offload")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@cavium.com>
6 years agonet/qede/base: fix VF LRO tunnel configuration
Harish Patil [Sat, 27 Jan 2018 21:15:25 +0000 (13:15 -0800)]
net/qede/base: fix VF LRO tunnel configuration

Add missing LRO tunnel configuration parameters for VF over sriov channel.

Fixes: ec94dbc57362 ("qede: add base driver")
Cc: stable@dpdk.org
Signed-off-by: Harish Patil <harish.patil@cavium.com>
6 years agonet/tap: support Rx interrupt
Moti Haimovsky [Sun, 28 Jan 2018 10:45:35 +0000 (12:45 +0200)]
net/tap: support Rx interrupt

This patch adds support for registering and waiting for Rx interrupts.
This allows applications to wait for Rx events from the PMD using the
DPDK rte_epoll subsystem.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Pascal Mazon <pascal.mazon@6wind.com>
6 years agonet/mlx4: fix broadcast Rx
Moti Haimovsky [Sun, 28 Jan 2018 09:43:37 +0000 (11:43 +0200)]
net/mlx4: fix broadcast Rx

This patch fixes the issue of mlx4 not receiving broadcast packets
when configured to work promiscuous or allmulticast modes.

Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")
Cc: stable@dpdk.org
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/mlx4: fix single port configuration
Ophir Munk [Tue, 23 Jan 2018 23:32:47 +0000 (23:32 +0000)]
net/mlx4: fix single port configuration

The number of mlx4 present ports is calculated as follows:
conf.ports.present |= (UINT64_C(1) << device_attr.phys_port_cnt) - 1;

That is - all ones sequence (due to -1 subtraction)
When retrieving the number of ports, 1 must be added in order to obtain
the correct number of ports to the power of 2, as follows:
uint32_t ports = rte_log2_u32(conf->ports.present + 1);
If 1 was not added, in the case of one port, the number of ports would
be falsely calculated as 0.

Fixes: 8264279967dc ("net/mlx4: check max number of ports dynamically")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agonet/failsafe: add Rx interrupts
Moti Haimovsky [Thu, 25 Jan 2018 16:19:32 +0000 (18:19 +0200)]
net/failsafe: add Rx interrupts

This patch is the last patch in the series of patches aimed
to add support for registering and waiting for Rx interrupts
in failsafe PMD. This allows applications to wait for Rx events
from the PMD using the DPDK rte_epoll subsystem.
The failsafe PMD presents to the application a facade of a single
device to be handled by the application while internally it manages
several devices on behalf of the application including packets
transmission and reception.
The Proposed failsafe Rx interrupt scheme follows this approach.
The failsafe PMD will present the application with a single set of
Rx interrupt vectors representing the failsafe Rx queues, while
internally it will serve as an interrupt proxy for its subdevices.
will allow applications to wait for Rx traffic from the failsafe
PMD by registering and waiting for Rx events from its Rx queues.
In order to support this the following is suggested:
  * Every Rx queue in the failsafe (virtual) device will be assigned
  * a Linux event file descriptor (efd) and an enable_interrupts flag.
  * The failsafe PMD will fill in its rte_intr_handle structure with
    the Rx efds assigned previously and register them with the EAL.
  * The failsafe driver will create a private epoll fd (epfd) and
  * will allocate enough space to handle all the Rx events from all its
    subdevices.
  * Acting as an application,
    for each Rx queue in each active subdevice the failsafe will:
      o Register the Rx queue with the EAL.
      o Pass the EAL the failsafe private epoll fd as the epfd to
        register the Rx queue event on.
      o Pass the EAL, as a parameter, the pointer to the failsafe Rx
        queue that handles this Rx queue.
      o Using the DPDK service callbacks, the failsafe PMD will launch
        an Rx proxy service that will Wait on the epoll fd for Rx
        events from the sub-devices.
      o For each Rx event received the proxy service will
          - Retrieve the pointer to failsafe Rx queue that handles
            this subdevice Rx queue from the user info returned by the
            EAL.
          - Trigger a failsafe Rx event on that queue by writing to
            the event fd unless interrupts are disabled for that queue.
  * The failsafe pmd will also implement the rx_queue_intr_enable
  * and rx_queue_intr_disable routines that will enable and disable Rx
    interrupts respectively on both on the failsafe and its subdevices.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agonet/failsafe: register slaves Rx interrupts
Moti Haimovsky [Thu, 25 Jan 2018 16:19:31 +0000 (18:19 +0200)]
net/failsafe: register slaves Rx interrupts

This commit adds the following functionality to failsafe PMD:
* Register and unregister slaves Rx interrupts.
* Enable and Disable slaves Rx interrupts.
The interrupts events generated by the slaves are not handled in this
commit.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agonet/failsafe: register as Rx interrupt mode
Moti Haimovsky [Thu, 25 Jan 2018 16:19:30 +0000 (18:19 +0200)]
net/failsafe: register as Rx interrupt mode

This patch adds registering the Rx queues of the failsafe PMD with EAL
Rx interrupts subsystem.
Each failsafe RX queue is assigned with a unique eventfd and an enable
interrupts flag.
The PMD creates an interrupt vector containing the above eventfds and
Registers it with  EAL. The PMD also implements the Rx interrupts enable
and disable interface routines.
This patch does not implement the generation of Rx interrupts, so an
application can now wait for failsafe Rx interrupts but it will not
receive one.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agodoc: update MUSDK library build instructions
Tomasz Duszynski [Fri, 26 Jan 2018 08:02:25 +0000 (09:02 +0100)]
doc: update MUSDK library build instructions

By default both static and shared libraries should be created while
building MUSDK library. It turns out that this will not happen if
host parameter is not explicitly passed to the configure script.

Specifying host makes sure configure will detect support for shared
libraries.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agonet/mrvl: fix mbuf to bpool lookup
Natalie Samsonov [Fri, 26 Jan 2018 07:55:22 +0000 (08:55 +0100)]
net/mrvl: fix mbuf to bpool lookup

Since in DPDK 17.11 port type was changed from uint8_t to uint16_t
the MBUF_INVALID_PORT value became 0xffff but in mrvl_tx_pkt_burst()
when trying to lookup bpool using mbuf port, we check if the port
is invalid according to value 0xff. This causes segmentation fault.

Solution: since the valid port value cannot exceed RTE_MAX_ETHPORTS
(size of bpool lookup table) any other values consider as invalid so
the packet should be returned to DPDK pool.

Fixes: afb4d0d0bf91 ("net/mrvl: add Rx/Tx support")
Cc: stable@dpdk.org
Signed-off-by: Natalie Samsonov <nsamsono@marvell.com>
6 years agonet/bnxt: fix number of pools for RSS
Ajit Khaparde [Fri, 26 Jan 2018 17:32:00 +0000 (09:32 -0800)]
net/bnxt: fix number of pools for RSS

While using RSS, the pool count should be 1.

Fixes: 8103a57ab432a ("net/bnxt: handle Rx multi queue creation properly")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: add 100G speed detection
Ajit Khaparde [Fri, 26 Jan 2018 17:31:59 +0000 (09:31 -0800)]
net/bnxt: add 100G speed detection

When the driver is loaded on a 100G NIC, the port speed is not
displayed correctly. Parse the 100G speed before displaying it.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: support Rx/Tx queue start/stop
Ajit Khaparde [Fri, 26 Jan 2018 17:31:58 +0000 (09:31 -0800)]
net/bnxt: support Rx/Tx queue start/stop

Currently this is implemented entirely in the PMD as there is no
explicit support in the HW. Re-program the RSS Table without this queue
on stop and add it back to the table on start.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: check if MAC address is all zeros
Ajit Khaparde [Fri, 26 Jan 2018 17:31:57 +0000 (09:31 -0800)]
net/bnxt: check if MAC address is all zeros

In certain cases the MAC address of a port could be all zeros.
Catch it early, log a message and fail the initialization.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: register for more async events
Ajit Khaparde [Fri, 26 Jan 2018 17:31:56 +0000 (09:31 -0800)]
net/bnxt: register for more async events

Register for async events from the FW.
New events we are registering for include Link speed config changes,
PF driver unload and VF config change. Also log a message when the
async event arrives on the completion ring.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: use dynamic log type
Ajit Khaparde [Fri, 26 Jan 2018 17:31:55 +0000 (09:31 -0800)]
net/bnxt: use dynamic log type

This patch implements driver specific log type doing away with
usage of RTE_LOG() for logging.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/bnxt: fix size of Tx ring in HW
Ajit Khaparde [Fri, 26 Jan 2018 17:31:54 +0000 (09:31 -0800)]
net/bnxt: fix size of Tx ring in HW

During Tx ring allocation, the actual ring size configured in the HW
ends up being twice the number of txd parameter specified to the driver.
The power of 2 ring size wrongly adds a +1 while sending the ring
create command to the FW.

Fixes: 6eb3cc2294fd ("net/bnxt: add initial Tx code")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
6 years agonet/e1000: fix VF Rx interrupt enabling
Wenzhuo Lu [Wed, 24 Jan 2018 08:16:52 +0000 (16:16 +0800)]
net/e1000: fix VF Rx interrupt enabling

When using UIO, after enabling the interrupt to get the PF
message, VF RX queue interrupt is not working.
It's expected, as UIO doesn't support multiple interrupt.
So, PMD should not try to enable RX queue interrupt. Then
APP can know the RX queue interrupt is not enabled and only
choose the polling mode.

Fixes: 316f4f1adc2e ("net/igb: support VF mailbox interrupt for link up/down")
CC: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
6 years agonet/ixgbe: fix VF Rx interrupt enabling
Wenzhuo Lu [Wed, 24 Jan 2018 08:16:51 +0000 (16:16 +0800)]
net/ixgbe: fix VF Rx interrupt enabling

When using UIO, after enabling the interrupt to get the PF
message, VF RX queue interrupt is not working.
It's expected, as UIO doesn't support multiple interrupt.
So, PMD should not try to enable RX queue interrupt. Then
APP can know the RX queue interrupt is not enabled and only
choose the polling mode.

Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down")
CC: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
6 years agonet/i40e: fix VF Rx interrupt enabling
Wenzhuo Lu [Wed, 24 Jan 2018 08:16:50 +0000 (16:16 +0800)]
net/i40e: fix VF Rx interrupt enabling

When using UIO, after enabling the interrupt to get the PF
message, VF RX queue interrupt is not working.
It's expected, as UIO doesn't support multiple interrupt.
So, PMD should not try to enable RX queue interrupt. Then
APP can know the RX queue interrupt is not enabled and only
choose the polling mode.

Fixes: ae19955e7c86 ("i40evf: support reporting PF reset")
CC: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
6 years agonet/avf: fix VF Rx interrupt enabling
Wenzhuo Lu [Wed, 24 Jan 2018 08:16:53 +0000 (16:16 +0800)]
net/avf: fix VF Rx interrupt enabling

As UIO doesn't support multiple interrupt, and the interrupt
is occupied by the control plane. PMD should not try to enable
RX queue interrupt. Then APP can know the RX queue interrupt
is not enabled and only choose the polling mode.

Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
6 years agonet/virtio: fix typo in function name
Olivier Matz [Tue, 23 Jan 2018 15:54:43 +0000 (16:54 +0100)]
net/virtio: fix typo in function name

Fixes: c1f86306a026 ("virtio: add new driver")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agonet/virtio: rationalize queue flushing
Olivier Matz [Tue, 23 Jan 2018 15:54:42 +0000 (16:54 +0100)]
net/virtio: rationalize queue flushing

Use the same kind of loop than in virtio_free_queues() and factorize
common code.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agonet/virtio: fix memory leak when reinitializing device
Olivier Matz [Tue, 23 Jan 2018 15:54:41 +0000 (16:54 +0100)]
net/virtio: fix memory leak when reinitializing device

Free the previous queues and the attached mbufs before initializing new
ones.

The function virtio_dev_free_mbufs() is now called when reconfiguring the
device, so we also need to add a check to ensure that it won't crash for
uninitialized queues.

Cc: stable@dpdk.org
Fixes: 60e6f4707ef2 ("net/virtio: reinitialize device when configuring")

Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agonet/virtio: fix queue flushing with vector Rx enabled
Olivier Matz [Tue, 23 Jan 2018 15:54:40 +0000 (16:54 +0100)]
net/virtio: fix queue flushing with vector Rx enabled

When using vector Rx mode (use_simple_rx = 1), vq->vq_descx[] is not
kept up to date. To properly detach the mbufs in this case, browse
sw_ring[] instead, as it's done in virtqueue_rxvq_flush().

Since we need virtio_get_queue_type(), also move this function in
virtqueue.h as a static inline.

Fixes: fc3d66212fed ("virtio: add vector Rx")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agonet/virtio: fix Rx and Tx handler selection for ARM32
Samuel Gauthier [Thu, 14 Dec 2017 14:32:13 +0000 (15:32 +0100)]
net/virtio: fix Rx and Tx handler selection for ARM32

On arm32, we were always selecting the simple handler, but it is only
available if neon is present.

This is due to a typo in the name of the config option.
CONFIG_RTE_ARCH_ARM is for Makefiles. One should use RTE_ARCH_ARM.

Fixes: 2d7c37194ee4 ("net/virtio: add NEON based Rx handler")
Cc: stable@dpdk.org
Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agonet/virtio-user: fix crash as features change
Jianfeng Tan [Tue, 23 Jan 2018 09:52:43 +0000 (09:52 +0000)]
net/virtio-user: fix crash as features change

Since commit 59fe5e17d930 ("vhost: propagate set features handling error"),
vhost does not allow to set different features without reset.

The virtio-user driver fails to reset the device in below commit.

To fix, we send the reset message as stopping the device.

Fixes: c12a26ee209e ("net/virtio-user: fix not properly reset device")
Cc: stable@dpdk.org
Reported-by: Lei Yao <lei.a.yao@intel.com>
Reported-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agovhost: claim to support any layout feature
Zhihong Wang [Fri, 19 Jan 2018 19:02:50 +0000 (14:02 -0500)]
vhost: claim to support any layout feature

The VIRTIO_F_ANY_LAYOUT feature indicates the device accepts arbitrary
descriptor layouts. The vhost-user lib already supports it, but the
feature declaration is missing. This patch fixes the mismatch.

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agonet/ena: do not set Tx L4 offloads in Rx path
Rafal Kozik [Thu, 25 Jan 2018 15:27:43 +0000 (16:27 +0100)]
net/ena: do not set Tx L4 offloads in Rx path

Information about received packet type detected by NIC should be
stored in packet_type field of rte_mbuf. TX L4 offload flags should
not be set in RX path. Only fields that could be set in of_flags
during packet receiving are information if L4 and L3 checksum is
correct.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org
Reported-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Rafal Kozik <rk@semihalf.com>
Signed-off-by: Michal Krawczyk <mk@semihalf.com>
6 years agonet/mlx5: map UAR address around huge pages
Xueming Li [Thu, 25 Jan 2018 15:00:24 +0000 (23:00 +0800)]
net/mlx5: map UAR address around huge pages

Reserving the memory space for the UAR near huge pages helps to
**reduce** the cases where the secondary process cannot start. Those
pages being physical pages they must be mapped at the same virtual
address as in the primary process to have a
working secondary process.

As this remap is almost the latest being done by the processes
(libraries, heaps, stacks are already loaded), similar to huge pages,
there is **no guarantee** this mechanism will always work.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix memory region boundary checks
Shahaf Shuler [Thu, 25 Jan 2018 16:18:03 +0000 (18:18 +0200)]
net/mlx5: fix memory region boundary checks

Since commit f81ec748434b ("net/mlx5: fix memory region lookup") the
Memory Region (MR) are no longer overlaps.

Comparing the end address of the MR should be exclusive, otherwise two
contiguous MRs may cause wrong matching.

Fixes: f81ec748434b ("net/mlx5: fix memory region lookup")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix memory region cache last index
Shahaf Shuler [Thu, 25 Jan 2018 16:18:02 +0000 (18:18 +0200)]
net/mlx5: fix memory region cache last index

In case Memory Region cache is full, the new mempool will be
inserted in the last index of the array.

Update the last entry being hit to reflect it.

Fixes: b0b093845793 ("net/mlx5: use buffer address for LKEY search")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: warn for unsuccessful memory registration
Shahaf Shuler [Thu, 25 Jan 2018 16:18:01 +0000 (18:18 +0200)]
net/mlx5: warn for unsuccessful memory registration

Memory registration can fail, add the proper warning for such scenario
for it at least to be visible in debug mode.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: remove assert un-accessible from secondary process
Shahaf Shuler [Thu, 25 Jan 2018 16:18:00 +0000 (18:18 +0200)]
net/mlx5: remove assert un-accessible from secondary process

Verbs structs such as ibv_mr are not accessible from the secondary
process.

Choose to remove the assert in favor of performing more checks on the
critical data path.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix secondary process mempool registration
Shahaf Shuler [Thu, 25 Jan 2018 16:17:59 +0000 (18:17 +0200)]
net/mlx5: fix secondary process mempool registration

Secondary process is not allowed to register mempools on the flight.

The code will return invalid memory key for such case.

Fixes: 87ec44ce1651 ("net/mlx5: add operations for secondary process")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix memory region cache lookup
Shahaf Shuler [Thu, 25 Jan 2018 16:17:58 +0000 (18:17 +0200)]
net/mlx5: fix memory region cache lookup

The Memory Region (MR) cache contains pointers to mlx5_mr.
The MR cache indexes are filled when a new MR is created. As it is
possible for MR to be created on the flight, an extra validation must be
added to avoid segmentation fault.

Fixes: b0b093845793 ("net/mlx5: use buffer address for LKEY search")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix link state on device start
Shahaf Shuler [Thu, 25 Jan 2018 16:04:28 +0000 (18:04 +0200)]
net/mlx5: fix link state on device start

Following commit c7bf62255edf ("net/mlx5: fix handling link status event")
the link state must be up in order for the burst function to be set on
the device ops.

As the link may take time to move between down and up state it is
possible the rte_eth_dev_start call will return with wrong burst
function (either null or the empty burst function).

Fixing it by forcing the link to be up before returning from device
start. In case the link is still not up after 5 seconds fail the function.
In addition initialize the burst function on device probe to prevent
crashes before the link is up.

Fixes: c7bf62255edf ("net/mlx5: fix handling link status event")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/mlx5: fix reception of multiple MAC addresses
Nélio Laranjeiro [Thu, 25 Jan 2018 08:22:19 +0000 (09:22 +0100)]
net/mlx5: fix reception of multiple MAC addresses

When promiscuous is disabled, adding/removing a mac address is ignored
causing the packet to not be received or still being received corresponding
to the add or remove request.

Fixes: 272733b5ebfd ("net/mlx5: use flow to enable unicast traffic")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: use RSS table max size from config
Nélio Laranjeiro [Thu, 25 Jan 2018 08:19:46 +0000 (09:19 +0100)]
net/mlx5: use RSS table max size from config

Maximum indirection table size has not been updated accordingly.

Fixes: 7fe24446e946 ("net/mlx5: add device configuration structure")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agonet/mlx5: support IPv4 time-to-live filter
Nélio Laranjeiro [Tue, 23 Jan 2018 08:05:10 +0000 (09:05 +0100)]
net/mlx5: support IPv4 time-to-live filter

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix flow item validation
Nélio Laranjeiro [Tue, 23 Jan 2018 08:05:09 +0000 (09:05 +0100)]
net/mlx5: fix flow item validation

Two masks were compared instead of verifying the spec was included in the
supported mask.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix flow director conversion
Nélio Laranjeiro [Tue, 23 Jan 2018 08:05:08 +0000 (09:05 +0100)]
net/mlx5: fix flow director conversion

Flow director must provide the same spec and mask to be sure to be
validated.

Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")
Cc: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix missing RSS capability
Shahaf Shuler [Mon, 22 Jan 2018 20:52:14 +0000 (22:52 +0200)]
net/mlx5: fix missing RSS capability

The PMD was not reporting the supported RSS capabilities.

Fixes: 2f97422e7759 ("mlx5: support RSS hash update and get")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: use PCI address as port name
Yuanhan Liu [Mon, 22 Jan 2018 09:30:06 +0000 (17:30 +0800)]
net/mlx5: use PCI address as port name

It is suggested to use PCI BDF to identify a port for port addition
in OVS-DPDK. While mlx5 has its own naming style: name it by ib dev
name. This breaks the typical OVS DPDK use case and brings more puzzle
to the end users.

To fix it, this patch changes it to use PCI BDF as the name, too.
Also, a postfix " port %u" is added, just in case their might be more
than 1 port associated with a PCI device.

Signed-off-by: Yuanhan Liu <yliu@fridaylinux.org>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
6 years agonet/i40e: fix RSS flow action parser
Qi Zhang [Thu, 25 Jan 2018 05:10:33 +0000 (13:10 +0800)]
net/i40e: fix RSS flow action parser

Parameter action_flag is not used correctly in i40e_flow_parse_rss_action.
Also change it from point type to value type since it is not an output
parameter.

Fixes: ecad87d22383 ("net/i40e: move RSS to flow API")

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>