dpdk.git
4 years agopdump: use mbuf copy function
Stephen Hemminger [Fri, 8 Nov 2019 16:47:16 +0000 (08:47 -0800)]
pdump: use mbuf copy function

The rte_pktmbuf_copy handles varying size mbuf pools correctly.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
4 years agohash: fix lock-free flag doxygen
Honnappa Nagarahalli [Mon, 3 Feb 2020 19:49:12 +0000 (13:49 -0600)]
hash: fix lock-free flag doxygen

Lock-free extendable table is supported. Correct the comments.

Fixes: f401363d984a ("hash: support lock-free extendable bucket")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agotest/hash: move lock-free tests to perf tests
Honnappa Nagarahalli [Mon, 3 Feb 2020 19:49:11 +0000 (13:49 -0600)]
test/hash: move lock-free tests to perf tests

Move reader writer lock free tests to performance tests.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agotest/hash: add lock-free functional tests
Honnappa Nagarahalli [Mon, 3 Feb 2020 19:49:10 +0000 (13:49 -0600)]
test/hash: add lock-free functional tests

Add lock-free reader writer concurrency functional tests.
These tests will provide the same coverage that non lock-free
APIs have.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agotest/hash: split into shorter subtests
Amit Gupta [Mon, 3 Feb 2020 19:49:08 +0000 (13:49 -0600)]
test/hash: split into shorter subtests

hash_readwrite test was taking too much time to complete in Travis.
Test is split into functional and perf test.
perf test is being moved under perf testsuites in meson.

Signed-off-by: Amit Gupta <agupta3@marvell.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agobuildtools: allow pedantic empty pmdinfo
Thomas Monjalon [Wed, 5 Feb 2020 15:39:23 +0000 (16:39 +0100)]
buildtools: allow pedantic empty pmdinfo

If a driver has no info generated by pmdinfogen,
and if this driver is compiled as pedantic,
then an failure would occur:
drivers/rte_common_mlx5.pmd.c:1: error:
ISO C forbids an empty translation unit [-Werror=pedantic]
Such error is triggered with the new mlx5 common directory.

In order to allow an "empty driver info" compiled in pedantic mode,
the script generating .pmd.c file is modified to add a static string
unconditionnaly.
The minimal generated code is:
static __attribute__((unused)) const char *generator =
"/path/to/dpdk/buildtools/gen-pmdinfo-cfile.sh";

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agocryptodev: revert Chacha20-Poly1305 AEAD algorithm
Thomas Monjalon [Wed, 5 Feb 2020 11:04:32 +0000 (12:04 +0100)]
cryptodev: revert Chacha20-Poly1305 AEAD algorithm

API makes think that rte_cryptodev_info_get() cannot return
a value >= 3 (RTE_CRYPTO_AEAD_LIST_END in 19.11).
20.02-rc1 was returning 3 (RTE_CRYPTO_AEAD_CHACHA20_POLY1305).
So the ABI compatibility contract was broken.

It could be solved with some function versioning,
but because a lack of time, the feature is reverted for now.

This reverts following commits:
6c9f3b347e21 ("cryptodev: add Chacha20-Poly1305 AEAD algorithm")
2c512e64d600 ("crypto/qat: support Chacha Poly")
d55e01f579e1 ("test/crypto: add Chacha Poly cases")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodevtools: add ABI checks
David Marchand [Sun, 2 Feb 2020 21:08:34 +0000 (22:08 +0100)]
devtools: add ABI checks

For normal developers, those checks are disabled.

Enabling them requires a configuration that will trigger the ABI dumps
generation as part of the existing devtools/test-build.sh and
devtools/test-meson-builds.sh scripts.

Those checks are enabled in the CI for the default meson options on x86
and aarch64 so that proposed patches are validated via our CI robot.
A cache of the ABI is stored in travis jobs to avoid rebuilding too
often.

Checks can be informational only, by setting ABI_CHECKS_WARN_ONLY when
breaking the ABI in a future release.

Explicit suppression rules have been added on internal structures
exposed to crypto drivers as the current ABI policy does not apply to
them.
This could be improved in the future by carefully splitting the headers
content with application and driver "users" in mind.

We currently have issues reported for librte_crypto recent changes for
which suppression rules have been added too.

Mellanox glue libraries are explicitly skipped as they are not part of
the application ABI.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agodevtools: split meson build helper
David Marchand [Sun, 2 Feb 2020 21:08:33 +0000 (22:08 +0100)]
devtools: split meson build helper

No functional change intended, prepare for reusing this code.
The config and compilation parts are separated in helpers.
Unsetting CC is moved to the caller of the helper.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agohash: fix meson headers packaging
David Marchand [Sun, 2 Feb 2020 21:08:32 +0000 (22:08 +0100)]
hash: fix meson headers packaging

Those headers are internal and should not be distributed.

Fixes: 5b9656b157d3 ("lib: build with meson")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agolib: use common macro RTE_DIM
Pavan Nikhilesh [Fri, 24 Jan 2020 04:55:44 +0000 (10:25 +0530)]
lib: use common macro RTE_DIM

Use RTE_DIM to calculate array size.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples: use common macro RTE_DIM
Pavan Nikhilesh [Fri, 24 Jan 2020 04:55:43 +0000 (10:25 +0530)]
examples: use common macro RTE_DIM

