Anoob Joseph [Mon, 16 Apr 2018 12:23:15 +0000 (17:53 +0530)]
examples/ipsec-secgw: fix usage print
The usage print was not updated when jumbo frames & crypto_dev mask
support was added. Fixing that. Also, the optional arguments were not
properly highlighted in the usage header. This is also fixed.
General cleanup of the usage print was also done to make it look more
cleaner and similar to what is existing in other applications like
l3fwd.
Fixes:
bbabfe6e4ee4 ("examples/ipsec_secgw: support jumbo frames")
Fixes:
2c68fe791538 ("examples/ipsec-secgw: add cryptodev mask option")
Fixes:
d299106e8e31 ("examples/ipsec-secgw: add IPsec sample application")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:26 +0000 (17:23 +0800)]
doc: add virtio crypto PMD guide
This patch adds the guide for virtio crypto PMD.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:25 +0000 (17:23 +0800)]
test/crypto: add tests for virtio-crypto
Only RTE_CRYPTO_CIPHER_AES_CBC cipher
algorithm are tested as unit test, it is supported both by the
cryptodev-backend-builtin and cryptodev-vhost-user of qemu side.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:24 +0000 (17:23 +0800)]
crypto/virtio: support HMAC-SHA1
The AES-CBC with HMAC-SHA1 has been supported now.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:23 +0000 (17:23 +0800)]
crypto/virtio: support AES-CBC
The AES-CBC cipher only algorithm has been supported now.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:22 +0000 (17:23 +0800)]
crypto/virtio: support stats related ops
This patch implements the statistics of the packets.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:21 +0000 (17:23 +0800)]
crypto/virtio: support burst enqueue/dequeue
This patch implements the functions of virtio_crypto_pkt_tx_burst()
and virtio_crypto_pkt_rx_burst(). The encryption and decryption requests
are placed in the data queue and are ultimately handled by
the backend crypto accelerators.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:20 +0000 (17:23 +0800)]
crypto/virtio: support session related ops
This patch implements session related operations, which includes creating
and destroying the session. For now, it only supports the session-oriented
API implementation. The control queue used to create or destroy sessions
for symmetric algorithms.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:19 +0000 (17:23 +0800)]
crypto/virtio: support basic PMD ops
This patch implements the basic operations of virtio crypto PMD, which
includes start, stop, close, information getting, queue setup and
release of the device.
The virtio crypto device has two types of queues, data queue and
control queue. It has one data queue at least and has one and only one
control queue. For example, if a virtio crypto device has N queues,
then [0, N-2] is the data queue index, N-1 is the control
queue index.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:18 +0000 (17:23 +0800)]
crypto/virtio: support device init
This patch implements the initialization of the virtio crypto device.
The virtio crypto device conforms to virtio-1.0, so this patch only
supports modern mode operation.
The cryptodev is created at the virtio crypto pci device probing stage.
The function of virtio_crypto_pkt_tx_burst() is used to burst transfer
packets and virtio_crypto_pkt_rx_burst() is used to burst receive packets.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Jay Zhou [Tue, 17 Apr 2018 09:23:17 +0000 (17:23 +0800)]
crypto/virtio: add virtio crypto PMD
The virtio crypto device is a virtual cryptography device
as well as a kind of virtual hardware accelerator for
virtual machines. The linux kernel virtio-crypto driver
has been merged, and this patch introduces virtio crypto
PMD to achieve better performance.
Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Reviewed-by: Fan Zhang <roy.fan.zhang@intel.com>
Fiona Trahe [Fri, 6 Apr 2018 18:51:43 +0000 (19:51 +0100)]
crypto/qat: use SPDX license
Use SPDK license for dual-licensed files
and update license date in all files
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Hemant Agrawal [Mon, 9 Apr 2018 08:58:35 +0000 (14:28 +0530)]
app/crypto-perf: add missing SPDX identifier
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Hemant Agrawal [Wed, 11 Apr 2018 09:15:47 +0000 (14:45 +0530)]
examples/l2fwd-crypto: fix the default aead assignments
The code is incorrectly updating the authxform instead of
aead xforms.
Fixes:
b79e4c00af0e ("cryptodev: use AES-GCM/CCM as AEAD algorithms")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Sunil Kumar Kori [Thu, 5 Apr 2018 08:35:49 +0000 (14:05 +0530)]
crypto/dpaa2_sec: improve error handling
Fixed as reported by NXP's internal coverity.
Also part of dpdk coverity.
Coverity issue: 268331
Coverity issue: 268333
Fixes:
8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Sunil Kumar Kori [Thu, 5 Apr 2018 08:35:48 +0000 (14:05 +0530)]
crypto/dpaa_sec: improve the error checking
Reported by NXP's internal coverity
Fixes:
c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Abhinandan Gujjar [Mon, 16 Apr 2018 06:54:56 +0000 (12:24 +0530)]
doc: add private data info in crypto guide
Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Abhinandan Gujjar [Mon, 16 Apr 2018 06:54:55 +0000 (12:24 +0530)]
cryptodev: support session private data setting
The application may want to store private data along with the
rte_cryptodev that is transparent to the rte_cryptodev layer.
For e.g., If an eventdev based application is submitting a
rte_cryptodev_sym_session operation and wants to indicate event
information required to construct a new event that will be
enqueued to eventdev after completion of the rte_cryptodev_sym_session
operation. This patch provides a mechanism for the application
to associate this information with the rte_cryptodev_sym_session session.
The application can set the private data using
rte_cryptodev_sym_session_set_private_data() and retrieve it using
rte_cryptodev_sym_session_get_private_data().
Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Abhinandan Gujjar [Mon, 16 Apr 2018 06:54:54 +0000 (12:24 +0530)]
cryptodev: set private data for session-less mode
The application may want to store private data along with the
rte_crypto_op that is transparent to the rte_cryptodev layer.
For e.g., If an eventdev based application is submitting a
crypto session-less operation and wants to indicate event
information required to construct a new event that will be
enqueued to eventdev after completion of the crypto
operation. This patch provides a mechanism for the application
to associate this information with the rte_crypto_op in
session-less mode.
Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Hemant Agrawal [Mon, 2 Apr 2018 15:33:16 +0000 (21:03 +0530)]
app/crypto-perf: support non default mempools
The current code usages the default mempool ops while
creating the mempool for crypto usages. Adding the support
for best_mempool_ops to enable it for devices using
non default mempools.
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Hemant Agrawal [Mon, 2 Apr 2018 15:33:15 +0000 (21:03 +0530)]
app/crypto-perf: fix excess crypto device error
If number of available devices are more than logical core,
there is no need to throw an error.
Just use the less number of devices instead.
Fixes:
f8be1786b1b8 ("app/crypto-perf: introduce performance test application")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Ashish Jain [Mon, 2 Apr 2018 15:33:14 +0000 (21:03 +0530)]
test/crypto: add macro for dpaa device name
Fixes:
b674d6d0381a ("test/crypto: add dpaa crypto test cases")
Cc: stable@dpdk.org
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Hemant Agrawal [Mon, 2 Apr 2018 15:33:21 +0000 (21:03 +0530)]
crypto/dpaa2_sec: fix OP storage for physical IOVA mode
op storage in fle is just for reference for post dq.
So, don't convert it to iova mode.
Fixes:
37f96eb01bce ("crypto/dpaa2_sec: support scatter gather")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Akhil Goyal [Mon, 2 Apr 2018 15:33:20 +0000 (21:03 +0530)]
crypto/dpaa_sec: move mempool allocation to config
Currently, the context mempools are allocated during device probe. Thus,
even if the DPAA SEC devices are not used, any application would still
allocate the memory required for working with the contexts.
This patch moves the allocation to configuration time so that when the
CAAM devices are configured, this allocation would be done.
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Tested-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Shreyansh Jain [Mon, 2 Apr 2018 15:33:19 +0000 (21:03 +0530)]
crypto/dpaa_sec: fix null check in uninit
Fixes:
c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: akhil.goyal@nxp.com
Cc: stable@dpdk.org
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Ashish Jain [Mon, 2 Apr 2018 15:33:18 +0000 (21:03 +0530)]
crypto/dpaa_sec: add portal presence check
Adding a check to do portal configuration if not already
configured before packet enqueue. This check is only done
during dpaa_sec_attach_sess_q for initial packets,
so this change wont affect the data path and hence performance.
Fixes:
e79416d10fa3 ("crypto/dpaa_sec: support multiple sessions per queue pair")
Cc: stable@dpdk.org
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Ashish Jain [Mon, 2 Apr 2018 15:33:17 +0000 (21:03 +0530)]
crypto/dpaa_sec: add macro for device name
Fixes:
c3e85bdcc6e6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:53 +0000 (08:23 -0400)]
doc: add AMD CCP guide
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:52 +0000 (08:23 -0400)]
test/crypto: add tests for AMD CCP
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:51 +0000 (08:23 -0400)]
crypto/ccp: support CPU based MD5 and SHA2 family
Auth operations can be performed on CPU without offloading
to CCP if CONFIG_RTE_LIBRTE_PMD_CCP_CPU_AUTH is enabled in
DPDK configuration. CCP PMD skip offloading auth operations
to hardware engines and perform them using openssl APIs.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:50 +0000 (08:23 -0400)]
crypto/ccp: support SHA3 family
Add SHA3 family authentication algorithm support for
CCP crypto PMD. This patch defines new macros for SHA3
algorithms in the DPDK crypto framework.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:49 +0000 (08:23 -0400)]
crypto/ccp: support SHA2 family
Add SHA2 family authentication algorithm support for
CCP crypto PMD.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:48 +0000 (08:23 -0400)]
crypto/ccp: support SHA1
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:47 +0000 (08:23 -0400)]
crypto/ccp: support AES-GCM
Support AES-GCM-128/192/256 AEAD algorithm for
CCP crypto PMD.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:46 +0000 (08:23 -0400)]
crypto/ccp: support AES-CMAC
Support AES-CMAC-128/192/256 authentication algorithm for
CCP crypto PMD.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:45 +0000 (08:23 -0400)]
crypto/ccp: support 3DES
Support 3DES-CBC cipher algorithm for CCP crypto PMD.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:44 +0000 (08:23 -0400)]
crypto/ccp: support AES
Added CCP cipher support for following algorithms:
AES-CBC-128/192/256
AES-CTR-128/192/256
AES-ECB-128/192/256
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:43 +0000 (08:23 -0400)]
crypto/ccp: support hwrng
CCP engines support true hardware random generation feature.
This patch implements api to read random number from CCP to be
used within PMD.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:42 +0000 (08:23 -0400)]
crypto/ccp: support stats related ops
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:41 +0000 (08:23 -0400)]
crypto/ccp: support sessionless ops
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:40 +0000 (08:23 -0400)]
crypto/ccp: support burst enqueue/dequeue
Added support for burst oriented data path.
CCP PMD selects appropriate CCP engine available
on the platform and schedule the batch of crypto ops to a
selected hardware queue of the respective crypto engine.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:39 +0000 (08:23 -0400)]
crypto/ccp: support queue pair related ops
Added crypto queue pair specific crypto ops callback functions
to setup and manage a CCP crypto queue pair object. CCP PMD
exposes only a single crypto queue pair object and handles the
actual hardware queues underneath.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:38 +0000 (08:23 -0400)]
crypto/ccp: support session related ops
Added crypto session specific basic crypto ops callback functions.
Added different crypto engine types and definitions.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:37 +0000 (08:23 -0400)]
crypto/ccp: support basic PMD ops
Added device specific basic crypto ops callback functions.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:36 +0000 (08:23 -0400)]
crypto/ccp: support device init
CCP PMD is a virtual crypto PMD which schedules a number of available
actual CCP hardware engines underneath. The PMD
manages all devices by its own. The PMD supports CCP_5a and
CCP_5b versions of crypto engines and this patch adds support
to initialize and use such devices.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Ravi Kumar [Mon, 19 Mar 2018 12:23:35 +0000 (08:23 -0400)]
crypto/ccp: add AMD ccp skeleton PMD
Added DPDK crypto PMD for AMD Cryptographic Co-Processors.
This patch adds a basic skeleton for PMD.
Signed-off-by: Ravi Kumar <ravi1.kumar@amd.com>
Anoob Joseph [Fri, 23 Mar 2018 05:50:51 +0000 (11:20 +0530)]
examples/ipsec-secgw: remove redundant string compare
Removing redundant strncmp in parsing long arguments. The getopt library
provides means to identify long options using the "val" field of
structure option. The existing code gets 0 as "val" for all long
arguments and then uses strncmp to figure out which long option was
being referred to. Fixing this.
In addition, the macros and enums used for long arguments have been
renamed and repositioned adhering to the general convention followed in
various other apps, like l3fwd.
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
Marko Kovacevic [Tue, 27 Mar 2018 12:15:32 +0000 (13:15 +0100)]
crypto/aesni_mb: support AES CMAC
Added support for AES CMAC hash algorithm with 128-bit key,
which has been added in the v0.49 of the IPSec Multi-buffer lib.
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Marko Kovacevic [Tue, 27 Mar 2018 12:14:30 +0000 (13:14 +0100)]
crypto/aesni_gcm: support IPsec Multi-buffer lib v0.49
Adds support for the v0.49 of the IPsec Multi-buffer lib,
which now gets compiled and installed as a shared object.
Therefore, there is no need to pass the AESNI_MULTI_BUFFER_LIB_PATH
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Marko Kovacevic [Tue, 27 Mar 2018 12:14:29 +0000 (13:14 +0100)]
crypto/aesni_mb: support IPsec Multi-buffer lib v0.49
Adds support for the v0.49 of the IPsec Multi-buffer lib,
which now gets compiled and installed as a shared object.
Therefore, there is no need to pass the AESNI_MULTI_BUFFER_LIB_PATH
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Lee Roberts [Fri, 9 Mar 2018 18:00:36 +0000 (11:00 -0700)]
crypto/qat: assign device to correct NUMA node
rte_cryptodev_pmd_init_params should use NUMA node of the QAT device
for its socket_id rather than the socket_id of the initializing process.
Signed-off-by: Lee Roberts <lee.roberts@hpe.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Tomasz Duszynski [Wed, 21 Mar 2018 09:44:38 +0000 (10:44 +0100)]
crypto/mrvl: add missing library dependencies
While trying to do a shared build one will get linkage error
since a couple of library dependencies are missing from a makefile.
At some point there was a batch update of all PMDs but mrvl crypto was
missed back then.
Necessary makefile changes were introduced in
commit
cbc12b0a96f5 ("mk: do not generate LDLIBS from directory dependencies")
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Tomasz Duszynski [Wed, 14 Mar 2018 13:12:54 +0000 (14:12 +0100)]
test/crypto: add MRVL to hash test cases
MRVL Crypto PMD supports most of the hash algorithms covered
by test suites thus specific bits should be set in pmd_masks.
Otherwise blockcipher authonly test returns success even though no
real tests have been executed.
Fixes:
84e0ded38ac5 ("test/crypto: add mrvl crypto unit tests")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Fiona Trahe [Fri, 9 Mar 2018 17:44:38 +0000 (17:44 +0000)]
cryptodev: change argument of driver registration
Pass an rte_driver to the RTE_PMD_REGISTER_CRYPTO_DRIVER macro
rather than an unspecified container which holds an rte_driver.
All the macro actually needs is the rte_driver, not the
container holding it.
This paves the way for a later patch in which a driver
will be registered which does not naturally derive from a
container and so avoids having to create an arbitrary container
to pass in the rte_driver.
This patch changes the cryptodev lib macro and all the
PMDs which use it.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Reviewed-by: Akhil Goyal <akhil.goyal@nxp.com>
Tomasz Duszynski [Mon, 12 Mar 2018 07:47:19 +0000 (08:47 +0100)]
crypto/mrvl: convert license headers to SPDX tags
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Maxime Coquelin [Wed, 14 Mar 2018 16:31:25 +0000 (17:31 +0100)]
vhost: deprecate unsafe GPA translation API
This patch marks rte_vhost_gpa_to_vva() as deprecated because
it is unsafe. Application relying on this API should move
to the new rte_vhost_va_from_guest_pa() API, and check
returned length to avoid out-of-bound accesses.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Thu, 19 Apr 2018 08:52:33 +0000 (10:52 +0200)]
vhost/crypto: move to safe GPA translation API
This patch uses the new rte_vhost_va_from_guest_pa() API
to ensure all the descriptor buffer is mapped contiguously
in the application virtual address space.
It does not handle buffers discontiguous in host virtual
address space, but only return an error.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Wed, 14 Mar 2018 15:46:46 +0000 (16:46 +0100)]
examples/vhost_scsi: move to safe GPA translation API
This patch uses the new rte_vhost_va_from_guest_pa() API
to ensure all the descriptor buffer is mapped contiguously
in the application virtual address space.
As the application did not checked return of previous API,
this patch just print an error if the buffer address isn't in
the vhost memory regions or if it is scattered. Ideally, it
should handle scattered buffers gracefully.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 13 Mar 2018 18:43:48 +0000 (19:43 +0100)]
examples/vhost: move to safe GPA translation API
This patch uses the new rte_vhost_va_from_guest_pa() API
to ensure the application doesn't perform out-of-bound
accesses either because of a malicious guest providing an
incorrect descriptor length, or because the buffer is
contiguous in guest physical address space but not in the
host process virtual address space.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Thu, 1 Mar 2018 08:36:33 +0000 (09:36 +0100)]
vhost: handle virtually non-contiguous buffers in Rx-mrg
This patch enables the handling of buffers non-contiguous in
process virtual address space in the enqueue path when mergeable
buffers are used.
When virtio-net header doesn't fit in a single chunck, it is
computed in a local variable and copied to the buffer chuncks
afterwards.
For packet content, the copy length is limited to the chunck
size, next chuncks VAs being fetched afterward.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Thu, 1 Mar 2018 07:47:58 +0000 (08:47 +0100)]
vhost: handle virtually non-contiguous buffers in Rx
This patch enables the handling of buffers non-contiguous in
process virtual address space in the enqueue path when mergeable
buffers aren't used.
When virtio-net header doesn't fit in a single chunck, it is
computed in a local variable and copied to the buffer chuncks
afterwards.
For packet content, the copy length is limited to the chunck
size, next chuncks VAs being fetched afterward.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Wed, 24 Jan 2018 16:19:29 +0000 (17:19 +0100)]
vhost: handle virtually non-contiguous buffers in Tx
This patch enables the handling of buffers non-contiguous in
process virtual address space in the dequeue path.
When virtio-net header doesn't fit in a single chunck, it is
copied into a local variablei before being processed.
For packet content, the copy length is limited to the chunck
size, next chuncks VAs being fetched afterward.
This issue has been assigned CVE-2018-1059.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Wed, 24 Jan 2018 10:27:25 +0000 (11:27 +0100)]
vhost: add support for non-contiguous indirect descs tables
This patch adds support for non-contiguous indirect descriptor
tables in VA space.
When it happens, which is unlikely, a table is allocated and the
non-contiguous content is copied into it.
This issue has been assigned CVE-2018-1059.
Reported-by: Yongji Xie <xieyongji@baidu.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 23 Jan 2018 18:01:45 +0000 (19:01 +0100)]
vhost: ensure all range is mapped when translating QVAs
This patch ensures that all the address range is mapped when
translating addresses from master's addresses (e.g. QEMU host
addressess) to process VAs.
This issue has been assigned CVE-2018-1059.
Reported-by: Yongji Xie <xieyongji@baidu.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 23 Jan 2018 13:37:50 +0000 (14:37 +0100)]
vhost: introduce safe API for GPA translation
This new rte_vhost_va_from_guest_pa API takes an extra len
parameter, used to specify the size of the range to be mapped.
Effective mapped range is returned via len parameter.
This issue has been assigned CVE-2018-1059.
Reported-by: Yongji Xie <xieyongji@baidu.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 23 Jan 2018 13:26:02 +0000 (14:26 +0100)]
vhost: check all range is mapped when translating GPAs
There is currently no check done on the length when translating
guest addresses into host virtual addresses. Also, there is no
guanrantee that the guest addresses range is contiguous in
the host virtual address space.
This patch prepares vhost_iova_to_vva() and its callers to
return and check the mapped size. If the mapped size is smaller
than the requested size, the caller handle it as an error.
This issue has been assigned CVE-2018-1059.
Reported-by: Yongji Xie <xieyongji@baidu.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Tue, 23 Jan 2018 08:51:29 +0000 (09:51 +0100)]
vhost: fix indirect descriptors table translation size
This patch fixes the size passed at the indirect descriptor
table translation time, which is the len field of the descriptor,
and not a single descriptor.
This issue has been assigned CVE-2018-1059.
Fixes:
62fdb8255ae7 ("vhost: use the guest IOVA to host VA helper")
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thomas Monjalon [Tue, 17 Apr 2018 12:23:29 +0000 (14:23 +0200)]
eal/linux: use strlcpy in uevent parsing
Support of strlcpy has recently been added to DPDK.
This replacement has been generated by the coccinelle script:
devtools/cocci.sh devtools/cocci/strlcpy.cocci
Fixes:
0d0f478d0483 ("eal/linux: add uevent parse and process")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Thomas Monjalon [Thu, 19 Apr 2018 23:53:10 +0000 (01:53 +0200)]
mbuf: improve tunnel Tx offloads API doc
Add few details to remind TSO flag, checksum flags and header lengths.
The doxygen syntax for MPLS-in-UDP is fixed.
Fixes:
d95188551fa1 ("mbuf: introduce new Tx offload flag for MPLS-in-UDP")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Thomas Monjalon [Thu, 19 Apr 2018 23:39:52 +0000 (01:39 +0200)]
mbuf: fix Tx checksum offload API doc
When introducing rte_eth_tx_prepare(), the constraints on checksum
pre-filling for Tx offloads were relaxed because implemented in
the PMDs with rte_net_intel_cksum_flags_prepare() helper.
As a consequence, these old requirements are removed for:
- PKT_TX_OUTER_IP_CKSUM
- PKT_TX_IP_CKSUM
- PKT_TX_[L4]_CKSUM
- PKT_TX_TCP_SEG
Not sure SCTP offload is properly implemented though.
A reference to rte_eth_tx_prepare() is added in rte_eth_tx_burst() doc.
Fixes:
609dd68ef14f ("mbuf: enhance the API documentation of offload flags")
Fixes:
4fb7e803eb1a ("ethdev: add Tx preparation")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Thomas Monjalon [Mon, 23 Apr 2018 01:18:35 +0000 (03:18 +0200)]
maintainers: fix typo and ordering
Fix logical/alphabetical ordering, spacing, and syntax typo.
Fixes:
8fb3b2576025 ("maintainers: call out subtree committers")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tomasz Duszynski [Thu, 19 Apr 2018 12:21:14 +0000 (14:21 +0200)]
crypto/mrvl: add to meson build
Add MRVL CRYPTO PMD to meson build system.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tomasz Duszynski [Wed, 11 Apr 2018 11:45:07 +0000 (13:45 +0200)]
net/mvpp2: add to meson build
Add support for building MRVL MVPP2 PMD with meson. To avoid cluttering
the build environment and to keep all relevant settings local to a cross
build we get MUSDK library installation path from a meson option.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tomasz Duszynski [Wed, 11 Apr 2018 11:45:06 +0000 (13:45 +0200)]
net/mvpp2: rename version map file to standard
Rename the version file to follow standard naming convention.
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Jerin Jacob [Mon, 9 Apr 2018 14:39:46 +0000 (20:09 +0530)]
build: fix default arm64 instruction level
The make based build system has crc+crypto instruction
support for the default arm64 build.
http://dpdk.org/browse/dpdk/tree/mk/machine/armv8a/rte.vars.mk#n31
This patch fixes the disparity with meson build flags for armv8.
As a bonus, This patch fixes the following errors with
ip_pipeline example application.
Assembler messages:
Error: selected processor does not support `crc32cx w3,w3,x0'
Fixes:
c6e536e38437 ("build: add more implementers IDs and PNs for ARM")
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Wed, 4 Apr 2018 10:12:13 +0000 (11:12 +0100)]
rawdev: add to meson build
Add librte_rawdev to the meson build of DPDK.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Bruce Richardson [Thu, 29 Mar 2018 13:54:36 +0000 (14:54 +0100)]
drivers/dpaa: reduce meson dependency lists
Meson build currently tracks the dependencies between libraries, which
can often make things easier, but has the side-effect of slowing down
the initial meson run if too many duplicated dependencies are provided.
Therefore, we remove dependencies from the dpaa items where other
dependencies already depend on those. This provides a noticable speed-up
in meson configuration runs when lots of sample apps are included in the
build.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Bruce Richardson [Thu, 29 Mar 2018 13:54:35 +0000 (14:54 +0100)]
examples: improve error report for missing meson deps
When a required library is missing on a platform, rather than having
meson report an error about the missing variable, catch the problem
earlier and provide a more readable message.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Bruce Richardson [Thu, 29 Mar 2018 13:54:34 +0000 (14:54 +0100)]
examples: allow building all as part of meson build
To test building all relevant example applications as part of a build, we
add support for the "all" keyword to be passed to the "examples" build
option. Since not all examples can actually be built on all systems,
we also add support for the "build" option inside the sub-dirs. However,
in case where "all" is not used, and a particular example is requested
to be built, we will error out if building the requested app is not
possible.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Bruce Richardson [Thu, 29 Mar 2018 13:54:33 +0000 (14:54 +0100)]
examples: disable unsupported examples on BSD build
When building with meson, set build to false when building unsupported
example apps on FreeBSD.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Bruce Richardson [Thu, 29 Mar 2018 13:54:32 +0000 (14:54 +0100)]
examples/l2fwd-cat: make build dependent on pqos lib
The l2fwd-cat example uses the pqos library to work, so make the meson
build dependent on the presence of that library
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Bruce Richardson [Thu, 29 Mar 2018 13:54:31 +0000 (14:54 +0100)]
examples: add empty meson files for unsupported ones
A number of example apps are not supported by the meson build system yet,
but to allow future testing with "-Dexamples=all" we add in a placeholder
meson.build file indicating that the apps should not be built.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
Bruce Richardson [Thu, 29 Mar 2018 13:48:47 +0000 (14:48 +0100)]
build: remove checks for non-optional libraries
Unless a library cannot be built for a specific platform (generally
BSD), it will always be available. Therefore remove checks for IP
fragmentation and ACL libraries, since these are built for all
platforms.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Bruce Richardson [Wed, 4 Apr 2018 16:04:52 +0000 (17:04 +0100)]
build: clean up building kernel modules using meson
The meson.build files for building the kernel modules directory could
be improved now that it is extracted from the EAL. For example, no
global processing is necessary inside the kernel folder, just need to
subdir to the appropriate bsd or linux folder to do the actual work.
To avoid potential race conditions with the BSD module builds when
the kernel build system is creating the dev_if.h and other files,
we serialize the kernel module builds (all 2 of them!) by setting
up each module to depend on all the previous.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Pavan Nikhilesh [Tue, 3 Apr 2018 11:24:52 +0000 (16:54 +0530)]
build: set toolchain info during meson configure
Meson reports the toolchain using cc.get_id and we can set RTE_TOOLCHAIN,
RTE_TOOLCHAIN_X in dpdk_conf so that it can be used by both x86 and arm.
Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Pavan Nikhilesh [Fri, 20 Apr 2018 09:34:10 +0000 (15:04 +0530)]
doc: fix typos in OcteonTx guides
Fixes:
26cb0a72412f ("doc: add octeontx platform guide")
Fixes:
48191dde6acf ("doc: add octeontx mempool guide")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Jerin Jacob [Sun, 8 Apr 2018 02:23:38 +0000 (07:53 +0530)]
doc: fix a typo in rawdev guide
Fixes:
a9bb0c44c775 ("doc: add rawdev library guide and doxygen page")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
Rami Rosen [Sun, 22 Apr 2018 03:03:37 +0000 (23:03 -0400)]
doc: fix a typo in the EAL guide
This patch fixes a trivial typo in the programmer's guide.
Fixes:
1733be6d3147 ("doc: new eal multi-pthread feature")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Vipin Varghese [Mon, 26 Feb 2018 06:22:38 +0000 (11:52 +0530)]
app/pdump: check for ports
In case of application build with shared library mode unless
option '-d' is passed, poll mode driver for devices is not
initialized. Notifying the user just after rte_eal_init is
pro active way of intimating the user.
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Ferruh Yigit [Mon, 12 Mar 2018 17:53:08 +0000 (17:53 +0000)]
app/testpmd: print Rx/Tx offload values on start
Which per port offloads are enabled is not clear. Printing offloads
values at forwarding start.
CRC strip offload value was printed in more verbose manner, it is
removed since Rx/Tx offload values covers it and printing only CRC one
can cause confusion.
Hexadecimal offloads values are not very user friendly but preferred to
not create to much noise during forwarding start.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Scott Branden [Tue, 17 Apr 2018 17:52:25 +0000 (10:52 -0700)]
igb_uio: fix build on Linux < 3.16
Starting from Linux v3.16 pci_is_bridge() is in linux/pci.h,
in previous versions it is in drivers/pci/pci.h which is private header.
Fix build error when calling pci_is_bridge by not calling/supporting
pci_is_bridge with kernel versions before 3.16.
Fixes:
6f0841b7701b ("igb_uio: bind error if PCIe bridge")
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Thomas Monjalon [Thu, 19 Apr 2018 16:02:31 +0000 (18:02 +0200)]
net/mvpp2: fix build
The iterator RTE_ETH_FOREACH_DEV (added in below commit)
requires to enable experimental APIs.
Fixing also the config option rename in the build test.
Fixes:
8728ccf37615 ("fix ethdev ports enumeration")
Fixes:
fe93968722af ("net/mrvl: rename PMD as mvpp2")
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Hemant Agrawal [Thu, 19 Apr 2018 12:32:39 +0000 (18:02 +0530)]
bus/fslmc: fix build with clang 3.4
error: redefinition of typedef 'dma_addr_t' is a C11 feature
[-Werror,-Wtypedef-redefinition]
Fixes:
4bc5ab88dbd6 ("net/dpaa2: fix Tx only mode")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Pablo de Lara [Tue, 17 Apr 2018 13:13:42 +0000 (14:13 +0100)]
eventdev: fix build with icc
ICC complains about variable being used before its value is set.
Since the variable is only assigned in the for loop,
its declaration is moved inside and is initialized.
lib/librte_eventdev/rte_event_timer_adapter.c(708): error #592:
variable "ret" is used before its value is set
RTE_SET_USED(ret);
Fixes:
6750b21bd6af ("eventdev: add default software timer adapter")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Wisam Jaddo [Wed, 18 Apr 2018 15:31:03 +0000 (18:31 +0300)]
app/testpmd: fix build without i40e
Unused variables will appear when setting RTE_LIBRTE_I40E_PMD
to be disabled.
The fix was to move these variables to the I40E_PMD scope,
since only I40E_PMD is using it.
Fixes:
a9dbe1802226 ("fix ethdev port id validation")
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Yangchao Zhou [Wed, 18 Apr 2018 03:09:13 +0000 (11:09 +0800)]
mem: fix leaks of hugedir and replace snprintf
The hugedir returned by get_hugepage_dir is allocated by strdup
but not released. Replace snprintf with a more suitable strlcpy.
Coverity issue: 272585
Fixes:
cb97d93e9d3b ("mem: share hugepage info primary and secondary")
Signed-off-by: Yangchao Zhou <zhouyates@gmail.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Junjie Chen [Thu, 12 Apr 2018 05:16:36 +0000 (13:16 +0800)]
eal/x86: force inlining of memcpy sub-functions
Sometimes gcc does not inline the function despite keyword *inline*,
we observe rte_movX is not inline when doing performance profiling,
so use *always_inline* keyword to force gcc to inline the function.
Signed-off-by: Junjie Chen <junjie.j.chen@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Jianfeng Tan [Thu, 5 Apr 2018 12:28:37 +0000 (12:28 +0000)]
pdump: use generic multi-process channel
The original code replies on the private channel for primary and
secondary communication. Change to use the generic multi-process
channel.
Note with this change, dpdk-pdump will be not compatible with
old version DPDK applications.
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Jianfeng Tan [Sun, 15 Apr 2018 15:06:19 +0000 (15:06 +0000)]
vfio: use generic multi-process channel
Previously, vfio uses its own private channel for the secondary
process to get container fd and group fd from the primary process.
This patch changes to use the generic mp channel.
Test:
1. Bind two NICs to vfio-pci.
2. Start the primary and secondary process.
$ (symmetric_mp) -c 2 -- -p 3 --num-procs=2 --proc-id=0
$ (symmetric_mp) -c 4 --proc-type=auto -- -p 3 \
--num-procs=2 --proc-id=1
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Thomas Monjalon [Thu, 5 Apr 2018 15:33:22 +0000 (17:33 +0200)]
ethdev: deprecate port count function
Some DPDK applications wrongly assume these requirements:
- no hotplug, i.e. ports are never detached
- all allocated ports are available to the application
Such application iterates over ports by its own mean.
The most common pattern is to request the port count and
assume ports with index in the range [0..count[ can be used.
In order to fix this common mistake in all external applications,
the function rte_eth_dev_count is deprecated, while introducing
the new functions rte_eth_dev_count_avail and rte_eth_dev_count_total.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>