dpdk.git
6 years agodoc: add zlib PMD guide
Shally Verma [Tue, 24 Jul 2018 15:05:36 +0000 (20:35 +0530)]
doc: add zlib PMD guide

Add zlib pmd feature support and user guide with
build and run instructions

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>
6 years agocompress/zlib: support burst enqueue/dequeue
Sunila Sahu [Tue, 24 Jul 2018 15:05:35 +0000 (20:35 +0530)]
compress/zlib: support burst enqueue/dequeue

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>
6 years agocompress/zlib: create private xform
Sunila Sahu [Tue, 24 Jul 2018 15:05:34 +0000 (20:35 +0530)]
compress/zlib: create private xform

Create non-shareable private xform for stateless
operation processing

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>
6 years agocompress/zlib: add basic ops
Ashish Gupta [Tue, 24 Jul 2018 15:05:33 +0000 (20:35 +0530)]
compress/zlib: add basic ops

Implement device configure and queue pair
setup PMD ops

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>
6 years agocompress/zlib: introduce zlib PMD
Ashish Gupta [Tue, 24 Jul 2018 15:05:32 +0000 (20:35 +0530)]
compress/zlib: introduce zlib PMD

Add initial PMD setup routines in compressdev
framework. ZLIB PMD appears as virtual compression
device. User would need to install zlib prior to
enabling this PMD.

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>
6 years agocompress/isal: support chained mbufs
Lee Daly [Tue, 24 Jul 2018 11:19:23 +0000 (12:19 +0100)]
compress/isal: support chained mbufs

This patch adds chained mbuf support for input or output buffers
during compression/decompression operations.

Signed-off-by: Lee Daly <lee.daly@intel.com>
Reviewed-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agodoc: add graphics to bbdev guide
Amr Mokhtar [Thu, 19 Jul 2018 17:29:36 +0000 (18:29 +0100)]
doc: add graphics to bbdev guide

Add two SVG graphics representing Turbo coding of code blocks
in mbuf data buffer.

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agocrypto/scheduler: add mode-specific threshold parameter
Fan Zhang [Mon, 23 Jul 2018 13:17:15 +0000 (14:17 +0100)]
crypto/scheduler: add mode-specific threshold parameter

This patch adds packet-size-distr mode specific parameter parser
to support different threshold packet size value other than default
128 bytes.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocrypto/scheduler: add mode-specific parameter
Fan Zhang [Mon, 23 Jul 2018 13:17:14 +0000 (14:17 +0100)]
crypto/scheduler: add mode-specific parameter

This patch adds the mode parameter parsing to scheduler PMD.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
6 years agocompress/qat: support scatter-gather buffers
Fiona Trahe [Mon, 23 Jul 2018 13:06:51 +0000 (14:06 +0100)]
compress/qat: support scatter-gather buffers

This patch adds Scatter-Gather List (SGL) feature to
QAT compression PMD.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocommon/qat: add scatter-gather header
Fiona Trahe [Mon, 23 Jul 2018 13:05:35 +0000 (14:05 +0100)]
common/qat: add scatter-gather header

This patch refactors the sgl struct so it includes a flexible
array of flat buffers as sym and compress PMDs can have
different size sgls.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoapp/crypto-perf: compile with -O3
Pablo de Lara [Mon, 25 Jun 2018 12:53:11 +0000 (13:53 +0100)]
app/crypto-perf: compile with -O3

The crypto performance application was not being compiled
with -O3, which means that the performance shown may not be
optimal.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/virtio: fix memory leak
Pablo de Lara [Thu, 19 Jul 2018 09:05:56 +0000 (10:05 +0100)]
crypto/virtio: fix memory leak

Put session private data back to mempool when clearing
a crypto session, which is expected to be done in the PMD.

Fixes: b7fa78c7d3b0 ("crypto/virtio: support session related ops")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Jay Zhou <jianjay.zhou@huawei.com>
6 years agocrypto/qat: support 8-byte 3DES
Fiona Trahe [Fri, 20 Jul 2018 18:49:23 +0000 (19:49 +0100)]
crypto/qat: support 8-byte 3DES

Added extra case to support 8 byte key size
for 3DES CBC. Also changed capabilities to reflect
the change.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/openssl: support 8-byte 3DES
Marko Kovacevic [Tue, 12 Jun 2018 10:39:25 +0000 (11:39 +0100)]
crypto/openssl: support 8-byte 3DES

Added extra case to support 8 byte key size
for 3DES CBC. Also changed capabilities to reflect
the change.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/aesni_mb: support 3DES
Marko Kovacevic [Fri, 8 Jun 2018 09:10:01 +0000 (10:10 +0100)]
crypto/aesni_mb: support 3DES

Added support for 3DES cipher algorithm which
will support 8, 16 and 24 byte keys, which also has been
added in the v0.50 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>
6 years agocrypto/aesni_mb: support IPsec Multi-buffer lib v0.50
Pablo de Lara [Tue, 3 Jul 2018 08:22:34 +0000 (09:22 +0100)]
crypto/aesni_mb: support IPsec Multi-buffer lib v0.50

