dpdk.git
6 years agomempool/octeontx: fix pool to aura mapping
Pavan Nikhilesh [Tue, 3 Jul 2018 04:50:41 +0000 (10:20 +0530)]
mempool/octeontx: fix pool to aura mapping

HW needs each pool to be mapped to an aura set of 16 auras.
Previously, pool to aura mapping was considered to be 1:1.

Fixes: 02fd6c744350 ("mempool/octeontx: support allocation")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoexamples/l3fwd-power: add high/regular perf cores options
Radu Nicolau [Mon, 11 Jun 2018 10:03:23 +0000 (11:03 +0100)]
examples/l3fwd-power: add high/regular perf cores options

Added high/regular performance core pinning configuration options
that can be used in place of the existing 'config' option.

'--high-perf-cores CORELIST' option allow the user to specify a
high performance cores list; if this option is not used and the
'perf-config' option is used, the application will query the
system using the rte_power library in order to get a list of
available high performance cores. The cores that are considered
high performance are the cores that have turbo enabled.

'--perf-config (port,queue,hi_perf,lcore_index)'
option is similar to the existing config option, the cores are specified
as indices for bins containing high or regular performance cores.

Example:

l3fwd-power -l 6,7 -- -p 0xff \
--high-perf-cores 6 --perf-config="(0,0,0,0),(1,0,1,0)"

cores 6 and 7 are used, core 6 is specified as a high performance core.
port 0 queue 0 will use a regular performance core, index 0 (core 7)
port 1 queue 0 will use a high performance core, index 0 (core 6)

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
6 years agotest/power: add unit test for get capabilities API
Radu Nicolau [Mon, 11 Jun 2018 10:03:22 +0000 (11:03 +0100)]
test/power: add unit test for get capabilities API

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
6 years agopower: add get capabilities API
Radu Nicolau [Mon, 11 Jun 2018 10:03:21 +0000 (11:03 +0100)]
power: add get capabilities API

New API added, rte_power_get_capabilities(), that allows the
application to query the power and performance capabilities
of the CPU cores.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
6 years agoexamples/ip_pipeline: remove commands restriction
Jasvinder Singh [Tue, 10 Jul 2018 20:43:39 +0000 (21:43 +0100)]
examples/ip_pipeline: remove commands restriction

Currently, some CLI commands (for examples- add or delete pipeline
table entries, add meter profile etc.) fails to execute when
application pipeline threads are not running. Therefore,
command for enabling pipeline on the thread is required to be
executed first or specified in the script file before any of
such commands.

This patch removes above restriction and adds support for
executing all CLI commands regardless of the pipeline thread state.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoapp/testpmd: rework softnic forward mode
Jasvinder Singh [Fri, 6 Jul 2018 17:21:16 +0000 (18:21 +0100)]
app/testpmd: rework softnic forward mode

Modied the testpmd softnic forwarding mode as per the
changes in softnic PMD.

To run testpmd application with softnic fwd mode, following
command is used;

$ ./testpmd -c 0xc -n 4 --vdev 'net_softnic0,firmware=script.cli'
  -- -i --forward-mode=softnic

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
6 years agonet/softnic: add firmware script
Jasvinder Singh [Fri, 6 Jul 2018 17:21:15 +0000 (18:21 +0100)]
net/softnic: add firmware script

Add default firmware script for softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: implement start and stop
Jasvinder Singh [Fri, 6 Jul 2018 17:21:14 +0000 (18:21 +0100)]
net/softnic: implement start and stop

Implements softnic start and stop function.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: setup Rx/Tx queues
Jasvinder Singh [Fri, 6 Jul 2018 17:21:13 +0000 (18:21 +0100)]
net/softnic: setup Rx/Tx queues

Implements softnic receive and transmit queues setup using swq object.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for TTL action
Jasvinder Singh [Fri, 6 Jul 2018 17:21:12 +0000 (18:21 +0100)]
net/softnic: add command for TTL action

Add cli commands for ttl action in softnic pipeline objects.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for meter action
Jasvinder Singh [Fri, 6 Jul 2018 17:21:11 +0000 (18:21 +0100)]
net/softnic: add command for meter action

Add cli commands for meter action in softnic pipeline objects.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command to read stats
Jasvinder Singh [Fri, 6 Jul 2018 17:21:10 +0000 (18:21 +0100)]
net/softnic: add command to read stats

Add cli commands to read port and table stats of
softnic pipeline objects.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command for pipeline table entries
Jasvinder Singh [Fri, 6 Jul 2018 17:21:09 +0000 (18:21 +0100)]
net/softnic: add command for pipeline table entries

Add cli commands for table entries in softnic pipeline objects.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command to enable/disable pipeline
Jasvinder Singh [Fri, 6 Jul 2018 17:21:08 +0000 (18:21 +0100)]
net/softnic: add command to enable/disable pipeline

