Commit Graph

11475 Commits

Author SHA1 Message Date
Fiona Trahe
3b12d382db crypto/qat: fix truncated response ring value
Issue detected by coverity. Could never actually cause a
problem as truncated value (0x7f7f7f7f->0x7f) is what's needed.
But fix in code for correctness.

Coverity issue: 194998
Fixes: 571365dd4c ("crypto/qat: enable Rx head writes coalescing")
Cc: stable@dpdk.org

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Fiona Trahe
3c60756c73 test/crypto: improve NULL authentication validation
Add comparison to make sure memory pointed to by
digest pointer is not overwritten in NULL auth case.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-01-29 20:22:33 +01:00
Fiona Trahe
4e0955bddb crypto/qat: fix null auth algo overwrite
If auth algorithm is RTE_CRYPTO_AUTH_NULL and digest_length is 0
in the xform and digest pointer is set in the op, then
the PMD may overwrite memory at the digest pointer.
With this patch the memory is not overwritten.

Fixes: db0e952a5c ("crypto/qat: add NULL capability")
Cc: stable@dpdk.org

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 20:22:33 +01:00
Zhiyong Yang
513942f07c cryptodev: fix session pointer cast
The wrong casts don't cause actual error, but they should conform to C
standard.

Fixes: c261d1431b ("security: introduce security API and framework")
Fixes: b3bbd9e5f2 ("cryptodev: support device independent sessions")
Cc: stable@dpdk.org

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-01-29 20:22:33 +01:00
Fan Zhang
7629b31f84 app/crypto-perf: fix out-of-bounds array access
Fixes: 27c2e74719 ("app/crypto-perf: support IMIX")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
2018-01-29 20:22:33 +01:00
Fan Zhang
a6b57a534d examples/ipsec_secgw: fix security session
Fixes: 3da37f6821 ("examples/ipsec_secgw: create session mempools for ethdevs")

Some NICs do not have the rte_security context, this patch fixes the segment fault
caused by this.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2018-01-29 20:22:33 +01:00
Tomasz Jozwiak
c202320775 crypto/qat: fix parameter type
This commit fixes right cast from qat_cipher_get_block_size
function. This function can return -EFAULT in case of
any error, and that value must be cast to int instead of uint8_t

