dpdk.git
5 years agonet/qede: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:18 +0000 (16:03 +0100)]
net/qede: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘transceiver_type’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  switch (transceiver_type) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
5 years agonet/ifc: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:17 +0000 (16:03 +0100)]
net/ifc: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘features’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if (RTE_VHOST_NEED_LOG(features)) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
5 years agonet/i40e: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:16 +0000 (16:03 +0100)]
net/i40e: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘filter_idx’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  PMD_DRV_LOG(INFO, "Added port %d with AQ command with index %d",

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
5 years agonet/e1000: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:15 +0000 (16:03 +0100)]
net/e1000: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘link’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if (link) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
5 years agonet/dpaa2: fix possible use of uninitialized vars
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:14 +0000 (16:03 +0100)]
net/dpaa2: fix possible use of uninitialized vars

This patch fixes 'maybe-uninitialized' warnings reported by compiler
when using LTO.

Compiler warning pointing to this error (with LTO enabled):
error: ‘kg_cfg.extracts[0].masks[0].mask’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
    extr->masks[j].mask = cfg->extracts[i].masks[j].mask;

Fixes: 16bbc98a3e63 ("bus/fslmc: update MC to 10.3.x")
Cc: stable@dpdk.org
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
5 years agotest: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:13 +0000 (16:03 +0100)]
test: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘stats.greatest_free_size’ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
  return len - overhead;

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agoevent/octeontx2: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:12 +0000 (16:03 +0100)]
event/octeontx2: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘chunk’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
   bkt->current_chunk = (uintptr_t)chunk;

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
5 years agoapp/eventdev: clean LTO warnings
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:11 +0000 (16:03 +0100)]
app/eventdev: clean LTO warnings

During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘service_id’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
    ret = evt_service_setup(service_id);

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
5 years agoeventdev: fix possible use of uninitialized var
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:10 +0000 (16:03 +0100)]
eventdev: fix possible use of uninitialized var

Fix the logic for the case of event queue allowing all schedule types.

Compiler warning pointing to this error (with LTO enabled):
error: ‘sched_type’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if ((ret < 0 && ret != -EOVERFLOW) ||

Fixes: 6750b21bd6af ("eventdev: add default software timer adapter")
Cc: stable@dpdk.org
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
5 years agobuild: add option to enable LTO
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:09 +0000 (16:03 +0100)]
build: add option to enable LTO

This patch adds an option to enable link time optimization.  In addition
to LTO option itself (-flto) fat-lto-objects are being used.  This is
because during the build pmdinfogen scans the generated ELF objects to
find this_pmd_name* symbol in symbol table.  Without fat-lto-objects gcc
produces ELF only with extra symbols for internal use during linking.

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agolib: annotate versioned functions
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:08 +0000 (16:03 +0100)]
lib: annotate versioned functions

Every implementation of a particular version of given symbol needs to be
marked in its declaration as such (using `__vsym` macro).  This patch
fixes this and also clarifies the documentation about that.

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agodoc: fix description of versioning macros
Andrzej Ostruszka [Thu, 7 Nov 2019 15:03:07 +0000 (16:03 +0100)]
doc: fix description of versioning macros

This patch fixes documentation of versioning macros so that they are
aligned with their implementation (no underscore is added by macros).

Fixes: f1ef9794f9bd ("doc: add ABI guidelines")
Cc: stable@dpdk.org
Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
5 years agoport: fix build dependency
Rahul R Shah [Wed, 6 Nov 2019 14:43:20 +0000 (07:43 -0700)]
port: fix build dependency

The port library should be built after eventdev library.

Fixes: 5d92c4e592c4 ("port: add eventdev port type")
Cc: stable@dpdk.org
Signed-off-by: Rahul R Shah <rahul.r.shah@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agotest/atomic: add atomic 16/32/64-bit exchanges test
David Christensen [Wed, 6 Nov 2019 21:18:35 +0000 (13:18 -0800)]
test/atomic: add atomic 16/32/64-bit exchanges test

The test works by creating a token comprised of random data
and a CRC8 value, using the rte_atomicXX_exchange to exchange
the new token for a previously generated token, and then
verifying that the exchanged data is intact (i.e. the CRC8
is still correct for the data).

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agotest/rib: speed up rib6 autotests
Vladimir Medvedkin [Wed, 6 Nov 2019 12:21:47 +0000 (12:21 +0000)]
test/rib: speed up rib6 autotests

Split slow part of rib6_autotest into rib6_slow_autotest

Fixes: abab6d2966dc ("test/rib: add IPv6 autotests")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agotest/rib: speed up rib autotests
Vladimir Medvedkin [Wed, 6 Nov 2019 12:21:46 +0000 (12:21 +0000)]
test/rib: speed up rib autotests

Split slow part of rib_autotest into rib_slow_autotest

Fixes: b35df4dd666e ("test/rib: add autotests")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
5 years agovfio: fix DMA mapping of external heaps
Anatoly Burakov [Tue, 5 Nov 2019 15:15:12 +0000 (15:15 +0000)]
vfio: fix DMA mapping of external heaps

