dpdk.git
7 years agoevent/dpaa2: add enqueue and dequeue functionality
Nipun Gupta [Fri, 30 Jun 2017 08:54:31 +0000 (14:24 +0530)]
event/dpaa2: add enqueue and dequeue functionality

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: change argument to const to avoid warning
Nipun Gupta [Fri, 30 Jun 2017 08:54:30 +0000 (14:24 +0530)]
bus/fslmc: change argument to const to avoid warning

qbman_get_dqrr_idx() API is required with constant dqrr entry
in the eventdev driver. Also, this routine is not updating the
dqrr. So, this patch updates its input argument to a const type.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: add callback per queue to enable
Nipun Gupta [Fri, 30 Jun 2017 08:54:29 +0000 (14:24 +0530)]
bus/fslmc: add callback per queue to enable

Dequeue from event device needs to process the event on
the basis of the hardware queue from which it is dequeued.
A callback is added into dpaa2_queue structure, to enable
event dequeue functionality to call that processing routine.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: support enqueue with multiple descriptors
Nipun Gupta [Fri, 30 Jun 2017 08:54:28 +0000 (14:24 +0530)]
bus/fslmc: support enqueue with multiple descriptors

This patch adds the QBMAN API which support multiple enqueue
descriptors.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agoevent/dpaa2: add configuration functions
Nipun Gupta [Fri, 30 Jun 2017 08:54:27 +0000 (14:24 +0530)]
event/dpaa2: add configuration functions

This patch adds all the configuration API's for DPAA2 eventdev
including device config, start, stop & port and queue
related API's

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: support static dequeue from portal
Nipun Gupta [Fri, 30 Jun 2017 08:54:26 +0000 (14:24 +0530)]
bus/fslmc: support static dequeue from portal

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agoevent/dpaa2: initialize device
Nipun Gupta [Fri, 30 Jun 2017 08:54:25 +0000 (14:24 +0530)]
event/dpaa2: initialize device

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: adding cpu support in stashing config
Nipun Gupta [Fri, 30 Jun 2017 08:54:24 +0000 (14:24 +0530)]
bus/fslmc: adding cpu support in stashing config

Stashing can also be configured by other drivers (for instance
event driver) passing cpu_id as an argument. This change
facilitates the same.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: register dpci as dpaa2 device for bus scan
Nipun Gupta [Fri, 30 Jun 2017 08:54:23 +0000 (14:24 +0530)]
bus/fslmc: register dpci as dpaa2 device for bus scan

Registering dpci as dpaa2 type device handling initialization,
allocation and freeing of the device

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: adding basic dpci support
Nipun Gupta [Fri, 30 Jun 2017 08:54:22 +0000 (14:24 +0530)]
bus/fslmc: adding basic dpci support

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agoevent/dpaa2: register dpcon as dpaa2 device for bus scan
Nipun Gupta [Fri, 30 Jun 2017 08:54:21 +0000 (14:24 +0530)]
event/dpaa2: register dpcon as dpaa2 device for bus scan

Registering dpcon as dpaa2 type device handling initialization,
allocation and freeing of the device

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: export qbman dqrr funcs for eventdev usages
Hemant Agrawal [Fri, 30 Jun 2017 08:54:20 +0000 (14:24 +0530)]
bus/fslmc: export qbman dqrr funcs for eventdev usages

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/fslmc: add basic dpcon support
Nipun Gupta [Fri, 30 Jun 2017 08:54:19 +0000 (14:24 +0530)]
bus/fslmc: add basic dpcon support

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: integrate dpio and dpbp to object framework
Nipun Gupta [Fri, 30 Jun 2017 08:54:18 +0000 (14:24 +0530)]
bus/fslmc: integrate dpio and dpbp to object framework

This patch removes the existing static call for dpio and dpbp
create and add them to object registration framework.

This patch also changes the vfio mc object processing to use
the framework.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: generic framework for mc object creation
Hemant Agrawal [Fri, 30 Jun 2017 08:54:17 +0000 (14:24 +0530)]
bus/fslmc: generic framework for mc object creation

There are muliple help mc object, which are not an independent
device, but they are required for dpaa2 based devices.
This framework allows registration and handling of all such
mc devices.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agoevent/dpaa2: add basic build infrastructure
Nipun Gupta [Fri, 30 Jun 2017 08:54:16 +0000 (14:24 +0530)]
event/dpaa2: add basic build infrastructure

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agodrivers: add bus dependency for eventdev
Hemant Agrawal [Fri, 30 Jun 2017 08:54:15 +0000 (14:24 +0530)]
drivers: add bus dependency for eventdev

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agoapp/crypto-perf: wait for cores launched by app
Kirill Rybalchenko [Wed, 14 Jun 2017 08:44:33 +0000 (09:44 +0100)]
app/crypto-perf: wait for cores launched by app