Adds support for the v0.50 of the IPsec Multi-buffer lib.
The library now exposes its version, with the idea
of maintaining backwards compatibility in the future,
avoiding breaking the compilation of the PMD every time
there is a new version available.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/aesni_gcm: support IPsec Multi-buffer lib v0.50
Pablo de Lara [Tue, 3 Jul 2018 08:22:22 +0000 (09:22 +0100)]
crypto/aesni_gcm: support IPsec Multi-buffer lib v0.50

Adds support for the v0.50 of the IPsec Multi-buffer lib.
The library now exposes its version, with the idea
of maintaining backwards compatibility in the future,
avoiding breaking the compilation of the PMD every time
there is a new version available.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/aesni_mb: call buffer manager allocation
Pablo de Lara [Tue, 3 Jul 2018 05:58:01 +0000 (06:58 +0100)]
crypto/aesni_mb: call buffer manager allocation

Instead of having a static field for the buffer manager
MB_MGR in the queue pair structure, use the provided API
that allocates memory for it and store a pointer to it.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agotest/compress: limit segments in scatter-gather
Fiona Trahe [Thu, 19 Jul 2018 17:40:05 +0000 (18:40 +0100)]
test/compress: limit segments in scatter-gather

Some PMDs may have a limitation on the number of segments
in an SGL mbuf that they can process.
Thefore, an upper limit is set to avoid having
an indeterminate number of segments.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agoexamples/l2fwd-crypto: remove duplicated capability check
Pablo de Lara [Thu, 19 Jul 2018 08:39:59 +0000 (09:39 +0100)]
examples/l2fwd-crypto: remove duplicated capability check

Now that device capabilities are checked separately,
before setting the xform parameters, it is not required
to do the check again, leaving only the xform setting
with the device configuration.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoexamples/l2fwd-crypto: fix session mempool size
Pablo de Lara [Thu, 19 Jul 2018 08:39:58 +0000 (09:39 +0100)]
examples/l2fwd-crypto: fix session mempool size

The session mempool size for this application depends
on the number of crypto devices that are capable
of performing the operation given by the parameters on the app.

However, previously this calculation was done before all devices
were checked, resulting in an incorrect number of sessions
required.

Now the calculation of the devices to be used is done first
(checking the capabilities of the enabled devices),
followed by the creation of the session pool, resulting
in a correct number of objects needed for the sessions
to be created.

Fixes: e3bcb99a5e13 ("examples/l2fwd-crypto: limit number of sessions")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoexamples/l2fwd-crypto: separate IV check from xform setting
Pablo de Lara [Thu, 19 Jul 2018 08:39:57 +0000 (09:39 +0100)]
examples/l2fwd-crypto: separate IV check from xform setting

IV_param_check() function was checking if the IV size provided
was supported by device and setting the IV size in the xform
structure.

Instead of this, the function should only do the parameter check
and outside the IV size on the xform is set.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoexamples/l2fwd-crypto: skip device not supporting operation
Pablo de Lara [Thu, 19 Jul 2018 08:39:56 +0000 (09:39 +0100)]
examples/l2fwd-crypto: skip device not supporting operation

When a crypto device does not support an algorithm, it is skipped
and not used. However, when it does support it, but not the rest
of the parameters (IV, key, AAD sizes...), application stops.
Instead, the device should be skipped and the search of a suitable
device should continue.

Fixes: a061e50a0d97 ("examples/l2fwd-crypto: fix ambiguous input key size")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoexamples/l2fwd-crypto: check return value on IV size check
Pablo de Lara [Thu, 19 Jul 2018 08:39:55 +0000 (09:39 +0100)]
examples/l2fwd-crypto: check return value on IV size check

IV size parameter is checked through a function,
but its return value was not checked.

Fixes: 0fbd75a99fc9 ("cryptodev: move IV parameters to session")
Fixes: acf8616901b5 ("cryptodev: add auth IV")
Fixes: 2661f4fbe93d ("examples/l2fwd-crypto: add AEAD parameters")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoexamples/l2fwd-crypto: fix digest with AEAD algo
Pablo de Lara [Mon, 16 Jul 2018 08:26:16 +0000 (09:26 +0100)]
examples/l2fwd-crypto: fix digest with AEAD algo

When performing authentication verification (both for AEAD algorithms,
such as AES-GCM, or for authentication algorithms, such as SHA1-HMAC),
the digest address is calculated based on the packet size and the
algorithm used (substracting digest size and IP header to the packet size).

However, for AEAD algorithms, this was not calculated correctly,
since the digest size was not being substracted.

Bugzilla ID: 44
Fixes: 2661f4fbe93d ("examples/l2fwd-crypto: add AEAD parameters")
Cc: stable@dpdk.org
Reported-by: Ankur Dwivedi <ankur.dwivedi@cavium.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Tested-by: Ankur Dwivedi <ankur.dwivedi@cavium.com>
6 years agotest/compress: add scatter-gather tests
Pablo de Lara [Tue, 3 Jul 2018 00:52:07 +0000 (01:52 +0100)]
test/compress: add scatter-gather tests

