dpdk.git
6 years agomempool/bucket: implement block dequeue operation
Artem V. Andreev [Thu, 26 Apr 2018 10:59:22 +0000 (11:59 +0100)]
mempool/bucket: implement block dequeue operation

Signed-off-by: Artem V. Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agomempool: support block dequeue operation
Artem V. Andreev [Thu, 26 Apr 2018 10:59:21 +0000 (11:59 +0100)]
mempool: support block dequeue operation

If mempool manager supports object blocks (physically and virtual
contiguous set of objects), it is sufficient to get the first
object only and the function allows to avoid filling in of
information about each block member.

Signed-off-by: Artem V. Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: implement abstract mempool info API
Artem V. Andreev [Thu, 26 Apr 2018 10:59:20 +0000 (11:59 +0100)]
mempool: implement abstract mempool info API

Primarily, it is intended as a way for the mempool driver to provide
additional information on how it lays up objects inside the mempool.

Signed-off-by: Artem V. Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool/bucket: implement bucket mempool manager
Artem V. Andreev [Thu, 26 Apr 2018 10:59:19 +0000 (11:59 +0100)]
mempool/bucket: implement bucket mempool manager

The manager provides a way to allocate physically and virtually
contiguous set of objects.

Signed-off-by: Artem V. Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoapp/pdump: remove unused socket path options
Thomas Monjalon [Wed, 25 Apr 2018 13:03:39 +0000 (15:03 +0200)]
app/pdump: remove unused socket path options

The options --server-socket-path and --client-socket-path
were said to be deprecated and will be removed soon.
No need to wait for removing application options which have
no effect, and can confuse the user.

Fixes: 660098d61f57 ("pdump: use generic multi-process channel")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agotest/mempool: fix autotest retry
Andrew Rybchenko [Wed, 25 Apr 2018 17:00:37 +0000 (18:00 +0100)]
test/mempool: fix autotest retry

Single producer / single consumer mempool handle is stored in static
variable and the mempool allocated if stored value is NULL.
If the mempool is freed, NULL should be restored to make sure that
the mempool is allocated once again next time when the test is run.

Fixes: 8ef772aee072 ("app/test: rework mempool test")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agotest: fix memory flags test for low NUMA nodes number
Phil Yang [Tue, 6 Feb 2018 02:21:38 +0000 (10:21 +0800)]
test: fix memory flags test for low NUMA nodes number

Since RTE_MAX_NUMA_NODES is configurable, the existing socket number
could greater than RTE_MAX_NUMA_NODES. Optimize test case to cover this
situation.(i.e RTE_MAX_NUMA_NODES=1)

Fixes: 45f1b6e8680a ("app: add new tests on eal flags")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
6 years agobus/fslmc: do not log messages if bus not present
Stephen Hemminger [Wed, 25 Apr 2018 23:16:37 +0000 (16:16 -0700)]
bus/fslmc: do not log messages if bus not present

A typical distribution will compile with default config and all
buses enabled. Therefore every driver should be silent and not
log anything for this normal case.

This patch gets rid of these messages when running on basic x86
environment such as bare metal or VM.

fslmc: DPAA2: DPRC not available
fslmc: FSLMC Bus Not Available. Skipping

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agoeal: shut up warning about master lcore
Stephen Hemminger [Thu, 26 Apr 2018 00:48:39 +0000 (17:48 -0700)]
eal: shut up warning about master lcore

This message looks suspicious and seen on healthy testpmd.
 EAL: WARNING: Master core has no memory on local socket!

The message is wrong: the master lcore is 0 and its socket is 0
and there are multiple available memory segments on socket 0.

At that point in the startup process, the count value is zero,
meaning they are not used yet so the check_socket gets confused.

Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoeal: make semantics of lcore role function more intuitive
Anatoly Burakov [Thu, 26 Apr 2018 13:42:31 +0000 (14:42 +0100)]
eal: make semantics of lcore role function more intuitive

rte_lcore_has_role() returns 0 if role of lcore matches requested
role. The return value of the API is confusing, and this is a known
problem with a deprecation notice announcing the change to more
intuitive semantics:

Commit 064518f68d48 ("doc: announce EAL API change to lcore role function")

Implement changes announced in the deprecation notice, and remove it.
Also, fix usages of this API to reflect the change. Control thread patches
expected new behavior and were broken before, now they are fixed as well.

Fixes: d651ee4919cd ("eal: set affinity for control threads")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoevent/octeontx: fix snprintf mempool name overflow
Pavan Nikhilesh [Mon, 23 Apr 2018 13:39:33 +0000 (19:09 +0530)]
event/octeontx: fix snprintf mempool name overflow

Bugzilla-ID: 28
Fixes: f874c1eb1519 ("event/octeontx: create and free timer adapter")

Reported-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agodoc: fix PDF build
Marko Kovacevic [Wed, 25 Apr 2018 13:59:52 +0000 (14:59 +0100)]
doc: fix PDF build