Currently, externally created heaps are supposed to be automatically
mapped for VFIO DMA by EAL, however they only do so if, at the time of
heap creation, VFIO is initialized and has at least one device
available. If no devices are available at the time of heap creation (or
if devices were available, but were since hot-unplugged, thus dropping
all VFIO container mappings), then VFIO mapping code would have skipped
over externally allocated heaps.

The fix is two-fold. First, we allow externally allocated memory
segments to be marked as "heap" segments. This allows us to distinguish
between external memory segments that were created via heap API, from
those that were created via rte_extmem_register() API.

Then, we fix the VFIO code to only skip non-heap external segments.
Also, since external heaps are not guaranteed to have valid IOVA
addresses, we will skip those which have invalid IOVA addresses as well.

Fixes: 0f526d674f8e ("malloc: separate creating memseg list and malloc heap")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Rajesh Ravi <rajesh.ravi@broadcom.com>
Acked-by: David Marchand <david.marchand@redhat.com>
5 years agovfio: remove deprecated DMA mapping functions
Anatoly Burakov [Thu, 24 Oct 2019 12:18:24 +0000 (13:18 +0100)]
vfio: remove deprecated DMA mapping functions

The rte_vfio_dma_map/unmap API's have been marked as deprecated in
release 19.05. Remove them.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agovfio: fix DMA mapping with default container
Anatoly Burakov [Mon, 4 Nov 2019 17:41:33 +0000 (17:41 +0000)]
vfio: fix DMA mapping with default container

When requesting DMA mapping to default container, we are meant to
supply the RTE_VFIO_DEFAULT_CONTAINER_FD value, however this is
not handled correctly by get_vfio_cfg_by_container_fd(), because
it only looks at actual fd values and does not check for this
special case.

Fix it to return default container if the fd requested is the
special RTE_VFIO_DEFAULT_CONTAINER_FD value.

Fixes: 4106d89a18f8 ("vfio: allow DMA map to the default container")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: add application usage guide for l2fwd-event
Sunil Kumar Kori [Wed, 30 Oct 2019 17:03:47 +0000 (22:33 +0530)]
doc: add application usage guide for l2fwd-event

Add documentation for l2fwd-event example.
Update release notes.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: add graceful teardown
Pavan Nikhilesh [Wed, 30 Oct 2019 16:26:50 +0000 (21:56 +0530)]
examples/l2fwd-event: add graceful teardown

Add graceful teardown that addresses both event mode and poll mode.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: add eventdev main loop
Pavan Nikhilesh [Wed, 30 Oct 2019 16:26:49 +0000 (21:56 +0530)]
examples/l2fwd-event: add eventdev main loop

Add event dev main loop based on enabled l2fwd options and eventdev
capabilities.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: setup service core
Pavan Nikhilesh [Wed, 30 Oct 2019 16:26:48 +0000 (21:56 +0530)]
examples/l2fwd-event: setup service core

Setup service cores for eventdev and Rx/Tx adapter when they don't have
internal port capability.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: setup Rx/Tx adapter
Sunil Kumar Kori [Wed, 30 Oct 2019 16:26:47 +0000 (21:56 +0530)]
examples/l2fwd-event: setup Rx/Tx adapter

Add event eth Rx/Tx adapter setup for both generic and internal port
event device pipelines.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: setup event queue and port
Sunil Kumar Kori [Wed, 30 Oct 2019 16:26:46 +0000 (21:56 +0530)]
examples/l2fwd-event: setup event queue and port

Add event device queue and port setup based on event eth Tx adapter
capabilities.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: setup event device
Sunil Kumar Kori [Wed, 30 Oct 2019 16:26:45 +0000 (21:56 +0530)]
examples/l2fwd-event: setup event device

Add event device device setup based on event eth Tx adapter
capabilities.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: add infra to split eventdev framework
Sunil Kumar Kori [Wed, 30 Oct 2019 16:26:44 +0000 (21:56 +0530)]
examples/l2fwd-event: add infra to split eventdev framework

Add infra to split eventdev framework based on event Tx adapter
capability.
If event Tx adapter has internal port capability then we use
`rte_event_eth_tx_adapter_enqueue` to transmitting packets else
we use a SINGLE_LINK event queue to enqueue packets to a service
core which is responsible for transmitting packets.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: add infra for eventdev
Pavan Nikhilesh [Wed, 30 Oct 2019 16:26:43 +0000 (21:56 +0530)]
examples/l2fwd-event: add infra for eventdev

Add infra to select event device as a mode to process packets through
command line arguments. Also, allow the user to select the schedule type
to be RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC or
RTE_SCHED_TYPE_PARALLEL.

Usage:

`--mode="eventdev"` or `--mode="poll"`
`--eventq-sched="ordered"`, `--eventq-sched="atomic"` or
`--event-sched=parallel`

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoexamples/l2fwd-event: add default poll mode routines
Pavan Nikhilesh [Wed, 30 Oct 2019 16:26:42 +0000 (21:56 +0530)]
examples/l2fwd-event: add default poll mode routines

