dpdk.git
6 years agovhost: fix buffer length calculation
Tiwei Bie [Tue, 17 Jul 2018 13:10:35 +0000 (21:10 +0800)]
vhost: fix buffer length calculation

Fixes: fd68b4739d2c ("vhost: use buffer vectors in dequeue path")

Reported-by: Yinan Wang <yinan.wang@intel.com>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Zhihong Wang <zhihong.wang@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
6 years agonet/sfc: prepare to support Rx datapath without checksum
Andrew Rybchenko [Sun, 15 Jul 2018 09:56:15 +0000 (10:56 +0100)]
net/sfc: prepare to support Rx datapath without checksum

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: fix Rx queue offloads reporting in queue info
Andrew Rybchenko [Sun, 15 Jul 2018 09:56:14 +0000 (10:56 +0100)]
net/sfc: fix Rx queue offloads reporting in queue info

CRC_STRIP offload is always enabled, but lost here.

It is more robust to use device level offloads directly to
compose returned value.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/sfc: move Rx checksum offload check to device level
Andrew Rybchenko [Sun, 15 Jul 2018 09:56:13 +0000 (10:56 +0100)]
net/sfc: move Rx checksum offload check to device level

Rx checksum offloads are on device level and should be checked and
enforced on device level.

Avoid logging of Rx checksum offloads enforced for each Rx queue.

Fixes: ff6a1197c3b1 ("net/sfc: convert to new Rx offload API")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ivan Malov <ivan.malov@oktetlabs.ru>
6 years agonet/enic: pick the right Rx handler after changing MTU
Hyong Youb Kim [Wed, 18 Jul 2018 02:02:16 +0000 (19:02 -0700)]
net/enic: pick the right Rx handler after changing MTU

enic_set_mtu always reverts to the default Rx handler after changing
MTU. Try to use the simpler, non-scatter handler in this case as well.

Fixes: 35e2cb6a1795 ("net/enic: add simple Rx handler")

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agonet/sfc: fallback to filter with zero vid
Igor Romanov [Sat, 14 Jul 2018 07:38:59 +0000 (08:38 +0100)]
net/sfc: fallback to filter with zero vid

Fallback to filter with VLAN=0 if match without VLAN is not supported
Strictly speaking it is not 100% equivalent, but good tradeoff -
untagged and priority only tagged frames will match.

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/sfc: fix filter exceptions logic
Igor Romanov [Sat, 14 Jul 2018 07:38:23 +0000 (08:38 +0100)]
net/sfc: fix filter exceptions logic

Now exception logic handles these cases:

When FW variant does not support filters with transport ports, but
IP protocol filters are supported, TCP/UDP protocol filters may be
used. When FW variant does not support filters with IPv4/6 addresses
or IP protocol, but filters with EtherType are supported, IPv4 and
IPv6 EtherTypes may be used

Fixes: 096dba799b4a ("net/sfc: avoid creation of ineffective flow rules")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/qede: move SPDX tags to source files
Rasesh Mody [Sat, 14 Jul 2018 01:34:27 +0000 (18:34 -0700)]
net/qede: move SPDX tags to source files

We were using LICENSE.qede_pmd to reference inclusion of SPDX licensing
tag from all the source file. Remove the LICENSE.qede_pmd file and
directly include SPDX tags in source files.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agodoc: update enic guide and features
Hyong Youb Kim [Wed, 18 Jul 2018 02:15:30 +0000 (19:15 -0700)]
doc: update enic guide and features

Make a few updates in preparation for 18.08.
- Use SPDX
- Add 1400 series VIC adapters to supported models
- Describe the VXLAN port number
- Expand the description for ig-vlan-rewrite
- Add inner RSS and checksum to the features

Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
6 years agoapp/testpmd: fix little performance drop
Xiaoyun Li [Thu, 12 Jul 2018 07:55:46 +0000 (15:55 +0800)]
app/testpmd: fix little performance drop

There is about 3% perf drop. And it is because of a bitrate
calculation in the datapath. So improve it by maintaining an array
of port indexes in testpmd, which is updated with ethdev events.

Fixes: 8728ccf37615 ("fix ethdev ports enumeration")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
6 years agonet/thunderx: avoid sq door bell write on zero packet
Kiran Kumar [Wed, 11 Jul 2018 08:24:36 +0000 (13:54 +0530)]
net/thunderx: avoid sq door bell write on zero packet

Avoid sq door bell write on zero packet case to reduce additional
traffic on register bus.

Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
Cc: stable@dpdk.org
Signed-off-by: Kiran Kumar <kkokkilagadda@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agonet/cxgbe: fix init failure due to new flash parts
Rahul Lakkireddy [Mon, 9 Jul 2018 15:43:23 +0000 (21:13 +0530)]
net/cxgbe: fix init failure due to new flash parts