After test is finished the main thread waits only for lcores
where runners were started because, in case of using the
multicore scheduler, more cores are launched that do not need
to be waited for.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agocrypto/qat: fix possible out-of-bounds
Fiona Trahe [Mon, 3 Jul 2017 15:24:27 +0000 (16:24 +0100)]
crypto/qat: fix possible out-of-bounds

Out-of-bounds access possible if ctx.qat_cipher_alg has invalid value.
This should never happen at this point on data path, but fix for safety.

Coverity issue: 143458, 143465

Fixes: d18ab45f7654 ("crypto/qat: support DOCSIS BPI mode")

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agodoc: add new crypto session information
Pablo de Lara [Wed, 5 Jul 2017 05:26:20 +0000 (06:26 +0100)]
doc: add new crypto session information

Modified cryptodev library section in Programmer's Guide,
with the recent changes in the crypto sessions.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agocryptodev: remove session init internal function
Pablo de Lara [Wed, 5 Jul 2017 05:26:19 +0000 (06:26 +0100)]
cryptodev: remove session init internal function

Since now the private session data is initialized after
the session pool is created, there is no need to keep
this PMD function.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: add mempool pointer in queue pair setup
Pablo de Lara [Wed, 5 Jul 2017 05:26:18 +0000 (06:26 +0100)]
cryptodev: add mempool pointer in queue pair setup

The session mempool pointer is needed in each queue pair,
if session-less operations are being handled.
Therefore, the API is changed to accept this parameter,
as the session mempool is created outside the
device configuration function, similar to what ethdev
does with the rx queues.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: support device independent sessions
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:17 +0000 (06:26 +0100)]
cryptodev: support device independent sessions

Change crypto device's session management to make it
device independent and simplify architecture when session
is intended to be used on more than one device.

Sessions private data is agnostic to underlying device
by adding an indirection in the sessions private data
using the crypto driver identifier.
A single session can contain indirections to multiple device types.

New function rte_cryptodev_sym_session_init has been created,
to initialize the driver private session data per driver to be
used on a same session, and rte_cryptodev_sym_session_clear
to clear this data before calling rte_cryptodev_sym_session_free.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: remove mempool from session
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:16 +0000 (06:26 +0100)]
cryptodev: remove mempool from session

Mempool pointer can be obtained from the object itself,
which means that it is not required to actually store the pointer
in the session.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: remove driver id from session
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:15 +0000 (06:26 +0100)]
cryptodev: remove driver id from session

Since crypto session will not be attached to a specific
device or driver, the field driver_id is not required
anymore (only used to check that a session was being
handled by the right device).

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: remove device id from session
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:14 +0000 (06:26 +0100)]
cryptodev: remove device id from session

Device id is necessary in the crypto session,
as it was only used for the functions that attach/detach
a session to a queue pair.

Since the session is not going to be attached to a device
anymore, this is field is no longer necessary.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: change attach session to queue pair API
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:13 +0000 (06:26 +0100)]
cryptodev: change attach session to queue pair API

Device id is going to be removed from session,
as the session will be device independent.
Therefore, the functions that attach/dettach a session
to a queue pair need to be updated, to accept the device id
as a parameter, apart from the queue pair id and the session.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: do not create session mempool internally
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:12 +0000 (06:26 +0100)]
cryptodev: do not create session mempool internally

Instead of creating the session mempool while configuring
the crypto device, apps will create the mempool themselves.
This way, it gives flexibility to the user to have a single
mempool for all devices (as long as the objects are big
enough to contain the biggest private session size) or
separate mempools for different drivers.

Also, since the mempool is now created outside the
device configuration function, now it needs to be passed
through this function, which will be eventually passed
when setting up the queue pairs, as ethernet devices do.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: add private session size retrieval function
Slawomir Mrozowicz [Wed, 5 Jul 2017 05:26:11 +0000 (06:26 +0100)]
cryptodev: add private session size retrieval function

Provide a function to get the private session size
of any crypto device (specifically, to its crypto driver).

This will be useful once the session mempool is created
outside the library.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: move session init out of pool creation
Pablo de Lara [Wed, 5 Jul 2017 05:26:10 +0000 (06:26 +0100)]
cryptodev: move session init out of pool creation

Prior to removing the session pool creation from cryptodev
configure function, session init function needs to be
separated from the pool creation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: remove unused cryptodev session structure
Pablo de Lara [Wed, 5 Jul 2017 05:26:09 +0000 (06:26 +0100)]
cryptodev: remove unused cryptodev session structure