Add cli commands to enable and disable pipelines on specific threads in
softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command to create objects
Jasvinder Singh [Fri, 8 Jun 2018 12:41:48 +0000 (13:41 +0100)]
net/softnic: add command to create objects

Add cli commands to create softnic objects such as mempool, swq,
pipeline, etc.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add connection agent
Jasvinder Singh [Fri, 6 Jul 2018 17:21:06 +0000 (18:21 +0100)]
net/softnic: add connection agent

Add connection agent to enable connectivity with external agent
(e.g. telnet, netcat, Python script, etc).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add command interface
Jasvinder Singh [Fri, 8 Jun 2018 12:41:46 +0000 (13:41 +0100)]
net/softnic: add command interface

Add interface for softnic cli commands.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add run API
Cristian Dumitrescu [Wed, 11 Jul 2018 12:43:09 +0000 (13:43 +0100)]
net/softnic: add run API

Implements softnic API function to run pipeline objects.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add thread
Jasvinder Singh [Fri, 6 Jul 2018 17:21:03 +0000 (18:21 +0100)]
net/softnic: add thread

Add thread data structure and init function to run softnic pipelines
objects.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add pipeline object
Jasvinder Singh [Fri, 6 Jul 2018 17:21:02 +0000 (18:21 +0100)]
net/softnic: add pipeline object

Add pipeline object implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add table action profile
Jasvinder Singh [Fri, 6 Jul 2018 17:21:01 +0000 (18:21 +0100)]
net/softnic: add table action profile

Add pipeline's table action profile implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add port action profile
Jasvinder Singh [Fri, 6 Jul 2018 17:21:00 +0000 (18:21 +0100)]
net/softnic: add port action profile

Add pipeline's port action profile implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add traffic manager object
Jasvinder Singh [Fri, 6 Jul 2018 17:20:59 +0000 (18:20 +0100)]
net/softnic: add traffic manager object

Add traffic manager(tmgr) object to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add tap object
Jasvinder Singh [Fri, 6 Jul 2018 17:20:58 +0000 (18:20 +0100)]
net/softnic: add tap object

Add tap object implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add mempool object
Jasvinder Singh [Fri, 6 Jul 2018 17:20:57 +0000 (18:20 +0100)]
net/softnic: add mempool object

Add mempool object implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add link object
Jasvinder Singh [Fri, 6 Jul 2018 17:20:56 +0000 (18:20 +0100)]
net/softnic: add link object

Add link object implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: add software queue object
Jasvinder Singh [Fri, 6 Jul 2018 17:20:55 +0000 (18:20 +0100)]
net/softnic: add software queue object

Add swq object implementation to the softnic.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agonet/softnic: restructure
Jasvinder Singh [Fri, 6 Jul 2018 17:20:54 +0000 (18:20 +0100)]
net/softnic: restructure

Rework the softnic implementation to have flexiblity in enabling
more features to its receive and transmit data path.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
6 years agoexamples/ip_pipeline: add link command
Kevin Laatz [Fri, 22 Jun 2018 14:31:47 +0000 (15:31 +0100)]
examples/ip_pipeline: add link command

Add the functionality to track links in the application. This enables the
user to print the name, mac address and statistics for each link
in the application.

Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoraw/dpaa2_qdma: fix IOVA as VA flag
Hemant Agrawal [Thu, 21 Jun 2018 09:15:14 +0000 (14:45 +0530)]
raw/dpaa2_qdma: fix IOVA as VA flag

Fixes: b1ee472fed58 ("raw/dpaa2_qdma: introduce the DPAA2 QDMA driver")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: support scatter/gather config
Hemant Agrawal [Fri, 6 Jul 2018 08:10:12 +0000 (13:40 +0530)]
bus/dpaa: support scatter/gather config

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/dpaa: move the push queue set to global init
Hemant Agrawal [Fri, 6 Jul 2018 08:10:11 +0000 (13:40 +0530)]
net/dpaa: move the push queue set to global init

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agodrivers: support function name in NXP logs
Hemant Agrawal [Fri, 6 Jul 2018 08:10:10 +0000 (13:40 +0530)]
drivers: support function name in NXP logs

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/fslmc: cleanup unnecessary global variables
Hemant Agrawal [Fri, 6 Jul 2018 08:10:09 +0000 (13:40 +0530)]
bus/fslmc: cleanup unnecessary global variables

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: cleanup unnecessary global variables
Hemant Agrawal [Fri, 6 Jul 2018 08:10:08 +0000 (13:40 +0530)]
bus/dpaa: cleanup unnecessary global variables

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/dpaa: remove experimental tag from PMD API
Hemant Agrawal [Fri, 6 Jul 2018 08:10:07 +0000 (13:40 +0530)]
net/dpaa: remove experimental tag from PMD API

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/dpaa: support default queue mode
Hemant Agrawal [Fri, 6 Jul 2018 08:10:06 +0000 (13:40 +0530)]
net/dpaa: support default queue mode