Use RTE_DIM macro to calculate array size.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agoapp: use common macro RTE_DIM
Pavan Nikhilesh [Fri, 24 Jan 2020 04:55:42 +0000 (10:25 +0530)]
app: use common macro RTE_DIM

Use RTE_DIM macro to calculate array size.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: add event mode to l3fwd guide
Pavan Nikhilesh [Tue, 28 Jan 2020 05:35:05 +0000 (11:05 +0530)]
doc: add event mode to l3fwd guide

Update l3fwd user guide to include event device related information.
Update release notes.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add graceful teardown for eventdev
Pavan Nikhilesh [Tue, 28 Jan 2020 05:35:04 +0000 (11:05 +0530)]
examples/l3fwd: add graceful teardown for eventdev

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

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add event em main loop
Pavan Nikhilesh [Tue, 28 Jan 2020 05:35:03 +0000 (11:05 +0530)]
examples/l3fwd: add event em main loop

Add em main loop for handling events based on capabilities of the
event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add event lpm main loop
Pavan Nikhilesh [Tue, 28 Jan 2020 05:35:02 +0000 (11:05 +0530)]
examples/l3fwd: add event lpm main loop

Add lpm main loop for handling events based on capabilities of the
event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add service core setup based on caps
Pavan Nikhilesh [Tue, 28 Jan 2020 05:35:01 +0000 (11:05 +0530)]
examples/l3fwd: add service core setup based on caps

Add service core setup when eventdev and Rx/Tx adapter don't have
internal port capability.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add event eth Rx/Tx adapter setup
Pavan Nikhilesh [Tue, 28 Jan 2020 05:35:00 +0000 (11:05 +0530)]
examples/l3fwd: add event eth Rx/Tx adapter setup

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: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add event port and queue setup
Sunil Kumar Kori [Tue, 28 Jan 2020 05:34:59 +0000 (11:04 +0530)]
examples/l3fwd: add event port and queue setup

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

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add ethdev setup based on eventdev
Sunil Kumar Kori [Tue, 28 Jan 2020 05:34:58 +0000 (11:04 +0530)]
examples/l3fwd: add ethdev setup based on eventdev

Add ethernet port Rx/Tx queue setup for event device which are later
used for setting up event eth Rx/Tx adapters.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add event device configuration
Pavan Nikhilesh [Tue, 28 Jan 2020 05:34:57 +0000 (11:04 +0530)]
examples/l3fwd: add event device configuration

Add event device configuration based on the capabilities of the
probed event device.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: split pipelines based on capability
Sunil Kumar Kori [Tue, 28 Jan 2020 05:34:56 +0000 (11:04 +0530)]
examples/l3fwd: split pipelines based on capability

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>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoexamples/l3fwd: add framework for event device
Sunil Kumar Kori [Tue, 28 Jan 2020 05:34:55 +0000 (11:04 +0530)]
examples/l3fwd: add framework for event device

Add framework to enable event device as a producer of packets.
To switch between event mode and poll mode the following options
have been added:
`--mode="eventdev"` or `--mode="poll"`
Allow the user to select the schedule type to be either
RTE_SCHED_TYPE_ORDERED, RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_PARALLEL
through:
`--eventq-sched="ordered"` or `--eventq-sched="atomic"` or
`--eventq-sched="parallel"`
Allow the user to specify the number of Rx queues to be connected to
event queue using:
`--event-eth-rxqs`

Poll mode is still the default operation mode.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoevent/dsw: use custom element size ring for control
Mattias Rönnblom [Mon, 20 Jan 2020 15:03:00 +0000 (16:03 +0100)]
event/dsw: use custom element size ring for control

Replace DSW's use of regular DPDK rings (and code for
packing/unpacking control messages into void pointers) with custom
size rings.

In addition to cleaner code, this change allows DSW to support up to
the eventdev API's maximum of 255 ports by tweaking DSW_MAX_PORTS.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agomaintainers: set git tree for EAL and core libraries
David Marchand [Mon, 20 Jan 2020 20:35:13 +0000 (21:35 +0100)]
maintainers: set git tree for EAL and core libraries

Without a git tree, the "guess" script from dpdk-ci will ignore all files
that are referenced in those sections and let a patchset land in any
subtree.
Changes in the EAL, mbuf, mempool... go through the main repository.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agomaintainers: set git tree for packet framework and QoS
David Marchand [Tue, 14 Jan 2020 13:09:02 +0000 (14:09 +0100)]
maintainers: set git tree for packet framework and QoS

Mark librte_meter and librte_sched as being handled in the dpdk-next-qos
subtree.
The packet framework bits go through dpdk-next-pipeline.

Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agomaintainers: set git tree for test applications
David Marchand [Tue, 14 Jan 2020 09:18:15 +0000 (10:18 +0100)]
maintainers: set git tree for test applications

Changes on the main test applications should be considered against
subtrees where most of the API changes and development happen:
- testpmd goes through dpdk-next-net as it is mainly about ethdev,
- dpdk-test-compress-perf goes through dpdk-next-crypto since the
  compress API goes through this tree,
- dpdk-test-crypto-perf through dpdk-next-crypto,
- dpdk-test-eventdev through dpdk-next-eventdev,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agomaintainers: update for Windows
Ranjit Menon [Mon, 13 Jan 2020 19:35:34 +0000 (11:35 -0800)]
maintainers: update for Windows

