dpdk.git
6 years agodoc: fix testpmd commands for TM capabilities
Tomasz Duszynski [Sun, 28 Jan 2018 15:08:14 +0000 (16:08 +0100)]
doc: fix testpmd commands for TM capabilities

Command used for querying node or level capabilities requires
argument which specifies which set of capabilities to show.

Thus trying to show node/level capabilities using current
documentation will not work. Fix that by adding missing
arguments to command documentation.

Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoapp/testpmd: add meter to flow actions table
Tomasz Duszynski [Sun, 28 Jan 2018 11:58:39 +0000 (12:58 +0100)]
app/testpmd: add meter to flow actions table

Since METER action is supported by the testpmd application
suitable entry should exist in flow actions information table.

Without that testpmd will return error on adding a new flow to
the list of flows attached to a given port.

Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agoapp/testpmd: fix allocation check in TM config
Jasvinder Singh [Mon, 22 Jan 2018 15:45:53 +0000 (15:45 +0000)]
app/testpmd: fix allocation check in TM config

Calloc() function might returns NULL due to insufficient space. Therefore,
check for handling memory allocation failure is added.

Coverity issue: 257030
Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoapp/testpmd: fix allocation check in MTR parsing
Jasvinder Singh [Mon, 22 Jan 2018 15:15:04 +0000 (15:15 +0000)]
app/testpmd: fix allocation check in MTR parsing

Malloc() function might return NULL due to insufficient space. Therefore,
check for handling memory allocation failure is added.

Coverity issue: 257039
Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoapp/testpmd: move variables definition in source
Georgios Katsikas [Wed, 24 Jan 2018 11:53:36 +0000 (12:53 +0100)]
app/testpmd: move variables definition in source

This patch moves the definition of 3 variables in testpmd.h
into the respective .c file. The idea behind this move is
to allow external applications to compile against testpmd
without throwing compilation errors related to multiple
definition of variables.

Also, an extern dcb_q_mapping in testpmd.h is removed
since it appears that this variable is not defined
elsewhere in the tree.

Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
6 years agoapp/testpmd: change log level at run time
Elza Mathew [Mon, 22 Jan 2018 22:09:45 +0000 (14:09 -0800)]
app/testpmd: change log level at run time

Introduced a run time command to change the
log level for a given log type. Added the
necessary documentation.

Signed-off-by: Elza Mathew <elza.mathew@intel.com>
6 years agoapp/testpmd: fix port id size
Remy Horton [Fri, 19 Jan 2018 13:27:22 +0000 (13:27 +0000)]
app/testpmd: fix port id size

The word size of port_id is now 16 bits, but there were parsing directives
that assumed it was still of type UINT8, resulting in incorrect commandline
parse results.

Fixes: f14a210a65fe ("app: fix port id type")
Cc: stable@dpdk.org
Signed-off-by: Remy Horton <remy.horton@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoapp/testpmd: fix SW checksum calculation enabling
Jiayu Hu [Thu, 25 Jan 2018 02:13:44 +0000 (10:13 +0800)]
app/testpmd: fix SW checksum calculation enabling

In current design, we can't enable SW checksum calculation
for the devices which don't have checksum offloading abilities
via the command "csum set ip|tcp|udp|sctp|outer-ip sw <port_id>".
But SW checksum calculation shouldn't depend on HW offloading
abilities. This patch is to fix this issue.

Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Reviewed-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agoapp/testpmd: disable Rx VLAN offloads by default
Moti Haimovsky [Wed, 31 Jan 2018 17:32:03 +0000 (19:32 +0200)]
app/testpmd: disable Rx VLAN offloads by default

Removed the hardcoded preconfigured Rx VLAN offload configuration
from testpmd and changed the Rx offload command line parameters from
disable to enable.

It has been decided by the Technical Board that testers who wish to
use these offloads will now have to explicitly write them in the
command-line when running testpmd.
The agreement is to keep two exceptions enabled by default in 18.02:
Rx CRC strip and Tx fast free.

Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
  commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
  commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.

Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoapp/testpmd: fix invalid port detach
Matan Azrad [Tue, 30 Jan 2018 14:13:40 +0000 (14:13 +0000)]
app/testpmd: fix invalid port detach

Using registration to all ports includes also the ports which should not
be used by the application.

It is nice to print each port event by testpmd but in case of RMV
event, testpmd tries to detach the port and this case is problematic
when the port should not be used by the application.

Check the port validation before detach API calling.

Fixes: 4fb82244b394 ("app/testpmd: extend event printing")

Signed-off-by: Matan Azrad <matan@mellanox.com>
6 years agoapp/testpmd: fix port validation
Matan Azrad [Tue, 30 Jan 2018 14:13:39 +0000 (14:13 +0000)]
app/testpmd: fix port validation