A .svg extension was added instead of .* which caused
the pdf docs to not build this change fixes that.

Fixes: a5e1231f099b ("net/szedata2: do not affect Ethernet interfaces")

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
6 years agoservice: remove experimental tags
Harry van Haaren [Thu, 5 Apr 2018 13:15:46 +0000 (14:15 +0100)]
service: remove experimental tags

This commit removes the experimental tags from the
service cores functions, they now become part of the
main DPDK API/ABI.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoeal/linux: remove useless unlock of hugepage when clearing
Anatoly Burakov [Wed, 25 Apr 2018 10:08:13 +0000 (11:08 +0100)]
eal/linux: remove useless unlock of hugepage when clearing

Coverity was complaining about not checking result of call to
fcntl() for unlocking the file. Disregarding the fact that error
value returned from fcntl() unlock call is highly unlikely in the
first place, we are subsequently calling close() on that same fd,
which will drop the lock, which makes call to fcntl() unnecessary.

Fix this by removing a call to fcntl() altogether.

Coverity issue: 272607
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agodoc: update preferred log level syntax in guides
Stephen Hemminger [Wed, 25 Apr 2018 03:17:50 +0000 (20:17 -0700)]
doc: update preferred log level syntax in guides

Use symbolic names and match rather than numbers and regex
in the guides.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agolog: add ability to match log type with globbing
Stephen Hemminger [Wed, 25 Apr 2018 03:17:49 +0000 (20:17 -0700)]
log: add ability to match log type with globbing

Regular expressions are not the best way to match a hierarchical
pattern like dynamic log levels. And the separator for dynamic
log levels is period which is the regex wildcard character.

A better solution is to use filename matching 'globbing' so
that log levels match like file paths. For compatibility,
use colon to separate pattern match style arguments. For
example:
--log-level 'pmd.net.virtio.*:debug'

This also makes the documentation match what really happens
internally.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agoeal: make log level save private
Stephen Hemminger [Wed, 25 Apr 2018 03:17:48 +0000 (20:17 -0700)]
eal: make log level save private

We don't want format of eal log level saved values to be visible
in ABI. Move to private storage in eal_common_log.

Includes minor optimization. Compile the regular expression for
each log match once, rather than each time it is used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agoeal: allow symbolic log levels
Stephen Hemminger [Wed, 25 Apr 2018 03:17:47 +0000 (20:17 -0700)]
eal: allow symbolic log levels

Much easeier to remember names than numbers. Allows
--log-level=pmd.net.ixgbe.*,debug

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agoeal: make syslog facility table const
Stephen Hemminger [Wed, 25 Apr 2018 03:17:46 +0000 (20:17 -0700)]
eal: make syslog facility table const

The mapping for facility name to value can be const.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
6 years agoeal: abstract away the auxiliary vector
Aaron Conole [Mon, 2 Apr 2018 18:24:34 +0000 (14:24 -0400)]
eal: abstract away the auxiliary vector

Rather than attempting to load the contents of the auxv directly,
prefer to use an exposed API - and if that doesn't exist then attempt
to load the vector.  This is because on some systems, when a user
is downgraded, the /proc/self/auxv file retains the old ownership
and permissions.  The original method of /proc/self/auxv is retained.

This also removes a potential abort() in the code when compiled with
NDEBUG.  A quick parse of the code shows that many (if not all) of
the CPU flag parsing isn't used internally, so it should be okay.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
6 years agoeal: add last init priority
Gaetan Rivet [Tue, 24 Apr 2018 11:28:53 +0000 (13:28 +0200)]
eal: add last init priority

Add the priority RTE_PRIORITY_LAST, used for initialization routines
meant to be run after all other constructors.

This priority becomes the default priority for all DPDK constructors.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agoeal: list acceptable init priorities
Gaetan Rivet [Tue, 24 Apr 2018 11:28:52 +0000 (13:28 +0200)]
eal: list acceptable init priorities

Build a central list to quickly see each used priorities for
constructors, allowing to verify that they are both above 100 and in the
proper order.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agodevargs: rename legacy API
Gaetan Rivet [Mon, 23 Apr 2018 23:54:52 +0000 (01:54 +0200)]
devargs: rename legacy API

The previous symbols were deprecated for two releases.
They are now marked as such and cannot be used anymore.

They are replaced by ones respecting the new namespace that are marked
experimental.

As a result, eth_dev attach and detach are slightly reworked to follow
the changes.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: use proper namespace prefix
Gaetan Rivet [Mon, 23 Apr 2018 23:54:51 +0000 (01:54 +0200)]
devargs: use proper namespace prefix

rte_eal_devargs is useless, rte_devargs is sufficient.

Only experimental functions are changed for now.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: update syntax documentation
Gaetan Rivet [Mon, 23 Apr 2018 23:54:50 +0000 (01:54 +0200)]
devargs: update syntax documentation