Added Scatter-Gather test, which split input data
into multi-segment mbufs and compresses/decompresses
the data into also a multi-segment mbuf.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
6 years agoapp/crypto-perf: fix mempool creation
Radu Nicolau [Mon, 16 Jul 2018 11:14:16 +0000 (12:14 +0100)]
app/crypto-perf: fix mempool creation

Using a small number of sessions results in rte_mempool_create call
with cache_size > n, which fails. There is no need to cache the elements,
as there is no performance impact.

Fixes: 501c0a3b14c3 ("app/crypto-perf: limit number of sessions")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agotest/compress: log device name
Fiona Trahe [Tue, 10 Jul 2018 11:07:14 +0000 (12:07 +0100)]
test/compress: log device name

Print out name of device on which test is running at start of
test suite.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocompress/isal: fix memory leak
Pablo de Lara [Wed, 11 Jul 2018 06:38:46 +0000 (07:38 +0100)]
compress/isal: fix memory leak

Processed operations ring is created for each queue pair,
but it was not being freed when the queue pair was released.

Fixes: b0e23c458a6f ("compress/isal: add queue pair related ops")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
6 years agocompress/isal: set null pointer after freeing
Pablo de Lara [Wed, 11 Jul 2018 06:38:45 +0000 (07:38 +0100)]
compress/isal: set null pointer after freeing

Fixes: b0e23c458a6f ("compress/isal: add queue pair related ops")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
6 years agocompress/isal: fix log type name
Pablo de Lara [Wed, 11 Jul 2018 06:38:44 +0000 (07:38 +0100)]
compress/isal: fix log type name

There is a naming convention for logtypes of PMDs:
"pmd.driverType.driverName".
Therefore, the logtype for ISA-L PMD should be "pmd.compress.isal".

Fixes: 490e725b95b2 ("compress/isal: add device init and de-init")
Cc: stable@dpdk.org
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
6 years agocompress/isal: fix offset usage
Lee Daly [Wed, 11 Jul 2018 14:21:45 +0000 (15:21 +0100)]
compress/isal: fix offset usage

This patch allows the ISA-L compression PMD,
to be used with offsets in the mbuf.
Offsets can now be used for source and destination buffers,
during compression or decompression.

Fixes: 7bf4f0630af6 ("compress/isal: add ISA-L decomp functionality")
Fixes: dc49e6aa4879 ("compress/isal: add ISA-L compression functionality")
Cc: stable@dpdk.org
Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agocrypto/qat: fix checks for 3GPP algo bit params
Fiona Trahe [Wed, 11 Jul 2018 18:02:43 +0000 (19:02 +0100)]
crypto/qat: fix checks for 3GPP algo bit params

QAT driver checks byte alignment for KASUMI/SNOW 3G/ZUC algorithms using
cipher/auth_param, which are not initialized at this moment yet. Use
operation params instead.

Fixes: 39e0bee48e81 ("crypto/qat: rework request builder for performance")
Cc: stable@dpdk.org
Reported-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agoexamples/ipsec-secgw: fix IPv4 checksum at Tx
Konstantin Ananyev [Wed, 6 Jun 2018 12:04:01 +0000 (13:04 +0100)]
examples/ipsec-secgw: fix IPv4 checksum at Tx

For ESP transport and BYPASS mode the app might generate output
packets with invalid IPv4 header checksum.
At least such behavior was observed on few Intel NICs.
The reason is that the app didn't set ipv4 header checksum to zero
before passing it to the HW.

Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agodoc: add QAT compression guide
Fiona Trahe [Fri, 13 Jul 2018 02:28:25 +0000 (03:28 +0100)]
doc: add QAT compression guide

Extend QAT guide to cover crypto and compression and common
information, particularly about kernel driver dependency.
Update release note.
Update compression feature list for qat.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocompress/qat: prevent usage if incorrect firmware
Fiona Trahe [Fri, 13 Jul 2018 02:28:24 +0000 (03:28 +0100)]
compress/qat: prevent usage if incorrect firmware

Previous check only causes op to fail on dequeue.
This extends so once first fail is detected, application can
no longer enqueue ops to the device and will also get an
appropriate error if trying to reconfigure or setup the device.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocompress/qat: add create and destroy functions
Fiona Trahe [Fri, 13 Jul 2018 02:28:23 +0000 (03:28 +0100)]
compress/qat: add create and destroy functions

Now that all the device operations are available,
add the functions to create and destroy the pmd.
Called on probe and remove of the qat pci device, these
register the device with the compressdev API
and plug in all the device functionality.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: create and populate the ops structure
Fiona Trahe [Fri, 13 Jul 2018 02:28:22 +0000 (03:28 +0100)]
compress/qat: create and populate the ops structure

Create an ops structure and populate it with the
qat-specific functions.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: add device start and stop
Fiona Trahe [Fri, 13 Jul 2018 02:28:21 +0000 (03:28 +0100)]
compress/qat: add device start and stop

There are no specific actions needed to start/stop a QAT comp device
so these are just trivial fns to satisfy the pmd API.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agocompress/qat: add enqueue/dequeue functions
Fiona Trahe [Fri, 13 Jul 2018 02:28:20 +0000 (03:28 +0100)]
compress/qat: add enqueue/dequeue functions