Cryptodev session structure was a duplication of the
cryptodev symmetric structure.
It was used by some PMDs that should use the symmetric
structure instead.

Since this structure was internal, there is no deprecation
notice required.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/scheduler: add multicore scheduling mode
Kirill Rybalchenko [Wed, 5 Jul 2017 16:14:38 +0000 (17:14 +0100)]
crypto/scheduler: add multicore scheduling mode

Multi-core scheduling mode is a mode where scheduler distributes
crypto operations in a round-robin base, between several core
assigned as workers.

Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocryptodev: remove crypto device driver name
Slawomir Mrozowicz [Mon, 22 May 2017 13:54:30 +0000 (15:54 +0200)]
cryptodev: remove crypto device driver name

Remove crypto device driver name string definitions from librte_cryptodev,
which avoid to library changes every time a new crypto driver was added.

The driver name is predefined internaly in the each PMD.
The applications could use the crypto device driver names based on
options with the driver name string provided in command line.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocryptodev: remove crypto device type enumeration
Slawomir Mrozowicz [Fri, 30 Jun 2017 14:34:21 +0000 (15:34 +0100)]
cryptodev: remove crypto device type enumeration

Changes device type identification to be based on a unique
driver id replacing the current device type enumeration, which needed
library changes every time a new crypto driver was added.

The driver id is assigned dynamically during driver registration using
the new macro RTE_PMD_REGISTER_CRYPTO_DRIVER which returns a unique
uint8_t identifier for that driver. New APIs are also introduced
to allow retrieval of the driver id using the driver name.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/dpaa2_sec: update driver name string
Akhil Goyal [Wed, 5 Jul 2017 16:21:42 +0000 (21:51 +0530)]
crypto/dpaa2_sec: update driver name string

while registering driver to dpaa2, hard coded string is used.
It is now updated as per the latest changes in string name.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agotest/crypto: extend AES-GCM 192/256 to other PMDs
Pablo de Lara [Tue, 4 Jul 2017 00:12:43 +0000 (01:12 +0100)]
test/crypto: extend AES-GCM 192/256 to other PMDs

QAT, OpenSSL and DPAA2 PMDs support 192-bit and 256-bit key sizes
for AES-GCM, apart from 128-bit keys. Therefore, these tests that were
only used by AES-NI MB PMD are extended to these other two PMDs.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agotest/crypto: add AES-GCM 192
Pablo de Lara [Tue, 4 Jul 2017 00:12:42 +0000 (01:12 +0100)]
test/crypto: add AES-GCM 192

Added AES GCM tests for 192-bit keys, now that AES GCM PMD
supports it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agotest/crypto: rename some tests
Pablo de Lara [Tue, 4 Jul 2017 00:12:41 +0000 (01:12 +0100)]
test/crypto: rename some tests

AES-GCM tests are used for AES-NI MB, OpenSSL,
QAT and DPAA2_SEC PMDs, so they are not specific to the first one.
Therefore, _mb_ prefix can be removed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
7 years agocrypto/aesni_gcm: migrate to Multi-buffer library
Pablo de Lara [Tue, 4 Jul 2017 00:12:40 +0000 (01:12 +0100)]
crypto/aesni_gcm: migrate to Multi-buffer library

Since Intel Multi Buffer library for IPSec has been updated to
support Scatter Gather List, the AESNI GCM PMD can link
to this library, instead of the ISA-L library.

This move eases the maintenance of the driver, as it will
use the same library as the AESNI MB PMD.
It also adds support for 192-bit keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agotest/crypto: add 12-byte IV AES-CTR test cases
Pablo de Lara [Sun, 2 Jul 2017 02:55:06 +0000 (03:55 +0100)]
test/crypto: add 12-byte IV AES-CTR test cases

AESNI MB PMD supports now 12-byte IVs, so some tests
are added to check that, apart from the ones with 16-byte IVs,
as this is still compatible.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/aesni_mb: support IPSec Multi-buffer lib v0.46
Pablo de Lara [Sun, 2 Jul 2017 02:55:05 +0000 (03:55 +0100)]
crypto/aesni_mb: support IPSec Multi-buffer lib v0.46

IPSec Multi-buffer library v0.46 has been released,
which includes, among othe features, support for 12-byte IV,
for AES-CTR, keeping also the previous 16-byte IV,
for backward compatibility reasons.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
7 years agocrypto/dpaa2_sec: support AES-GCM and CTR
Akhil Goyal [Mon, 3 Jul 2017 12:31:39 +0000 (18:01 +0530)]
crypto/dpaa2_sec: support AES-GCM and CTR