rte_eth_dev_is_valid_port() API validates each valid port from ethdev
point of view and may validate ports which should not be used by the
application.

Testpmd should use only the ports available through the
RTE_ETH_FOREACH_DEV iterator.

Replace rte_eth_dev_is_valid_port() usage by RTE_ETH_FOREACH_DEV
iterator usage for testpmd ports validation.

Fixes: 7d89b2610353 ("app/testpmd: use ethdev iterator to list devices")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
6 years agonet/failsafe: use ownership mechanism for slaves
Matan Azrad [Mon, 22 Jan 2018 16:38:22 +0000 (16:38 +0000)]
net/failsafe: use ownership mechanism for slaves

Fail-safe PMD sub devices management is based on ethdev port mechanism.
So, the sub-devices management structures are exposed to other DPDK
entities which may use them in parallel to fail-safe PMD.

Use the new port ownership mechanism to avoid multiple managments of
fail-safe PMD sub-devices.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agonet/failsafe: free port by dedicated function
Matan Azrad [Mon, 22 Jan 2018 16:38:21 +0000 (16:38 +0000)]
net/failsafe: free port by dedicated function

Call dedicated ethdev API to free port in remove time as was done in
other fail-safe places.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoethdev: synchronize port allocation
Matan Azrad [Mon, 22 Jan 2018 16:38:20 +0000 (16:38 +0000)]
ethdev: synchronize port allocation

Ethernet port allocation was not thread safe, means 2 threads which tried
to allocate a new port at the same time might get an identical port
identifier and caused to memory overwrite.
Actually, all the port configurations were not thread safe from ethdev
point of view.

The port ownership mechanism added to the ethdev is a good point to
redefine the synchronization rules in ethdev:

1. The port allocation and port release synchronization will be
   managed by ethdev.
2. The port usage synchronization will be managed by the port owner.
3. The port ownership synchronization will be managed by ethdev.

Add port allocation synchronization to complete the new rules.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoethdev: add port ownership
Matan Azrad [Mon, 22 Jan 2018 16:38:19 +0000 (16:38 +0000)]
ethdev: add port ownership

The ownership of a port is implicit in DPDK.
Making it explicit is better from the next reasons:
1. It will define well who is in charge of the port usage synchronization.
2. A library could work on top of a port.
3. A port can work on top of another port.

Also in the fail-safe case, an issue has been met in testpmd.
We need to check that the application is not trying to use a port which
is already managed by fail-safe.

A port owner is built from owner id(number) and owner name(string) while
the owner id must be unique to distinguish between two identical entity
instances and the owner name can be any name.
The name helps to logically recognize the owner by different DPDK
entities and allows easy debug.
Each DPDK entity can allocate an owner unique identifier and can use it
and its preferred name to owns valid ethdev ports.
Each DPDK entity can get any port owner status to decide if it can
manage the port or not.

The mechanism is synchronized for both the primary process threads and
the secondary processes threads to allow secondary process entity to be
a port owner.

Add a synchronized ownership mechanism to DPDK Ethernet devices to
avoid multiple management of a device by different DPDK entities.

The current ethdev internal port management is not affected by this
feature.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoethdev: fix port id allocation
Matan Azrad [Mon, 22 Jan 2018 16:38:18 +0000 (16:38 +0000)]
ethdev: fix port id allocation

rte_eth_dev_find_free_port() found a free port by state checking.
The state field are in local process memory, so other DPDK processes
may get the same port ID because their local states may be different.

Replace the state checking by the ethdev port name checking,
so, if the name is an empty string the port ID will be detected as
unused.

Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model")
Cc: stable@dpdk.org
Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoethdev: fix port data reset timing
Matan Azrad [Mon, 22 Jan 2018 16:38:17 +0000 (16:38 +0000)]
ethdev: fix port data reset timing

rte_eth_dev_data structure is allocated per ethdev port and can be
used to get a data of the port internally.

rte_eth_dev_attach_secondary tries to find the port identifier using
rte_eth_dev_data name field comparison and may get an identifier of
invalid port in case of this port was released by the primary process
because the port release API doesn't reset the port data.

So, it will be better to reset the port data in release time instead of
allocation time.

Move the port data reset to the port release API.

Fixes: d948f596fee2 ("ethdev: fix port data mismatched in multiple process model")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agonet/tap: fix build on ARM32
Ophir Munk [Wed, 31 Jan 2018 16:03:58 +0000 (16:03 +0000)]
net/tap: fix build on ARM32