Since Anand is no longer with Intel, Pallavi will replace him
as maintainer.

Signed-off-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agomaintainers: resign from flow API maintenance
Adrien Mazarguil [Wed, 8 Jan 2020 10:10:00 +0000 (11:10 +0100)]
maintainers: resign from flow API maintenance

Unfortunately due to lack of time, I've been unable to even participate to
flow API discussions for several months. Better make it official since this
is not going to improve anytime soon.

This doesn't mean I won't contribute to rte_flow in the future!

Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agomaintainers: update for failsafe and PCI library
Gaetan Rivet [Wed, 8 Jan 2020 14:13:32 +0000 (15:13 +0100)]
maintainers: update for failsafe and PCI library

My email address has changed, gaetan.rivet@6wind.com is no longer valid.

Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <grive@u256.net>
4 years agonet/ionic: ignore missing field initializers warning
Ferruh Yigit [Tue, 21 Jan 2020 09:58:01 +0000 (09:58 +0000)]
net/ionic: ignore missing field initializers warning

The compiler warning is:
   from .../drivers/net/ionic/ionic_dev.c:7:
.../drivers/net/ionic/ionic_if.h:202:5: note: ‘rsvd’ declared here
  u8 rsvd[62];
     ^

This has been observed with gcc 4.8.5, newer 9+ compiler are not giving
this warning.

Warning is a reminder to the user that there are some fields in the
struct not initialized with the default value.
But the C standard clarifies that in that case the field value will be
zero and code is aware of this behavior, so no initializing to a default
value is intentional and it is safe to ignore this compiler warning.

Adding '-Wno-missing-field-initializers' compiler flag to disable the
warning.

Reported-by: Anoob Joseph <anoobj@marvell.com>
Reported-by: Raslan Darawsheh <rasland@mellanox.com>
Reported-by: Xueming Zhang <xuemingx.zhang@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoversion: 20.02-rc1
Thomas Monjalon [Tue, 21 Jan 2020 00:26:11 +0000 (01:26 +0100)]
version: 20.02-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoeal: remove limitation on cpuset with --lcores
David Marchand [Mon, 2 Dec 2019 15:42:20 +0000 (16:42 +0100)]
eal: remove limitation on cpuset with --lcores

Contrary to the -c/-l options, where a logical core runs on the same
physical core in a 1:1 fashion (example: lcore 0 runs on core 0, lcore
16 runs on core 16), the --lcores option makes it possible to select the
physical cores on which runs a logical core.

However the current parsing code still limits the cpuset to the
[0, RTE_MAX_LCORE] range.

Example, before the patch, on a 24 cores system with RTE_MAX_LCORE == 16:
$ ./master/app/testpmd --no-huge --no-pci -m 512 --log-level *:debug \
 --lcores 0@16,1@17 -- -i --total-num-mbufs 2048
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Detected lcore 1 as core 1 on socket 0
EAL: Detected lcore 2 as core 2 on socket 0
EAL: Detected lcore 3 as core 3 on socket 0
EAL: Detected lcore 4 as core 4 on socket 0
EAL: Detected lcore 5 as core 5 on socket 0
EAL: Detected lcore 6 as core 6 on socket 0
EAL: Detected lcore 7 as core 8 on socket 0
EAL: Detected lcore 8 as core 9 on socket 0
EAL: Detected lcore 9 as core 10 on socket 0
EAL: Detected lcore 10 as core 11 on socket 0
EAL: Detected lcore 11 as core 12 on socket 0
EAL: Detected lcore 12 as core 13 on socket 0
EAL: Detected lcore 13 as core 14 on socket 0
EAL: Detected lcore 14 as core 0 on socket 0
EAL: Detected lcore 15 as core 1 on socket 0
EAL: Skipped lcore 16 as core 2 on socket 0
EAL: Skipped lcore 17 as core 3 on socket 0
EAL: Skipped lcore 18 as core 4 on socket 0
EAL: Skipped lcore 19 as core 5 on socket 0
EAL: Skipped lcore 20 as core 6 on socket 0
EAL: Skipped lcore 21 as core 8 on socket 0
EAL: Skipped lcore 22 as core 9 on socket 0
EAL: Skipped lcore 23 as core 10 on socket 0
EAL: Skipped lcore 24 as core 11 on socket 0
EAL: Skipped lcore 25 as core 12 on socket 0
EAL: Skipped lcore 26 as core 13 on socket 0
EAL: Skipped lcore 27 as core 14 on socket 0
EAL: Support maximum 16 logical core(s) by configuration.
EAL: Detected 16 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: invalid parameter for --lcores

We can remove this limitation by using a cpuset_t (which is a more
natural type since this is what gets passed to pthread_setaffinity*
in the end).

After the patch:
$ ./master/app/testpmd --no-huge --no-pci -m 512 --log-level *:debug \
 --lcores 0@16,1@17 -- -i --total-num-mbufs 2048
[...]
EAL: Master lcore 0 is ready (tid=7f94217bbc00;cpuset=[16])
EAL: lcore 1 is ready (tid=7f941f491700;cpuset=[17])

Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal: log all detected cores on startup
David Marchand [Mon, 2 Dec 2019 15:42:10 +0000 (16:42 +0100)]
eal: log all detected cores on startup