AES-GCM support is added as per the AEAD type of crypto
operations. Support for AES-CTR is also added.

test/crypto and documentation is also updated for
dpaa2_sec to add supported algorithms.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: add HW desc support for AES-GCM
Akhil Goyal [Mon, 3 Jul 2017 12:31:38 +0000 (18:01 +0530)]
crypto/dpaa2_sec: add HW desc support for AES-GCM

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: add HW desc support for CTR
Akhil Goyal [Mon, 3 Jul 2017 12:31:37 +0000 (18:01 +0530)]
crypto/dpaa2_sec: add HW desc support for CTR

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa2_sec: add per dev mempool to store FLE
Akhil Goyal [Mon, 3 Jul 2017 12:31:36 +0000 (18:01 +0530)]
crypto/dpaa2_sec: add per dev mempool to store FLE

rte_malloc uses common memory area for all cores.

Now rte_malloc are replaced by per device mempool to allocate
space for FLE. This removes contention and improves performance.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agobus/fslmc: add macros to get/set FLE context
Akhil Goyal [Mon, 3 Jul 2017 12:31:35 +0000 (18:01 +0530)]
bus/fslmc: add macros to get/set FLE context

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocryptodev: remove AAD from authentication structure
Pablo de Lara [Sun, 2 Jul 2017 05:41:27 +0000 (06:41 +0100)]
cryptodev: remove AAD from authentication structure

Now that AAD is only used in AEAD algorithms,
there is no need to keep AAD in the authentication
structure.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: use AES-GCM/CCM as AEAD algorithms
Pablo de Lara [Sun, 2 Jul 2017 05:41:26 +0000 (06:41 +0100)]
cryptodev: use AES-GCM/CCM as AEAD algorithms

Now that all the structures/functions for AEAD algorithms
are in place, migrate the two supported algorithms
AES-GCM and AES-CCM to these, instead of using
cipher and authentication parameters.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoexamples/l2fwd-crypto: add AEAD parameters
Pablo de Lara [Sun, 2 Jul 2017 05:41:25 +0000 (06:41 +0100)]
examples/l2fwd-crypto: add AEAD parameters

Since there is a new operation type (AEAD), add parameters
for this in the application.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoexamples/ipsec-secgw: add AEAD parameters
Pablo de Lara [Sun, 2 Jul 2017 05:41:24 +0000 (06:41 +0100)]
examples/ipsec-secgw: add AEAD parameters

Since there is a new operation type (AEAD), add parameters
for this in the application.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/test-crypto-perf: add AEAD parameters
Pablo de Lara [Sun, 2 Jul 2017 05:41:23 +0000 (06:41 +0100)]
app/test-crypto-perf: add AEAD parameters

Since there is a new operation type (AEAD), add parameters
for this in the application.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoexamples/l2fwd-crypto: avoid too many tabs
Pablo de Lara [Sun, 2 Jul 2017 05:41:22 +0000 (06:41 +0100)]
examples/l2fwd-crypto: avoid too many tabs

Some extra functions have been created to avoid
too many nested conditionals.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: add AEAD parameters in crypto operation
Pablo de Lara [Sun, 2 Jul 2017 05:41:21 +0000 (06:41 +0100)]
cryptodev: add AEAD parameters in crypto operation

AEAD operation parameters can be set in the new
aead structure, in the crypto operation.
This structure is within a union with the cipher
and authentication parameters, since operations can be:
- AEAD: using the aead structure

- Cipher only: using only the cipher structure

- Auth only: using only the authentication structure

- Cipher-then-auth/Auth-then-cipher: using both cipher
  and authentication structures

Therefore, all three cannot be used at the same time.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: add AEAD specific data
Pablo de Lara [Sun, 2 Jul 2017 05:41:20 +0000 (06:41 +0100)]
cryptodev: add AEAD specific data

AEAD algorithms such as AES-GCM needed to be
used as a concatenation of a cipher transform and
an authentication transform.

Instead, a new transform and functions to handle it
are created to support these kind of algorithms,
making their use easier.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: set AES-GMAC as auth-only algo
Pablo de Lara [Sun, 2 Jul 2017 05:41:19 +0000 (06:41 +0100)]
cryptodev: set AES-GMAC as auth-only algo

AES-GMAC is an authentication algorithm, based on AES-GCM
without encryption. To simplify its usage, now it can be used
setting the authentication parameters, without requiring
to concatenate a ciphering transform.

Therefore, it is not required to set AAD, but authentication
data length and offset, giving the user the option
to have Scatter-Gather List in the input buffer,
as long as the driver supports it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: remove digest length from crypto op
Pablo de Lara [Sun, 2 Jul 2017 05:41:18 +0000 (06:41 +0100)]
cryptodev: remove digest length from crypto op