Add decode logic for new flash parts shipped with new Chelsio NICs
to fix initialization failure on these NICs.

Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agonet/cxgbe: update release notes for flow API support
Rahul Lakkireddy [Fri, 6 Jul 2018 14:42:50 +0000 (20:12 +0530)]
net/cxgbe: update release notes for flow API support

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
6 years agoapp/testpmd: add NVGRE encap/decap
Nelio Laranjeiro [Fri, 6 Jul 2018 06:43:06 +0000 (08:43 +0200)]
app/testpmd: add NVGRE encap/decap

Due to the complex NVGRE_ENCAP flow action and based on the fact testpmd
does not allocate memory, this patch adds a new command in testpmd to
initialise a global structure containing the necessary information to
make the outer layer of the packet.  This same global structure will
then be used by the flow command line in testpmd when the action
nvgre_encap will be parsed, at this point, the conversion into such
action becomes trivial.

This global structure is only used for the encap action.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Tested-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
6 years agoapp/testpmd: add VXLAN encap/decap
Nelio Laranjeiro [Fri, 6 Jul 2018 06:43:05 +0000 (08:43 +0200)]
app/testpmd: add VXLAN encap/decap

Due to the complex VXLAN_ENCAP flow action and based on the fact testpmd
does not allocate memory, this patch adds a new command in testpmd to
initialise a global structure containing the necessary information to
make the outer layer of the packet.  This same global structure will
then be used by the flow command line in testpmd when the action
vxlan_encap will be parsed, at this point, the conversion into such
action becomes trivial.

This global structure is only used for the encap action.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Ori Kam <orika@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Tested-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
6 years agoethdev: fix queue statistics mapping documentation
Jerin Jacob [Fri, 29 Jun 2018 09:44:43 +0000 (15:14 +0530)]
ethdev: fix queue statistics mapping documentation

The RTE_MAX_ETHPORT_QUEUE_STATS_MAPS does not exists, change
to the correct definition(RTE_ETHDEV_QUEUE_STAT_CNTRS)

Fixes: 5de201df8927 ("ethdev: add stats per queue")
Cc: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
6 years agonet/i40e: fix check of flow director programming status
Wei Zhao [Fri, 13 Jul 2018 03:16:33 +0000 (11:16 +0800)]
net/i40e: fix check of flow director programming status

In i40e FDIR PMD code for checking programming status
function i40e_check_fdir_programming_status(), the initial value
of return value ret should be set to -1 not 0, because if DD bit of
I40E_RX_DESC_STATUS_DD is not write back, this function will return
0 to upper function, this give an error info to upper function, the
fact for this is it is time out for DD write back and it should return
-1.

Fixes: 05999aab4ca6 ("i40e: add or delete flow director")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix link speed
Xiaoyun Li [Tue, 10 Jul 2018 09:30:54 +0000 (17:30 +0800)]
net/i40e: fix link speed

When link needs to go up, I40E_AQ_PHY_AN_ENABLED is always be set in DPDK.
So all speeds are always set. This causes speed config never works.

This patch fixes this issue and only allows to set available speeds. If
link needs to go up and speed setting is not supported, it will print
warning and set default available speeds. And when link needs to go down,
link speed field should be set to non-zero to avoid link down issue when
binding back to kernel driver.

Fixes: ca7e599d4506 ("net/i40e: fix link management")
Fixes: 1bb8f661168d ("net/i40e: fix link down and negotiation")
Cc: stable@dpdk.org
Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix Tx queue setup after stop
Shaopeng He [Tue, 10 Jul 2018 10:37:27 +0000 (06:37 -0400)]
net/i40e: fix Tx queue setup after stop

Currently, i40e_dev_tx_queue_setup_runtime checks simple tx and treats
mbuf fast free offloading as No-simple, which is classified as simple tx
in i40e_set_tx_function_flag. This inconsistent behavior causes tx queue
setup fail after queue was stopped. This patch fixes this bug.

Fixes: 399421100e08 ("net/i40e: fix missing mbuf fast free offload")
Cc: stable@dpdk.org
Signed-off-by: Shaopeng He <shaopeng.he@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix setting TPID with AQ command
Beilei Xing [Thu, 5 Jul 2018 07:03:08 +0000 (15:03 +0800)]
net/i40e: fix setting TPID with AQ command

TPID can be set by set_switch_config AdminQ command on
new FW release. But find fail to set 0x88A8 on some NICs.
According to the datasheet, Switch Tag value should not
be identical to either the First Tag or Second Tag values.
So set something other than common Ethertype for internal
switching.