This commit adds eBPF system call definitions for ARM architecture.
Old Linux header files may not define eBPF system call numbers.
In order to successful compile eBPF on all Linux platforms - the
missing ARM system call definition is explicitly added.

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

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
6 years agocrypto/scheduler: fix strncpy
Pablo de Lara [Mon, 29 Jan 2018 09:22:02 +0000 (09:22 +0000)]
crypto/scheduler: fix strncpy

The coverity issue was not completely fixed, since strncpy
should not be called with max length.
Instead, snprintf is used as a safer option.

Coverity issue: 143431
Fixes: d040aca67170 ("crypto/scheduler: fix strings not null terminated")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agoexamples/bbdev: fix unchecked return of stats
Amr Mokhtar [Wed, 31 Jan 2018 14:40:25 +0000 (14:40 +0000)]
examples/bbdev: fix unchecked return of stats

Added a check on rte_bbdev_stats_get() return before
printing out the statistics results.

Coverity issue: 257018
Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agoexamples/bbdev: fix memory leak in stats print
Amr Mokhtar [Wed, 31 Jan 2018 14:30:29 +0000 (14:30 +0000)]
examples/bbdev: fix memory leak in stats print

xstats and xstats_names buffers were allocated for
the purpose of printing eth_xstats, but were not
freed before exit.
A fix is added to free before exit points.

Coverity issue: 257013
Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agoexamples/bbdev: fix out-of-bounds access in MAC print
Amr Mokhtar [Wed, 31 Jan 2018 14:19:34 +0000 (14:19 +0000)]
examples/bbdev: fix out-of-bounds access in MAC print

eth_address was improperly accessed in bbdev example
app, this patch removes the use of port_id, it is
irrelevant here.

Coverity issue: 257021
Fixes: 1ffee690eaa1 ("examples/bbdev: add sample app")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agoapp/bbdev: fix unchecked return value
Amr Mokhtar [Wed, 31 Jan 2018 13:54:28 +0000 (13:54 +0000)]
app/bbdev: fix unchecked return value

add check for rte_bbdev_callback_register() retun

Coverity issue: 257027
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agoapp/bbdev: fix out-of-bounds read in vector array
Amr Mokhtar [Wed, 31 Jan 2018 13:46:21 +0000 (13:46 +0000)]
app/bbdev: fix out-of-bounds read in vector array

Coverity issue: 257033
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agoapp/bbdev: fix division by zero in latency measure
Amr Mokhtar [Wed, 31 Jan 2018 12:56:21 +0000 (12:56 +0000)]
app/bbdev: fix division by zero in latency measure

check that iter > 0 before division

Coverity issue: 257027, 257038, 257014
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agoapp/bbdev: fix null termination in argument parsing
Amr Mokhtar [Wed, 31 Jan 2018 12:40:40 +0000 (12:40 +0000)]
app/bbdev: fix null termination in argument parsing

use snprintf instead of strncpy to ensure null termination when
copying test_vector_filename from cmd arguments.

Coverity issue: 257001
Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agodoc: add rawdev library guide and doxygen page
Shreyansh Jain [Wed, 31 Jan 2018 09:13:18 +0000 (14:43 +0530)]
doc: add rawdev library guide and doxygen page

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agotest: enable rawdev skeleton test
Shreyansh Jain [Wed, 31 Jan 2018 09:13:17 +0000 (14:43 +0530)]
test: enable rawdev skeleton test

Skeleton rawdevice test cases are part of driver layer. This patch
allows test cases to be executed using 'rawdev_autotest' command
in test framework.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agoraw/skeleton: add test cases
Shreyansh Jain [Wed, 31 Jan 2018 09:13:16 +0000 (14:43 +0530)]
raw/skeleton: add test cases

Patch introduces rawdev unit testcase for validation against the
Skeleton rawdev dummy PMD implementation.

Test cases are added along with the skeleton driver implementation.
It can be enabled by using vdev argument to any DPDK binary:

  --vdev="rawdev_skeleton,self_test=1"

In case 'self_test=1' is not provided, autotest doesn't execute the
test cases but the vdev is still available for application use.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agoraw/skeleton: introduce skeleton rawdev driver
Shreyansh Jain [Wed, 31 Jan 2018 09:13:15 +0000 (14:43 +0530)]
raw/skeleton: introduce skeleton rawdev driver

Skeleton rawdevice driver, on the lines of eventdev skeleton, is for
showcasing the rawdev library. This driver implements some of the
operations of the library based on which a test module can be
developed.

Design of skeleton involves a virtual device which is plugged into
VDEV bus on initialization.

