dpdk.git
7 years agoapp/testeventdev: add perf all types queue test
Jerin Jacob [Tue, 4 Jul 2017 04:53:21 +0000 (10:23 +0530)]
app/testeventdev: add perf all types queue test

This is a performance test case that aims at testing the following:
1. Measure the number of events can be processed in a second.
2. Measure the latency to forward an event.

The atq queue test functions as same as "perf_queue" test.
The difference is, it uses, "all type queue" scheme instead of separate
queues for each stage and thus reduces the number of queues required to
realize the use case and enables flow pinning as the event does not
move to the next queue.

Example command to run perf "all types queue" test:

sudo build/app/dpdk-test-eventdev --vdev=event_octeontx --\
--test=perf_atq --plcores=2 --wlcore=3 --stlist=p --nb_pkts=1000000000

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add perf queue worker functions
Jerin Jacob [Tue, 4 Jul 2017 04:53:20 +0000 (10:23 +0530)]
app/testeventdev: add perf queue worker functions

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add perf queue test
Jerin Jacob [Tue, 4 Jul 2017 04:53:19 +0000 (10:23 +0530)]
app/testeventdev: add perf queue test

This is a performance test case that aims at testing the following:
1. Measure the number of events can be processed in a second.
2. Measure the latency to forward an event.

The perf queue test configures the eventdev with Q queues and P ports,
where Q is nb_producers * nb_stages and P is nb_workers + nb_producers.

The user can choose the number of workers, the number of producers and
number of stages through the --wlcores , --plcores and the --stlist
application command line arguments respectively.

The producer(s) injects the events to eventdev based the
first stage sched type list requested by the user through --stlist
the command line argument.

Based on the number of stages to process(selected through --stlist),
the application forwards the event to next upstream queue and
terminates when it reaches the last stage in the pipeline.
On event termination, application increments the number events
processed and print periodically in one second to get the
number of events processed in one second.

When --fwd_latency command line option selected, the application
inserts the timestamp in the event on the first stage and then
on termination, it updates the number of cycles to forward
a packet. The application uses this value to compute the average
latency to a forward packet.

Example command to run perf queue test:
sudo build/app/dpdk-test-eventdev --vdev=event_sw0 -- --test=perf_queue\
--slcore=1 --plcores=2 --wlcore=3 --stlist=p --nb_pkts=1000000000

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: launch perf lcores
Jerin Jacob [Tue, 4 Jul 2017 04:53:18 +0000 (10:23 +0530)]
app/testeventdev: launch perf lcores

The event producer and master lcore's test termination and
the logic to print the mpps and latency are common for the
queue and all types queue test.

Move them as the common function.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add perf port setup
Jerin Jacob [Tue, 4 Jul 2017 04:53:17 +0000 (10:23 +0530)]
app/testeventdev: add perf port setup

Setup one port per worker and link to all queues and setup
N producer ports to inject the events.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add perf opt dump and check functions
Jerin Jacob [Tue, 4 Jul 2017 04:53:16 +0000 (10:23 +0530)]
app/testeventdev: add perf opt dump and check functions

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add perf basic functions
Jerin Jacob [Tue, 4 Jul 2017 04:53:15 +0000 (10:23 +0530)]
app/testeventdev: add perf basic functions

add functions to create mempool, destroy mempool and print the test result.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add perf test setup and destroy
Jerin Jacob [Tue, 4 Jul 2017 04:53:14 +0000 (10:23 +0530)]
app/testeventdev: add perf test setup and destroy

perf test has the queue and all types queue variants.
Introduce test_perf_common* to share the common code between those tests.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add order all types queue test
Jerin Jacob [Tue, 4 Jul 2017 04:53:13 +0000 (10:23 +0530)]
app/testeventdev: add order all types queue test

This test verifies the same aspects of order_queue test,
The difference is the number of queues used, this test
operates on a single "all types queue"(atq) instead of two
different queues for ordered and atomic.