Device syntax documentation is out of date.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: make parsing variadic
Gaetan Rivet [Mon, 23 Apr 2018 23:54:49 +0000 (01:54 +0200)]
devargs: make parsing variadic

rte_eal_devargs_parse can be used by EAL subsystems, drivers,
applications alike.

Device parameters may be presented with different structure each time;
as a single declaration string or several strings each describing
different parts of the declaration.

To simplify the use of this parsing facility, its parameters are made
variadic.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: make devargs list private
Gaetan Rivet [Mon, 23 Apr 2018 23:54:48 +0000 (01:54 +0200)]
devargs: make devargs list private

Initially, rte_devargs was meant to be populated once and sometimes
accessed, then never emptied.

With the new hotplug functionality having better standing, new usage
appeared with repeated addition of devices and their subsequent removal.

Exposing devargs_list pushed bus drivers and libraries to be careless
and inconsistent in their memory management. Making it private will
allow to rationalize this part of the EAL and ensure that fewer memory
leaks occur during operations.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agotest: remove devargs unit tests
Gaetan Rivet [Mon, 23 Apr 2018 23:54:47 +0000 (01:54 +0200)]
test: remove devargs unit tests

The current test will not be compatible anymore with a private
devargs list.

Moreover, the new functions should have new tests, while the existing
API will be removed.

The current unit tests are thus obsolete and hereby removed.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agonet/vdev_netvsc: do not reference devargs list
Gaetan Rivet [Mon, 23 Apr 2018 23:54:46 +0000 (01:54 +0200)]
net/vdev_netvsc: do not reference devargs list

This list should not be used by drivers.
Use the public API instead.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agobus/pci: do not reference devargs list
Gaetan Rivet [Mon, 23 Apr 2018 23:54:45 +0000 (01:54 +0200)]
bus/pci: do not reference devargs list

This list should not be used by drivers.
Use the public API instead.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agobus/vdev: do not reference devargs list
Gaetan Rivet [Mon, 23 Apr 2018 23:54:44 +0000 (01:54 +0200)]
bus/vdev: do not reference devargs list

This list should not be operated upon by drivers.
Use the public API to achieve the same functionalities.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: introduce iterator
Gaetan Rivet [Mon, 23 Apr 2018 23:54:43 +0000 (01:54 +0200)]
devargs: introduce iterator

In preparation to making devargs_list private.

Bus drivers generally need to access rte_devargs pertaining to their
operations. This match is a common operation for bus drivers.

Add a new accessor for the rte_devargs list.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoexamples: use new API to create control threads
Olivier Matz [Tue, 24 Apr 2018 14:46:51 +0000 (16:46 +0200)]
examples: use new API to create control threads

A new API was introduced to create control thread:
rte_ctrl_thread_create(). Use it in examples when relevant.

While at it, change the prototype of the thread start functions: it's
not a good idea to cast it in (void *) since the compiler won't check
that the prototype is compatible.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoeal: set affinity for control threads
Olivier Matz [Tue, 24 Apr 2018 14:46:50 +0000 (16:46 +0200)]
eal: set affinity for control threads

The management threads must not bother the dataplane or service cores.
Set the affinity of these threads accordingly.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoeal: set name when creating a control thread
Olivier Matz [Tue, 24 Apr 2018 14:46:49 +0000 (16:46 +0200)]
eal: set name when creating a control thread

To avoid code duplication, add a parameter to rte_ctrl_thread_create()
to specify the name of the thread.

This requires to add a wrapper for the thread start routine in
rte_thread_init(), which will first wait that the thread is configured.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoeal: add function to create control threads
Olivier Matz [Tue, 24 Apr 2018 14:46:48 +0000 (16:46 +0200)]
eal: add function to create control threads

Many parts of dpdk use their own management threads. Introduce a new
wrapper for thread creation that will be extended in next commits to set
the name and affinity.

To be consistent with other DPDK APIs, the return value is negative in
case of error, which was not the case for pthread_create().

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agouse sizeof to avoid double use of a length define
Olivier Matz [Tue, 24 Apr 2018 14:46:47 +0000 (16:46 +0200)]
use sizeof to avoid double use of a length define

Only a cosmetic change: the *_LEN defines are already used
when defining the buffer. Using sizeof() ensures that the length
stays consistent, even if the definition is modified.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agotest/power: fix build with shared library
Reshma Pattan [Tue, 24 Apr 2018 22:10:21 +0000 (23:10 +0100)]
test/power: fix build with shared library