Fixes: d18ab45f76 ("crypto/qat: support DOCSIS BPI mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Tomasz Jozwiak
2c4e6fd19c crypto/qat: fix typo in error message
This commit fixes typo in bpi_cipher_decrypt error message

Fixes: d18ab45f76 ("crypto/qat: support DOCSIS BPI mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Tomasz Jozwiak
8aa8ee9d2d crypto/qat: fix out-of-bounds access
This commit fixes
  - bpi_cipher_encrypt to prevent before 'array subscript is
    above array bounds' error
  - bpi_cipher_decrypt to prevent before 'array subscript is
    above array bounds' error

Fixes: d18ab45f76 ("crypto/qat: support DOCSIS BPI mode")
Cc: stable@dpdk.org

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2018-01-29 20:22:33 +01:00
Akhil Goyal
a74af788c6 crypto/dpaa_sec: support scatter gather
Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 20:22:33 +01:00
Akhil Goyal
37f96eb01b crypto/dpaa2_sec: support scatter gather
Signed-off-by: Alok Makhariya <alok.makhariya@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 20:22:33 +01:00
Akhil Goyal
42c3576d44 doc: update feature list for cryptodevs
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2018-01-29 20:22:33 +01:00
Thomas Monjalon
2ab9a94831 crypto/dpaa2_sec: fix build with GCC 7
Seen with GCC 7.2.0, a switch fall through is detected and
cannot be fixed with a fall-through comment or attribute:

drivers/crypto/dpaa2_sec/hw/rta/operation_cmd.h:89:6: error:
this statement may fall through [-Werror=implicit-fallthrough=]
   if (rta_sec_era < RTA_SEC_ERA_2)
      ^

The check is disabled in dpaa2_sec Makefile but not in dpaa_sec Makefile
which uses source code shared by dpaa2_sec.

The workaround is to disable the check at the beginning of the file.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:38:24 +01:00
Thomas Monjalon
d961c37439 crypto/mrvl: fix export map file name
Fixes: 8a61c83af2 ("crypto/mrvl: add mrvl crypto driver")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
2843cdd93a doc: add ABI experimental tag in versioning guide
Document the need to add the __experimental tag to appropriate functions

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
a6ec31597a mk: add experimental tag check
Add checks during build to ensure that all symbols in the EXPERIMENTAL
version map section have __experimental tags on their definitions, and
enable the warnings needed to announce their use.  Also add an
ALLOW_EXPERIMENTAL_APIS define to allow individual libraries and files
to declare the acceptability of experimental api usage

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
77b7b81e32 add experimental tag to appropriate functions
Append the __rte_experimental tag to api calls appearing in the
EXPERIMENTAL section of their libraries version map

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
2018-01-29 23:35:29 +01:00
Neil Horman
7d540a3e73 compat: add experimental tag macro
The __rte_experimental macro tags a given exported function as being part of
the EXPERIMENTAL api.  Use of this tag will cause any caller of the
function (that isn't removed by dead code elimination) to emit a warning
that the user is making use of an API whos stabilty isn't guaranteed.
It also places the function in the .text.experimental section, which is
used to validate the tag against the corresponding library version map

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2018-01-29 22:44:01 +01:00
Neil Horman
a4bcd61de8 buildtools: add script to check experimental API exports
This tools reads the given version map for a directory, and checks to
ensure that, for each symbol listed in the export list, the corresponding
definition is tagged as __rte_experimental, erroring out if its not.  In this
way, we can ensure that the EXPERIMENTAL api is kept in sync with the tags

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2018-01-29 22:44:00 +01:00
Bruce Richardson
0d68533617 pmdinfogen: allow using stdin and stdout
Rather than having to work off files all the time, allow stdin and stdout
to be used as the source and destination for pmdinfogen. This will allow
other possible usages from scripts, e.g. taking files from ar archive and
building a single .pmd.c file from all the .o files in it.

	for f in `ar t librte_pmd_xyz.a` ; do
		ar p librte_pmd_xyz.a $f | pmdinfogen - - >> xyz_info.c
	done

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
2018-01-29 20:48:16 +01:00
Harry van Haaren
67684d1e87 app/procinfo: call EAL cleanup before exit
This patch adds a call to the newly introduced cleanup()
function just before quitting the app.

Adding this function call before quitting from a secondary processes
is important, as otherwise it will leak hugepage memory. For a secondary
process that is run multiple times, this could cause hugepage memory
to become depleted and stop a secondary process from starting.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 20:33:53 +01:00
Harry van Haaren
295d71095a app/pdump: call EAL cleanup before exit
This patch adds a call to the newly introduced cleanup()
function just before quitting the pdump app.

Adding this function call before quitting from a secondary processes
is important, as otherwise it will leak hugepage memory. For a secondary
process that is run multiple times, this could cause hugepage memory
to become depleted and stop a secondary process from starting.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 20:33:53 +01:00
Harry van Haaren
aec9c13c52 eal: add function to release internal resources
This commit adds a new function rte_eal_cleanup().
The function serves as a hook to allow DPDK to release
internal resources (e.g.: hugepage allocations).

This function allows DPDK to become more like an ordinary
library, where the library context itself can be initialized
and cleaned up by the application.

The rte_exit() and rte_panic() functions must be considered,
particularly if they should call rte_eal_cleanup() to release any
resources or not. This patch adds the cleanup to rte_exit(),
but does not clean up on rte_panic(). The reason to not clean
up on panicing is that the developer may wish to inspect the
exact internal state of EAL and hugepages.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 20:33:53 +01:00
Harry van Haaren
1dd133ae07 service: restrict finalize to internal usage
This commit moves the rte_service_finalize() function
to be in the component header, and marks it as @internal.
The function is only called internally by rte_eal_finalize().

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Vipin Varghese <vipin.varghese@intel.com>
2018-01-29 19:24:45 +01:00
Hemant Agrawal
8824b74d8f bus/fslmc: register platform HW mempool on runtime
Detect if the DPAA2 mempool objects are present and register
it as platform default hw mempool

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
2bd0d5b951 bus/dpaa: register platform HW mempool on runtime
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 19:02:05 +01:00
Pavan Nikhilesh
0e79856795 app/testpmd: add log for preferred mempool ops
This patch adds the debug message to print the best selected
pktmbuf mempool ops name.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
e5b45e9b2b mbuf: add pool create helper for specific mempool ops
Introduce a new helper for pktmbuf pool, which will allow
the application to optionally specify the mempool ops name
as well.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
a3acc3144a mbuf: add pool ops selection functions
This patch add support for various mempool ops config helper APIs.

1.User defined mempool ops
2.Platform detected HW mempool ops (active).
3.Best selection of mempool ops by looking into user defined,
  platform registered and compile time configured.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 19:02:05 +01:00
Hemant Agrawal
8b0f7f4341 mbuf: maintain user and compile time mempool ops name
At present the userdefined mempool ops name overwrites
the default mempool ops name variable in internal_config.

This patch change the logic to maintain the value of
user defined only in the internal config.

The pktmbuf_create_pool is updated to reflect the same ie.
use user defined. If not present than use the default.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 18:52:34 +01:00
Hemant Agrawal
96fd032ba8 eal: prefix mbuf pool ops name with user defined
This patch prefix the mbuf pool ops name with "user" to indicate
that it is user defined.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
2018-01-29 18:52:07 +01:00
Olivier Matz
de677ca0a9 mbuf: fix VLAN flags documentation
Fix inconsistency between mbuf structure documentation and flags
documentation.

Fixes: 380a7aab1a ("mbuf: rename deprecated VLAN flags")
Cc: stable@dpdk.org

Reported-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-29 18:51:45 +01:00
Olivier Matz
7a52bcf5d8 mbuf: rename Tx VLAN flags
For consistency with the Rx flags, the flags PKT_TX_VLAN_PKT and
PKT_TX_QINQ_PKT are respectively renamed as PKT_TX_VLAN and
PKT_TX_QINQ. The old defines are deprecated but will stay for some time
for compatibility.

Reported-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-29 18:51:42 +01:00
Olivier Matz
9f8d9b2ee3 mbuf: fix NULL freeing when debug enabled
Do not panic when calling rte_pktmbuf_free(NULL) with mbuf debug
enabled, it is a valid operation.

Fixes: af75078fec ("first public release")
Cc: stable@dpdk.org

Reported-by: Keith Wiles <keith.wiles@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
2018-01-29 18:32:19 +01:00
Konstantin Ananyev
096ffd811f eal/x86: use lock-prefixed instructions for SMP barrier
On x86 it is possible to use lock-prefixed instructions to get
the similar effect as mfence.
As pointed by Java guys, on most modern HW that gives a better
performance than using mfence:
https://shipilev.net/blog/2014/on-the-fence-with-dependencies/
That patch adopts that technique for rte_smp_mb() implementation.
On BDW 2.2 mb_autotest on single lcore reports 2X cycle reduction,
i.e. from ~110 to ~55 cycles per operation.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2018-01-29 16:50:04 +01:00
Konstantin Ananyev
93da5b59af test: introduce memory barrier test case
Simple functional test for rte_smp_mb() implementations.
Also when executed on a single lcore could be used as rough
estimation how many cycles particular implementation of rte_smp_mb()
might take.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2018-01-29 16:45:18 +01:00
Jerin Jacob
369adc4885 config/thunderx: disable C11 memory model ring
On thunderx and octeontx, ring_perf_autotest and
ring_pmd_perf_autotest test shows better performance
when disabling CONFIG_RTE_RING_USE_C11_MEM_MODEL.
On the other hand, Enabling CONFIG_RTE_RING_USE_C11_MEM_MODEL
shows better performance on thunderx2.
Since thunderx2 is using the default armv8 config,
no particular change is required.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
2018-01-29 16:40:01 +01:00
Jia He
39368ebfc6 ring: introduce C11 memory model barrier option
This patch is to support C11 memory model barrier in librte_ring.

There are 2 barrier implementation options in librte_ring (suggested
by Jerin).
1. use rte_smp_rmb
2. use load_acquire/store_release(refer to [1]).
The reason why providing 2 options is the performance benchmark
difference in different arm machines, refer to [2].

CONFIG_RTE_RING_USE_C11_MEM_MODEL is provided, and by default it is "n"
on any architectures and only "y" on arm64 so far.

[1] https://github.com/freebsd/freebsd/blob/master/sys/sys/buf_ring.h#L170
[2] http://dpdk.org/ml/archives/dev/2017-October/080861.html

Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Jia He <jia.he@hxt-semitech.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 16:10:20 +01:00
Jia He
c9fb3c6289 ring: move code in a new header file
Move the common part of rte_ring.h into rte_ring_generic.h.
Move the memory barrier part into update_tail().

No functional changes here.

Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Suggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Jia He <jia.he@hxt-semitech.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 16:04:43 +01:00
Jia He
59a3cae530 eal/arm64: remove the braces in memory barrier macros
for the code as follows:
if (condition)
	rte_smp_rmb();
else
	rte_smp_wmb();
Without this patch, compiler will report this error:
error: 'else' without a previous 'if'

Fixes: 84733fd0d7 ("eal/arm64: fix memory barrier definition")
Cc: stable@dpdk.org

Signed-off-by: Jia He <jia.he@hxt-semitech.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-01-29 15:14:53 +01:00
Yongseok Koh
1742c2d9fa net/mlx5: fix synchronization on polling Rx completions
Polling a new packet is basically sensing the generation bit in a
completion entry. For some processors not having strongly-ordered memory
model, there has to be a memory barrier between reading the generation bit
and other fields of the entry in order to guarantee data is not stale.

Fixes: 570acdb1da ("net/mlx5: add vectorized Rx/Tx burst for ARM")
Cc: stable@dpdk.org

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
2018-01-28 08:30:36 +01:00
Yongseok Koh
4fe7f662ac net/mlx5: replace I/O memory barrier with coherent version
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-28 08:30:35 +01:00
Yongseok Koh
8d27708212 net/mlx5: remove unnecessary memory barrier
As rte_write64() has an IO barrier, there's no need to have a barrier
before the call.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-28 08:30:33 +01:00
Yongseok Koh
52bd60a5cf eal/arm64: define coherent I/O memory barriers
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Thomas Speier <tspeier@qti.qualcomm.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
2018-01-28 08:30:30 +01:00
Yongseok Koh
bbc504dfbb eal/arm32: define coherent I/O memory barriers
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Jianbo Liu <jianbo.liu@arm.com>
2018-01-28 08:30:25 +01:00
Yongseok Koh
cbb3c41628 eal/ppc64: define coherent I/O memory barriers
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-28 08:30:23 +01:00
Yongseok Koh
0079e4fb69 eal/x86: define coherent I/O memory barriers
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-28 08:30:22 +01:00
Yongseok Koh
cd36cc49e5 eal: introduce coherent I/O memory barriers
This commit introduces rte_cio_wmb() and rte_cio_rmb(), in order to
guarantee the ordering of coherent shared memory between the CPU and a DMA
capable device.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
2018-01-28 08:30:21 +01:00
Yongseok Koh
9bea9e865a eal: group memory barriers by type in doxygen
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
2018-01-28 08:30:20 +01:00
Pavan Nikhilesh
948bc3d6d0 test: add reciprocal based division
This commit provides a set of tests for verifying the correctness and
performance of both unsigned 32 and 64bit reciprocal based division.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
2018-01-27 22:36:56 +01:00