In case DPAA FMAN configuration tool (FMC) is not available,
the system can still work with default queue(1 queue per port).

This patch also fixes some logs related to FQ ids, which were
idetified while testing this support.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobus/dpaa: make vdqcr configurable
Nipun Gupta [Fri, 6 Jul 2018 08:10:05 +0000 (13:40 +0530)]
bus/dpaa: make vdqcr configurable

This patch add support for configurable vdqcr exact flag.
This boost the performance, however this can give
side effects for some extra packet fetch. Which has been
taken care in the patch as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/dpaa: add API to get MAC address
Akhil Goyal [Fri, 6 Jul 2018 08:10:04 +0000 (13:40 +0530)]
bus/dpaa: add API to get MAC address

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/dpaa: optimize fq callback routine
Hemant Agrawal [Fri, 6 Jul 2018 08:10:03 +0000 (13:40 +0530)]
bus/dpaa: optimize fq callback routine

Avoid array of fq as packets are dq only from a single q.

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/dpaa2: fix prefetch Rx to honor number of packets
Hemant Agrawal [Fri, 6 Jul 2018 08:10:02 +0000 (13:40 +0530)]
net/dpaa2: fix prefetch Rx to honor number of packets

This patch fixes prefetch rx routine to
set the next prefetch request to the size of nb_pkts.
It assumes that next request would ideally be
of same size.

Fixes: 4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agonet/dpaa: fix queue error handling and logs
Hemant Agrawal [Fri, 6 Jul 2018 08:10:01 +0000 (13:40 +0530)]
net/dpaa: fix queue error handling and logs

Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/dpaa: fix buffer offset setting in FMAN
Hemant Agrawal [Fri, 6 Jul 2018 08:10:00 +0000 (13:40 +0530)]
bus/dpaa: fix buffer offset setting in FMAN

The buffer offset was incorrectly being set at 64,
thus not honoring the packet headroom.

Fixes: 6d6b4f49a155 ("bus/dpaa: add FMAN hardware operations")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/dpaa: fix SVR id fetch location
Hemant Agrawal [Fri, 6 Jul 2018 08:09:59 +0000 (13:39 +0530)]
bus/dpaa: fix SVR id fetch location

Otherwise the SVR may not be available for dpaa init.

Fixes: 3b59b73dea08 ("bus/dpaa: update platform SoC value register routines")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agobus/dpaa: fix phandle support for Linux 4.16
Alok Makhariya [Fri, 6 Jul 2018 08:09:58 +0000 (13:39 +0530)]
bus/dpaa: fix phandle support for Linux 4.16

Fixes: 2183c6f69d7e ("bus/dpaa: add OF parser for device scanning")
Cc: stable@dpdk.org
Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agomk: change TLS model for DPAA machine
Sachin Saxena [Wed, 4 Jul 2018 09:54:45 +0000 (15:24 +0530)]
mk: change TLS model for DPAA machine

Random corruptions observed on platfoms with using
the dpdk library in shared mode with VPP software (plugin).

using traditional TLS scheme resolved the issue.

Tested with VPP with DPDK as a plugin.

Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
6 years agohash: validate hash bucket entries while compiling
Honnappa Nagarahalli [Thu, 31 May 2018 15:30:49 +0000 (10:30 -0500)]
hash: validate hash bucket entries while compiling

Validate RTE_HASH_BUCKET_ENTRIES during compilation instead of
run time.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agonet/kni: fix check for meson build
Bruce Richardson [Tue, 3 Jul 2018 10:31:19 +0000 (11:31 +0100)]
net/kni: fix check for meson build

The configuration value indicating that KNI was build was incorrect,
causing the driver to never be built.

Fixes: 3479586fe636 ("net/kni: add to meson build")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agonet/avp: fix 32-bit meson builds
Bruce Richardson [Tue, 3 Jul 2018 10:31:18 +0000 (11:31 +0100)]
net/avp: fix 32-bit meson builds

When compiling with meson, extra warnings are enabled about casting from
integers to different size pointers. This triggers an error in AVP as the
addition of the offset to the pointer address causes the result to be a
64-bit integer which doesn't fit a 32-bit pointer. The fix here is to
explicitly indicate that the offset is of type "uintptr_t" which prevents
any promotion which would cause errors.

Fixes: c0ad584222b5 ("net/avp: add device initialization")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoexamples/kni: fix dependency check for meson build
Bruce Richardson [Tue, 3 Jul 2018 10:31:17 +0000 (11:31 +0100)]
examples/kni: fix dependency check for meson build

Rather than hard-coding the example app to be built only when a set of
conditions are met, we can simplify things by having the app built when
KNI library itself is available. That saves us duplicating the same set
of restrictions on both library and example app.