Add the default l2fwd poll mode routines similar to examples/l2fwd.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoevent/octeontx2: remove hot spots by prefetching data
Pavan Nikhilesh [Wed, 23 Oct 2019 16:07:07 +0000 (21:37 +0530)]
event/octeontx2: remove hot spots by prefetching data

Recent profiling revealed few hotspots in octeontx2 event device
driver add prefetch hints to reduce stalls.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
5 years agoevent/octeontx2: use WFE while waiting for head
Pavan Nikhilesh [Wed, 23 Oct 2019 16:12:43 +0000 (21:42 +0530)]
event/octeontx2: use WFE while waiting for head

Use WFE to save power while waiting for tag to become head.

SSO signals EVENTI to allow cores to exit from wfe when they
are waiting for specific operations in which one of them is
setting HEAD bit in GWS_TAG.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agodoc: bump supported SDK and firmware version for DPAA2
Hemant Agrawal [Tue, 5 Nov 2019 07:59:07 +0000 (13:29 +0530)]
doc: bump supported SDK and firmware version for DPAA2

This patch bump the supported SDK and MC firmware version
to the latest.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoconfig: remove redundant DPAA2 build
Hemant Agrawal [Tue, 5 Nov 2019 07:59:06 +0000 (13:29 +0530)]
config: remove redundant DPAA2 build

dpaa and dpaa2 config have evolved to be same. The same binary
can now work across the platforms. So, there is no need to maintain
two different build configs.
The dpaa config shall work for both generation of dpaa platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/bnx2x: fix meson build
Rasesh Mody [Wed, 6 Nov 2019 05:45:20 +0000 (21:45 -0800)]
net/bnx2x: fix meson build

Use kernel headers for __le* types to avoid potential conflicts
resulting in redefinition errors for some Linux build environments.
Add check for FreeBSD execution environments.

Without this fix, aarch64 builds can fail with error below:

In file included from ../drivers/net/bnx2x/bnx2x.h:22,
                 from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
../drivers/net/bnx2x/bnx2x_osal.h:27:17: error:
conflicting types for ‘uint64_t’
 #define __le64  uint64_t
               ^~~~~~~~
In file included from /usr/include/stdint.h:37,
                 from /usr/lib/gcc/aarch64-linux-gnu/8/include/stdint.h:9,
                 from ../lib/librte_eal/common/include/arch/arm/rte_byteorder.h:16,
                 from ../drivers/net/bnx2x/bnx2x.h:17,
                 from ../drivers/net/bnx2x/bnx2x_ethdev.c:8:
/usr/include/aarch64-linux-gnu/bits/stdint-uintn.h:27:20: note:
previous declaration of ‘uint64_t’ was here
 typedef __uint64_t uint64_t;
                    ^~~~~~~~

There is also one minor change mixed in this commit:
Some use of __FreeBSD__ are replaced by RTE_EXEC_ENV_FREEBSD.

Fixes: 38dff79ba736 ("net/bnx2x: update HSI")

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Tested-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Tested-by: Gavin Hu <gavin.hu@arm.com>
5 years agotest/mempool: fix false positive result
Olivier Matz [Mon, 4 Nov 2019 10:06:23 +0000 (11:06 +0100)]
test/mempool: fix false positive result

The ret variable, initialized to -1, is changed to 0 during the test,
making the test successful in some cases where it should return a
failure.

Fix this by always using the GOTO_ERR() macro that sets the ret
variable before doing the goto.

Fixes: 923ceaeac140 ("test/mempool: add unit test cases")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agomempool: use specific macro for object alignment
Olivier Matz [Tue, 5 Nov 2019 15:37:06 +0000 (16:37 +0100)]
mempool: use specific macro for object alignment

For consistency, RTE_MEMPOOL_ALIGN should be used in place of
RTE_CACHE_LINE_SIZE. They have the same value, because the only arch
that was defining a specific value for it has been removed from DPDK.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agomempool: prevent objects from being across pages
Olivier Matz [Tue, 5 Nov 2019 15:37:05 +0000 (16:37 +0100)]
mempool: prevent objects from being across pages

When populating a mempool, ensure that objects are not located across
several pages, except if user did not request IOVA-contiguous objects.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agomempool: introduce helpers for populate and required size
Olivier Matz [Tue, 5 Nov 2019 15:37:04 +0000 (16:37 +0100)]
mempool: introduce helpers for populate and required size

Introduce new functions that can used by mempool drivers to
calculate required memory size and to populate mempool.

For now, these helpers just replace the *_default() functions
without change. They will be enhanced in next commit.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agomempool: introduce function to get mempool page size
Olivier Matz [Tue, 5 Nov 2019 15:37:03 +0000 (16:37 +0100)]
mempool: introduce function to get mempool page size

In rte_mempool_populate_default(), we determine the page size,
which is needed for calc_size and allocation of memory.