Wrap generic qat enqueue/dequeue functions with
compressdev enqueue and dequeue fns.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: add info retrieval function
Fiona Trahe [Fri, 13 Jul 2018 02:28:19 +0000 (03:28 +0100)]
compress/qat: add info retrieval function

Add capabilities pointer to internal qat comp device
and function to return this and other info.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: add configure and clear functions
Fiona Trahe [Fri, 13 Jul 2018 02:28:18 +0000 (03:28 +0100)]
compress/qat: add configure and clear functions

Add functions to configure and clear the qat comp device,
including the creation and freeing of the xform pool
and the freeing of queue-pairs.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: setup queue-pairs for compression
Fiona Trahe [Fri, 13 Jul 2018 02:28:17 +0000 (03:28 +0100)]
compress/qat: setup queue-pairs for compression

Setup and clear queue-pairs for handling compression
requests and responses.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: add stats functions
Fiona Trahe [Fri, 13 Jul 2018 02:28:16 +0000 (03:28 +0100)]
compress/qat: add stats functions

Add functions to get and clear compression queue-pair statistics.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: check that correct firmware is in use
Fiona Trahe [Fri, 13 Jul 2018 02:28:15 +0000 (03:28 +0100)]
compress/qat: check that correct firmware is in use

Check bit in response message to verify that correct firmware
is in use for compression. If not return an error.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: create FW request and process response
Fiona Trahe [Fri, 13 Jul 2018 02:28:14 +0000 (03:28 +0100)]
compress/qat: create FW request and process response

Add functions to create the request message to send to
firmware and to process the firmware response.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: add xform processing
Fiona Trahe [Fri, 13 Jul 2018 02:28:13 +0000 (03:28 +0100)]
compress/qat: add xform processing

Add code to process compressdev rte_comp_xforms, creating
private qat_comp_xforms with prepared firmware message templates.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocompress/qat: add empty driver
Fiona Trahe [Fri, 13 Jul 2018 02:28:11 +0000 (03:28 +0100)]
compress/qat: add empty driver

Add Makefiles, meson files, and empty source files for compression PMD.
Handle cases for building either symmetric crypto PMD
or compression PMD or both and the common files both depend on.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
6 years agocommon/qat: update firmware headers
Fiona Trahe [Fri, 13 Jul 2018 02:28:10 +0000 (03:28 +0100)]
common/qat: update firmware headers

Updated to latest firmware headers files for QuickAssist devices.
Includes updates for symmetric crypto, PKE and Compression services.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
6 years agoexamples/vm_power: make branch ratio configurable
David Hunt [Fri, 13 Jul 2018 14:23:02 +0000 (15:23 +0100)]
examples/vm_power: make branch ratio configurable

For different workloads and poll loops, the theshold
may be different for when you want to scale up and down.

This patch allows changing of the default branch ratio
by using the -b command line argument (or --branch-ratio=)

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add options to guest app
David Hunt [Fri, 13 Jul 2018 14:23:01 +0000 (15:23 +0100)]
examples/vm_power: add options to guest app

Add new command line arguments to the guest app to make
    testing and validation of the policy usage easier.
    These arguments are mainly around setting up the power
    management policy that is sent from the guest vm to
    to the vm_power_manager in the host

    New command line parameters:
    -n or --vm-name
       sets the name of the vm to be used by the host OS.
    -b or --busy-hours
       sets the list of hours that are predicted to be busy
    -q or --quiet-hours
       sets the list of hours that are predicted to be quiet
    -l or --vcpu-list
       sets the list of vcpus to monitor
    -p or --port-list
       sets the list of posts to monitor when using a
       workload policy.
    -o or --policy
       sets the default policy type
          TIME
          WORKLOAD
          TRAFFIC
          BRANCH_RATIO

    The format of the hours or list paramers is a comma-separated
    list of integers, which can take the form of
       a. x    e.g. --vcpu-list=1
       b. x,y  e.g. --quiet-hours=3,4
       c. x-y  e.g. --busy-hours=9-12
       d. combination of above (e.g. --busy-hours=4,5-7,9)

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add branch ratio policy type
David Hunt [Fri, 13 Jul 2018 14:23:00 +0000 (15:23 +0100)]
examples/vm_power: add branch ratio policy type

Add the capability for the vm_power_manager to receive
a policy of type BRANCH_RATIO. This will add any vcpus
in the policy to the oob monitoring thread.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add --port-list option
David Hunt [Fri, 13 Jul 2018 14:22:59 +0000 (15:22 +0100)]
examples/vm_power: add --port-list option

add in the long form of -p, which is --port-list

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add thread for oob core monitor
David Hunt [Fri, 13 Jul 2018 14:22:58 +0000 (15:22 +0100)]
examples/vm_power: add thread for oob core monitor

Change the app to now require three cores, as the third core
will be used to run the oob montoring thread.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: allow greater than 64 cores
David Hunt [Fri, 13 Jul 2018 14:22:57 +0000 (15:22 +0100)]
examples/vm_power: allow greater than 64 cores

To facilitate more info per core, change the global_cpu_mask
from a uint64_t to an array. This also removes the limit on
64 cores, allocing the aray at run-time based on the number of
cores found in the system.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add oob monitoring functions
David Hunt [Fri, 13 Jul 2018 14:22:56 +0000 (15:22 +0100)]
examples/vm_power: add oob monitoring functions