Digest length was duplicated in the authentication transform
and the crypto operation structures.

Since digest length is not expected to change in a same
session, it is removed from the crypto operation.

Also, the length has been shrunk to 16 bits,
which should be sufficient for any digest.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: remove AAD length from crypto op
Pablo de Lara [Sun, 2 Jul 2017 05:41:17 +0000 (06:41 +0100)]
cryptodev: remove AAD length from crypto op

Additional authenticated data (AAD) information was duplicated
in the authentication transform and in the crypto
operation structures.

Since AAD length is not meant to be changed in a same session,
it is removed from the crypto operation structure.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: do not use AAD in wireless algorithms
Pablo de Lara [Sun, 2 Jul 2017 05:41:16 +0000 (06:41 +0100)]
cryptodev: do not use AAD in wireless algorithms

For wireless algorithms (SNOW3G, KASUMI, ZUC),
the IV for the authentication algorithms (F9, UIA2 and EIA3)
was taken from the AAD parameter, as there was no IV parameter
in the authentication structure.

Now that IV is available for all algorithms, there is need
to keep doing this, so AAD is not used for these algorithms
anymore.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: add auth IV
Pablo de Lara [Sun, 2 Jul 2017 05:41:15 +0000 (06:41 +0100)]
cryptodev: add auth IV

Authentication algorithms, such as AES-GMAC or the wireless
algorithms (like SNOW3G) use IV, like cipher algorithms.
So far, AES-GMAC has used the IV from the cipher structure,
and the wireless algorithms have used the AAD field,
which is not technically correct.

Therefore, authentication IV parameters have been added,
so API is more correct. Like cipher IV, auth IV is expected
to be copied after the crypto operation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: move IV parameters to session
Pablo de Lara [Sun, 2 Jul 2017 05:41:14 +0000 (06:41 +0100)]
cryptodev: move IV parameters to session

Since IV parameters (offset and length) should not
change for operations in the same session, these parameters
are moved to the crypto transform structure, so they will
be stored in the sessions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: pass IV as offset
Pablo de Lara [Sun, 2 Jul 2017 05:41:13 +0000 (06:41 +0100)]
cryptodev: pass IV as offset

Since IV now is copied after the crypto operation, in
its private size, IV can be passed only with offset
and length.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoexamples/ipsec-secgw: move IV to crypto op private data
Pablo de Lara [Sun, 2 Jul 2017 05:41:12 +0000 (06:41 +0100)]
examples/ipsec-secgw: move IV to crypto op private data

Usually, IV will change for each crypto operation.
Therefore, instead of pointing at the same location,
IV is copied after each crypto operation.

This will let the IV to be passed as an offset from
the beginning of the crypto operation, instead of
a pointer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoexamples/l2fwd-crypto: move IV to crypto op private data
Pablo de Lara [Sun, 2 Jul 2017 05:41:11 +0000 (06:41 +0100)]
examples/l2fwd-crypto: move IV to crypto op private data

Usually, IV will change for each crypto operation.
Therefore, instead of pointing at the same location,
IV is copied after each crypto operation.

This will let the IV to be passed as an offset from
the beginning of the crypto operation, instead of
a pointer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/crypto-perf: move IV to crypto op private data
Pablo de Lara [Sun, 2 Jul 2017 05:41:10 +0000 (06:41 +0100)]
app/crypto-perf: move IV to crypto op private data

Usually, IV will change for each crypto operation.
Therefore, instead of pointing at the same location,
IV is copied after each crypto operation.

This will let the IV to be passed as an offset from
the beginning of the crypto operation, instead of
a pointer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agotest/crypto-perf: move IV to crypto op private data
Pablo de Lara [Sun, 2 Jul 2017 05:41:09 +0000 (06:41 +0100)]
test/crypto-perf: move IV to crypto op private data

Usually, IV will change for each crypto operation.
Therefore, instead of pointing at the same location,
IV is copied after each crypto operation.

This will let the IV to be passed as an offset from
the beginning of the crypto operation, instead of
a pointer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agotest/crypto: move IV to crypto op private data
Pablo de Lara [Sun, 2 Jul 2017 05:41:08 +0000 (06:41 +0100)]
test/crypto: move IV to crypto op private data

Usually, IV will change for each crypto operation.
Therefore, instead of pointing at the same location,
IV is copied after each crypto operation.

This will let the IV to be passed as an offset from
the beginning of the crypto operation, instead of
a pointer.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: add crypto op helper macros
Pablo de Lara [Sun, 2 Jul 2017 05:41:07 +0000 (06:41 +0100)]
cryptodev: add crypto op helper macros