Example command to run order all types queue test:
sudo build/app/dpdk-test-eventdev --vdev=event_octeontx --\
--test=order_atq --plcores 1 --wlcores 2,3

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add order queue worker functions
Jerin Jacob [Tue, 4 Jul 2017 04:53:12 +0000 (10:23 +0530)]
app/testeventdev: add order queue worker functions

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add order queue test
Jerin Jacob [Tue, 4 Jul 2017 04:53:11 +0000 (10:23 +0530)]
app/testeventdev: add order queue test

The order queue test configures the eventdev with two queues
and an event producer to inject the events to q0(ordered) queue.
Both q0(ordered) and q1(atomic) are linked to all the workers.

The event producer maintains a sequence number per flow and
injects the events to the ordered queue.

The worker receives the events from ordered queue and
forwards to atomic queue. Since the events from an ordered queue can
be processed in parallel on the different workers, the
ingress order of events might have changed on the downsteam
atomic queue enqueue. On enqueue to the atomic queue, the eventdev PMD
driver reorders the event to the original ingress order
i.e producer ingress order).

When the event is dequeued from the atomic queue by the worker,
this test verifies the expected
sequence number of associated event per flow by comparing
the free running expected sequence number per flow.

Example command to run order queue test:

sudo build/app/dpdk-test-eventdev --vdev=event_sw0 --\
--test=order_queue --plcores 1 --wlcores 2,3

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: launch order lcores
Jerin Jacob [Tue, 4 Jul 2017 04:53:10 +0000 (10:23 +0530)]
app/testeventdev: launch order lcores

The event producer and master lcore's test end and
failure detection logic are common for the queue and
all types queue test.Move them as the common function.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add order port setup
Jerin Jacob [Tue, 4 Jul 2017 04:53:09 +0000 (10:23 +0530)]
app/testeventdev: add order port setup

Setup one port per worker and link to all queues and setup
one producer port to inject the events.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add order basic functions
Jerin Jacob [Tue, 4 Jul 2017 04:53:08 +0000 (10:23 +0530)]
app/testeventdev: add order basic functions

add functions to create mempool, destroy mempool,
dump the options, check the options and print the test result.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add order test setup and destroy
Jerin Jacob [Tue, 4 Jul 2017 04:53:07 +0000 (10:23 +0530)]
app/testeventdev: add order test setup and destroy

order test has the queue and all types queue variants. Introduce
test_order_common* to share the common code between those tests.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add signal handler
Jerin Jacob [Tue, 4 Jul 2017 04:53:06 +0000 (10:23 +0530)]
app/testeventdev: add signal handler

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: invoke the test ops
Jerin Jacob [Tue, 4 Jul 2017 04:53:05 +0000 (10:23 +0530)]
app/testeventdev: invoke the test ops

This patch retrieves the test ops from the given test case name and
invokes the registered test ops callbacks in order and
print the test result.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: update options through command line
Guduri Prathyusha [Tue, 4 Jul 2017 04:53:04 +0000 (10:23 +0530)]
app/testeventdev: update options through command line

Add an infrastructure for updating the options through
application specific command line arguments.

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add helper functions to dump options
Jerin Jacob [Tue, 4 Jul 2017 04:53:03 +0000 (10:23 +0530)]
app/testeventdev: add helper functions to dump options

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add helper functions to check options
Jerin Jacob [Tue, 4 Jul 2017 04:53:02 +0000 (10:23 +0530)]
app/testeventdev: add helper functions to check options

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: define the test options
Jerin Jacob [Tue, 4 Jul 2017 04:53:01 +0000 (10:23 +0530)]
app/testeventdev: define the test options

Define the test options that used across all test cases and
fill the default values for the same.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add common helper functions
Jerin Jacob [Tue, 4 Jul 2017 04:53:00 +0000 (10:23 +0530)]
app/testeventdev: add common helper functions

adding common helper functions that used in test framework and
in all the test cases.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add string parsing helpers
Guduri Prathyusha [Tue, 4 Jul 2017 04:52:59 +0000 (10:22 +0530)]
app/testeventdev: add string parsing helpers