This patch introduces the out-of-band (oob) core monitoring
functions.

The functions are similar to the channel manager functions.
There are function to add and remove cores from the
list of cores being monitored. There is a function to initialise
the monitor setup, run the monitor thread, and exit the monitor.

The monitor thread runs in it's own lcore, and is separate
functionality to the channel monitor which is epoll based.
THis thread is timer based. It loops through all monitored cores,
calculates the branch ratio, scales up or down the core, then
sleeps for an interval (~250 uS).

The method it uses to read the branch counters is a pread on the
/dev/cpu/x/msr file, so the 'msr' kernel module needs to be loaded.
Also, since the msr.h file has been made unavailable in recent
kernels, we have #defines for the relevant MSRs included in the
code.

The makefile has a switch for x86 and non-x86 platforms,
and compiles stub function for non-x86 platforms.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add core list parameter
David Hunt [Fri, 13 Jul 2018 14:22:55 +0000 (15:22 +0100)]
examples/vm_power: add core list parameter

Add in the '-l' command line parameter (also --core-list)
So the user can now pass --corelist=4,6,8-10 and it will
expand out to 4,6,8,9,10 using the parse function provided
in parse.c (parse_set).

This list of cores is then used to enable out-of-band monitoring
to scale up and down these cores based on the ratio of branch
hits versus branch misses. The ratio will be low when a poll
loop is spinning with no packets being received, so the frequency
will be scaled down.

Also , as part of this change, we introduce a core_info struct
which keeps information on each core in the system, and whether
we're doing out of band monitoring on them.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agoexamples/vm_power: add check for port count
David Hunt [Fri, 13 Jul 2018 14:22:54 +0000 (15:22 +0100)]
examples/vm_power: add check for port count

If we don't pass any ports to the app, we don't need to create
any mempools, and we don't need to init any ports.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
6 years agodevtools: fix checkpatch for filename with space
Thomas Monjalon [Fri, 20 Jul 2018 11:34:52 +0000 (13:34 +0200)]
devtools: fix checkpatch for filename with space

If the patch filename or the temporary file path have a space
in their name, the script checkpatches.sh does not work.
The variables for the filenames must be enclosed in quotes
in order to preserve spaces.

Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
6 years agovfio: remove uneccessary IPC for group fd clear
Qi Zhang [Thu, 12 Jul 2018 14:01:44 +0000 (22:01 +0800)]
vfio: remove uneccessary IPC for group fd clear

Clear vfio_group_fd is not necessary to involve any IPC.
Also, current IPC implementation for SOCKET_CLR_GROUP is not
correct. rte_vfio_clear_group on secondary will always fail,
that prevent device be detached correctly on a secondary process.
The patch simply removes all IPC related stuff in
rte_vfio_clear_group.

Fixes: 83a73c5fef66 ("vfio: use generic multi-process channel")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agovfio: enable unmapping resource for secondary
Qi Zhang [Thu, 12 Jul 2018 14:01:43 +0000 (22:01 +0800)]
vfio: enable unmapping resource for secondary

Subroutine to unmap VFIO resource is shared by secondary and
primary, and it does not work on the secondary process. Since
for secondary process, it is not necessary to close interrupt
handler, set pci bus mastering and remove vfio_res from
vfio_res_list. So, the patch adds a dedicate function to handle
the situation when a device is unmapped on a secondary process.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agovfio: fix PCI address comparison
Qi Zhang [Thu, 12 Jul 2018 14:01:42 +0000 (22:01 +0800)]
vfio: fix PCI address comparison

When use memcmp to compare two PCI address, sizeof(struct rte_pci_addr)
is 4 bytes aligned, and it is 8. While only 7 byte of struct rte_pci_addr
is valid. So compare the 8th byte will cause the unexpected result, which
happens when repeatedly attach/detach a device.

Fixes: 94c0776b1bad ("vfio: support hotplug")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoeal: fix hotplug add and remove
Qi Zhang [Thu, 12 Jul 2018 14:01:41 +0000 (22:01 +0800)]
eal: fix hotplug add and remove

If hotplug add an already plugged PCI device, it will
cause rte_pci_device->device.name be corrupted due to unexpected
rte_devargs_remove. Also if try to hotplug remove an already
unplugged device, it will cause segment fault due to unexpected
bus->unplug on a rte_device whose driver is NULL.
The patch fix these issues.

Fixes: 7e8b26650146 ("eal: fix hotplug add / remove")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agodevtools: fix symbol check for filename with space
Thomas Monjalon [Wed, 18 Jul 2018 21:26:58 +0000 (23:26 +0200)]
devtools: fix symbol check for filename with space

If the patch filename or the temporary file path have a space
in their name, the script check-symbol-change.sh does not work.
The variables for the filenames must be enclosed in quotes
in order to preserve spaces.

Fixes: 4bec48184e33 ("devtools: add checks for ABI symbol addition")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
6 years agomem: add logic check for static analyzer
Anatoly Burakov [Tue, 17 Jul 2018 15:41:45 +0000 (16:41 +0100)]
mem: add logic check for static analyzer