Fixes: 73cd7d6dc8e1 ("net/i40e: use set switch AQ instead of register setting")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix packet type parsing with DDP
Beilei Xing [Thu, 5 Jul 2018 01:36:29 +0000 (09:36 +0800)]
net/i40e: fix packet type parsing with DDP

To parse packet type correctly, profile needs to be
loaded again to update tables in SW even if profile
has exited. But previously packet type parser will
be false after loading profile when profile already
exists.
This patch fixes the issue.

Fixes: 0585f5c3d264 ("net/i40e: fix DDP profile DEL operation")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agonet/i40e: fix PPPoL2TP packet type parsing
Beilei Xing [Thu, 5 Jul 2018 01:36:14 +0000 (09:36 +0800)]
net/i40e: fix PPPoL2TP packet type parsing

Since PPPoL2TP profile is updated, PPPoL2TP packet type
parser will be false with the current parser function.
This patch fixes the issue.

Fixes: 11556c915a08 ("net/i40e: improve packet type parser")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
6 years agovfio: fix workaround of BAR mapping
Takeshi Yoshimura [Fri, 20 Jul 2018 08:13:47 +0000 (17:13 +0900)]
vfio: fix workaround of BAR mapping

Currently, VFIO will try to map around MSI-X table in the BARs. When
MSI-X table (page-aligned) size is equal to (page-aligned) size of BAR,
VFIO will just skip the BAR.

Recent kernel versions will allow VFIO to map the entire BAR containing
MSI-X tables (*), so instead of trying to map around the MSI-X vector
or skipping the BAR entirely if it's not possible, we can now try
mapping the entire BAR first. If mapping the entire BAR doesn't
succeed, fall back to the old behavior of mapping around MSI-X table or
skipping the BAR.

(*): "vfio-pci: Allow mapping MSIX BAR",
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?id=a32295c612c57990d17fb0f41e7134394b2f35f6

Fixes: 90a1633b2347 ("eal/linux: allow to map BARs with MSI-X tables")

Signed-off-by: Takeshi Yoshimura <t.yoshimura8869@gmail.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agomem: revert reversed allocation
Anatoly Burakov [Tue, 24 Jul 2018 12:21:40 +0000 (13:21 +0100)]
mem: revert reversed allocation

A few regressions with virtio/vhost have been discovered, due to the
strong dependency of virtio/vhost on the underlying memory layout.
Specifically, virtio/vhost share all memory pages starting from the
beginning of the segment, while the patch below made it so that the
memory is always allocated from the top of VA space, not from the
bottom.

Fixes: 179f916e88e4 ("mem: allocate in reverse to reduce fragmentation")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agodevtools: add compressdev tests to build test
Pablo de Lara [Thu, 19 Jul 2018 03:07:52 +0000 (04:07 +0100)]
devtools: add compressdev tests to build test

Compressdev tests depend on Zlib library,
so they can only be enabled if this is available.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 years agodevtools: remove already enabled nfp from build test
Pablo de Lara [Thu, 19 Jul 2018 03:03:31 +0000 (04:03 +0100)]
devtools: remove already enabled nfp from build test

NFP PMD does not have any external dependency.
It only requires Linux OS, so it is not needed
to be enabled in the test-build script.

Fixes: 80987c40fd28 ("config: enable nfp driver on Linux")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
6 years agoeal: fix error message for unsupported platforms
Bruce Richardson [Fri, 20 Jul 2018 14:13:10 +0000 (15:13 +0100)]
eal: fix error message for unsupported platforms

When building with meson on e.g. cygwin, the error message about an
unsupported platform referenced an unknown variable since
"host_machine" was missing an "_".

Fixes: 844514c73569 ("eal: build with meson")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agokvargs: fix building with meson outside source tree
Bruce Richardson [Thu, 19 Jul 2018 14:26:48 +0000 (15:26 +0100)]
kvargs: fix building with meson outside source tree

When building DPDK with meson with the <builddir> being outside the source
directory, an error was generated as the path to the EAL headers was not
found. The path specified for the includes backed out unnecessarily far and
so broke when the build directory was not in the expected location of
just inside the source dir. Changing the path to be shorter, just going
down one level and then into EAL builds for both cases - where builddir is
in source directory, and also when it's outside it.

Fixes: 092ee516496d ("kvargs: build before EAL")

Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agobuild: remove duplicate checks for cflags
Bruce Richardson [Thu, 19 Jul 2018 14:22:06 +0000 (15:22 +0100)]
build: remove duplicate checks for cflags