Also, enable compilation of rawdev skeleton driver.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agorawdev: add self test
Shreyansh Jain [Wed, 31 Jan 2018 09:13:14 +0000 (14:43 +0530)]
rawdev: add self test

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agorawdev: add firmware management
Shreyansh Jain [Wed, 31 Jan 2018 09:13:13 +0000 (14:43 +0530)]
rawdev: add firmware management

Some generic operations for firmware management can loading, unloading,
starting, stopping and querying firmware of a device.

This patch adds support for such generic operations.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agorawdev: add extended stats
Shreyansh Jain [Wed, 31 Jan 2018 09:13:12 +0000 (14:43 +0530)]
rawdev: add extended stats

Generic rawdev library cannot define a pre-defined set of stats
for devices which are yet to be defined.

This patch introduces the xstats support for rawdev so that any
implementation can create its own statistics.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agorawdev: add buffer stream IO
Shreyansh Jain [Wed, 31 Jan 2018 09:13:11 +0000 (14:43 +0530)]
rawdev: add buffer stream IO

Introduce handlers for raw buffer enqueue and dequeue. A raw buffer
is essentially a void object which is transparently passed via the
library onto the driver.

Using a context field as argument, any arbitrary meta information
can be passed by application to the driver/implementation. This can
be any data on which driver needs to define the operation semantics.
For example, passing along a queue identifier can suggest the driver
the queue context to perform I/O on.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agorawdev: add attribute get and set
Shreyansh Jain [Wed, 31 Jan 2018 09:13:10 +0000 (14:43 +0530)]
rawdev: add attribute get and set

A rawdevice can have various attributes. This patch introduce support
for transparently setting attribute value or getting current attribute
state. This is done by allowing an opaque set of key and value to be
passed through rawdev library.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agorawdev: introduce raw device library
Shreyansh Jain [Wed, 31 Jan 2018 09:13:09 +0000 (14:43 +0530)]
rawdev: introduce raw device library

Each device in DPDK has a type associated with it - ethernet, crypto,
event etc. This patch introduces 'rawdevice' which is a generic
type of device, not currently handled out-of-the-box by DPDK.

A device which can be scanned on an installed bus (pci, fslmc, ...)
or instantiated through devargs, can be interfaced using
standardized APIs just like other standardized devices.

This library introduces an API set which can be plugged on the
northbound side to the application layer, and on the southbound side
to the driver layer.

The APIs of rawdev library exposes some generic operations which can
enable configuration and I/O with the raw devices. Using opaque
data (pointer) as API arguments, library allows a high flexibility
for application and driver implementation.

This patch introduces basic device operations like start, stop, reset,
queue and info support.
Subsequent patches would introduce other operations like buffer
enqueue/dequeue and firmware support.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/dpaa: further push mode optimizations
Nipun Gupta [Tue, 23 Jan 2018 12:27:07 +0000 (17:57 +0530)]
net/dpaa: further push mode optimizations

This patch supports batch processing of multiple packets
in the Rx side

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: check portal presence in the caller function
Nipun Gupta [Tue, 23 Jan 2018 12:27:06 +0000 (17:57 +0530)]
bus/dpaa: check portal presence in the caller function

In the I/O path we were calling rte_dpaa_portal_init which
internally checks if a portal is affined to the core.
But this lead to calling of that non-static API in every call.

Instead check the portal affinity in the caller itself for
performance reasons

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/dpaa: use address translation optimizations
Hemant Agrawal [Tue, 23 Jan 2018 12:27:05 +0000 (17:57 +0530)]
net/dpaa: use address translation optimizations

Use the optimized routine for phy to virt conversion,
when the mempool is allocated from physical contiguous memory.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: fix port order shuffling
Shreyansh Jain [Tue, 23 Jan 2018 12:27:04 +0000 (17:57 +0530)]
bus/dpaa: fix port order shuffling

While scanning for devices, the order in which devices appear is
different as compared to MAC sequence.
This can cause confusion for users and automated scripts.
This patch create a sorted list of devices.

Fixes: 919eeaccb2ba ("bus/dpaa: introduce NXP DPAA bus driver skeleton")
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agomempool/dpaa: fix address translation optimization
Hemant Agrawal [Tue, 23 Jan 2018 12:27:03 +0000 (17:57 +0530)]
mempool/dpaa: fix address translation optimization

Fixes: 83a4f267f2e3 ("mempool/dpaa: optimize phy to virt conversion")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: allocate qman portals in thread safe manner
Nipun Gupta [Tue, 23 Jan 2018 12:27:02 +0000 (17:57 +0530)]
bus/dpaa: allocate qman portals in thread safe manner

Fixes: 9d32ef0f5d61 ("bus/dpaa: support creating dynamic HW portal")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: check flag in qman multi enqueue
Nipun Gupta [Tue, 23 Jan 2018 12:27:01 +0000 (17:57 +0530)]
bus/dpaa: check flag in qman multi enqueue