Technically, single file segments codepath will never get
triggered when using in-memory mode, because EAL prohibits
mixing these two options at initialization time. However,
code analyzers do not know that, and some will complain
about either using uninitialized variables, or trying to
do operations on an already closed descriptor.

Fix this by assuring the compiler or code analyzer that
in-memory mode code never gets triggered when using
single-file segments mode.

Coverity issue: 302847
Fixes: 72b49ff623c4 ("mem: support --in-memory mode")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agomalloc: do not skip pad on free
Anatoly Burakov [Thu, 19 Jul 2018 09:42:46 +0000 (10:42 +0100)]
malloc: do not skip pad on free

Previously, we were skipping erasing pad because we were
expecting it to be freed when we were merging adjacent
segments. However, if there were no adjacent segments to
merge, we would've skipped erasing the pad, leaving non-zero
memory in our free space.

Fix this by including pad in the erasing unconditionally.

Fixes: e43a9f52b7ff ("malloc: fix pad erasing")
Cc: stable@dpdk.org
Reported-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agodevargs: fix parsing truncation when using format
Andrew Rybchenko [Wed, 18 Jul 2018 07:23:30 +0000 (08:23 +0100)]
devargs: fix parsing truncation when using format

Space for string terminating NUL character should be provided to
snprintf() to avoid the last symbol truncation.

Fixes: a23bc2c4e01b ("devargs: add non-variadic parsing function")

Reported-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoeal: fix dependency in multi-process detection
Anatoly Burakov [Wed, 18 Jul 2018 10:53:42 +0000 (11:53 +0100)]
eal: fix dependency in multi-process detection

Currently, we need runtime dir to put all of our runtime info in,
including the DPDK shared config. However, we use the shared
config to determine our proc type, and this happens earlier than
we actually create the config dir and thus can know where to
place the config file.

Fix this by moving runtime dir creation right after the EAL
arguments parsing, but before proc type autodetection. Also,
previously we were creating the config file unconditionally,
even if we specified no_shconf - fix it by only creating
the config file if no_shconf is not set.

Fixes: adf1d867361c ("eal: move runtime config file to new location")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
6 years agomem: fix alignment of requested virtual areas
Anatoly Burakov [Mon, 16 Jul 2018 14:57:19 +0000 (15:57 +0100)]
mem: fix alignment of requested virtual areas

The original code did not align any addresses that were requested as
page-aligned, but were different because addr_is_hint was set.

Below fix by Dariusz has introduced an issue where all unaligned addresses
were left as unaligned.

This patch is a partial revert of
commit 7fa7216ed48d ("mem: fix alignment of requested virtual areas")

and implements a proper fix for this issue, by asking for alignment in all
but the following two cases:

1) page size is equal to system page size, or
2) we got an aligned requested address, and will not accept a different one

This ensures that alignment is performed in all cases, except for those we
can guarantee that the address will not need alignment.

Fixes: b7cc54187ea4 ("mem: move virtual area function in common directory")
Fixes: 7fa7216ed48d ("mem: fix alignment of requested virtual areas")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Acked-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
6 years agodevargs: fix build with gcc 4.7
Pablo de Lara [Mon, 16 Jul 2018 06:26:27 +0000 (07:26 +0100)]
devargs: fix build with gcc 4.7

Fixed possible out-of-bounds issue:

lib/librte_eal/common/eal_common_devargs.c:
In function ‘rte_devargs_layers_parse’:
lib/librte_eal/common/eal_common_devargs.c:121:7:
error: array subscript is above array bounds

Bugzilla ID: 71
Fixes: 338327d731e6 ("devargs: add function to parse device layers")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoversion: 18.08-rc1
Thomas Monjalon [Sun, 15 Jul 2018 23:17:18 +0000 (01:17 +0200)]
version: 18.08-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevtools: add checks for ABI symbol addition
Neil Horman [Wed, 27 Jun 2018 18:01:01 +0000 (14:01 -0400)]
devtools: add checks for ABI symbol addition

Recently, some additional patches were added to allow for programmatic
marking of C symbols as experimental.  The addition of these markers is
dependent on the manual addition of exported symbols to the EXPERIMENTAL
section of the corresponding libraries version map file.  The consensus
on review is that, in addition to mandating the addition of symbols to
the EXPERIMENTAL version in the map, we need a mechanism to enforce our
documented process of mandating that addition when they are introduced.
To that end, I am proposing this change.  It is an addition to the
checkpatches script, which scan incoming patches for additions and
removals of symbols to the map file, and warns the user appropriately.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
6 years agoapp/testpmd: fix typo in setting Tx offload command
Ferruh Yigit [Thu, 5 Jul 2018 16:58:00 +0000 (17:58 +0100)]
app/testpmd: fix typo in setting Tx offload command

udp_cksum is duplicated, second one should be tcp_cksum

Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agoapp/testpmd: set keep CRC offload flag
Ferruh Yigit [Tue, 3 Jul 2018 18:44:52 +0000 (19:44 +0100)]
app/testpmd: set keep CRC offload flag