Move this in a function and export it, it will be used in a next
commit.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agomempool: remove optimistic IOVA-contiguous allocation
Olivier Matz [Tue, 5 Nov 2019 15:37:02 +0000 (16:37 +0100)]
mempool: remove optimistic IOVA-contiguous allocation

The previous commit reduced the amount of required memory when
populating the mempool with non IOVA-contiguous memory.

Since there is no big advantage to have a fully iova-contiguous mempool
if it is not explicitly asked, remove this code, it simplifies the
populate function.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agomempool: reduce wasted space on populate
Olivier Matz [Tue, 5 Nov 2019 15:37:01 +0000 (16:37 +0100)]
mempool: reduce wasted space on populate

The size returned by rte_mempool_op_calc_mem_size_default() is aligned
to the specified page size. Therefore, with big pages, the returned size
can be much more that what we really need to populate the mempool.

For instance, populating a mempool that requires 1.1GB of memory with
1GB hugepages can result in allocating 2GB of memory.

This problem is hidden most of the time due to the allocation method of
rte_mempool_populate_default(): when try_iova_contig_mempool=true, it
first tries to allocate an iova contiguous area, without the alignment
constraint. If it fails, it fallbacks to an aligned allocation that does
not require to be iova-contiguous. This can also fallback into several
smaller aligned allocations.

This commit changes rte_mempool_op_calc_mem_size_default() to relax the
alignment constraint to a cache line and to return a smaller size.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agomempool: allow populating with unaligned virtual area
Olivier Matz [Tue, 5 Nov 2019 15:37:00 +0000 (16:37 +0100)]
mempool: allow populating with unaligned virtual area

rte_mempool_populate_virt() currently requires that both addr
and length are page-aligned.

Remove this unneeded constraint which can be annoying with big
hugepages (ex: 1GB).

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agobus/fslmc: sanitize device name parsing for clarity
Shreyansh Jain [Tue, 5 Nov 2019 14:23:21 +0000 (19:53 +0530)]
bus/fslmc: sanitize device name parsing for clarity

remove unnecessary dup and free

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agobus/dpaa: move QBMAN global init to bus
Hemant Agrawal [Tue, 5 Nov 2019 14:23:20 +0000 (19:53 +0530)]
bus/dpaa: move QBMAN global init to bus

DPAA SEC shall be able to work independent of DPAA ETH
driver.
This patch moves qbman init to bus, so that any driver
can use them even when no eth resources are present
or none of the eth devices are probed.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agomempool/dpaa2: report error on endless loop in mbuf release
Radu Bulie [Tue, 5 Nov 2019 14:23:19 +0000 (19:53 +0530)]
mempool/dpaa2: report error on endless loop in mbuf release

When BMAN is not able to accept more buffers, it could be that
there are no FBPR's (internal mem provided to bman) left.
Report error in such condition.

Fixes: 5dc43d22b5ad ("mempool/dpaa2: add hardware offloaded mempool")
Cc: stable@dpdk.org
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agoraw/dpaa2_cmdif: add retry and timeout in packet enqueue API
Nipun Gupta [Tue, 5 Nov 2019 14:23:18 +0000 (19:53 +0530)]
raw/dpaa2_cmdif: add retry and timeout in packet enqueue API

This patch adds retry in the DPAA2 CMDIF packet enqueue API

Fixes: 53c71586c789 ("raw/dpaa2_cmdif: support enqueue/dequeue operations")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoraw/dpaa2_qdma: add retry and timeout in packet enqueue API
Nipun Gupta [Tue, 5 Nov 2019 14:23:17 +0000 (19:53 +0530)]
raw/dpaa2_qdma: add retry and timeout in packet enqueue API

This patch adds the logic in the DPAA2 QDMA packet enqueue API

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa2: add retry and timeout in packet enqueue API
Nipun Gupta [Tue, 5 Nov 2019 14:23:16 +0000 (19:53 +0530)]
net/dpaa2: add retry and timeout in packet enqueue API

In the packet transmit, if the QBMAN is not able to process the
packets, the Tx function loops infinitely to send the packet out.
This patch changes the logic retry for some time (count) and then
return.

Fixes: cd9935cec873 ("net/dpaa2: enable Rx and Tx operations")
Fixes: 16c4a3c46ab7 ("bus/fslmc: add enqueue response read in qbman")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Radu Bulie <radu-andrei.bulie@nxp.com>
5 years agocommon/dpaax: fallback to check separate memory node for VM
Nipun Gupta [Tue, 5 Nov 2019 14:23:15 +0000 (19:53 +0530)]
common/dpaax: fallback to check separate memory node for VM

In Virtual Machine the memory node in the device tree is at
'/proc/device-tree/memory/reg' which is separate from the memory
node path on the host. This patch enables check on both the paths.

Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
5 years agonet/dpaa: fix LS1043 alignment check
Nipun Gupta [Tue, 5 Nov 2019 14:23:14 +0000 (19:53 +0530)]
net/dpaa: fix LS1043 alignment check

On LS1043, we are good to check 128 byte alignment of offset to
transmit out the packet