A caller may/may not pass the flags in qman enqueue multi API.
This patch adds a check on that flag and only accesses it if passed
by the caller.

Fixes: 43797e7b4774 ("bus/dpaa: support event dequeue and consumption")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoeal/arm64: fix instrinsic for GCC < 4.9
Yongseok Koh [Wed, 31 Jan 2018 00:07:08 +0000 (16:07 -0800)]
eal/arm64: fix instrinsic for GCC < 4.9

vceqzq_u32() is being used by mlx5 PMD but added since gcc 4.9.

Fixes: 570acdb1da8a ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agovhost: fix build with old kernels
Zhihong Wang [Wed, 31 Jan 2018 14:20:57 +0000 (09:20 -0500)]
vhost: fix build with old kernels

This patch fixes compile failure with old kernels which have no
VIRTIO_F_ANY_LAYOUT defined.

Fixes: 5a8bb6e9020f ("vhost: claim to support any layout feature")

Signed-off-by: Zhihong Wang <zhihong.wang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoevent/opdl: fix dereference before null check
Liang Ma [Wed, 24 Jan 2018 15:05:51 +0000 (15:05 +0000)]
event/opdl: fix dereference before null check

Coverity issue: 257022
Fixes: 4236ce9bf5bf ("event/opdl: add OPDL ring infrastructure library")

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
6 years agoevent/opdl: fix resource leak
Liang Ma [Wed, 24 Jan 2018 15:05:50 +0000 (15:05 +0000)]
event/opdl: fix resource leak

Coverity issue: 257004
Fixes: d548ef513cd7 ("event/opdl: add unit tests")

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
6 years agonet/dpaa2: prefetch the annotation in event processing
Nipun Gupta [Tue, 23 Jan 2018 14:17:53 +0000 (19:47 +0530)]
net/dpaa2: prefetch the annotation in event processing

This patch adds software prefetching of the annotation which is
accessed by the driver to fetch the parsing results. The changes
also include as many instructions in between prefetching memory
and using it.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
6 years agoevent/dpaa2: prefetch the next DQRR entry
Nipun Gupta [Tue, 23 Jan 2018 14:17:52 +0000 (19:47 +0530)]
event/dpaa2: prefetch the next DQRR entry

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
6 years agobus/fslmc: add function to prefetch next DQRR entry
Nipun Gupta [Tue, 23 Jan 2018 14:17:51 +0000 (19:47 +0530)]
bus/fslmc: add function to prefetch next DQRR entry

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoapp/eventdev: fix port dequeue depth configuration
Pavan Nikhilesh [Wed, 24 Jan 2018 09:30:33 +0000 (15:00 +0530)]
app/eventdev: fix port dequeue depth configuration

The port dequeue depth value has to be compared against the maximum
allowed dequeue depth reported by the event drivers.

Fixes: 3617aae53f92 ("app/eventdev: add event Rx adapter setup")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoevent/sw: support dynamic logging
Harry van Haaren [Thu, 25 Jan 2018 09:46:22 +0000 (09:46 +0000)]
event/sw: support dynamic logging

This commit enables dynamic logging with the SW pmd.
The string "pmd.event.sw" is used to change the verbosity
of the logging output, as per the newly defined log naming.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agonet/vmxnet3: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:10 +0000 (09:01 +0000)]
net/vmxnet3: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/virtio: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:09 +0000 (09:01 +0000)]
net/virtio: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/thunderx: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:08 +0000 (09:01 +0000)]
net/thunderx: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Note that the "nicvf" term has been replaced with "thunderx",
as the naming scheme defines that a PMD name should be the
same as the directory that it lives in: drivers/net/thunderx

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/qede: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:07 +0000 (09:01 +0000)]
net/qede: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/nfp: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:06 +0000 (09:01 +0000)]
net/nfp: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/liquidio: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:05 +0000 (09:01 +0000)]
net/liquidio: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Note that the "lio" term has been replaced with "liquidio",
as the naming scheme defines that a PMD name should be the
same as the directory that it lives in: drivers/net/liquidio

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/ixgbe: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:04 +0000 (09:01 +0000)]
net/ixgbe: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/i40e: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:03 +0000 (09:01 +0000)]
net/i40e: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/fm10k: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:02 +0000 (09:01 +0000)]
net/fm10k: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/enic: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:01 +0000 (09:01 +0000)]
net/enic: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Hyong Youb Kim <hyonkim@cisco.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/ena: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:01:00 +0000 (09:01 +0000)]
net/ena: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/e1000: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:00:59 +0000 (09:00 +0000)]
net/e1000: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/avp: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:00:58 +0000 (09:00 +0000)]
net/avp: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/avf: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:00:57 +0000 (09:00 +0000)]
net/avf: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoevent/opdl: align dynamic log name with standard
Harry van Haaren [Thu, 25 Jan 2018 09:00:54 +0000 (09:00 +0000)]
event/opdl: align dynamic log name with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Liang Ma <liang.j.ma@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodrivers/octeontx: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:00:55 +0000 (09:00 +0000)]
drivers/octeontx: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodrivers/bbdev: align dynamic log names with standard
Harry van Haaren [Thu, 25 Jan 2018 09:00:56 +0000 (09:00 +0000)]
drivers/bbdev: align dynamic log names with standard