If "--disable-crc-strip" testpmd parameter issued, it removes the
DEV_RX_OFFLOAD_CRC_STRIP flag.
With introduction of new DEV_RX_OFFLOAD_KEEP_CRC offload flag, this
flag also should be set when this parameter issued.

Fixes: 70815c9ecadd ("ethdev: add new offload flag to keep CRC")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
6 years agokvargs: add generic string matching callback
Gaetan Rivet [Wed, 11 Jul 2018 21:45:02 +0000 (23:45 +0200)]
kvargs: add generic string matching callback

This function can be used as a callback to
rte_kvargs_process.

This should reduce code duplication.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoeal: implement device iteration
Gaetan Rivet [Wed, 11 Jul 2018 21:45:01 +0000 (23:45 +0200)]
eal: implement device iteration

Use the iteration hooks in the abstraction layers to perform the
requested filtering on the internal device lists.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoeal: implement device iteration initialization
Gaetan Rivet [Wed, 11 Jul 2018 21:45:00 +0000 (23:45 +0200)]
eal: implement device iteration initialization

Parse a device description.
Split this description in their relevant part for each layers.
No dynamic allocation is performed.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoeal: add device iterator interface
Gaetan Rivet [Wed, 11 Jul 2018 21:44:59 +0000 (23:44 +0200)]
eal: add device iterator interface

A device iterator allows iterating over a set of devices.
This set is defined by the two descriptions offered,

  * rte_bus
  * rte_class

Only one description can be provided, or both. It is not allowed to
provide no description at all.

Each layer of abstraction then performs a filter based on the
description provided. This filtering allows iterating on their internal
set of devices, stopping when a match is valid and returning the current
iteration context.

This context allows starting the next iteration from the same point and
going forward.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agodevargs: add function to parse device layers
Gaetan Rivet [Wed, 11 Jul 2018 21:44:58 +0000 (23:44 +0200)]
devargs: add function to parse device layers

This function is private to the EAL.
It is used to parse each layers in a device description string,
and store the result in an rte_devargs structure.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agoeal: introduce device class abstraction
Gaetan Rivet [Wed, 11 Jul 2018 21:44:57 +0000 (23:44 +0200)]
eal: introduce device class abstraction

This abstraction exists since the infancy of DPDK.
It needs to be fleshed out however, to allow a generic
description of devices properties and capabilities.

A device class is the northbound interface of the device, intended
for applications to know what it can be used for.

It is conceptually just above buses.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agoeal: introduce destructor macros
Gaetan Rivet [Wed, 11 Jul 2018 21:44:56 +0000 (23:44 +0200)]
eal: introduce destructor macros

This macro adds symbols to the .fini section using the global
RTE priorities, to ensure consistency.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agokvargs: introduce a more flexible parsing function
Gaetan Rivet [Wed, 11 Jul 2018 21:44:55 +0000 (23:44 +0200)]
kvargs: introduce a more flexible parsing function

This function permits defining additional terminating characters,
ending the parsing to arbitrary delimiters.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
6 years agokvargs: build before EAL
Gaetan Rivet [Wed, 11 Jul 2018 21:44:54 +0000 (23:44 +0200)]
kvargs: build before EAL

This library will be used by the EAL to parse parameters.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agokvargs: remove error logs
Gaetan Rivet [Wed, 11 Jul 2018 21:44:53 +0000 (23:44 +0200)]
kvargs: remove error logs

Error logs in kvargs parsing should be better handled in components
calling the library.

This library must be as lean as possible.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: add non-variadic parsing function
Gaetan Rivet [Wed, 11 Jul 2018 21:44:52 +0000 (23:44 +0200)]
devargs: add non-variadic parsing function

rte_devargs_parse becomes non-variadic,
rte_devargs_parsef becomes the variadic version, to be used to compose
device strings.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
6 years agodevargs: use log functions
Gaetan Rivet [Wed, 11 Jul 2018 21:44:51 +0000 (23:44 +0200)]
devargs: use log functions

Use the standard EAL logging functions in rte_devargs.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
6 years agobus/vmbus: fix build without libuuid
Thomas Monjalon [Sun, 15 Jul 2018 20:32:49 +0000 (22:32 +0200)]
bus/vmbus: fix build without libuuid

The dependency on libuuid is useless because the required code
is embedded in EAL, see commit 6bc67c497a51 ("eal: add uuid API").

Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoethdev: check queue stats mapping input arguments
Kiran Kumar [Wed, 11 Jul 2018 08:41:59 +0000 (14:11 +0530)]
ethdev: check queue stats mapping input arguments

With current implementation, we are not checking for queue_id range
and stat_idx range in stats mapping function. This patch will add
check for queue_id and stat_idx range.

Fixes: 5de201df892 ("ethdev: add stats per queue")

Signed-off-by: Kiran Kumar <kkokkilagadda@caviumnetworks.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/netvsc: add documentation
Stephen Hemminger [Fri, 13 Jul 2018 17:06:44 +0000 (10:06 -0700)]
net/netvsc: add documentation

Matching documentation for new netvsc device.
Includes a brief note about the restart issue.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agonet/netvsc: add Hyper-V network device
Stephen Hemminger [Fri, 13 Jul 2018 17:06:43 +0000 (10:06 -0700)]
net/netvsc: add Hyper-V network device