Fixes: f8c7a17a48c9 ("net/dpaa: support Tx scatter gather for non-DPAA buffer")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agonet/dpaa: fix supported RSS types
Nipun Gupta [Tue, 5 Nov 2019 14:23:13 +0000 (19:53 +0530)]
net/dpaa: fix supported RSS types

This patch fixes the supported RSS types on DPAA platform

Fixes: 15aa2a1b02e6 ("net/dpaa: update RSS offload types")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agotest/fib: add IPv6 performance autotests
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:45 +0000 (15:21 +0000)]
test/fib: add IPv6 performance autotests

Performance IPv6 tests for the FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agotest/fib: add performance autotests
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:44 +0000 (15:21 +0000)]
test/fib: add performance autotests

Performance tests for the new FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agotest/fib: add IPv6 autotests
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:43 +0000 (15:21 +0000)]
test/fib: add IPv6 autotests

Functional IPv6 tests for the FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agotest/fib: add autotests
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:42 +0000 (15:21 +0000)]
test/fib: add autotests

Functional tests for the new FIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agofib: add dataplane algorithm for IPv6
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:41 +0000 (15:21 +0000)]
fib: add dataplane algorithm for IPv6

Add fib implementation for ipv6 using modified DIR24_8 algorithm.
Implementation is similar to current LPM6 implementation but has
few enhancements:
faster control plane operations
more bits for userdata in table entries
configurable userdata size

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agofib: add DIR24-8 dataplane algorithm
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:40 +0000 (15:21 +0000)]
fib: add DIR24-8 dataplane algorithm

Add fib implementation for DIR24_8 algorithm for IPv4.
Implementation is similar to current LPM implementation but has
few enhancements:
faster control plane operations
more bits for userdata in table entries
configurable userdata size

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agofib: support IPv6
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:39 +0000 (15:21 +0000)]
fib: support IPv6

Add FIB library support for IPv6.
It implements a dataplane structures and algorithms designed for
fast IPv6 longest prefix match.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agofib: add FIB library
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:38 +0000 (15:21 +0000)]
fib: add FIB library

Add FIB (Forwarding Information Base) library. This library
implements a dataplane structures and algorithms designed for
fast longest prefix match.
Internally it consists of two parts - RIB (control plane ops) and
implementation for the dataplane tasks.
Initial version provides two implementations for both IPv4 and IPv6:
dummy (uses RIB as a dataplane) and DIR24_8 (same as current LPM)
Due to proposed design it allows to extend FIB with new algorithms
in future (for example DXR, poptrie, etc).

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agotest/rib: add IPv6 autotests
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:37 +0000 (15:21 +0000)]
test/rib: add IPv6 autotests

Functional tests for RIB6.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agorib: support IPv6
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:36 +0000 (15:21 +0000)]
rib: support IPv6

Extend RIB library with IPv6 support.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agotest/rib: add autotests
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:35 +0000 (15:21 +0000)]
test/rib: add autotests

Functional tests for the new RIB library.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agorib: add RIB library
Vladimir Medvedkin [Fri, 1 Nov 2019 15:21:34 +0000 (15:21 +0000)]
rib: add RIB library

Add RIB (Routing Information Base) library. This library
implements an IPv4 routing table optimized for control plane
operations. It implements a control plane struct containing routes
in a tree and provides fast add/del operations for routes.
Also it allows to perform fast subtree traversals
(i.e. retrieve existing subroutes for a given prefix).
This structure will be used as a control plane helper structure
for FIB implementation. Also it might be used standalone in other
different places such as bitmaps for example.
Internal implementation is level compressed binary trie.

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
5 years agocrypto/dpaa2_sec: fix build with clang 3.4.2
Ciara Power [Thu, 31 Oct 2019 14:05:52 +0000 (14:05 +0000)]
crypto/dpaa2_sec: fix build with clang 3.4.2

Building with clang 3.4.2 caused the following error:

  CC dpaa2_sec_dpseci.o
In file included from /dpdk/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:40:
In file included from /dpdk/drivers/common/dpaax/caamflib/desc/ipsec.h:11:
In file included from /dpdk/drivers/common/dpaax/caamflib/rta.h:11:
In file included from .../common/dpaax/caamflib/rta/sec_run_time_asm.h:14:
/dpdk/drivers/common/dpaax/compat.h:108:18:
error: redefinition of typedef 'dma_addr_t' is a C11 feature
[-Werror,-Wtypedef-redefinition]
typedef uint64_t        dma_addr_t;
                        ^
/dpdk/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c:37:18:
note: previous definition is here
typedef uint64_t        dma_addr_t;
                        ^

The dma_addr_t was defined in the common compat.h file, and does not
need to be redefined.

The meson build include directories list was updated to enable the
definition in the common compat.h file be used.

Fixes: 8c83f28cc8a4 ("common/dpaax: move OF library from DPAA bus")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoconfig: disable IEEE1588 on DPAA2
Nipun Gupta [Thu, 31 Oct 2019 12:48:35 +0000 (18:18 +0530)]
config: disable IEEE1588 on DPAA2