This commit aligns the names for dynamic logging with
the newly defined logging format.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodoc: describe dynamic logging format
Harry van Haaren [Thu, 25 Jan 2018 09:00:53 +0000 (09:00 +0000)]
doc: describe dynamic logging format

This commit adds a section to the DPDK style guide to set
the dynamic logging formatting naming scheme.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobus/fslmc: fix DPCI compare in scan
Shreyansh Jain [Tue, 30 Jan 2018 15:06:21 +0000 (20:36 +0530)]
bus/fslmc: fix DPCI compare in scan

Incorrect string length was being compared while scanning DPCI object.

Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/dpaa2: fix BPID offset
Hemant Agrawal [Tue, 30 Jan 2018 15:06:20 +0000 (20:36 +0530)]
net/dpaa2: fix BPID offset

Fixes: 774e9ea91992 ("net/dpaa2: add support for multi seg buffers")
Fixes: d2ef05d5c13e ("net/dpaa2: optimize Rx/Tx path")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoconfig: reduce DPAA2 mbuf headroom size to 128
Hemant Agrawal [Tue, 30 Jan 2018 15:06:19 +0000 (20:36 +0530)]
config: reduce DPAA2 mbuf headroom size to 128

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoeal: fix default mempool ops
Pavan Nikhilesh [Tue, 30 Jan 2018 15:57:47 +0000 (21:27 +0530)]
eal: fix default mempool ops

If '--mbuf-pool-ops' is not passed to EAL as command line argument then
rte_eal_mbuf_default_mempool_ops will return NULL.

Instead check if internal_config.user_mbuf_pool_ops_name is NULL and
return compile time RTE_MBUF_DEFAULT_MEMPOOL_OPS.

Fixes: 8b0f7f43413 ("mbuf: maintain user and compile time mempool ops name")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
6 years agotest/debug: fix EAL cleanup when forking
Harry van Haaren [Tue, 30 Jan 2018 18:26:09 +0000 (18:26 +0000)]
test/debug: fix EAL cleanup when forking

Before this patch, the debug_autotest would call fork(),
call rte_panic() or rte_exit() in the child process, and
examine the return code to verify that rte_panic() and
rte_exit() were correctly reporting failures.

With the inclusion of the rte_eal_cleanup() patch, rte_exit()
was modified to cleanly tear-down EAL allocations. Currently
only one library (service cores) is allocated by EAL at startup
and should be cleaned up. This library has a check on a normal
(non-hugepage) variable to protect against double cleanup. The
service cores finalize() function itself frees back hugepage mem.

Given the fork() approach from the unit test, and the fact that
the double-free check is on an ordinary variable, causes multiple
child processed (fork()-ed from the unit-test runner) to attempt
to free the huge-page memory multiple times. The variable to
protect against double-cleanup was not effective, as the fork()
would restore it to show initialized in the next child.

The solution is to call rte_service_finalize() *before* calling
fork(), which results in the service cores double-cleanup variable
to be zero before the fork(), and hence the child processes never
free the hugepage service-cores memory (correct behavior, as the
unit-test suite is still running, and owns the hugepages).

Fixes: aec9c13c5257 ("eal: add function to release internal resources")

Reported-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agomk: support renamed Makefile in external project
Marko Kovacevic [Mon, 22 Jan 2018 10:59:05 +0000 (10:59 +0000)]
mk: support renamed Makefile in external project

The build system made a recursive call to "make" after
creating the build directory. This recursive call used
the hard-coded filename "Makefile", which prevented
builds from working if the file was renamed and make
called using "make -f". Taking the filename from
MAKEFILES_LIST make variable fixes this.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
6 years agotest: build more test cases with meson
Bruce Richardson [Tue, 30 Jan 2018 14:41:26 +0000 (14:41 +0000)]
test: build more test cases with meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agodrivers: improve pmdinfo generation with meson
Bruce Richardson [Thu, 25 Jan 2018 11:14:43 +0000 (11:14 +0000)]
drivers: improve pmdinfo generation with meson