Using private api `guest_channel_host_connect()`
will cause shared library build failure:
        test_power_kvm_vm.c:(.text+0x2cb):
        undefined reference to `guest_channel_host_connect'

So revert the changes done.

Fixes: d550a8cc31f3 ("app/test: enhance power manager unit tests")

Reported-by: Bruce Richardson <bruce.richardson@intel.com>
Suggested-by: David Hunt <david.hunt@intel.com>
Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agodrivers/net: share vdev data to secondary process
Jianfeng Tan [Tue, 24 Apr 2018 05:51:24 +0000 (05:51 +0000)]
drivers/net: share vdev data to secondary process

dpdk-procinfo, as a secondary process, cannot fetch stats for vdev.

This patch enables that by attaching the port from the shared data.
We also fill the eth dev ops, with only some ops works in secondary
process, for example, stats_get().

Note that, we still cannot Rx/Tx packets on the ports which do not
support multi-process.

Reported-by: Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agodrivers/net: do not use private ethdev data
Jianfeng Tan [Tue, 24 Apr 2018 05:51:23 +0000 (05:51 +0000)]
drivers/net: do not use private ethdev data

We introduced private rte_eth_dev_data to allow vdev to be created
both in primary process and secondary process(es). This is not
friendly to multi-process model, for example, it leads to port id
contention issue if two processes both find the data entry is free.

And to get stats of primary vdev in secondary, we must allocate
from the pre-defined array so that we can find it.

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agobus/vdev: scan by multi-process channel
Jianfeng Tan [Tue, 24 Apr 2018 05:51:22 +0000 (05:51 +0000)]
bus/vdev: scan by multi-process channel

To scan the vdevs in primary, we send request to primary process
to obtain the names for vdevs.

Only the name is shared from the primary. In probe(), the device
driver is supposed to locate (or request more) the detail
information from the primary.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agobus/vdev: add lock on device list
Jianfeng Tan [Tue, 24 Apr 2018 05:51:21 +0000 (05:51 +0000)]
bus/vdev: add lock on device list

As we could add virtual devices from different threads now, we
add a spin lock to protect the vdev device list.

Suggested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoeal: bring forward multi-process channel init
Jianfeng Tan [Tue, 24 Apr 2018 05:51:20 +0000 (05:51 +0000)]
eal: bring forward multi-process channel init

Adjust the init sequence: put mp channel init before bus scan
so that we can init the vdev bus through mp channel in the
secondary process before the bus scan.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agomempool: support flushing the default cache
Artem V. Andreev [Mon, 16 Apr 2018 13:24:40 +0000 (14:24 +0100)]
mempool: support flushing the default cache

Mempool get/put API cares about cache itself, but sometimes it is
required to flush the cache explicitly.

The function is moved in the file since it now requires
rte_mempool_default_cache().

Signed-off-by: Artem V. Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: remove callback to register memory area
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:39 +0000 (14:24 +0100)]
mempool: remove callback to register memory area

The callback is not required any more since there is a new callback
to populate objects using provided memory area which provides
the same information.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool/dpaa: prepare to remove register memory area op
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:38 +0000 (14:24 +0100)]
mempool/dpaa: prepare to remove register memory area op

Populate mempool driver callback is executed a bit later than
register memory area, provides the same information and will
substitute the later since it gives more flexibility and in addition
to notification about memory area allows to customize how mempool
objects are stored in memory.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agomempool/octeontx: prepare to remove register memory area op
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:37 +0000 (14:24 +0100)]
mempool/octeontx: prepare to remove register memory area op

Callback to populate pool objects has all required information and
executed a bit later than register memory area callback.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
6 years agomempool: deprecate xmem functions
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:36 +0000 (14:24 +0100)]
mempool: deprecate xmem functions

Move rte_mempool_xmem_size() code to internal helper function
since it is required in two places: deprecated rte_mempool_xmem_size()
and non-deprecated rte_mempool_op_calc_mem_size_default().

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: remove callback to get capabilities
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:35 +0000 (14:24 +0100)]
mempool: remove callback to get capabilities

The callback was introduced to let generic code to know octeontx
mempool driver requirements to use single physically contiguous
memory chunk to store all objects and align object address to
total object size. Now these requirements are met using a new
callbacks to calculate required memory chunk size and to populate
objects using provided memory chunk.

These capability flags are not used anywhere else.

Restricting capabilities to flags is not generic and likely to
be insufficient to describe mempool driver features. If required
in the future, API which returns structured information may be
added.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: add op to populate objects using provided memory
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:34 +0000 (14:24 +0100)]
mempool: add op to populate objects using provided memory

The callback allows to customize how objects are stored in the
memory chunk. Default implementation of the callback which simply
puts objects one by one is available.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: add op to calculate memory size to be allocated
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:33 +0000 (14:24 +0100)]
mempool: add op to calculate memory size to be allocated

Size of memory chunk required to populate mempool objects depends
on how objects are stored in the memory. Different mempool drivers
may have different requirements and a new operation allows to
calculate memory size in accordance with driver requirements and
advertise requirements on minimum memory chunk size and alignment
in a generic way.

Bump ABI version since the patch breaks it.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agomempool: ensure mempool is initialized before populating
Artem V. Andreev [Mon, 16 Apr 2018 13:24:32 +0000 (14:24 +0100)]
mempool: ensure mempool is initialized before populating

Callback to calculate required memory area size may require mempool
driver data to be already allocated and initialized.

Signed-off-by: Artem V. Andreev <artem.andreev@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: rename flag to control IOVA-contiguous objects
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:31 +0000 (14:24 +0100)]
mempool: rename flag to control IOVA-contiguous objects

Flag MEMPOOL_F_NO_PHYS_CONTIG is renamed as MEMPOOL_F_NO_IOVA_CONTIG
to follow IO memory contiguous terminology.
MEMPOOL_F_NO_PHYS_CONTIG is kept for backward compatibility and
deprecated.

Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agomempool: fix leak when no objects are populated
Andrew Rybchenko [Mon, 16 Apr 2018 13:24:30 +0000 (14:24 +0100)]
mempool: fix leak when no objects are populated

Fixes: 84121f197187 ("mempool: store memory chunks in a list")
Cc: stable@dpdk.org
Suggested-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoapp/test: enhance power manager unit tests
Reshma Pattan [Wed, 11 Apr 2018 14:14:27 +0000 (15:14 +0100)]
app/test: enhance power manager unit tests

Unit Testcases are added for power_acpi_cpu_freq,
power_kvm_vm_test to improve coverage

Signed-off-by: Jananee Parthasarathy <jananeex.m.parthasarathy@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
6 years agomk: fix make defconfig on FreeBSD
David Hunt [Mon, 23 Apr 2018 13:09:02 +0000 (14:09 +0100)]
mk: fix make defconfig on FreeBSD

On FreeBSD, make defconfig generates the config as
"defconfig_x86_64-bsdapp-", which does not resolve to any known
config file.

On FreeBSD, we get amd64 out of "uname -m", which was not handled by
the list of checks, but which now resolves to x86_64-native.

Then we run '$CC --version', and use grep -o with the list of known
compilers, and set to either gcc, icc or clang. Grep's '-o' option
returns the matched word rather than the whole line, making the
result easier to use.

The remaining code in the patch then takes ${compiler}, the "uname -m"
output and assembles them all together into a valid freebsd config name,
i.e. "defconfig_x86_64-native-bsdapp-clang".

Fixes: bce6c42c4ad5 ("mk: add sensible default target with defconfig")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoipc: fix timeout handling in async
Jianfeng Tan [Fri, 20 Apr 2018 15:20:12 +0000 (15:20 +0000)]
ipc: fix timeout handling in async

In original implementation, timeout event for an async request
will be ignored. As a result, an async request will never
trigger the action if it cannot receive any reply any more.

We fix this by counting timeout as a processed reply.

Fixes: f05e26051c15 ("eal: add IPC asynchronous request")

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoipc: clean up code
Jianfeng Tan [Fri, 20 Apr 2018 15:20:11 +0000 (15:20 +0000)]
ipc: clean up code

Following below commit, we change some internal function and variable
names:
  commit ce3a7312357b ("eal: rename IPC request as synchronous one")

Also use calloc to supersede malloc + memset for code clean up.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agoipc: fix resource leak in init failure
Anatoly Burakov [Tue, 17 Apr 2018 15:46:26 +0000 (16:46 +0100)]
ipc: fix resource leak in init failure

Coverity issue: 272609
Fixes: f05e26051c15 ("eal: add IPC asynchronous request")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoipc: fix return without mutex unlock
Anatoly Burakov [Tue, 17 Apr 2018 15:46:25 +0000 (16:46 +0100)]
ipc: fix return without mutex unlock

gettimeofday() returning a negative value is highly unlikely,
but if it ever happens, we will exit without unlocking the mutex.
Arguably at that point we'll have bigger problems, but fix this
issue anyway.

Coverity issue: 272595
Fixes: f05e26051c15 ("eal: add IPC asynchronous request")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoipc: use strlcpy where applicable
Anatoly Burakov [Tue, 17 Apr 2018 15:46:24 +0000 (16:46 +0100)]
ipc: use strlcpy where applicable

This also silences (or should silence) a few Coverity false
positives where we used strcpy before (Coverity complained
about not checking buffer size, but source buffers were
always known to be sized correctly).

Coverity issue: 260407, 272565, 272582
Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Fixes: f05e26051c15 ("eal: add IPC asynchronous request")
Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agofbarray: check sysconf failure
Anatoly Burakov [Tue, 17 Apr 2018 15:44:08 +0000 (16:44 +0100)]
fbarray: check sysconf failure

sysconf() may return a negative value, check for it.

Coverity issue: 272586
Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agofbarray: fix potential null-dereference
Anatoly Burakov [Tue, 17 Apr 2018 15:44:07 +0000 (16:44 +0100)]
fbarray: fix potential null-dereference

We get pointer to mask before we check if fbarray is NULL. Fix
by moving getting mask pointer to until after NULL check.

Coverity issue: 272579
Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agofbarray: check for open failure
Anatoly Burakov [Tue, 17 Apr 2018 15:44:06 +0000 (16:44 +0100)]
fbarray: check for open failure

Coverity issue: 272564
Fixes: c44d09811b40 ("eal: add shared indexed file-backed array")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agofbarray: use strlcpy instead of snprintf
Anatoly Burakov [Tue, 17 Apr 2018 15:44:05 +0000 (16:44 +0100)]
fbarray: use strlcpy instead of snprintf

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
6 years agofbarray: make all fbarrays hidden files
Anatoly Burakov [Mon, 23 Apr 2018 11:14:13 +0000 (12:14 +0100)]
fbarray: make all fbarrays hidden files

fbarray stores its data in a shared file, which is not hidden.
This leads to polluting user's HOME directory with visible
files when running DPDK as non-root. Change fbarray to always
create hidden files by default.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoapp/testpmd: allow none shaper profile
Tomasz Duszynski [Tue, 30 Jan 2018 07:37:08 +0000 (08:37 +0100)]
app/testpmd: allow none shaper profile

Private shaper profiles are attached to nodes defined
in traffic manager hierarchy.

Since not every node must have a configured shaper
testpmd should allow setting shaper profile id to
invalid (RTE_TM_SHAPER_PROFILE_ID_NONE) easily.

This patch follows same approach as in case of setting
parent id of the root node i.e passing a negative value
sets node id to RTE_TM_NODE_ID_NULL.

In case of private shaper profile negative value will set
shaper profile id to RTE_TM_SHAPER_PROFILE_ID_NONE.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Reviewed-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agocmdline: standardize conversion of IP address strings
Olivier Matz [Mon, 29 Jan 2018 10:29:03 +0000 (11:29 +0100)]
cmdline: standardize conversion of IP address strings

The code to convert IPv4 and IPv6 address strings into a binary format
(inet_ntop) was included in the cmdline library because the DPDK was
historically compiled in environments where the standard inet_ntop()
function is not available. Today, this is not the case and the standard
inet_ntop() can be used.

This patch removes the internal inet_ntop*() functions and their
specific license.

There is a small functional impact: IP addresses like 012.34.56.78
are not valid anymore.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
6 years agovfio: fix boundary check in region search
Xiao Wang [Fri, 20 Apr 2018 15:10:50 +0000 (23:10 +0800)]
vfio: fix boundary check in region search

A previously mapped region is skipped during the search, leading to
DMA unmap fails.

This patch fixes it and rewords the comment.

Fixes: 73a639085938 ("vfio: allow to map other memory regions")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agocrypto/dpaa2_sec: fix HMAC supported digest sizes
Hemant Agrawal [Thu, 19 Apr 2018 16:52:38 +0000 (22:22 +0530)]
crypto/dpaa2_sec: fix HMAC supported digest sizes

For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
digest sizes are not a fixed value, but a range between
1 and the maximum digest size for those algorithms.

Fixes: f947fd77185f ("crypto/dpaa2_sec: fix HMAC supported key sizes")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agocrypto/dpaa_sec: fix HMAC supported digest sizes
Hemant Agrawal [Thu, 19 Apr 2018 16:52:37 +0000 (22:22 +0530)]
crypto/dpaa_sec: fix HMAC supported digest sizes

For HMAC algorithms (MD5-HMAC, SHAx-HMAC), the supported
digest sizes are not a fixed value, but a range between
1 and the maximum digest size for those algorithms.
Also setting iv_size as 0.

Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agocrypto/dpaa_sec: support dynamic logging
Hemant Agrawal [Thu, 19 Apr 2018 16:52:36 +0000 (22:22 +0530)]
crypto/dpaa_sec: support dynamic logging

This patch adds the support for dynamic logging in dpaa_sec.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agocrypto/zuc: batch ops with same transform
Pablo de Lara [Thu, 19 Apr 2018 14:55:41 +0000 (15:55 +0100)]
crypto/zuc: batch ops with same transform

The ZUC API to encrypt packets does not require the operations
to share the same key. Currently, the operations were being
batched only when they shared the same key, but this is not needed.

Instead, now operations will be batched based on the transform
(cipher only, auth only...).

Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/zuc: remove unnecessary check
Pablo de Lara [Thu, 19 Apr 2018 14:55:40 +0000 (15:55 +0100)]
crypto/zuc: remove unnecessary check

When processing operations, the operation type was being
checked to avoid if it was set to NOT SUPPORTED.
In data path, doing so is not required since that is already
checked when creating the crypto session,
so that case will not ever happen.

Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocrypto/zuc: do not set default op status
Pablo de Lara [Thu, 19 Apr 2018 14:55:39 +0000 (15:55 +0100)]
crypto/zuc: do not set default op status

When crypto operations are allocated from the operation
pool, their status get reset to NOT_PROCESSED.
Therefore, there is no need to set this status again.

Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agomaintainers: update MRVL crypto PMD
Tomasz Duszynski [Thu, 19 Apr 2018 10:48:00 +0000 (12:48 +0200)]
maintainers: update MRVL crypto PMD

Jacek will no longer be maintaining mrvl crypto PMD.
Special thanks to him for development and support.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
6 years agoapp/testpmd: support IPsec event
Anoob Joseph [Wed, 11 Apr 2018 06:40:46 +0000 (12:10 +0530)]
app/testpmd: support IPsec event

Adding support for IPsec event

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agoexamples/ipsec-secgw: handle ESN soft limit event
Anoob Joseph [Wed, 11 Apr 2018 06:40:45 +0000 (12:10 +0530)]
examples/ipsec-secgw: handle ESN soft limit event

For inline protocol processing, the PMD/device is required to maintain
the ESN. But the application is required to monitor ESN overflow to
initiate SA expiry.

For such cases, application would set the ESN soft limit. An IPsec event
would be raised by rte_eth_event framework, when ESN hits the soft limit
set by the application.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agosecurity: extend userdata for IPsec events
Anoob Joseph [Wed, 11 Apr 2018 06:40:44 +0000 (12:10 +0530)]
security: extend userdata for IPsec events

Extending 'userdata' to be used for IPsec events too.

IPsec events would have some metadata which would uniquely identify the
security session for which the event is raised. But application would
need some construct which it can understand. The 'userdata' solves a
similar problem for inline processed inbound traffic. Updating the
documentation to extend the usage of 'userdata'.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agosecurity: add ESN soft limit in config
Anoob Joseph [Wed, 11 Apr 2018 06:40:43 +0000 (12:10 +0530)]
security: add ESN soft limit in config

Adding ESN soft limit in conf. This will be used in case of protocol
offload. Per SA, application could specify for what ESN the security
device need to notify application. In case of eth dev(inline protocol),
rte_eth_event framework would raise an IPsec event.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agoethdev: support inline IPsec events
Anoob Joseph [Wed, 11 Apr 2018 06:40:42 +0000 (12:10 +0530)]
ethdev: support inline IPsec events

Adding support for IPsec events in rte_eth_event framework. In inline
IPsec offload, the per packet protocol defined variables, like ESN,
would be managed by PMD. In such cases, PMD would need IPsec events
to notify application about various conditions like, ESN overflow.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoexamples/ipsec-secgw: fix usage print
Anoob Joseph [Mon, 16 Apr 2018 12:23:15 +0000 (17:53 +0530)]
examples/ipsec-secgw: fix usage print

The usage print was not updated when jumbo frames & crypto_dev mask
support was added. Fixing that. Also, the optional arguments were not
properly highlighted in the usage header. This is also fixed.

General cleanup of the usage print was also done to make it look more
cleaner and similar to what is existing in other applications like
l3fwd.

Fixes: bbabfe6e4ee4 ("examples/ipsec_secgw: support jumbo frames")
Fixes: 2c68fe791538 ("examples/ipsec-secgw: add cryptodev mask option")
Fixes: d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agodoc: add virtio crypto PMD guide
Jay Zhou [Tue, 17 Apr 2018 09:23:26 +0000 (17:23 +0800)]
doc: add virtio crypto PMD guide

This patch adds the guide for virtio crypto PMD.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agotest/crypto: add tests for virtio-crypto
Jay Zhou [Tue, 17 Apr 2018 09:23:25 +0000 (17:23 +0800)]
test/crypto: add tests for virtio-crypto

Only RTE_CRYPTO_CIPHER_AES_CBC cipher
algorithm are tested as unit test, it is supported both by the
cryptodev-backend-builtin and cryptodev-vhost-user of qemu side.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support HMAC-SHA1
Jay Zhou [Tue, 17 Apr 2018 09:23:24 +0000 (17:23 +0800)]
crypto/virtio: support HMAC-SHA1

The AES-CBC with HMAC-SHA1 has been supported now.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support AES-CBC
Jay Zhou [Tue, 17 Apr 2018 09:23:23 +0000 (17:23 +0800)]
crypto/virtio: support AES-CBC

The AES-CBC cipher only algorithm has been supported now.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support stats related ops
Jay Zhou [Tue, 17 Apr 2018 09:23:22 +0000 (17:23 +0800)]
crypto/virtio: support stats related ops

This patch implements the statistics of the packets.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support burst enqueue/dequeue
Jay Zhou [Tue, 17 Apr 2018 09:23:21 +0000 (17:23 +0800)]
crypto/virtio: support burst enqueue/dequeue

This patch implements the functions of virtio_crypto_pkt_tx_burst()
and virtio_crypto_pkt_rx_burst(). The encryption and decryption requests
are placed in the data queue and are ultimately handled by
the backend crypto accelerators.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support session related ops
Jay Zhou [Tue, 17 Apr 2018 09:23:20 +0000 (17:23 +0800)]
crypto/virtio: support session related ops

This patch implements session related operations, which includes creating
and destroying the session. For now, it only supports the session-oriented
API implementation. The control queue used to create or destroy sessions
for symmetric algorithms.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support basic PMD ops
Jay Zhou [Tue, 17 Apr 2018 09:23:19 +0000 (17:23 +0800)]
crypto/virtio: support basic PMD ops

This patch implements the basic operations of virtio crypto PMD, which
includes start, stop, close, information getting, queue setup and
release of the device.
The virtio crypto device has two types of queues, data queue and
control queue. It has one data queue at least and has one and only one
control queue. For example, if a virtio crypto device has N queues,
then [0, N-2] is the data queue index, N-1 is the control
queue index.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: support device init
Jay Zhou [Tue, 17 Apr 2018 09:23:18 +0000 (17:23 +0800)]
crypto/virtio: support device init

This patch implements the initialization of the virtio crypto device.
The virtio crypto device conforms to virtio-1.0, so this patch only
supports modern mode operation.
The cryptodev is created at the virtio crypto pci device probing stage.
The function of virtio_crypto_pkt_tx_burst() is used to burst transfer
packets and virtio_crypto_pkt_rx_burst() is used to burst receive packets.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/virtio: add virtio crypto PMD
Jay Zhou [Tue, 17 Apr 2018 09:23:17 +0000 (17:23 +0800)]
crypto/virtio: add virtio crypto PMD

The virtio crypto device is a virtual cryptography device
as well as a kind of virtual hardware accelerator for
virtual machines. The linux kernel virtio-crypto driver
has been merged, and this patch introduces virtio crypto
PMD to achieve better performance.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/qat: use SPDX license
Fiona Trahe [Fri, 6 Apr 2018 18:51:43 +0000 (19:51 +0100)]
crypto/qat: use SPDX license

Use SPDK license for dual-licensed files
and update license date in all files

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoapp/crypto-perf: add missing SPDX identifier
Hemant Agrawal [Mon, 9 Apr 2018 08:58:35 +0000 (14:28 +0530)]
app/crypto-perf: add missing SPDX identifier

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agoexamples/l2fwd-crypto: fix the default aead assignments
Hemant Agrawal [Wed, 11 Apr 2018 09:15:47 +0000 (14:45 +0530)]
examples/l2fwd-crypto: fix the default aead assignments

The code is incorrectly updating the authxform instead of
aead xforms.

Fixes: b79e4c00af0e ("cryptodev: use AES-GCM/CCM as AEAD algorithms")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/dpaa2_sec: improve error handling
Sunil Kumar Kori [Thu, 5 Apr 2018 08:35:49 +0000 (14:05 +0530)]
crypto/dpaa2_sec: improve error handling

Fixed as reported by NXP's internal coverity.
Also part of dpdk coverity.

Coverity issue: 268331
Coverity issue: 268333

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agocrypto/dpaa_sec: improve the error checking
Sunil Kumar Kori [Thu, 5 Apr 2018 08:35:48 +0000 (14:05 +0530)]
crypto/dpaa_sec: improve the error checking

Reported by NXP's internal coverity

Fixes: c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agodoc: add private data info in crypto guide
Abhinandan Gujjar [Mon, 16 Apr 2018 06:54:56 +0000 (12:24 +0530)]
doc: add private data info in crypto guide

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: support session private data setting
Abhinandan Gujjar [Mon, 16 Apr 2018 06:54:55 +0000 (12:24 +0530)]
cryptodev: support session private data setting

The application may want to store private data along with the
rte_cryptodev that is transparent to the rte_cryptodev layer.
For e.g., If an eventdev based application is submitting a
rte_cryptodev_sym_session operation and wants to indicate event
information required to construct a new event that will be
enqueued to eventdev after completion of the rte_cryptodev_sym_session
operation. This patch provides a mechanism for the application
to associate this information with the rte_cryptodev_sym_session session.
The application can set the private data using
rte_cryptodev_sym_session_set_private_data() and retrieve it using
rte_cryptodev_sym_session_get_private_data().

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: set private data for session-less mode
Abhinandan Gujjar [Mon, 16 Apr 2018 06:54:54 +0000 (12:24 +0530)]
cryptodev: set private data for session-less mode

The application may want to store private data along with the
rte_crypto_op that is transparent to the rte_cryptodev layer.
For e.g., If an eventdev based application is submitting a
crypto session-less operation and wants to indicate event
information required to construct a new event that will be
enqueued to eventdev after completion of the crypto
operation. This patch provides a mechanism for the application
to associate this information with the rte_crypto_op in
session-less mode.

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>