This patch disables the 1588 timer support by default on DPAA2
platform due to the performance impact.
By default it is disabled in config/common_base, so remove the entry
from DPAA2.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agobus/fslmc: fix resource leak
Agalya Babu RadhaKrishnan [Tue, 10 Sep 2019 07:30:55 +0000 (08:30 +0100)]
bus/fslmc: fix resource leak

1 issue caught by coverity (issue 344967).
Leaked_storage: Variable sep going out of scope leaks the
storage it points to.

When 'sep' is not null and sep_exist is 0, 'sep' is freed
before going out of scope of the function irrespective of
'addr' exists or not.

Coverity issue: 344967
Fixes: e67a61614d0b ("bus/fslmc: support device iteration")
Cc: stable@dpdk.org
Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Acked-by: Sachin Saxena <sachin.saxena@nxp.com>
5 years agodoc: fix description of links to EAL options pages
Dekel Peled [Thu, 24 Oct 2019 13:17:51 +0000 (16:17 +0300)]
doc: fix description of links to EAL options pages

Documentation includes separate pages of EAL command-line options for
Linux and for FreeBSD.
Links to these pages use the same text 'EAL parameters', so it is not
clear which link to use for which environment.

This patch adds the text '(Linux)' and '(FreeBSD)' where relevant, to
clearly identify the links.

Fixes: 3ee567cfec37 ("doc: document all EAL parameters in one place")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoraw/ioat: support xstats reset
Ciara Power [Tue, 29 Oct 2019 13:41:47 +0000 (13:41 +0000)]
raw/ioat: support xstats reset

The rawdev xstats_reset function is now enabled.  It is called when the
ioat autotest completes, to reset all xstat values after they have been
modified during testing.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoversion: 19.11-rc1
Thomas Monjalon [Sun, 27 Oct 2019 21:46:22 +0000 (22:46 +0100)]
version: 19.11-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agorename private header files
Dharmik Thakkar [Tue, 22 Oct 2019 00:19:45 +0000 (19:19 -0500)]
rename private header files

Some of the internal header files have 'rte_' prefix
and some don't.
Remove 'rte_' prefix from all internal header files.

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
5 years agousertools: fix telemetry client with python 3
Robin Jarry [Thu, 17 Oct 2019 17:32:12 +0000 (19:32 +0200)]
usertools: fix telemetry client with python 3

When running the dpdk-telemetry-client.py with python 3, we get the
following syntax errors:

  File "usertools/dpdk-telemetry-client.py", line 70
      print "\nResponse: \n", str(data)
                           ^
  SyntaxError: invalid syntax

  File "usertools/dpdk-telemetry-client.py", line 93
      print "\nResponse: \n", str(data)
                           ^
  SyntaxError: invalid syntax

  File "usertools/dpdk-telemetry-client.py", line 111
      file_path = sys.argv[1]
                            ^
  TabError: inconsistent use of tabs and spaces in indentation

Import print_function from __future__ and add parentheses where missing.
Also, use spaces for indentation everywhere.

Fixes: d1b94da4a4e0 ("usertools: add client script for telemetry")
Fixes: 53f293c9a783 ("usertools: replace unsafe input function")
Fixes: 4080e46c8078 ("telemetry: support global metrics")
Cc: stable@dpdk.org
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agousertools: fix pmdinfo with python 3 and pyelftools>=0.24
Robin Jarry [Tue, 15 Oct 2019 12:39:17 +0000 (14:39 +0200)]
usertools: fix pmdinfo with python 3 and pyelftools>=0.24

Running dpdk-pmdinfo.py on Ubuntu 18.04 (bionic) with python 3 and
pyelftools installed produces no output but no error is reported
neither:

  ~$ python3 usertools/dpdk-pmdinfo.py -r build/app/testpmd
  ~$ echo $?
  0

While with python 2, it works:

  ~# python2 usertools/dpdk-pmdinfo.py -r build/app/testpmd
  {"pci_ids": [], "name": "dpio"}
  {"pci_ids": [], "name": "dpbp"}
  {"pci_ids": [], "name": "dpaa2_qdma"}
  .....