In order to facilitate the access to the private data,
after the crypto operation, two new macros have been
implemented:

- rte_crypto_op_ctod_offset(c,t,o), which returns a pointer
  to "o" bytes after the start of the crypto operation
  (rte_crypto_op)
- rte_crypto_op_ctophys_offset(c, o), which returns
  the physical address of the data "o" bytes after the
  start of the crypto operation (rte_crypto_op)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: remove useless alignment
Pablo de Lara [Sun, 2 Jul 2017 05:41:06 +0000 (06:41 +0100)]
cryptodev: remove useless alignment

rte_crypto_op and rte_crypto_sym_op structures
were marked as cache aligned.
However, since these structures are always initialized
in a mempool, this alignment is useless, since the mempool
forces the alignment of its objects.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: do not store pointer to op specific params
Pablo de Lara [Sun, 2 Jul 2017 05:41:05 +0000 (06:41 +0100)]
cryptodev: do not store pointer to op specific params

Instead of storing a pointer to operation specific parameters,
such as symmetric crypto parameters, use a zero-length array,
to mark that these parameters will be stored after the
generic crypto operation structure, which was already assumed
in the code, reducing the memory footprint of the crypto operation.

Besides, it is always expected to have rte_crypto_op
and rte_crypto_sym_op (the only operation specific parameters
structure right now) to be together, as they are initialized
as a single object in the crypto operation pool.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: remove opaque data pointer in crypto op
Pablo de Lara [Sun, 2 Jul 2017 05:41:04 +0000 (06:41 +0100)]
cryptodev: remove opaque data pointer in crypto op

Storing a pointer to the user data is unnecessary,
since user can store additional data, after the crypto operation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: replace enums with 1-byte variables
Pablo de Lara [Sun, 2 Jul 2017 05:41:03 +0000 (06:41 +0100)]
cryptodev: replace enums with 1-byte variables

Instead of storing some crypto operation flags,
such as operation status, as enumerations,
store them as uint8_t, for memory efficiency.

Also, reserve extra 5 bytes in the crypto operation,
for future additions.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocryptodev: move session type to generic crypto op
Pablo de Lara [Sun, 2 Jul 2017 05:41:02 +0000 (06:41 +0100)]
cryptodev: move session type to generic crypto op

Session type (operation with or without session) is not
something specific to symmetric operations.
Therefore, the variable is moved to the generic crypto operation
structure.

Since this is an ABI change, the cryptodev library version
gets bumped.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/crypto-perf: set crypto op pool cache
Sergio Gonzalez Monroy [Fri, 30 Jun 2017 07:56:29 +0000 (08:56 +0100)]
app/crypto-perf: set crypto op pool cache

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/crypto-perf: return crypto ops to mempool in bulk
Sergio Gonzalez Monroy [Fri, 30 Jun 2017 07:56:58 +0000 (08:56 +0100)]
app/crypto-perf: return crypto ops to mempool in bulk

Use rte_mempool_put_bulk for both latency and throughput tests instead
of rte_crypto_op_free to improve application performance.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agoapp/crypto-perf: fix digest data for chained mbufs
Sergio Gonzalez Monroy [Fri, 30 Jun 2017 07:56:03 +0000 (08:56 +0100)]
app/crypto-perf: fix digest data for chained mbufs

Use corect mbuf segment for chained mbufs.

Fixes: f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
7 years agocrypto/qat: fix typo
Pablo de Lara [Thu, 29 Jun 2017 11:16:21 +0000 (12:16 +0100)]
crypto/qat: fix typo

Fixed a comment in QAT, referring to the IV size
for AES-GCM, that should be in bytes, and not bits.

Fixes: 53d8971cbe81 ("qat: fix AES-GCM decryption")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Deepak Kumar Jain <deepak.k.jain@intel.com>
7 years agovhost: print reason of NUMA node query failure
Ilya Maximets [Thu, 6 Jul 2017 13:30:43 +0000 (16:30 +0300)]
vhost: print reason of NUMA node query failure

syscall always returns '-1' on failure and there is no point
in printing that value. 'errno' is much more informative.

Fixes: 586e39001317 ("vhost: export numa node")

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio-user: fix comment
Yong Wang [Fri, 23 Jun 2017 04:14:45 +0000 (00:14 -0400)]
net/virtio-user: fix comment

Since "rte_eal_dev_init()" has been removed, the comment referred to
it should be modified simultaneously.

Fixes: 9721b4d543a3 ("eal: remove unused device init function")

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/virtio-user: fix crash when detaching device
Allain Legacy [Fri, 23 Jun 2017 12:41:37 +0000 (08:41 -0400)]
net/virtio-user: fix crash when detaching device