Add debug logs to have a trace of unused cores for -c/-l options on
systems with more cores than RTE_MAX_LCORE.

Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal: do not cache lcore detection state
David Marchand [Mon, 2 Dec 2019 15:42:01 +0000 (16:42 +0100)]
eal: do not cache lcore detection state

We use this state in control path only for services cores and -c/-l
options.
The value is not updated when using --lcores.

Use the internal helper where needed.

Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoeal/windows: fix cpuset macro name
David Marchand [Mon, 2 Dec 2019 15:41:46 +0000 (16:41 +0100)]
eal/windows: fix cpuset macro name

Fix the name of CPU_SETSIZE in hope we can reuse it in other parts of
the dpdk manipulating some rte_cpuset_t.

Fixes: 4dc2b4d2a4cd ("eal/windows: add headers for compatibility")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agodoc: add flow dump command in testpmd guide
Xiaoyu Min [Mon, 20 Jan 2020 04:01:45 +0000 (06:01 +0200)]
doc: add flow dump command in testpmd guide

Explanation of flow dump command is added into testpmd functions.

Fixes: 1e8a4e97b057 ("app/testpmd: add flow dump command")

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix modify actions support limitation
Bing Zhao [Mon, 20 Jan 2020 09:43:07 +0000 (11:43 +0200)]
net/mlx5: fix modify actions support limitation

In the root table, there is some limitation of total number of header
modify actions, 16 or 8 for each. But in other tables, there is no
such strict limitation. In an IPv6 case, the IP fields modifying
will occupy more actions than that in IPv4, so the total support
number should be increased in order to support as many actions as
possible for an IPv6 + TCP packet.
And in the meanwhile, the memory consumption should also be taken
into consideration because sometimes only several actions are needed.
The root table checking could also be done in low layer driver and
the error code will be returned if the actions number is over the
maximal supported value.

Fixes: 0e9d00027686 ("net/mlx5: check maximum modify actions number")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: fix meter suffix flow
Suanming Mou [Wed, 8 Jan 2020 10:41:09 +0000 (12:41 +0200)]
net/mlx5: fix meter suffix flow

The meter suffix flow item pointer restore is not correct to decrease
a fixed value. The incorrect operation will cause incorrect match to
the meter suffix flow, the flow create will fail once the magic number
in the wrong offset memory start with RTE_FLOW_ITEM_TYPE_END.
The pointer should decrease the real offset it increases.

Set the decrease value to the real offset the pointer increases to fix
the issue.

Fixes: 9ea9b049a960 ("net/mlx5: split meter flow")
Cc: stable@dpdk.org
Reported-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: support GTP
Dekel Peled [Thu, 16 Jan 2020 18:36:23 +0000 (20:36 +0200)]
net/mlx5: support GTP

This patch adds to MLX5 PMD support of matching on GTP item,
fields msg_type and teid, according to RFC [1].
GTP item validation and translation functions are added and called.
GTP tunnel type is added to supported tunnels.

[1] http://mails.dpdk.org/archives/dev/2019-December/152799.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agonet/mlx5: optimize Rx hash fields conversion
Dekel Peled [Wed, 15 Jan 2020 21:19:39 +0000 (23:19 +0200)]
net/mlx5: optimize Rx hash fields conversion

Previous fix added translation of Rx hash fields to PRM format.

This patch optimizes the fix, to perform value translation only
if value is not zero.
In case value is zero, there is no need to translate it.

Fixes: c3e33304a7f6 ("net/mlx5: fix setting of Rx hash fields")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agonet/mlx5: engage free on completion queue
Viacheslav Ovsiienko [Thu, 9 Jan 2020 17:16:07 +0000 (17:16 +0000)]
net/mlx5: engage free on completion queue

The free on completion queue keeps the indices of elts array,
all mbuf stored below this index should be freed on arrival
of normal send completion. In debug version it also contains
an index of completed transmitting descriptor (WQE) to check
queues synchronization.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: add free on completion queue
Viacheslav Ovsiienko [Thu, 9 Jan 2020 17:16:06 +0000 (17:16 +0000)]
net/mlx5: add free on completion queue

The new software manged entity is introduced in Tx datapath
- free on completion queue. This queue keeps the information
how many buffers stored in elts array must freed on send
completion. Each element of the queue contains transmitting
descriptor index to be in synch with completion entries (in
debug build only) and the index in elts array to free buffers.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: update Tx error handling routine
Viacheslav Ovsiienko [Thu, 9 Jan 2020 17:16:05 +0000 (17:16 +0000)]
net/mlx5: update Tx error handling routine

This is preparation step, we are going to store the index
of elts to free on completion in the dedicated free on
completion queue, this patch updates the elts freeing routine
and updates Tx error handling routine to be synced with
coming new queue.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: move Tx complete request routine
Viacheslav Ovsiienko [Thu, 9 Jan 2020 17:16:04 +0000 (17:16 +0000)]
net/mlx5: move Tx complete request routine

The complete request flag is set once per Tx burst call,
the code of appropriate routine moved to the end of sending
loop. This is preparation step to remove WQE reserved field
usage to store index of elts to free.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/ionic: support FW version
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:55 +0000 (16:53 +0100)]
net/ionic: support FW version