On Ubuntu 18.04, pyelftools is version 0.24. The change log of
pyelftools v0.24 says:

 - Symbol/section names are strings internally now, not bytestrings
   (this may affect API usage in Python 3) (#76).

We cannot guess which version of pyelftools is actually being used. The
elftools.__version__ symbol is not consistent with each distro's package
version. For example, on Ubuntu 16.04 (xenial), the .deb package version
is '0.23-2' but elftools.__version__ contains '0.25'. This is certainly
due to partial backports.

To have a more consistent behaviour of this script across all versions
of python, add the unicode_literals future import so that literal
strings are now always "unicode".

Add 2 utility functions to force a string into bytes or bytes into an
unicode string.

Force pyelftools return values to unicode strings (will do nothing with
recent version of pyelftools).

If elffile.get_section_by_name returns None with a unicode section name,
try with the same one encoded as bytes.

Also, replace all open() calls by io.open() which behaves like the
builtin open in python 3. The only non-binary opened file is
/usr/share/hwdata/pci.ids which is UTF-8 encoded text. Explicitly
specify that encoding.

Link: https://github.com/eliben/pyelftools/blob/v0.24/CHANGES#L7
Link: https://github.com/eliben/pyelftools/commit/108eaea9e75a8b5a
Fixes: 54ca545dce4b ("make python scripts python2/3 compliant")
Cc: stable@dpdk.org
Signed-off-by: Robin Jarry <robin.jarry@6wind.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
5 years agoexamples/vm_power: send capabilities request from guest
Marcin Hajkowski [Mon, 30 Sep 2019 13:00:43 +0000 (14:00 +0100)]
examples/vm_power: send capabilities request from guest

Send request to power manager for core id provided
by user to get related capabilities.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: send CPU capabilities on VM request
Marcin Hajkowski [Mon, 30 Sep 2019 13:00:42 +0000 (14:00 +0100)]
examples/vm_power: send CPU capabilities on VM request

Send capabilities for requested cores.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: add packet type for capabilities
Marcin Hajkowski [Mon, 30 Sep 2019 13:00:41 +0000 (14:00 +0100)]
power: add packet type for capabilities

Add new packet type and commands for capabilities query.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: add command to query CPU frequency
Marcin Hajkowski [Fri, 27 Sep 2019 12:16:01 +0000 (13:16 +0100)]
examples/vm_power: add command to query CPU frequency

Add command and related logic to query CPU frequencies
either for specified CPU or all cores.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: add mechanism to disable queries
Marcin Hajkowski [Fri, 27 Sep 2019 12:16:00 +0000 (13:16 +0100)]
examples/vm_power: add mechanism to disable queries

Add new command which gives possibility to enable/disable queries
form VM guest.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: process CPU frequency query
Marcin Hajkowski [Fri, 27 Sep 2019 12:15:59 +0000 (13:15 +0100)]
examples/vm_power: process CPU frequency query

On query received from VM guest send CPUs frequencies.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: extend guest channel for frequency query
Marcin Hajkowski [Fri, 27 Sep 2019 12:15:58 +0000 (13:15 +0100)]
power: extend guest channel for frequency query

Extend incoming packet reading API with new packet
type which carries CPU frequencies.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: fix build without i40e
David Hunt [Thu, 24 Oct 2019 14:26:10 +0000 (15:26 +0100)]
examples/vm_power: fix build without i40e

channel_monitor.c was dependent on i40e driver being available.
This is only necessary for the TRAFFIC policy, so use #ifdef's
to not call these when i40e not available.

Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/vm_power: send confirmation cmd to guest
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:16 +0000 (09:42 +0100)]
examples/vm_power: send confirmation cmd to guest

Use new guest channel API to send confirmation
message for received power command.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agoexamples/vm_power: process incoming confirmation cmds
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:15 +0000 (09:42 +0100)]
examples/vm_power: process incoming confirmation cmds

Extend vm_power_guest to check incoming confirmations
of messages previously sent to host.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: extend guest channel API for reading
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:14 +0000 (09:42 +0100)]
power: extend guest channel API for reading

Added new experimental API rte_power_guest_channel_receive_msg
which gives possibility to receive messages send to guest.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Tested-by: David Hunt <david.hunt@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agopower: fix socket indicator value
Marcin Hajkowski [Fri, 27 Sep 2019 08:42:13 +0000 (09:42 +0100)]
power: fix socket indicator value

Currently 0 is being used for not connected slot indication.
This is not consistent with linux doc which identifies 0 as valid
(connected) slot, thus modification was done to change it.

Fixes: cd0d5547 ("power: vm communication channels in guest")
Cc: stable@dpdk.org
Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/l3fwd-power: fix Rx interrupt disabling
Xiao Zhang [Tue, 10 Sep 2019 16:10:14 +0000 (00:10 +0800)]
examples/l3fwd-power: fix Rx interrupt disabling

Interrupt will not be received when disabling RX interrupt without
synchronization mechanism sometimes which leads to wake up issue.
Add spinlock to fix it.

Fixes: b736d64787 ("examples/l3fwd-power: disable Rx interrupt when waking up")
Cc: stable@dpdk.org
Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
Reviewed-by: Marvin Liu <yong.liu@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/l3fwd: prefetch the content of the next packet
Feifei Wang [Wed, 14 Aug 2019 08:54:30 +0000 (16:54 +0800)]
examples/l3fwd: prefetch the content of the next packet

The cache-misses problem is very serious when the function
lpm_cb_parse_ptype is called to read the content of packets. That is
because the contents of packages previously stored in the cache are
overwritten by the following instructions or variables.
Thus the prefetch order can be used to prefetch the next packet into
the cache to avoid CPU spending too much time on it.

On Octeon TX platform with built-in NIC, 12% performance gain was
measured by running RFC2544 NDR test with l3fwd. Furthermore, the
cache-misses event of the function lpm_cb_parse_ptype was reduced by
20%, and the CPU task-clock of it dropped from 16.49% to 11.3%, based
on the forwarding test for one minute with the 64B packet.
On the dpaa2 platform, no performance improvement nor drop were seen
with this patch by running RFC2544 NDR test with l3fwd.
On the x86 platform, 15.7% performance gain was measured by running
RFC2544 NDR test with l3fwd.