Add a couple of help functions that will allow parsing many types of
input parameters, i.e.: bool, 16, 32, 64 bits, hex and list of cores etc.

Derived from examples/ip_pipeline/parser.h

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: add registration framework
Jerin Jacob [Tue, 4 Jul 2017 04:52:58 +0000 (10:22 +0530)]
app/testeventdev: add registration framework

adding routines to register and retrieve eventdev test cases.
The RTE_INIT based constructor approach has been taken to simplify the test
case registration.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: define test ops
Jerin Jacob [Tue, 4 Jul 2017 04:52:57 +0000 (10:22 +0530)]
app/testeventdev: define test ops

In order to extend the test framework to realize different use cases,
The ops with function pointer callback scheme has been chosen.

This patch defines the callbacks for each test case.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoapp/testeventdev: introduce dpdk-test-eventdev app
Jerin Jacob [Tue, 4 Jul 2017 04:52:56 +0000 (10:22 +0530)]
app/testeventdev: introduce dpdk-test-eventdev app

The dpdk-test-eventdev tool is a Data Plane Development Kit (DPDK)
application that allows exercising various eventdev use cases. This
application has a generic framework to add new eventdev based test cases
to verify functionality and measure the performance parameters of DPDK
eventdev devices.

This patch adds the skeleton of the dpdk-test-eventdev application.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agodoc: add eventdev library to programmers guide
Harry van Haaren [Thu, 6 Jul 2017 14:35:16 +0000 (15:35 +0100)]
doc: add eventdev library to programmers guide

This commit adds an entry in the programmers guide
explaining the eventdev library.

The rte_event struct, queues and ports are explained.
An API walktrough of a simple two stage atomic pipeline
provides the reader with a step by step overview of the
expected usage of the Eventdev API.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agodoc: add SW eventdev pipeline to sample app guide
Harry van Haaren [Thu, 6 Jul 2017 14:35:15 +0000 (15:35 +0100)]
doc: add SW eventdev pipeline to sample app guide

Add a new entry in the sample app user-guides,
which details the working of the eventdev_pipeline_sw.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoexamples/eventdev_pipeline_sw_pmd: add sample app
Harry van Haaren [Thu, 6 Jul 2017 14:35:14 +0000 (15:35 +0100)]
examples/eventdev_pipeline_sw_pmd: add sample app

This commit adds a sample app for the eventdev library.
The app has been tested with DPDK 17.05-rc2, hence this
release (or later) is recommended.

The sample app showcases a pipeline processing use-case,
with event scheduling and processing defined per stage.
The application receives traffic as normal, with each
packet traversing the pipeline. Once the packet has
been processed by each of the pipeline stages, it is
transmitted again.

The app provides a framework to utilize cores for a single
role or multiple roles. Examples of roles are the RX core,
TX core, Scheduling core (in the case of the event/sw PMD),
and worker cores.

Various flags are available to configure numbers of stages,
cycles of work at each stage, type of scheduling, number of
worker cores, queue depths etc. For a full explaination,
please refer to the documentation.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoevent/sw: change worker rings to standard event rings
Bruce Richardson [Fri, 30 Jun 2017 15:06:21 +0000 (16:06 +0100)]
event/sw: change worker rings to standard event rings

Now that we have a standard event ring implementation for passing events
core-to-core, use that in place of the custom event rings in the software
eventdev.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agotest/eventdev: add auto-tests for event ring functions
Bruce Richardson [Fri, 30 Jun 2017 15:06:20 +0000 (16:06 +0100)]
test/eventdev: add auto-tests for event ring functions

Add some basic tests for the event ring functions. Not everything needs
testing as there is so much code re-use from the rte_ring code.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoeventdev: add ring structure for events
Bruce Richardson [Fri, 30 Jun 2017 15:06:19 +0000 (16:06 +0100)]
eventdev: add ring structure for events