The driver supports Hyper-V networking directly like
virtio for KVM or vmxnet3 for VMware.

This code is based off of the FreeBSD driver. The file and variable
names are kept the same to help with understanding (with most of the
BSD style warts removed).

This version supports the latest NetVSP 6.1 version and
older versions.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agobus/vmbus: add Hyper-V virtual bus support
Stephen Hemminger [Fri, 13 Jul 2018 17:06:42 +0000 (10:06 -0700)]
bus/vmbus: add Hyper-V virtual bus support

This patch adds support for an additional bus type Virtual Machine BUS
(VMBUS) on Microsoft Hyper-V in Windows 10, Windows Server 2016
and Azure. Most of this code was extracted from FreeBSD and some of
this is from earlier code donated by Brocade.

Only Linux is supported at present, but the code is split
to allow future FreeBSD and Windows support.

The bus support relies on the uio_hv_generic driver from Linux
kernel 4.16. Multiple queue support requires additional sysfs
interfaces which is in kernel 5.0 (a.k.a 4.17).

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agoeal: add uuid API
Stephen Hemminger [Fri, 13 Jul 2018 17:06:41 +0000 (10:06 -0700)]
eal: add uuid API

Since uuid functions may not be available everywhere, implement
uuid functions in DPDK. These are based off the BSD licensed
libuuid in util-link.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
6 years agovhost/crypto: use function to access mbuf private area
Dan Gora [Mon, 18 Jun 2018 23:37:33 +0000 (16:37 -0700)]
vhost/crypto: use function to access mbuf private area

Use rte_mbuf_to_priv() to access the private data area in the mbuf.

Signed-off-by: Dan Gora <dg@adax.com>
6 years agoexamples/ipsec-secgw: use function to access mbuf private
Dan Gora [Mon, 18 Jun 2018 23:36:18 +0000 (16:36 -0700)]
examples/ipsec-secgw: use function to access mbuf private

Update get_priv() to use rte_mbuf_to_priv() to access the private
area in the mbuf.

In inbound_sa_check(), use the application's get_priv() function to
access the private area in the mbuf.

Signed-off-by: Dan Gora <dg@adax.com>
6 years agombuf: add accessor function for private data area
Dan Gora [Mon, 18 Jun 2018 23:35:34 +0000 (16:35 -0700)]
mbuf: add accessor function for private data area

Add an inline accessor function to return the starting address of
the private data area in the supplied mbuf.

This allows applications to easily access the private data area between
the struct rte_mbuf and the data buffer in the specified mbuf without
creating private macros or accessor functions.

No checks are made to ensure that a private data area actually exists
in the buffer.

Signed-off-by: Dan Gora <dg@adax.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
6 years agonet/mlx5: support 32-bit systems
Moti Haimovsky [Thu, 12 Jul 2018 12:01:31 +0000 (15:01 +0300)]
net/mlx5: support 32-bit systems

This patch adds support for building and running mlx5 PMD on
32bit systems such as i686.

The main issue to tackle was handling the 32bit access to the UAR
as quoted from the mlx5 PRM:
QP and CQ DoorBells require 64-bit writes. For best performance, it
is recommended to execute the QP/CQ DoorBell as a single 64-bit write
operation. For platforms that do not support 64 bit writes, it is
possible to issue the 64 bits DoorBells through two consecutive
writes,
each write 32 bits, as described below:
* The order of writing each of the Dwords is from lower to upper
  addresses.
* No other DoorBell can be rung (or even start ringing) in the midst
 of an on-going write of a DoorBell over a given UAR page.

The last rule implies that in a multi-threaded environment, the access
to a UAR page (which can be accessible by all threads in the process)
must be synchronized (for example, using a semaphore) unless an atomic
write of 64 bits in a single bus operation is guaranteed. Such a
synchronization is not required for when ringing DoorBells on different
UAR pages.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: fix build with rdma-core v19
Shahaf Shuler [Thu, 12 Jul 2018 06:40:32 +0000 (09:40 +0300)]
net/mlx5: fix build with rdma-core v19

The flow counter support introduced by
commit 9a761de8ea14 ("net/mlx5: flow counter support") was intend to
work only with MLNX_OFED_4.3 as the upstream rdma-core
libraries were lack such support.

On rdma-core v19 the support for the flow counters was added but with
different user APIs, hence causing compilation issues on the PMD.

This patch fix the compilation errors by forcing the flow counters
to be enabled only with MLNX_OFED APIs.
Once MLNX_OFED and rdma-core APIs will be aligned, a proper patch to
support the new API will be submitted.

Fixes: 9a761de8ea14 ("net/mlx5: flow counter support")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
6 years agonet/mlx5: add count flow action
Nelio Laranjeiro [Thu, 12 Jul 2018 09:31:07 +0000 (11:31 +0200)]
net/mlx5: add count flow action

This is only supported by Mellanox OFED.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
6 years agonet/mlx5: add flow MPLS item
Nelio Laranjeiro [Thu, 12 Jul 2018 09:31:06 +0000 (11:31 +0200)]
net/mlx5: add flow MPLS item

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>