Fixes: 89f0711f9ddf ("examples: build some samples with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agobus/dpaa2: fix default IOVA setting for meson builds
Bruce Richardson [Tue, 3 Jul 2018 10:31:16 +0000 (11:31 +0100)]
bus/dpaa2: fix default IOVA setting for meson builds

By default, the DPAA2_USE_PHYS_IOVA setting with the make build-system
is "y", which is overridden to "n" in the config file specifically for
the arm64-dpaa2-linuxapp-gcc builds. The lack of this setting in meson
builds causes issues for 32-bit build, as the alternative code paths
have compiler warnings e.g. for i686 builds. Therefore we should align
the meson and make settings, setting the value to "true" by default and
overriding it to "false" for dpaa2-specific builds.

Fixes: 6ec78c2463ac ("build: add meson support for dpaaX platforms")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobuild: disable pointer to int warnings for 32-bit
Bruce Richardson [Tue, 3 Jul 2018 10:31:15 +0000 (11:31 +0100)]
build: disable pointer to int warnings for 32-bit

Converting a 32-bit pointer to a 64-bit integer is generally safe, but
generates a lot of warnings when compiling 32-bit code with meson. The
warnings are not flagged when using make, so just disable them for
32-bit meson builds.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agonet/sfc: disable for 32-bit builds
Bruce Richardson [Tue, 3 Jul 2018 10:31:14 +0000 (11:31 +0100)]
net/sfc: disable for 32-bit builds

The sfc driver is not supported on 32-bit so disable in meson in
those cases.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agobpf: fix 32-bit build support with meson
Bruce Richardson [Tue, 3 Jul 2018 10:31:13 +0000 (11:31 +0100)]
bpf: fix 32-bit build support with meson

The JIT is only supported on x86_64 so disable for 32-bit builds.

Fixes: cc752e43e079 ("bpf: add JIT compilation for x86_64 ISA")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agokni: disable for 32-bit meson builds
Bruce Richardson [Tue, 3 Jul 2018 10:31:12 +0000 (11:31 +0100)]
kni: disable for 32-bit meson builds

The kni library is not supported on 32-bit so disable it for those
builds using meson.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoexamples: make Linux environment check consistent
Thomas Monjalon [Wed, 6 Jun 2018 13:50:27 +0000 (15:50 +0200)]
examples: make Linux environment check consistent

Some Makefiles are using CONFIG_RTE_EXEC_ENV and others
are using CONFIG_RTE_EXEC_ENV_LINUXAPP.
Use the latter one for consistency.
We could remove CONFIG_RTE_EXEC_ENV later if considered useless.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agotest/bpf: add test for external function call
Konstantin Ananyev [Fri, 8 Jun 2018 08:42:35 +0000 (09:42 +0100)]
test/bpf: add test for external function call

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agobpf: add extra validation for input BPF program
Konstantin Ananyev [Fri, 8 Jun 2018 08:42:34 +0000 (09:42 +0100)]
bpf: add extra validation for input BPF program

Add checks for:
 - use/return uninitialized registers and/or stack data
 - possible memory access boundaries violation
 - invalid arguments for the function

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agobpf: add extra information for external symbol definitions
Konstantin Ananyev [Fri, 8 Jun 2018 08:42:33 +0000 (09:42 +0100)]
bpf: add extra information for external symbol definitions

Extend struct rte_bpf_xsym with new fields to provide information about:
 - for variables - type and size
 - for functions - number of arguments and type/size of each argument
   and return value

Such information would allow validate code to perform
more extensive checking on input BPF program and catch
misbehaving BPF code.

That change would cause ABI/API breakage for librte_bpf.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoeventdev: add callback for Rx adapter SW transfers
Nikhil Rao [Thu, 28 Jun 2018 06:48:10 +0000 (12:18 +0530)]
eventdev: add callback for Rx adapter SW transfers

Add ability for application to register a callback function
for SW transfers, the callback can decide which packets can
be enqueued to the event device.

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agotest/event: add Rx adapter tests for interrupt driven queues
Nikhil Rao [Mon, 2 Jul 2018 09:11:14 +0000 (14:41 +0530)]
test/event: add Rx adapter tests for interrupt driven queues

Add test for queue add and delete, the add/delete calls
also switch queues between poll and interrupt mode.

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
6 years agoeventdev: add interrupt driven queues to Rx adapter
Nikhil Rao [Mon, 2 Jul 2018 09:11:13 +0000 (14:41 +0530)]
eventdev: add interrupt driven queues to Rx adapter

Add support for interrupt driven queues when eth device is
configured for rxq interrupts and servicing weight for the
queue is configured to be zero.

A interrupt driven packet received counter has been added to
rte_event_eth_rx_adapter_stats.

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
6 years agoeventdev: move Rx adapter to separate function
Nikhil Rao [Mon, 2 Jul 2018 09:11:12 +0000 (14:41 +0530)]
eventdev: move Rx adapter to separate function

Create a separate function that handles eth receive and
enqueue to event buffer. This function will also be called for
interrupt driven receive queues.

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoeventdev: improve error handling for Rx adapter queue add/del
Nikhil Rao [Mon, 2 Jul 2018 09:11:11 +0000 (14:41 +0530)]
eventdev: improve error handling for Rx adapter queue add/del

The new WRR sequence applicable after queue add/del is set
up after setting the new queue state, so a memory allocation
failure will leave behind an incorrect state.

This change separates the memory sizing + allocation for the
Rx poll and WRR array from calculation of the WRR sequence.
If there is a memory allocation failure, existing Rx queue
configuration remains unchanged.

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
6 years agoeventdev: standardize Rx adapter internal function names
Nikhil Rao [Mon, 2 Jul 2018 09:11:10 +0000 (14:41 +0530)]
eventdev: standardize Rx adapter internal function names

Add a common prefix to function names and rename
few to better match functionality

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoevent/sw: support device stop flush callback
Gage Eads [Thu, 21 Jun 2018 14:23:23 +0000 (09:23 -0500)]
event/sw: support device stop flush callback

This commit also adds a flush callback test to the sw eventdev's selftest
suite.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agoservice: add mechanism for quiescing
Gage Eads [Thu, 21 Jun 2018 14:23:22 +0000 (09:23 -0500)]
service: add mechanism for quiescing

Existing service functions allow us to stop a service, but doing so doesn't
guarantee that the service has finished running on a service core. This
commit introduces rte_service_may_be_active(), which returns whether the
service may be executing on one or more lcores currently, or definitely is
not.

The service core layer supports this function by setting a flag when
a service core is going to execute a service, and unsetting the flag when
the core is no longer able to run the service (its runstate becomes stopped
or the lcore is no longer mapped).

With this new function, applications can set a service's runstate to
stopped, then poll rte_service_may_be_active() until it returns false. At
that point, the service is quiesced.

Signed-off-by: Gage Eads <gage.eads@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agoevent/octeontx: fix flush callback
Pavan Nikhilesh [Fri, 15 Jun 2018 05:44:06 +0000 (11:14 +0530)]
event/octeontx: fix flush callback

When event queues are being flushed the getwork operation used to extract
events should be a grouped getwork operation to the specific event queue.

Fixes: 8384f0e039ea ("event/octeontx: support device stop flush callback")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoeventdev: include PCI devices when getting id from name
Pavan Nikhilesh [Fri, 15 Jun 2018 03:45:24 +0000 (09:15 +0530)]
eventdev: include PCI devices when getting id from name

Currently, rte_event_dev_get_dev_id works only for virtual devices(vdev)
update the function to include devices probed through pci.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoremove useless constructor headers
Thomas Monjalon [Mon, 18 Jun 2018 12:32:21 +0000 (14:32 +0200)]
remove useless constructor headers

A constructor is usually declared with RTE_INIT* macros.
As it is a static function, no need to declare before its definition.
The macro is used directly in the function definition.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodoc: add UDP/IPv4 GSO in guides
Jiayu Hu [Fri, 6 Jul 2018 01:02:24 +0000 (09:02 +0800)]
doc: add UDP/IPv4 GSO in guides

This patch updates the programmer guide and testpmd user guide for
UDP/IPv4 GSO.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
6 years agoapp/testpmd: enable UDP GSO in csum engine
Jiayu Hu [Fri, 6 Jul 2018 01:02:23 +0000 (09:02 +0800)]
app/testpmd: enable UDP GSO in csum engine

This patch enables GSO for UDP/IPv4 packets. Oversized UDP/IPv4
packets transmitted over a GSO-enabled port will undergo segmentation.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Tested-by: Yuwei Zhang <yuwei1.zhang@intel.com>
6 years agogso: support UDP/IPv4 fragmentation
Jiayu Hu [Fri, 6 Jul 2018 01:02:22 +0000 (09:02 +0800)]
gso: support UDP/IPv4 fragmentation

This patch adds GSO support for UDP/IPv4 packets. Supported packets
may include a single VLAN tag. UDP/IPv4 GSO doesn't check if input
packets have correct checksums, and doesn't update checksums for
output packets (the responsibility for this lies with the application).
Additionally, UDP/IPv4 GSO doesn't process IP fragmented packets.

UDP/IPv4 GSO uses two chained MBUFs, one direct MBUF and one indrect
MBUF, to organize an output packet. The direct MBUF stores the packet
header, while the indirect mbuf simply points to a location within the
original packet's payload. Consequently, use of UDP GSO requires
multi-segment MBUF support in the TX functions of the NIC driver.

If a packet is GSO'd, UDP/IPv4 GSO reduces its MBUF refcnt by 1. As a
result, when all of its GSOed segments are freed, the packet is freed
automatically.

Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
6 years agoservice: add attribute API
Erik Gabriel Carrillo [Wed, 9 May 2018 16:22:16 +0000 (11:22 -0500)]
service: add attribute API

Add APIs that allow an application to query and reset the attributes of
a service lcore.  Add one such new attribute, "loops", which is a
counter that tracks the number of times the service core has looped in
the service runner function.  This is useful to applications that desire
a "liveness" check to make sure a service core is not stuck.

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
6 years agodoc: add default that all fixes should be backported
Kevin Traynor [Fri, 29 Jun 2018 23:10:43 +0000 (00:10 +0100)]
doc: add default that all fixes should be backported

Set the starting point that all commits on master branch
with Fixes tag should be backported to relevant stable/LTS
branches, and explain that the submitter may indicate it is
not suitable for backport.

Of course there will be exceptions that will crop up from time
to time that need discussion, so also add a sentence for that.

This is to ensure that there is consistency between what is
backported to stable/LTS branches, remove some subjectivity
as to what constitutes "a fix" and avoid possible conflicts
for future backports.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevtools: expand meson cross compiling test coverage
Gavin Hu [Fri, 29 Jun 2018 17:27:38 +0000 (01:27 +0800)]
devtools: expand meson cross compiling test coverage

The default test script covers only default host cc compiler, either gcc or
clang, the fix is to increase the coverage by adding one more to cover
clang and the others for gcc.

Fixes: a55277a788 ("devtools: add test script for meson builds")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Song Zhu <song.zhu@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: fix for host clang and cross gcc
Gavin Hu [Fri, 29 Jun 2018 17:27:37 +0000 (01:27 +0800)]
build: fix for host clang and cross gcc

The following error hits if host cc compiler is clang(default one in most
linux distributions) and the cross compiler is gcc.

The root cause is: the hybride compilers add the warning options to the
meson project as project arguments, which apply for both host compiling and
cross compiling. But some options such as '-Wno-format-truncation' are not
supported nor recognized by clang, so they have to be removed from the
project arguments for the host compiler to run smoothily and added back as
cflags for the cross compiler to compile for cross source files.

The fix is remove unrecognized warning options from the meson project
arguments shared by gcc and clang, as add them specifically for gcc or
clang as cflags.

[265/893] Compiling C object
'buildtools/pmdinfogen/pmdinfogen@exe/pmdinfogen.c.o'.  warning: unknown
warning option '-Wno-format-truncation' [-Wunknown-warning-option]

Fixes: a55277a788 ("devtools: add test script for meson builds")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Song Zhu <song.zhu@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agodevtools: fix ninja command in build test
Gavin Hu [Fri, 29 Jun 2018 17:27:36 +0000 (01:27 +0800)]
devtools: fix ninja command in build test

On some linux distributions, eg: CentOS, the ninja executable has a
different name: ninja-build, this patch is to check and adapt to it
accordingly.

./devtools/test-meson-builds.sh: line 24: ninja: command not found

Fixes: a55277a788 ("devtools: add test script for meson builds")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Song Zhu <song.zhu@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: fix meson warning
Gavin Hu [Fri, 29 Jun 2018 17:27:35 +0000 (01:27 +0800)]
build: fix meson warning

This is to fix the unnecessary warning output, it is not consistent with
the configurations of other platforms.

WARNING: Cross file does not specify strip binary, result will not be
stripped.

Fixes: e53a5299d2 ("build: support vendor specific ARM cross builds")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Song Zhu <song.zhu@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
6 years agodoc: add cross compiling guide
Gavin Hu [Fri, 29 Jun 2018 17:27:34 +0000 (01:27 +0800)]
doc: add cross compiling guide

This is the guide for cross compiling ARM64 DPDK from X86 hosts.

Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
6 years agomk: fix cross build
Gavin Hu [Fri, 29 Jun 2018 17:27:33 +0000 (01:27 +0800)]
mk: fix cross build

The "-Wimplicit-fallthrough=2" option was introduced into gcc 7.0, it was
enabled when the cross compiler gcc is greater than 7.0, but for the host
side buildtools/pmdinfogen, if the native gcc is older than 7.0, or the
host cc compiler is clang, it should not be enabled.

The fix is to differentiate the host gcc Werror options from the cross gcc.

gcc -Wp,-MD,./.pmdinfogen.o.d.tmp  -W -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wold-style-definition
-Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual
-Wformat-nonliteral -Wformat-security -Wundef -Wwrite-strings -Wdeprecated
-Werror -Wimplicit-fallthrough=2 -Dbbb -Wno-format-truncation -g
-I/dpdk/build/include    -o pmdinfogen.o -c
~/dpdk/buildtools/pmdinfogen/pmdinfogen.c gcc: error:
unrecognized command line option ‘-Wimplicit-fallthrough=2’

Fixes: ced3e6f8 ("mk: adjust gcc flags for new gcc 7 warnings")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoexamples/multi_process: build l2fwd_fork app
Emma Kenny [Tue, 3 Jul 2018 16:16:45 +0000 (17:16 +0100)]
examples/multi_process: build l2fwd_fork app

l2fwd_fork is not complied by default, this will make it compile

Fixes: 95e8005a56e8 ("examples/l2fwd_fork: new app")

Signed-off-by: Emma Kenny <emma.kenny@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agoexamples/multi_process: fix build
Emma Kenny [Mon, 2 Jul 2018 15:40:21 +0000 (16:40 +0100)]
examples/multi_process: fix build

Fix bug with undeclared variable name and
calling a variable that is not member of struct.

CC main.o
l2fwd_fork/main.c:  In function ‘main’: l2fwd_fork/main.c:1043:33:
 error: ‘dev_info’ undeclared (first use in this function)
 rte_eth_dev_info_get(portid, &dev_info);

l2fwd_fork/main.c:1043:33: note: each undeclared identifier is
reported only once for each function it appears in
l2fwd_fork/main.c:1077:11: error: ‘struct rte_eth_txconf’
has no member named ‘tx_offloads’
   txq_conf.tx_offloads = local_port_conf.txmode.offloads;

Fixes: f8c02ca878af ("examples/multi_process: convert to new ethdev offloads API")
Cc: stable@dpdk.org
Signed-off-by: Emma Kenny <emma.kenny@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
6 years agomaintainers: update for Mellanox PMDs
Adrien Mazarguil [Thu, 5 Jul 2018 09:19:46 +0000 (11:19 +0200)]
maintainers: update for Mellanox PMDs

Shahaf and Matan volunteered to replace Nélio and myself as maintainers for
mlx4 and mlx5 PMDs. Cheers!

Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agomaintainers: update for mempool
Olivier Matz [Mon, 2 Jul 2018 15:55:35 +0000 (17:55 +0200)]
maintainers: update for mempool

Given its very good contributions to this library, add Andrew as
official maintainer for librte_mempool.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agoigb_uio: fix build with lock down checks
David Marchand [Fri, 29 Jun 2018 10:13:57 +0000 (12:13 +0200)]
igb_uio: fix build with lock down checks

Caught on ubuntu-16.04 with hwe kernel for aarch64:

$ uname -a
Linux ubuntu1604arm64es 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May
17 13:08:01 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

== Build kernel/linux/igb_uio
  CC [M] .../kernel/linux/igb_uio/igb_uio.o
In file included from .../kernel/linux/igb_uio/igb_uio.c:20:0:
.../igb_uio/compat.h: In function ‘igbuio_kernel_is_locked_down’:
.../igb_uio/compat.h:146:7:
error: "CONFIG_EFI_SECURE_BOOT_LOCK_DOWN" is not defined [-Werror=undef]
 #elif CONFIG_EFI_SECURE_BOOT_LOCK_DOWN
       ^
cc1: all warnings being treated as errors

Fixes: d67014c3d38b ("igb_uio: fail and log if kernel lock down is enabled")

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agotest/crypto: add DH and DSA tests
Sunila Sahu [Tue, 10 Jul 2018 16:01:31 +0000 (21:31 +0530)]
test/crypto: add DH and DSA tests

Test application include test case for :
- Diffie-Hellman  key pair generation and shared secret compute
- DSA sign and verify

Test cases uses predefined test vectors.

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Umesh Kartha <umesh.kartha@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agotest/crypto: add RSA and Mod tests
Sunila Sahu [Tue, 10 Jul 2018 16:01:30 +0000 (21:31 +0530)]
test/crypto: add RSA and Mod tests

Test application include test case for :
- RSA encrypt, decrypt, sign and verify
- Modular Inversion and Exponentiation

Test cases uses predefined test vectors.

Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Umesh Kartha <umesh.kartha@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agodoc: add asymmetric crypto in programmer guide
Shally Verma [Tue, 10 Jul 2018 15:33:21 +0000 (21:03 +0530)]
doc: add asymmetric crypto in programmer guide

Update cryptodev programmer guide with description of
asymmetric crypto framework in lib cryptodev.

Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Umesh Kartha <umesh.kartha@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: add asymmetric capability
Sunila Sahu [Tue, 10 Jul 2018 15:33:20 +0000 (21:03 +0530)]
cryptodev: add asymmetric capability

Extend cryptodev with asymmetric capability APIs and
definitions.

Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Umesh Kartha <umesh.kartha@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: support asymmetric operations
Ashish Gupta [Tue, 10 Jul 2018 15:33:19 +0000 (21:03 +0530)]
cryptodev: support asymmetric operations

Extend DPDK librte_cryptodev to:
- define asym op type in rte_crypto_op_type and associated
  op pool create/alloc APIs
- define asym session and associated session APIs

If PMD shows in its feature flag that it supports both sym and
asym then it must support those on all its qps.

Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Umesh Kartha <umesh.kartha@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: add asymmetric xform and op definitions
Umesh Kartha [Tue, 10 Jul 2018 15:33:18 +0000 (21:03 +0530)]
cryptodev: add asymmetric xform and op definitions

Add rte_crypto_asym.h with supported xforms
and associated op structures and APIs

API currently supports:
- RSA Encrypt, Decrypt, Sign and Verify
- Modular Exponentiation and Inversion
- DSA Sign and Verify
- Diffie-Hellman private key exchange
- Diffie-Hellman public key exchange
- Diffie-Hellman shared secret compute
- Diffie-Hellman public/private key pair generation
using xform chain

Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Umesh Kartha <umesh.kartha@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/scheduler: add minimum head/tailroom requirement
Anoob Joseph [Tue, 10 Jul 2018 14:42:40 +0000 (20:12 +0530)]
crypto/scheduler: add minimum head/tailroom requirement

Minimum head/tailroom requirement for each PMD has to be considered
while populating the dev_info.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agotest/crypto: skip validation of head/tailroom used by PMD
Anoob Joseph [Tue, 10 Jul 2018 14:42:39 +0000 (20:12 +0530)]
test/crypto: skip validation of head/tailroom used by PMD

Crypto PMDs would specify the head/tailroom it would use while
processing the crypto requests. This need to be considered while
verifying buffers processed by crypto PMDs.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agoapp/crypto-perf: honour min headroom/tailroom
Anoob Joseph [Tue, 10 Jul 2018 14:42:38 +0000 (20:12 +0530)]
app/crypto-perf: honour min headroom/tailroom

Crypto dev would specify its headroom and tailroom requirement and the
application is expected to honour this while creating buffers.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: add min headroom and tailroom requirement
Anoob Joseph [Tue, 10 Jul 2018 14:42:37 +0000 (20:12 +0530)]
cryptodev: add min headroom and tailroom requirement

Enabling crypto devs to specify the minimum headroom and tailroom it
expects in the mbuf. For net PMDs, standard headroom has to be honoured
by applications, which is not strictly followed for crypto devs. This
prevents crypto devs from using free space in mbuf (available as
head/tailroom) for internal requirements in crypto operations. Addition
of head/tailroom requirement will help PMDs to communicate such
requirements to the application.

The availability and use of head/tailroom is an optimization if the
hardware supports use of head/tailroom for crypto-op info. For devices
that do not support using the head/tailroom, they can continue to operate
without any performance-drop.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocryptodev: rename experimental private data APIs
Fiona Trahe [Fri, 6 Jul 2018 13:39:42 +0000 (14:39 +0100)]
cryptodev: rename experimental private data APIs

The name private_data is confusing in these APIs:
rte_cryptodev_sym_session_set_private_data()
rte_cryptodev_sym_session_get_private_data()
It refers to data added at the end of the session hdr for
use by the application.
The session already contains sess_private_data[index]
which is used to store private pmd data and most references to private
data refer to that.
e.g. external apis
rte_cryptodev_sym_get_private_session_size() and internal
set/get_session_private_data() refer to sess_private_data[].

So rename to user_data, i.e.
rte_cryptodev_sym_session_set_user_data()
rte_cryptodev_sym_session_get_user_data()

Refers to changes introduced here:
https://patches.dpdk.org/patch/38172/

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
6 years agocryptodev: check if symmetric sessions are supported
Pablo de Lara [Thu, 5 Jul 2018 02:08:05 +0000 (03:08 +0100)]
cryptodev: check if symmetric sessions are supported

Since asymmetric functionality will be implemented soon,
not all PMDs must support symmetric sessions.
Therefore, a check is added if a device does not implement
the symmetric functions, meaning that the device does not
support symmetric operations.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agocryptodev: rename PMD symmetric session API
Pablo de Lara [Thu, 5 Jul 2018 02:08:04 +0000 (03:08 +0100)]
cryptodev: rename PMD symmetric session API

The PMD specific API to configure, clear and
obtain session private size is renamed, including
the word _sym_ to clarify that it is API
for symmetric sessions, so there will not be any
conflicts for asymmetric and other type of sessions
in the future.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agocryptodev: remove attach/detach session API
Pablo de Lara [Thu, 5 Jul 2018 02:08:03 +0000 (03:08 +0100)]
cryptodev: remove attach/detach session API

As announced in the previous release,
The API to attach/dettach a session to a queue pair
is removed, as it was only used in DPAA, and it is not
actually needed.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>