Since meson 0.44, changing any file inside a PMD directory (quite
correctly) triggers a full re-run of meson on build, rather than an
incremental build as with earlier versions. This rerun is needed because
we use "grep" in meson to search for files on which to run pmdinfogen, and
changing any of those files means that grep and, therefore meson, needs to
be rerun. [Previous versions of meson did not track this dependency on the
grep command, and so did incremental builds only.]

If, however, we take advantage of pmdinfogen's ability to use stdin and
stdout instead of files, we can instead use a shell script to process an
entire static archive and generate a single .c file from it. This
eliminates the need for grep, and means that changes to a PMD file only
need an incremental build - a significant time saving.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodoc: add meson build to release notes
Bruce Richardson [Mon, 22 Jan 2018 15:14:13 +0000 (15:14 +0000)]
doc: add meson build to release notes

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agobuild: set compat lib as universal dependency
Bruce Richardson [Mon, 22 Jan 2018 15:42:54 +0000 (15:42 +0000)]
build: set compat lib as universal dependency

By making "compat" lib (which consists of a header only) a dependency of
the EAL, we make the header file available to all other libs, drivers and
apps, and thereby make it less work to do ABI versioning.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: support vendor specific ARM cross builds
Pavan Nikhilesh [Mon, 22 Jan 2018 15:26:31 +0000 (20:56 +0530)]
build: support vendor specific ARM cross builds

Add various vendor specific cross build targets.
This can be verified by using linaro toolchain and running

   meson build --cross-file config/arm/arm64_<cpu>_<platform>_<compiler>

In future more cross build targets can be added.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agobuild: detect micro-arch on ARM
Pavan Nikhilesh [Mon, 22 Jan 2018 15:26:30 +0000 (20:56 +0530)]
build: detect micro-arch on ARM

Added support for detecting march and mcpu by reading midr_el1 register.
The implementer, primary part number values read can be used to figure
out the underlying arm cpu.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agobuild: support ARM with meson
Bruce Richardson [Mon, 22 Jan 2018 15:26:29 +0000 (20:56 +0530)]
build: support ARM with meson

Add files to enable compiling for ARM native/cross builds.
This can be tested by doing a cross-compile for armv8-a type using
the linaro gcc toolchain.

        meson arm-build --cross-file aarch64_cross.txt
        ninja -C arm-build

where aarch64_cross.txt contained the following

        [binaries]
        c = 'aarch64-linux-gnu-gcc'
        cpp = 'aarch64-linux-gnu-cpp'
        ar = 'aarch64-linux-gnu-ar'

        [host_machine]
        system = 'linux'
        cpu_family = 'aarch64'
        cpu = 'armv8-a'
        endian = 'little'

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agotest: build more test cases with meson
Kevin Laatz [Wed, 20 Dec 2017 12:06:21 +0000 (12:06 +0000)]
test: build more test cases with meson

This commit adds most of the remaining tests to the meson build.
They can be run using test binary as normal, or via "ninja test".

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
6 years agoapp/eventdev: build with meson
Pavan Nikhilesh [Fri, 19 Jan 2018 18:15:21 +0000 (23:45 +0530)]
app/eventdev: build with meson

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoevent/octeontx: build with meson
Pavan Nikhilesh [Fri, 19 Jan 2018 18:15:20 +0000 (23:45 +0530)]
event/octeontx: build with meson

Add Cavium octeontx to meson build and change order of drivers built
from event->mempool->net to mempool->net->event to resolve dependency.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodrivers/net: build Cavium NIC PMDs with meson
Pavan Nikhilesh [Fri, 19 Jan 2018 18:15:19 +0000 (23:45 +0530)]
drivers/net: build Cavium NIC PMDs with meson

Add Cavium octeontx and thunder nicvf to meson build infrastructure.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agomempool/octeontx: build with meson
Pavan Nikhilesh [Fri, 19 Jan 2018 18:15:18 +0000 (23:45 +0530)]
mempool/octeontx: build with meson

Add octeontx hardware mempool driver to meson build.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodoc: add instructions on build using meson
Bruce Richardson [Wed, 10 Jan 2018 15:24:57 +0000 (15:24 +0000)]
doc: add instructions on build using meson

Add a document describing how to configure, build and install DPDK using
meson and ninja. Document includes references to official installation docs
using make, and points out the experimental nature of the build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agotest: build app with meson as dpdk-test
Harry van Haaren [Wed, 20 Dec 2017 11:16:32 +0000 (11:16 +0000)]
test: build app with meson as dpdk-test