The rte_eth_dev.data pointer is set to a reference to a static table.
Attempting to rte_free() it leads to a panic.  For example, the
following commands result in a panic if run in testpmd

  testpmd> port attach virtio_user0,path=/dev/vhost-net,iface=test0
  testpmd> port stop 2
  testpmd> port close 2
  testpmd> port detach 2

Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")
Cc: stable@dpdk.org
Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: check return of mutex initialization
Jens Freimann [Tue, 4 Jul 2017 08:50:43 +0000 (10:50 +0200)]
vhost: check return of mutex initialization

Check return value of pthread_mutex_init(). Also destroy
mutex in case of other erros before returning.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: check return of pthread calls
Jens Freimann [Tue, 4 Jul 2017 08:50:42 +0000 (10:50 +0200)]
vhost: check return of pthread calls

Make sure we catch and log failed calls to pthread
functions.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: add missing check in driver registration
Jens Freimann [Tue, 4 Jul 2017 08:50:41 +0000 (10:50 +0200)]
vhost: add missing check in driver registration

Add a check for strdup() return value and fail gracefully if we
get a bad return code.

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: fix MTU device feature check
Maxime Coquelin [Thu, 29 Jun 2017 07:58:10 +0000 (09:58 +0200)]
vhost: fix MTU device feature check

The MTU feature support check has to be done against MTU
feature bit mask, and not bit position.

Fixes: 72e8543093df ("vhost: add API to get MTU value")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: fix checking of device features
Ivan Dyukov [Wed, 28 Jun 2017 12:40:31 +0000 (15:40 +0300)]
vhost: fix checking of device features

To compare enabled features in current device we must use bit
mask instead of bit position.

Fixes: c843af3aa13e ("vhost: access header only if offloading is supported")
Cc: stable@dpdk.org
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agodoc: update virtio ring size and header size
Zhiyong Yang [Thu, 11 May 2017 02:16:35 +0000 (10:16 +0800)]
doc: update virtio ring size and header size

Add more explanations about vring size changes and different
virtio_header size.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: fix IP checksum
Jianfeng Tan [Wed, 7 Jun 2017 06:41:37 +0000 (06:41 +0000)]
vhost: fix IP checksum

There is no way to bypass IP checksum verification in Linux
kernel, no matter skb->ip_summed is assigned as CHECKSUM_UNNECESSARY
or CHECKSUM_PARTIAL.

So any packets with bad IP checksum will be dropped at VM IP layer.

To correct, we check this flag PKT_TX_IP_CKSUM to calculate IP csum.

Fixes: 859b480d5afd ("vhost: add guest offload setting")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: fix TCP checksum
Jianfeng Tan [Wed, 7 Jun 2017 06:41:36 +0000 (06:41 +0000)]
vhost: fix TCP checksum

As PKT_TX_TCP_SEG flag in mbuf->ol_flags implies PKT_TX_TCP_CKSUM,
applications, e.g., testpmd, don't set PKT_TX_TCP_CKSUM when TSO
is set.

This leads to that packets get dropped in VM tcp stack layer because
of bad TCP csum.

To fix this, we make sure TCP NEEDS_CSUM info is set into virtio net
header when PKT_TX_TCP_SEG is set, so that VM tcp stack will not
check the TCP csum.

Fixes: 859b480d5afd ("vhost: add guest offload setting")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agovhost: clean up per-socket mutex
Daniel Verkamp [Mon, 12 Jun 2017 21:29:04 +0000 (14:29 -0700)]
vhost: clean up per-socket mutex

vsocket->conn_mutex was allocated with pthread_mutex_init() but never
freed with pthread_mutex_destroy().  This is a potential memory leak,
depending on how pthread_mutex_t is implemented.

Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
7 years agonet/mlx5: add vectorized Rx/Tx burst for x86
Yongseok Koh [Thu, 6 Jul 2017 18:41:10 +0000 (11:41 -0700)]
net/mlx5: add vectorized Rx/Tx burst for x86

To make vectorized burst routines enabled, it is required to run on x86_64
architecture. If all the conditions are met, the vectorized burst functions
are enabled automatically. The decision is made individually on RX and TX.
There's no PMD option to make a selection.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: select Rx/Tx callbacks when starting device
Yongseok Koh [Thu, 6 Jul 2017 18:41:09 +0000 (11:41 -0700)]
net/mlx5: select Rx/Tx callbacks when starting device

The callbacks are global to a device but the selection is made every queue
configuration, which is redundant.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: use buffer address for LKEY search
Yongseok Koh [Thu, 6 Jul 2017 18:41:08 +0000 (11:41 -0700)]
net/mlx5: use buffer address for LKEY search