Add support for reading the firmware version.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support Tx checksum
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:54 +0000 (16:53 +0100)]
net/ionic: support Tx checksum

Add support for Tx checksumming.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add stats
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:53 +0000 (16:53 +0100)]
net/ionic: add stats

Add basic, per queue and extended statistics for
RX and TX, both from the adapter and the driver.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support RSS
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:52 +0000 (16:53 +0100)]
net/ionic: support RSS

Add code to manipulate the RSS configuration
used by the adapter.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add Rx and Tx handling
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:51 +0000 (16:53 +0100)]
net/ionic: add Rx and Tx handling

Add Rx and Tx queues setup and handling.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support flow control
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:50 +0000 (16:53 +0100)]
net/ionic: support flow control

Add support for managing Flow Control.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support Rx filters
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:49 +0000 (16:53 +0100)]
net/ionic: support Rx filters

Add support for managing RX filters based on MAC and VLAN.
Hardware cannot provide the list of filters, thus we keep
a local list.
Add support for promisc and allmulticast modes.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add basic port operations
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:48 +0000 (16:53 +0100)]
net/ionic: add basic port operations

Add support for port start/stop and handle basic features
including MTU and link up/down.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support notify queue
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:47 +0000 (16:53 +0100)]
net/ionic: support notify queue

Add support for the notify queue, which is used for events
published by the NIC.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support admin queue
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:46 +0000 (16:53 +0100)]
net/ionic: support admin queue

Add support for the admin queue, which is used for most
of the NIC configurations.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add doorbells
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:45 +0000 (16:53 +0100)]
net/ionic: add doorbells

Doorbell registers are used by the driver to signal to the NIC
that requests are waiting on the message queues.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: support basic LIF
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:44 +0000 (16:53 +0100)]
net/ionic: support basic LIF

Initialize LIFs (Logical Interfaces) which represents
external connections. The NIC can multiplex many LIFs
to a single port, but in most setups, LIF0 is the
primary control for the port.
Create a device for each LIF.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add port management commands
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:43 +0000 (16:53 +0100)]
net/ionic: add port management commands

Add port management commands that apply to the physical
ports associated with the PCI device, which might be
shared among several logical interfaces.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: register and initialize adapter
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:42 +0000 (16:53 +0100)]
net/ionic: register and initialize adapter

Register the Pensando ionic PMD (net_ionic) and define initial probe
and remove callbacks with adapter initialization.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add log
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:41 +0000 (16:53 +0100)]
net/ionic: add log

Add debug options to the config file.
Define macros used for logs and make use of config file options
to enable them.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add hardware structures definitions
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:40 +0000 (16:53 +0100)]
net/ionic: add hardware structures definitions

Add hardware structures and message commands definitions for
Pensando network adapters.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/ionic: add skeleton
Alfredo Cardigliano [Sun, 19 Jan 2020 15:53:39 +0000 (16:53 +0100)]
net/ionic: add skeleton

Add makefile and config file options to compile the Pensando ionic PMD.
Add feature and version map file.
Update maintainers file.

Signed-off-by: Alfredo Cardigliano <cardigliano@ntop.org>
Reviewed-by: Shannon Nelson <snelson@pensando.io>
4 years agonet/axgbe: add a HW quirk for register definitions
Selwin Sebastian [Mon, 20 Jan 2020 16:42:58 +0000 (22:12 +0530)]
net/axgbe: add a HW quirk for register definitions

V1000/R1000 processors are using the same PCI ids for the network
device as SNOWYOWL processor but has altered register definitions
for determining the window settings for the indirect PCS access.
Add support to check for this hardware and if found use the new
register values.

Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agomk: disable OCTEON TX2 EP with old arm64 compilers
Ali Alnubani [Mon, 20 Jan 2020 19:51:14 +0000 (19:51 +0000)]
mk: disable OCTEON TX2 EP with old arm64 compilers

OCTEON TX2 isn't built for gcc 4.8.5 as the compiler emits
"internal compiler error" on aarch64. This causes the following
build error when OCTEON TX2 EP is enabled:

  /usr/bin/ld: cannot find -lrte_common_octeontx2
  collect2: error: ld returned 1 exit status

Fixes: 56d46d13f736 ("raw/octeontx2_ep: add build infra and device probe")

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
4 years agonet/mlx5: allow allocated mbuf with external buffer
Viacheslav Ovsiienko [Mon, 20 Jan 2020 19:16:26 +0000 (19:16 +0000)]
net/mlx5: allow allocated mbuf with external buffer

In the Rx datapath the flags in the newly allocated mbufs
are all explicitly cleared but the EXT_ATTACHED_MBUF must be
preserved. It would allow to use mbuf pools with pre-attached
external data buffers.

The vectorized rx_burst routines are updated in order to
inherit the EXT_ATTACHED_MBUF from mbuf pool private
RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF flag.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agoapp/testpmd: add mempool with external data buffers
Viacheslav Ovsiienko [Mon, 20 Jan 2020 19:16:25 +0000 (19:16 +0000)]
app/testpmd: add mempool with external data buffers

The new mbuf pool type is added to testpmd. To engage the
mbuf pool with externally attached data buffers the parameter
"--mp-alloc=xbuf" should be specified in testpmd command line.