Add in a new rte_event_ring structure type and functions to allow events to
be passed core to core. This is needed because the standard rte_ring type
only works on pointers, while for events, we want to copy the entire, 16B
events themselves - not just pointers to them. The code makes extensive use
of the functions already defined in rte_ring.h

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agotest/ring: add unit tests for exact size rings
Bruce Richardson [Fri, 30 Jun 2017 15:06:18 +0000 (16:06 +0100)]
test/ring: add unit tests for exact size rings

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agoring: allow non power-of-2 sizes
Bruce Richardson [Fri, 30 Jun 2017 15:06:17 +0000 (16:06 +0100)]
ring: allow non power-of-2 sizes

The rte_rings traditionally have only supported having ring sizes as powers
of 2, with the actual usable space being the size - 1. In some cases, for
example, with an eventdev where we want to precisely control queue depths
for latency, we need to allow ring sizes which are not powers of two so we
add in an additional ring capacity value to allow that. For existing rings,
this value will be size-1, i.e. the same as the mask, but if the new
EXACT_SZ flag is passed on ring creation, the ring will have exactly the
usable space requested, although the underlying memory size may be bigger.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
7 years agoevent/octeontx: add enqueue fwd op variant
Jerin Jacob [Thu, 29 Jun 2017 14:19:56 +0000 (19:49 +0530)]
event/octeontx: add enqueue fwd op variant

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoevent/octeontx: add enqueue new op variant
Jerin Jacob [Thu, 29 Jun 2017 14:19:55 +0000 (19:49 +0530)]
event/octeontx: add enqueue new op variant

OCTEONTX can have optimized handling of events if the PMD
knows it is a producer pattern in advance and it can support
burst mode if all the events has op == RTE_EVENT_OP_NEW.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoeventdev: introduce specialized enqueue forward op variant
Jerin Jacob [Thu, 29 Jun 2017 14:19:54 +0000 (19:49 +0530)]
eventdev: introduce specialized enqueue forward op variant

Introducing the rte_event_enqueue_new_burst() for enabling the
PMD, an optimization opportunity to optimize if all the events in
the enqueue burst has the op type of RTE_EVENT_OP_FORWARD.

If a PMD does not have any optimization opportunity
for this operation then the PMD can choose the generic enqueue
burst PMD callback as the fallback.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoeventdev: introduce specialized enqueue new op variant
Jerin Jacob [Thu, 29 Jun 2017 14:19:53 +0000 (19:49 +0530)]
eventdev: introduce specialized enqueue new op variant

Introducing the rte_event_enqueue_new_burst() for enabling the
PMD, an optimization opportunity to optimize if all the events in
the enqueue burst has the op type of RTE_EVENT_OP_NEW.

If a PMD does not have any optimization opportunity
for this operation then the PMD can choose the generic enqueue
burst PMD callback as the fallback.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agoeventdev: introduce helper function for enqueue burst
Jerin Jacob [Thu, 29 Jun 2017 14:19:52 +0000 (19:49 +0530)]
eventdev: introduce helper function for enqueue burst

Introducing a helper function to avoid duplicating
common enqueue burst code when introducing
enqueue burst variants.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
7 years agodoc: add NXP DPAA2 eventdev guide
Nipun Gupta [Fri, 30 Jun 2017 08:54:35 +0000 (14:24 +0530)]
doc: add NXP DPAA2 eventdev guide

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoevent/dpaa2: handle timeout using interrupts in dequeue
Nipun Gupta [Fri, 30 Jun 2017 08:54:34 +0000 (14:24 +0530)]
event/dpaa2: handle timeout using interrupts in dequeue

This patch adds support for interrupt handling on the event port.
These interrupts facilitates managing of timeout ticks in the
event dequeue functions.

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

Eventdev requires portal interrupts to handle timeout in the
event dequeue. This patch provides mechanism to enable the
portal interrupts.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
7 years agobus/fslmc: add interrupt enabling routine
Nipun Gupta [Fri, 30 Jun 2017 08:54:32 +0000 (14:24 +0530)]
bus/fslmc: add interrupt enabling routine

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
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>