When searching LKEY, if search key is mempool pointer, the 2nd cacheline
has to be accessed and it even requires to check whether a buffer is
indirect per every search. Instead, using address for search key can reduce
cycles taken. And caching the last hit entry is beneficial as well.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: free buffers in bulk on Tx completion
Yongseok Koh [Thu, 6 Jul 2017 18:41:07 +0000 (11:41 -0700)]
net/mlx5: free buffers in bulk on Tx completion

When processing Tx completion, it is more efficient to free buffers in bulk
using rte_mempool_put_bulk() if buffers are from a same mempool.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx5: change indexing for Tx SW ring
Yongseok Koh [Thu, 6 Jul 2017 18:41:06 +0000 (11:41 -0700)]
net/mlx5: change indexing for Tx SW ring

For Tx SW ring (txq->elts[]), indexes are kept and used in
txq->elts_head/tail. Because of this, one entry must always be left unused
and it also makes code complex. Changed to store counters instead of
indexes in order to make the code simpler and to reduce a few calculations.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/ixgbe: remove MTU setting limitation
Beilei Xing [Thu, 6 Jul 2017 03:36:00 +0000 (11:36 +0800)]
net/ixgbe: remove MTU setting limitation

Currently, if requested MTU is bigger than mbuf size and scattered
receive is not enabled, setting MTU to that value fails.

This patch allows setting this special MTU when device is stopped,
because scattered_rx will be re-configured during next port start
and driver may enable scattered receive according new MTU value.

After this patch, driver may select different receive function
automatically after MTU set, according MTU values selected.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/bonding: allow slaves to also be bonded devices
Tomasz Kulasek [Wed, 5 Jul 2017 18:54:29 +0000 (19:54 +0100)]
net/bonding: allow slaves to also be bonded devices

This patch removes restrictions in bonded device library which prevent a
bonded device to be added to another bonded device with the limitation
that 802.3ad mode is not supported if one or more slaves is also a
bonded device,

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
7 years agonet/bonding: fix link properties management
Tomasz Kulasek [Wed, 5 Jul 2017 18:54:28 +0000 (19:54 +0100)]
net/bonding: fix link properties management

This patch fixes the management of link properties in the bonded device.

In all mode except mode 4 a bonded device link will default to reporting
the link as full duplex and auto-neg. The link speed for a bond port is
calculated on it's active slaves and the particular mode it is running
in. The bonding link speed is reported based on the transmit link as in
some modes link speed between egress/ingress is not symmetrical.

- round-robin, balance, 802.3ad, TLB and ALB modes all report the link
  speed as the sum of the speed of each active slave.
- active backup link speed is reported as the speed of the current
  primary slave
- broadcast is reported as the minimum of value of the active slaves
  link speeds.

In mode 4 (link aggregation 802.3ad) the properties of the first slave
added to the bonded device are slave and subsequent slaves are verified
to have the same properties.

Finally in the bond_ethdev_lsc_event_callback function the link
properties of the device are updated after any change to the number of
active slaves.

Fixes: 2efb58cbab6e ("bond: new link bonding library")
Cc: stable@dpdk.org
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
7 years agonet/ixgbe: enable IPv6 for consistent API
Qi Zhang [Wed, 5 Jul 2017 02:21:36 +0000 (22:21 -0400)]
net/ixgbe: enable IPv6 for consistent API

Enable IPv6 support with rte_flow API.
Only supports signature Match.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe: enable signature match for consistent API
Qi Zhang [Wed, 5 Jul 2017 02:21:35 +0000 (22:21 -0400)]
net/ixgbe: enable signature match for consistent API

Enable signature match for rte_flow API.
RTE_FLOW_ITEM_TYPE_FUZZY specify a signature match.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agonet/ixgbe: replace macro with inline function
Qi Zhang [Wed, 5 Jul 2017 02:21:34 +0000 (22:21 -0400)]
net/ixgbe: replace macro with inline function

Code cleanup done for 2 purposes.
1. "index" variable is no more needed.
2. inline function makes it easier and safer to nest into a loop.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
7 years agotest/bonding: fix mode 4 names
Daniel Mrzyglod [Wed, 5 Jul 2017 15:27:47 +0000 (17:27 +0200)]
test/bonding: fix mode 4 names

ring network driver is limited to 32 characters
the name of device was extended to net_ring_unit_test_mode4_slave_0
which is 33 characters long.

Fixes: 5e41ab250dfa ("app/test: unit tests for bonding mode 4")
Cc: stable@dpdk.org
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>