The objective of this patch is just to test whether mbuf pool
with externally attached data buffers works OK. The memory for
data buffers is allocated from DPDK memory, so this is not
"true" external memory from some physical device (this is
supposed the most common use case for such kind of mbuf pool).

The user should be aware that not all drivers support the mbuf
with EXT_ATTACHED_BUF flags set in newly allocated mbuf (many
PMDs just overwrite ol_flags field and flag value is getting
lost).

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agombuf: create pool with external memory buffers
Viacheslav Ovsiienko [Mon, 20 Jan 2020 19:16:24 +0000 (19:16 +0000)]
mbuf: create pool with external memory buffers

The dedicated routine rte_pktmbuf_pool_create_extbuf() is
provided to create mbuf pool with data buffers located in
the pinned external memory. The application provides the
external memory description and routine initializes each
mbuf with appropriate virtual and physical buffer address.
It is entirely application responsibility to register
external memory with rte_extmem_register() API, map this
memory, etc.

The new introduced flag RTE_PKTMBUF_POOL_F_PINNED_EXT_BUF
is set in private pool structure, specifying the new special
pool type. The allocated mbufs from pool of this kind will
have the EXT_ATTACHED_MBUF flag set and initialiazed shared
info structure, allowing cloning with regular mbufs (without
attached external buffers of any kind).

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agombuf: detach mbuf with pinned external buffer
Viacheslav Ovsiienko [Mon, 20 Jan 2020 19:16:23 +0000 (19:16 +0000)]
mbuf: detach mbuf with pinned external buffer

Update detach routine to check the mbuf pool type.
Introduce the special internal version of detach routine to handle
the special case of pinned external bufferon mbuf freeing.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agombuf: introduce routine to get private mbuf pool flags
Viacheslav Ovsiienko [Mon, 20 Jan 2020 19:16:22 +0000 (19:16 +0000)]
mbuf: introduce routine to get private mbuf pool flags

The routine rte_pktmbuf_priv_flags is introduced to fetch
the flags from the mbuf memory pool private structure
in unified fashion.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agombuf: use structure marker from EAL
Jerin Jacob [Thu, 19 Dec 2019 11:25:07 +0000 (16:55 +0530)]
mbuf: use structure marker from EAL

Use new marker typedef available in EAL and remove private marker
typedef.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agodrivers/net: use structure marker from EAL
Jerin Jacob [Thu, 19 Dec 2019 11:25:06 +0000 (16:55 +0530)]
drivers/net: use structure marker from EAL

Use new marker typedef available in EAL.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agoeal: introduce structure markers
Jerin Jacob [Thu, 19 Dec 2019 11:25:05 +0000 (16:55 +0530)]
eal: introduce structure markers

Introduce EAL typedef for structure 1B, 2B, 4B, 8B alignment marking and
a generic marker for a point in a structure.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agomem: improve log message for too low memzone segments
Artur Trybula [Fri, 20 Dec 2019 15:08:39 +0000 (16:08 +0100)]
mem: improve log message for too low memzone segments

In case of too low number of memzone segments user notification
was misleading. This patch improves the description by providing
better explanation about the cause.

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agoconfig: disable Linux kernel modules by default
Jerin Jacob [Fri, 17 Jan 2020 19:14:00 +0000 (00:44 +0530)]
config: disable Linux kernel modules by default

Based on the techboard meeting held on 2019-11-06,
It's been decided to disable all kmods by default from v20.02.

http://mails.dpdk.org/archives/dev/2019-November/151763.html

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
4 years agocontigmem: update for FreeBSD 13
Bruce Richardson [Fri, 3 Jan 2020 11:52:43 +0000 (11:52 +0000)]
contigmem: update for FreeBSD 13

FreeBSD 13 has changed the definition of vm_page_replace so we need
to have slightly different code paths around this function depending on
the BSD version.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoeal/freebsd: update CPU macro for FreeBSD 13
Bruce Richardson [Fri, 3 Jan 2020 11:52:42 +0000 (11:52 +0000)]
eal/freebsd: update CPU macro for FreeBSD 13

In (currently unreleased) FreeBSD 13, the CPU_NAND macro has been renamed
to CPU_ANDNOT, so we need to use different DPDK-specific macros depending
on what system-defined ones are present.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoapp/test: remove meson dependency on file in /sys
Bruce Richardson [Mon, 20 Jan 2020 12:22:18 +0000 (12:22 +0000)]
app/test: remove meson dependency on file in /sys

Meson versions 0.52 and 0.53 are being overly smart and detecting the path
"/sys/devices/system/cpu/present" in the call to cat in
app/test/meson.build and then adding it as a dependency to the build
configuration. This causes issues on systems where the timestamp of that
file always returns the current time, since it means that the build.ninja
file is always out of date, and therefore needs to be rebuilt.

We can fix this by just using a simple shell script to return the coremask
appropriately for BSD and Linux, and removing that code logic from meson -
thereby hiding the use of the /sys file.

Fixes: c70622ac6f72 ("test: detect number of cores with meson")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agometer: remove experimental flag from RFC4115 trTCM API
Eelco Chaudron [Tue, 17 Dec 2019 13:07:53 +0000 (08:07 -0500)]
meter: remove experimental flag from RFC4115 trTCM API