There is no need to check for each library, driver and example whether
certain cflags are supported. Instead of checking inside the loop, do
so outside and reuse the value.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: improve error message for missing dependency
Bruce Richardson [Fri, 20 Jul 2018 13:28:25 +0000 (14:28 +0100)]
build: improve error message for missing dependency

When building a driver or library and a required internal dependency
is missing, the error message printed was:

    Tried to get unknown variable "shared_rte_<libname>".

However, a better way to handle this is to catch the missing variable
earlier and convert it into a proper message, informing the user
that the required dependency is missing, and most importantly, what
library or driver wanted that dependency.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agobuild: fix meson build on FreeBSD
Bruce Richardson [Fri, 20 Jul 2018 13:53:36 +0000 (14:53 +0100)]
build: fix meson build on FreeBSD

A number of drivers have dependencies on libraries which
are only built on Linux, and so they need to be disabled
on FreeBSD. Rather than basing the disabling on OS, in
each case we base the building of the library on the
presence of the required dependency.

Fixes: 50385c106021 ("net/ifc: add to meson build")
Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Fixes: 5936aa3a39b9 ("net/vhost: add to meson build")
Fixes: 3298fa4853b8 ("raw/dpaa2_cmdif: introduce DPAA2 command interface driver")
Fixes: b1ee472fed58 ("raw/dpaa2_qdma: introduce the DPAA2 QDMA driver")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agousertools: add octeontx zip device for binding
Sunila Sahu [Wed, 25 Jul 2018 17:04:56 +0000 (22:34 +0530)]
usertools: add octeontx zip device for binding

Add the cavium octeontx zip pci device details.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agodoc: add octeonx zip guide
Ashish Gupta [Wed, 25 Jul 2018 17:04:55 +0000 (22:34 +0530)]
doc: add octeonx zip guide

Add Octeontx ZIP PMD feature specification and user guide
with build and run instructions.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: support burst enqueue/dequeue
Ashish Gupta [Wed, 25 Jul 2018 17:04:54 +0000 (22:34 +0530)]
compress/octeontx: support burst enqueue/dequeue

Implement enqueue/dequeue APIs to perform compression/decompression
operations

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: create private xform
Ashish Gupta [Wed, 25 Jul 2018 17:04:53 +0000 (22:34 +0530)]
compress/octeontx: create private xform

Create non-shareable private xform for applications to
perform stateless compression/decompression.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: add device setup ops
Ashish Gupta [Wed, 25 Jul 2018 17:04:52 +0000 (22:34 +0530)]
compress/octeontx: add device setup ops

Add compression PMD device and queue pair setup ops.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agocompress/octeontx: introduce octeontx zip PMD
Sunila Sahu [Wed, 25 Jul 2018 17:04:51 +0000 (22:34 +0530)]
compress/octeontx: introduce octeontx zip PMD

Octentx zipvf PMD provides hardware acceleration for
deflate and lzs compression and decompression operations
using Octeontx zip co-processor, which provide 8
virtualized zip devices.

This patch add basic initialization routine to register zip VFs
to compressdev library.

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
6 years agoexamples/ipsec-secgw: fix bypass rule processing
Konstantin Ananyev [Tue, 5 Jun 2018 14:16:02 +0000 (15:16 +0100)]
examples/ipsec-secgw: fix bypass rule processing

For outbound ports BYPASS rule is erroneously treated as PROTECT one
with SA idx zero.

Fixes: 2a5106af132b ("examples/ipsec-secgw: fix corner case for SPI value")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
6 years agobaseband/turbo_sw: update for FlexRAN 1.6.0
Amr Mokhtar [Thu, 19 Jul 2018 13:03:53 +0000 (14:03 +0100)]
baseband/turbo_sw: update for FlexRAN 1.6.0

Update BBDEV Turbo SW driver download/build instructions for
FlexRAN 1.6.0 release

Signed-off-by: Amr Mokhtar <amr.mokhtar@intel.com>
6 years agodoc: add crypto asymmetric feature list
Ashish Gupta [Mon, 23 Jul 2018 14:46:05 +0000 (20:16 +0530)]
doc: add crypto asymmetric feature list

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 agocrypto/openssl: add DH and DSA asym operations
Sunila Sahu [Mon, 23 Jul 2018 14:46:04 +0000 (20:16 +0530)]
crypto/openssl: add DH and DSA asym operations

- Add dh key generation and shared compute
- Add dsa sign and verify operation

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 agocrypto/openssl: add RSA and mod asym operations
Sunila Sahu [Mon, 23 Jul 2018 14:46:03 +0000 (20:16 +0530)]
crypto/openssl: add RSA and mod asym operations

- Add compat.h to make pmd compatible to openssl-1.1.0 and
  backward version
- Add rsa sign/verify/encrypt/decrypt and modular operation
  support

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 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>