This patch enables the test/test app to be built. It also adds
the test binary to be a meson-test, which allows the meson test
infrastructure to be used to run tests.

Tests are listed using the same test binary, however each test
sets a different DPDK_TEST environment variable. The string contents
of this DPDK_TEST env var is entered in the command line interface.
As such, the familiar test names such as "ring_perf_autotest" etc
are valid tests to run using this meson test infrastructure.

Note that the tests are run serially, given that we cannot run
multiple primary processes at a time. As each test must initialize
EAL this takes some time depending on the number of hugepages.
In future, we could improve this to run multiple tests from one
EAL init, but it is out of scope for this patchset.

Finally, an option to build the tests is added to the meson build
options. When disabled, the unit test code in test/test is not
compiled. The default is set to 'true'. To disable, run:

$ meson configure -Dtests=false

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agonet/pcap: fix cross compilation with meson
Bruce Richardson [Fri, 15 Dec 2017 17:19:26 +0000 (17:19 +0000)]
net/pcap: fix cross compilation with meson

The detection of pcap as a dependency involves invoking pcap-config to get
parameters - something not possible in a cross-compilation environment.
Therefore we need to just look for the presence of the library in a
cross-compilation environment and assume if the library is present we can
compile and link against it.

Fixes: efd5d1a8d8dd ("drivers/net: build some vdev PMDs with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: remove architecture flag as default C flag
Bruce Richardson [Fri, 15 Dec 2017 17:12:43 +0000 (17:12 +0000)]
build: remove architecture flag as default C flag

Any flags added to the project args are automatically added to all builds,
both native and cross-compiled. This is not what we want for the -march
flag as a valid -march for the cross-compile is not valid for pmdinfogen
which is a native-build tool.

Instead we store the march flag as a variable, and add it to the default
cflags for all libs, drivers, examples, etc. This will allow pmdinfogen to
compile successfully in a cross-compilation environment.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: replace license text with SPDX tag
Bruce Richardson [Mon, 18 Dec 2017 15:56:25 +0000 (15:56 +0000)]
build: replace license text with SPDX tag

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Luca Boccassi <bluca@debian.org>
6 years agoexamples: enable linking both static and shared
Bruce Richardson [Thu, 7 Dec 2017 15:51:41 +0000 (15:51 +0000)]
examples: enable linking both static and shared

Since the DPDK build now includes both static and shared libraries, we need
a new way to enable building the examples using either method from the one
installation. To do this, we add in a default "shared" target, and a
separate "static" target which links in the DPDK static libraries. In both
cases, the final application name is symlinked to the last-built static or
shared target, with both binaries able to co-exist in the build directory.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: symlink drivers to library directory
Bruce Richardson [Wed, 6 Dec 2017 10:45:48 +0000 (10:45 +0000)]
build: symlink drivers to library directory

With the introduction of bus drivers, we now have a situation where
driver libraries will start to depend upon each other. Because of this,
the driver libs need to be discoverable by the dynamic loader.

There are three options to fix this:
1. Force the user to put the $libdir/dpdk/drivers folder into their
library path.
2. Move all libraries from drivers sub-directory to $libdir.
3. Symlink all libraries from the subfolder to the main library dir.

Option 1 is not great for usability or distro packaging, and option 2
means that we can't have EAL load all drivers from a known path
automatically (as it would error out on non-PMD libs), so option 3 was
chosen as the best fix. The only downside is that on a "ninja uninstall"
the symlinks are not removed, as they are unknown to meson/ninja.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: change default library type to static
Bruce Richardson [Mon, 4 Dec 2017 15:00:33 +0000 (15:00 +0000)]
build: change default library type to static

Now that we always build both static and shared libraries, the default
library type only applies to apps and examples. To avoid issues with
paths when doing actual development with DPDK, change the default app
build to static. This makes sure that testpmd, and any examples built as
part of a development build, are runnable without being installed.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agobuild: build as both static and shared libs
Bruce Richardson [Fri, 3 Nov 2017 17:27:32 +0000 (17:27 +0000)]
build: build as both static and shared libs

This patch changes the build process to group all .o files for a driver or
library into a static archive first, and then link the .o files together
into a shared library. This eliminates the need for separate static or
shared object builds when packaging, for instance.

The "default_library" configuration option now only affects the apps and
examples, which are either linked against the static or shared library
versions depending on the value of the option.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
6 years agoeal: fix list of source files in meson build
Bruce Richardson [Fri, 3 Nov 2017 17:26:45 +0000 (17:26 +0000)]
eal: fix list of source files in meson build

Header files should not be listed in the sources list.

Fixes: 844514c73569 ("eal: build with meson")

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