Moved RFC4115 APIs to non-experimental as they have been there
since 19.02. Also, these APIs are the same as the non RFC4115 APIs.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agombuf: improve API doc for attaching external buffer
Jörg Thalheim [Thu, 26 Dec 2019 12:54:10 +0000 (13:54 +0100)]
mbuf: improve API doc for attaching external buffer

Enhance API documentation of rte_pktmbuf_attach_extbuf() to
explain that the attached mbuf is initialized with length = 0.

Link: https://bugs.dpdk.org/show_bug.cgi?id=362
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
4 years agomempool: remove memory wastage on non-x86
Jerin Jacob [Tue, 14 Jan 2020 21:06:03 +0000 (02:36 +0530)]
mempool: remove memory wastage on non-x86

The existing optimize_object_size() function address the memory object
alignment constraint on x86 for better performance.

Different (micro) architecture may have different memory alignment
constraint for better performance and it not the same as the existing
optimize_object_size().

Some use, XOR(kind of CRC) scheme to enable DRAM channel distribution
based on the address and some may have a different formula.

Introducing arch_mem_object_align() function to abstract
the difference between different (micro) architectures to avoid
wasting memory for mempool object alignment for the architecture
that it is not required to do so.

Details on the amount of memory saving:

Currently, arm64 based architectures use the default (nchan=4,
nrank=1). The worst case is for an object whose size (including mempool
header) is 2 cache lines, where it is optimized to 3 cache lines (+50%).

Examples for cache lines size = 64:
  orig     optimized
  64    -> 64           +0%
  128   -> 192          +50%
  192   -> 192          +0%
  256   -> 320          +25%
  320   -> 320          +0%
  384   -> 448          +16%
  ...
  2304  -> 2368         +2.7%  (~mbuf size)

Additional details:
https://www.mail-archive.com/dev@dpdk.org/msg149157.html

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agodoc: announce API change for mempool IOVA populate
Olivier Matz [Fri, 17 Jan 2020 14:57:53 +0000 (15:57 +0100)]
doc: announce API change for mempool IOVA populate

Starting from v20.05, rte_mempool_populate_iova() will return 0.
The ABI will be preserved through symbol versioning until 20.11.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
4 years agomempool: fix populate with small virtual chunks
Olivier Matz [Fri, 17 Jan 2020 14:57:52 +0000 (15:57 +0100)]
mempool: fix populate with small virtual chunks

To populate a mempool with a virtual area, the mempool code calls
rte_mempool_populate_iova() for each iova-contiguous area. It happens
(rarely) that this area is too small to store one object. In this case,
rte_mempool_populate_iova() returns an error, which is forwarded by
rte_mempool_populate_virt().

This case should not throw an error in rte_mempool_populate_virt().
Instead, the area that is too small should just be ignored.

To fix this issue, change the return value of
rte_mempool_populate_iova() to 0 when no object can be populated,
so it can be ignored by the caller. As this would be an API/ABI change,
only do this modification internally for now.

Fixes: 354788b60cfd ("mempool: allow populating with unaligned virtual area")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Alvin Zhang <alvinx.zhang@intel.com>
4 years agomempool: fix slow allocation of large pools
Olivier Matz [Fri, 17 Jan 2020 09:51:49 +0000 (10:51 +0100)]
mempool: fix slow allocation of large pools

When allocating a mempool which is larger than the largest
available area, it can take a lot of time:

a- the mempool calculate the required memory size, and tries
   to allocate it, it fails
b- then it tries to allocate the largest available area (this
   does not request new huge pages)
c- add this zone to the mempool, this triggers the allocation
   of a mem hdr, which request a new huge page
d- back to a- until mempool is populated or until there is no
   more memory

This can take a lot of time to finally fail (several minutes): in step
a- it takes all available hugepages on the system, then release them
after it fails.