Signed-off-by: Feifei Wang <feifei.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
5 years agonet: remove ethernet packing and set two-byte alignment
Bruce Richardson [Thu, 10 Oct 2019 10:46:23 +0000 (11:46 +0100)]
net: remove ethernet packing and set two-byte alignment

The ether header does not need to be packed since that makes no sense for
structures with only bytes in them, but it should be aligned to a two-byte
boundary to simplify access to it from code. Other packed structures that
use this also need to be updated to take account of the change, either by
removing packing - where it is clearly unneeded - or by explicitly giving
those structures 2-byte alignment also.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodoc: add IOAT sample app guide
Marcin Baran [Mon, 7 Oct 2019 11:08:09 +0000 (12:08 +0100)]
doc: add IOAT sample app guide

Added guide for IOAT sample app usage and code description.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: print statistics
Marcin Baran [Mon, 7 Oct 2019 11:08:08 +0000 (12:08 +0100)]
examples/ioat: print statistics

Added printing stats of ports each second.  The stats printing is done
using master core.  The information provided informs about packets
received, dropped and send as well as statistics of rawdev devices.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add two threads configuration
Pawel Modrak [Mon, 7 Oct 2019 11:08:07 +0000 (12:08 +0100)]
examples/ioat: add two threads configuration

Added possibility to use two lcores: first for packet receiving and
copying, second for packets sending.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add rawdev copy mode
Marcin Baran [Mon, 7 Oct 2019 11:08:06 +0000 (12:08 +0100)]
examples/ioat: add rawdev copy mode

Added support for copying packets using rawdev device. Each port's Rx queue
is assigned DMA channel for copy.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add software copy mode
Marcin Baran [Mon, 7 Oct 2019 11:08:05 +0000 (12:08 +0100)]
examples/ioat: add software copy mode

Added support for copying packets using software copy mode and MAC address
changing. The copies are processed using one lcore.

Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/ioat: add new sample app for ioat driver
Pawel Modrak [Mon, 7 Oct 2019 11:08:04 +0000 (12:08 +0100)]
examples/ioat: add new sample app for ioat driver

A new sample app demonstrating use of driver for CBDMA.  The app receives
packets, performs software or hardware copy, changes packets' MAC addresses
(if enabled) and forwards them. The change covers ports initialization,
closing connection and argument parsing.

Signed-off-by: Pawel Modrak <pawelx.modrak@intel.com>
Signed-off-by: Marcin Baran <marcinx.baran@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoexamples/vm_power: add guest cli to meson
Bruce Richardson [Tue, 22 Oct 2019 15:43:10 +0000 (16:43 +0100)]
examples/vm_power: add guest cli to meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/vm_power: fix type of cmdline token in cli
Bruce Richardson [Tue, 22 Oct 2019 15:43:09 +0000 (16:43 +0100)]
examples/vm_power: fix type of cmdline token in cli

Building the example with clang gives the error:

  error: expression which evaluates to zero treated as a null pointer
  constant of type 'const char *' [-Werror,-Wnon-literal-null-conversion]
                        lcore_id, UINT8);
                                  ^~~~~

This error is due to the wrong data type being given for the
cmd_set_cpu_freq_core_num value - it was specified as string rather than
numeric type.

Fixes: f5e5c3347ae3 ("examples/vm_power: cli in guest")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/server_node_efd: add server binary to meson build
Bruce Richardson [Tue, 22 Oct 2019 15:43:08 +0000 (16:43 +0100)]
examples/server_node_efd: add server binary to meson build

When adding to the build, add in two missing includes that prevented build
on freebsd, rather than just duplicating the makefile restriction.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/server_node_efd: add node binary to meson build
Bruce Richardson [Tue, 22 Oct 2019 15:43:07 +0000 (16:43 +0100)]
examples/server_node_efd: add node binary to meson build

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/performance-thread: add pthread shim to meson
Bruce Richardson [Tue, 22 Oct 2019 15:43:06 +0000 (16:43 +0100)]
examples/performance-thread: add pthread shim to meson

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/performance-thread: add l3fwd-thread to meson
Bruce Richardson [Tue, 22 Oct 2019 15:43:05 +0000 (16:43 +0100)]
examples/performance-thread: add l3fwd-thread to meson

Limited to x86_64 systems, as it fails to compile on any others and is
disabled in the examples makefile for non-x86_64 systems.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/performance-thread: remove warning disabling
Bruce Richardson [Tue, 22 Oct 2019 15:43:04 +0000 (16:43 +0100)]
examples/performance-thread: remove warning disabling

The warnings about functions not returning values can be removed from the
code by just adding an attribute to the function to specifies it doesn't
return. The GCC bug referenced in the makefile which prevents this from
working has been fixed for >10 years according to bugzilla.

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