The problem appeared with commit eba11e364614 ("mempool: reduce wasted
space on populate"), because smaller chunks are now allowed. Previously,
it had to be at least one page size, which is not the case in step b-.

To fix this, implement our own way to allocate the largest available
area instead of using the feature from memzone: if an allocation fails,
try to divide the size by 2 and retry. When the requested size falls
below min_chunk_size, stop and return an error.

Fixes: eba11e364614 ("mempool: reduce wasted space on populate")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
4 years agomempool: fix anonymous populate
Olivier Matz [Fri, 17 Jan 2020 14:34:29 +0000 (15:34 +0100)]
mempool: fix anonymous populate

The documentation says that a negative errno is returned on error, but
in most places that's not the case.

Fix the documentation and the exceptions in code. The second one
(return from populate_virt) also fixes a memory leak.

Note that testpmd was using the function correctly.

Fixes: aa10457eb4c2 ("mempool: make mempool populate and free api public")
Fixes: 6780f72fb82f ("mempool: populate with anonymous memory")
Fixes: 66e7ba0bad4c ("mempool: ensure mempool is initialized before populating")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
4 years agoethdev: allow multiple security sessions to use flow rule
Anoob Joseph [Sun, 8 Dec 2019 10:41:23 +0000 (16:11 +0530)]
ethdev: allow multiple security sessions to use flow rule

The rte_security API which enables inline protocol/crypto feature
mandates that for every security session an rte_flow is created. This
would internally translate to a rule in the hardware which would do
packet classification.

In rte_security, one SA would be one security session. And if an rte_flow
need to be created for every session, the number of SAs supported by an
inline implementation would be limited by the number of rte_flows the
PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this
limitation can be overcome. Multiple flows will be able to use one rule
for SECURITY processing. In this case, the security session provided as
conf would be NULL.

Application should do an rte_flow_validate() to make sure the flow is
supported on the PMD.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agoraw/octeontx2_ep: fix shared library
Thomas Monjalon [Mon, 20 Jan 2020 10:58:54 +0000 (11:58 +0100)]
raw/octeontx2_ep: fix shared library

The version of the PMD should not be overwritten with LIBABIVER.
All internal libs must have the same version.

Moreover, specifying LIBABIVER in the driver causes a symbolic link loop:
librte_rawdev_octeontx2_ep.so.1 -> librte_rawdev_octeontx2_ep.so.1

Fixes: 56d46d13f736 ("raw/octeontx2_ep: add build infra and device probe")

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agoexamples/ntb: fix mempool ops setting
Xiaoyun Li [Wed, 25 Dec 2019 09:09:42 +0000 (17:09 +0800)]
examples/ntb: fix mempool ops setting

Mempool ops may register in different order when compiling. The default
ops index is always zero but the wanted ops is ring_mp_mc. This patch
sets best mempool ops before generating mbuf pool to fix this issue.

Fixes: 5194299d6ef5 ("examples/ntb: support more functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
4 years agodoc: fix igb_uio parameter in ntb guide
Xiaoyun Li [Wed, 4 Dec 2019 15:19:31 +0000 (23:19 +0800)]
doc: fix igb_uio parameter in ntb guide

In prerequisites of ntb guide, the correct flag when loading igb_uio
module should be `wc_activate=1`, not `wc_active=1`.

Fixes: 11b5c7daf019 ("raw/ntb: add enqueue and dequeue functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agoraw/ntb: fix write memory barrier
Xiaoyun Li [Wed, 4 Dec 2019 15:19:16 +0000 (23:19 +0800)]
raw/ntb: fix write memory barrier

All buffers and ring info should be written before tail register update.
This patch relocates the write memory barrier before updating tail register
to avoid potential issues.

Fixes: 11b5c7daf019 ("raw/ntb: add enqueue and dequeue functions")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agoraw/octeontx2_ep: add driver self test
Mahipal Challa [Mon, 13 Jan 2020 06:00:41 +0000 (11:30 +0530)]
raw/octeontx2_ep: add driver self test

Add rawdev's selftest feature in SDP VF driver, which
verifies the EP mode functionality test.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add dequeue operation
Mahipal Challa [Mon, 13 Jan 2020 06:00:40 +0000 (11:30 +0530)]
raw/octeontx2_ep: add dequeue operation

Add rawdev dequeue operation for SDP VF devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add enqueue operation
Mahipal Challa [Mon, 13 Jan 2020 06:00:39 +0000 (11:30 +0530)]
raw/octeontx2_ep: add enqueue operation

Add rawdev enqueue operation for SDP VF devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add device uninitialization
Mahipal Challa [Mon, 13 Jan 2020 06:00:38 +0000 (11:30 +0530)]
raw/octeontx2_ep: add device uninitialization

Add rawdev close/uninitialize operation for SDP
VF devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add device configuration
Mahipal Challa [Mon, 13 Jan 2020 06:00:37 +0000 (11:30 +0530)]
raw/octeontx2_ep: add device configuration

Register "dev_configure" API to configure/initialize the SDP
VF PCIe devices.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agoraw/octeontx2_ep: add build infra and device probe
Mahipal Challa [Mon, 13 Jan 2020 06:00:36 +0000 (11:30 +0530)]
raw/octeontx2_ep: add build infra and device probe

Add the OCTEON TX2 SDP EP device probe along with the
build infrastructure for Make and meson builds.

Signed-off-by: Mahipal Challa <mchalla@marvell.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
4 years agotimer: add API to query ticks until the next timer
Stephen Hemminger [Tue, 17 Dec 2019 00:55:03 +0000 (16:55 -0800)]
timer: add API to query ticks until the next timer

It is useful to know when the next timer will expire when
using rte_epoll_wait (or sleep when idle). This experimental
API provides a hook to query the number of ticks remaining.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
4 years agolatency: fix calculation for multi-thread
Reshma Pattan [Thu, 5 Dec 2019 17:18:11 +0000 (17:18 +0000)]
latency: fix calculation for multi-thread

Make latency calculation multithread safe by
using spinlock.

Fixes: 5cd3cac9ed ("latency: added new library for latency stats")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
4 years agohash: add max key id query API
Kumar Amber [Tue, 26 Nov 2019 02:39:13 +0000 (02:39 +0000)]
hash: add max key id query API

Adding new API function to query the maximum key ID
that could possibly be returned by rte_hash_add_key and
rte_hash_add_key_with_hash. When RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD
is set, the maximum key id is larger than the entry count specified
by the user.

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
4 years agohash: remove unnecessary locks in lock-free
Dharmik Thakkar [Thu, 21 Nov 2019 18:17:59 +0000 (12:17 -0600)]
hash: remove unnecessary locks in lock-free

Remove __hash_rw_reader_unlock() calls from lock free hash lookup

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>