dpdk.git
7 years agomaintainers: update email for ARM
Jianbo Liu [Tue, 10 Oct 2017 03:11:37 +0000 (11:11 +0800)]
maintainers: update email for ARM

Update my email to jianbo.liu@arm.com.

Signed-off-by: Jianbo Liu <jianbo.liu@linaro.org>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoigb_uio: fix interrupt enablement after FLR in VM
Jingjing Wu [Mon, 9 Oct 2017 22:09:20 +0000 (06:09 +0800)]
igb_uio: fix interrupt enablement after FLR in VM

If pass-through a VF by vfio-pci to a Qemu VM, after FLR
in VM, the interrupt setting is not recoverd correctly
to host as below:
 in VM guest:
        Capabilities: [70] MSI-X: Enable+ Count=5 Masked-
 in Host:
        Capabilities: [70] MSI-X: Enable+ Count=5 Masked-

That was because in pci_reset_function, it first reads the
PCI configure and set FLR reset, and then writes PCI configure
as restoration. But not all the writing are successful to Host.
Because vfio-pci driver doesn't allow directly write PCI MSI-X
Cap.

To fix this issue, we need to move the interrupt enablement from
igb_uio probe to open device file. While it is also the similar as
the behaviour in vfio_pci kernel module code.

Fixes: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Tested-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/i40e: fix VF initialization error
Jingjing Wu [Mon, 9 Oct 2017 22:08:30 +0000 (06:08 +0800)]
net/i40e: fix VF initialization error

In igb_uio, FLR is issued during open device file. i40evf is trying
to initialize admin queue when driver probe, while the FLR is not
done by host driver. That will cause initialization fail.

This patch is adding the checking if VF reset is done before
adimin queue initialization.

Fixes: b58eedfc7dd5 ("igb_uio: issue FLR during open and release of device file")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
7 years agonet/mlx5: fix creation of compressed Rx completion queue
Yongseok Koh [Fri, 13 Oct 2017 20:00:19 +0000 (13:00 -0700)]
net/mlx5: fix creation of compressed Rx completion queue

The size of Rx completion queue should be doubled if compression is enabled
in case of non-vectorized Rx.

Fixes: 523f5a742102 ("net/mlx5: fix configuration of Rx CQE compression")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agovhost: fetch ring address after NUMA reallocation
Maxime Coquelin [Fri, 13 Oct 2017 09:30:21 +0000 (11:30 +0200)]
vhost: fetch ring address after NUMA reallocation

In case of NUMA reallocation, the virtqueue struct is reallocated
on another socket, meaning that its address changes.

In translate_ring_addresses(), addr pointer was not fetched again
after the reallocation, so it pointed to freed memory.

This patch just fetch again addr pointer after the reallocation.

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
7 years agovhost: fix IOTLB on NUMA realloc
Maxime Coquelin [Thu, 12 Oct 2017 15:38:50 +0000 (17:38 +0200)]
vhost: fix IOTLB on NUMA realloc

In case of NUMA reallocation, virtqueue's iotlb list is broken,
has its head changes but first iotlb entry in the list still points
to the previous head pointer.

Also, in case of reallocation, we want the IOTLB cache mempool to be
on the new socket.

This patch perform a full re-init of the IOTLB cache when mempool
already exists, and calls the IOTLB cache init function in case
the virtqueue is being reallocated on a new socket.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
7 years agovhost: fix deadlock on IOTLB miss
Maxime Coquelin [Thu, 12 Oct 2017 15:38:49 +0000 (17:38 +0200)]
vhost: fix deadlock on IOTLB miss

An optimization was done to only take the iotlb cache lock
once per packet burst instead of once per IOVA translation.

With this, IOTLB miss requests are sent to Qemu with the lock
held, which can cause a deadlock if the socket buffer is full,
and if Qemu is waiting for an IOTLB update to be done.

Holding the lock is not necessary when sending an IOTLB miss
request, as it is not manipulating the IOTLB cache list, which
the lock protects. Let's just release it while sending the
IOTLB miss.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
7 years agoefd: fix build when compiler does not support AVX2
Ferruh Yigit [Fri, 13 Oct 2017 18:24:21 +0000 (19:24 +0100)]
efd: fix build when compiler does not support AVX2

Compiler error:
irte_efd.o: In function `rte_efd_lookup':
rte_efd.c:(.text+0x6d6e): undefined reference to `efd_lookup_internal_avx2'
rte_efd.o: In function `rte_efd_lookup_bulk':
rte_efd.c:(.text+0x87d4): undefined reference to `efd_lookup_internal_avx2'

This can be observed with a compiler that doesn't support AVX2 and
shared build.

Fixes: 86d898968826 ("efd: add AVX2 vector lookup function")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agodoc: update port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:17:01 +0000 (21:17 +0800)]
doc: update port id type

Since port id has changed from uint8_t to uint16_t in dpdk code,
So update the change in related doc.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoexamples: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:17:00 +0000 (21:17 +0800)]
examples: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agotest: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:16:59 +0000 (21:16 +0800)]
test: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoapp: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:16:58 +0000 (21:16 +0800)]
app: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agonet/mrvl: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:16:57 +0000 (21:16 +0800)]
net/mrvl: fix port id type

port id should be defined as uint16_t.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agonet/fm10k: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:16:56 +0000 (21:16 +0800)]
net/fm10k: fix port id type

The variable "port" should be defined as uint16_t, fix it here.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agonet/i40e: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:16:55 +0000 (21:16 +0800)]
net/i40e: fix port id type

Some functions applied were still developed on top of uint8_t port_id,
however port_id has been increased range to uint16_t. The patch fixes
the issue.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agonet/bonding: fix port id type
Zhiyong Yang [Fri, 13 Oct 2017 13:16:54 +0000 (21:16 +0800)]
net/bonding: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoigb_uio: fix legacy MSI masking
Markus Theil [Fri, 13 Oct 2017 16:03:47 +0000 (18:03 +0200)]
igb_uio: fix legacy MSI masking

MSI masks contain a 1 if interrupt is masked, 0 if unmasked.
I got that wrong with the !!state calculation. For better
readability, the mask is now changed like in igbuio_msi_mask_irq.

Fixes: a8ea1e5fb647 ("igb_uio: fix unknown MSI symbols")

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
Tested-by: Markus Theil <markus.theil@tu-ilmenau.de>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoigb_uio: fix unknown MSI symbols
Ferruh Yigit [Fri, 13 Oct 2017 02:46:44 +0000 (03:46 +0100)]
igb_uio: fix unknown MSI symbols

This patch partially reverts the commit d196343a258e and adds some
functions from Markus' previous version of the patch [1].

igb_uio uses pci_msi_unmask_irq() and pci_msi_mask_irq() kernel APIs
when kernel version is >= 3.19 because these APIs are implemented in
this Linux kernel version.

But these APIs only exported beginning from Linux kernel 4.5, so before
this Linux kernel version igb_uio kernel module is not usable,
and giving following warnings:
"igb_uio: Unknown symbol pci_msi_unmask_irq"
"igb_uio: Unknown symbol pci_msi_mask_irq"

The support for these APIs increased to Linux kernel >= 4.5

For older version of Linux kernel unmask_msi_irq() and mask_msi_irq()
are used but these functions are not exported at all.
Instead of these functions switched back to previous implementation in
igb_uio for MSI-X, and for MSI used igbuio_msi_mask_irq() from [1].

[1]
http://dpdk.org/dev/patchwork/patch/28144/

Fixes: d196343a258e ("igb_uio: use kernel functions for masking MSI-X")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agoeal: call plugin init before device parse
Santosh Shukla [Fri, 13 Oct 2017 11:55:01 +0000 (11:55 +0000)]
eal: call plugin init before device parse

Default eal_init code calls
0. eal_plugins_init
1. eal_option_device_parse
2. rte_bus_scan

IOVA commit:cf408c224 missed on calling eal_plugins_init before
eal_option_device_parse, rte_bus_scan and that introduced below
regression for shared mode:

with CONFIG_RTE_BUILD_SHARED_LIB=y:

'net_vhost0,iface=/tmp/vhost-user2' -d ./install/lib/librte_pmd_vhost.so
-- --portmask=1 --disable-hw-vlan -i --rxq=1 --txq=1 --nb-cores=1
--eth-peer=0,52:54:00:11:22:12
EAL: Detected 4 lcore(s)
ERROR: failed to parse device "net_vhost0"
EAL: Unable to parse device 'net_vhost0,iface=/tmp/vhost-user2'
PANIC in main():
Cannot init EAL

Fixes: cf408c224 ("eal: auto detect IOVA mode")

Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Maxime Coquelin <maxime.coquelin@redhat.com>
7 years agoexamples/vm_power_manager: fix build
David Hunt [Fri, 13 Oct 2017 12:31:42 +0000 (13:31 +0100)]
examples/vm_power_manager: fix build

Remove variable declaration from within for loop.

Fixes: f14791a8126e ("examples/vm_power_mgr: add policy to channels")

Signed-off-by: David Hunt <david.hunt@intel.com>
7 years agomempool/octeontx: fix build with old gcc
Jerin Jacob [Fri, 13 Oct 2017 11:31:35 +0000 (17:01 +0530)]
mempool/octeontx: fix build with old gcc

Replaced _Static_assert compiler function with RTE_BUILD_BUG_ON()
to fix build issue with old gcc.

Fixes: 02fd6c744350 ("mempool/octeontx: support allocation")

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoefd: move AVX2 lookup in its own compilation unit
Xiaoyun Li [Fri, 13 Oct 2017 09:01:49 +0000 (17:01 +0800)]
efd: move AVX2 lookup in its own compilation unit

This patch enables x86 EFD file be compiled only if the compiler
supports AVX2 since it is already chosen at run-time.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
7 years agotest: select memcpy alignment unit at run-time
Xiaoyun Li [Fri, 13 Oct 2017 09:01:48 +0000 (17:01 +0800)]
test: select memcpy alignment unit at run-time

This patch modifies assignment of alignment unit from build-time
to run-time based on CPU flags that machine supports.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
7 years agoeal/x86: select optimized memcpy at run-time
Xiaoyun Li [Fri, 13 Oct 2017 09:01:47 +0000 (17:01 +0800)]
eal/x86: select optimized memcpy at run-time

This patch dynamically selects functions of memcpy at run-time based
on CPU flags that current machine supports. This patch uses function
pointers which are bind to the relative functions at constrctor time.
In addition, AVX512 instructions set would be compiled only if users
config it enabled and the compiler supports it.

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
7 years agoeal/x86: fix FreeBSD build
Pablo de Lara [Fri, 13 Oct 2017 13:08:12 +0000 (14:08 +0100)]
eal/x86: fix FreeBSD build

lib/librte_eal/common/arch/x86/rte_cycles.c: In function 'rdmsr':
lib/librte_eal/common/arch/x86/rte_cycles.c:57:11:
error: unused parameter 'msr' [-Werror=unused-parameter]
 rdmsr(int msr, uint64_t *val)
           ^
lib/librte_eal/common/arch/x86/rte_cycles.c:57:26:
error: unused parameter 'val' [-Werror=unused-parameter]
 rdmsr(int msr, uint64_t *val)
                          ^
Fixes: ad3516bb4ae1 ("eal/x86: implement arch-specific TSC freq query")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agoeal/x86: implement arch-specific TSC freq query
Sergio Gonzalez Monroy [Mon, 2 Oct 2017 11:17:38 +0000 (12:17 +0100)]
eal/x86: implement arch-specific TSC freq query

First, try to use CPUID Time Stamp Counter and Nominal Core Crystal
Clock Information Leaf to determine the tsc hz on platforms that
supports it (does not require privileged user).

If the CPUID leaf is not available, then try to determine the tsc hz by
reading the MSR 0xCE (requires privileged user).

Default to the tsc hz estimation if both methods fail.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agoeal/ppc64: implement arch-specific TSC freq query
Jerin Jacob [Fri, 22 Sep 2017 08:25:34 +0000 (13:55 +0530)]
eal/ppc64: implement arch-specific TSC freq query

In ppc_64, rte_rdtsc() returns timebase register value which increments
at independent timebase frequency and hence not related to lcore cpu
frequency to derive TSC hz. Hence, we stick with master lcore frequency.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
7 years agoeal/armv8: implement arch-specific TSC freq query
Jerin Jacob [Fri, 22 Sep 2017 08:25:36 +0000 (13:55 +0530)]
eal/armv8: implement arch-specific TSC freq query

Use cntvct_el0 system register to get the system counter frequency.

If the system is configured with RTE_ARM_EAL_RDTSC_USE_PMU then
return 0(let the common code calibrate the tsc frequency).

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Acked-by: Jianbo Liu <jianbo.liu@linaro.org>
7 years agotimer: honor arch-specific TSC frequency query
Jerin Jacob [Fri, 22 Sep 2017 08:25:37 +0000 (13:55 +0530)]
timer: honor arch-specific TSC frequency query

When calibrating the TSC frequency, first, probe the architecture specific
function. If not available, use the existing calibrate scheme.

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
7 years agoapp/crypto-perf: fix build with -Ofast
Pablo de Lara [Fri, 13 Oct 2017 09:20:14 +0000 (10:20 +0100)]
app/crypto-perf: fix build with -Ofast

app/test-crypto-perf/main.c:596:6: error: ‘total_nb_qps’ may be
used uninitialized in this function [-Werror=maybe-uninitialized]
   if (i == total_nb_qps)
      ^

Fixes: c4f916e33226 ("app/crypto-perf: support multiple queue pairs")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
7 years agonet/i40e: fix build on FreeBSD
Wei Zhao [Fri, 13 Oct 2017 09:11:30 +0000 (17:11 +0800)]
net/i40e: fix build on FreeBSD

ENODATA can not be build in FreeBSD.

Fixes: 7cbecc2f7424b ("net/i40e: support queue region set and flush")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
7 years agonet/mlx4: fix missing initializers for old GCC
Adrien Mazarguil [Fri, 13 Oct 2017 09:31:05 +0000 (11:31 +0200)]
net/mlx4: fix missing initializers for old GCC

This patch works around compilation issues so far only seen on RHEL 7.2
using GCC 4.8.5:

 [...]/mlx4_rxq.c: In function `mlx4_rx_queue_setup':
 [...]/mlx4_rxq.c:473:3: error: missing initializer for field `ipackets' of
     `struct mlx4_rxq_stats' [-Werror=missing-field-initializers]

 [...]/mlx4_txq.c: In function `mlx4_tx_queue_setup':
 [...]/mlx4_txq.c:265:3: error: missing initializer for field `opackets' of
     `struct mlx4_txq_stats' [-Werror=missing-field-initializers]

Fixes: 79770826499b ("net/mlx4: drop live queue reconfiguration support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agoethdev: rework xstats retrieve by id
Lee Daly [Thu, 12 Oct 2017 13:31:28 +0000 (14:31 +0100)]
ethdev: rework xstats retrieve by id

Fix xstats functions, rte_eth_xstats_get_names_by_id()
and rte_eth_xstats_get_by_id(), in current implementation
ethdev level reads all xstat values and filters out
the ones requested by the application. This behavior doesn't
benefit from PMD ops and doesn't provide the benefit the
API was created in the first place for. APIs are also unnecessarily
complicated. Both APIs have different returns for the same params.

In this fix, instead of reading all the stats and finding the
requested value, drivers can provide ops to get selected xstats.
API no longer crashes with certain params,

rte_eth_get_by_id returned seg fault with
"ids = NULL && values != NULL && n<max”
rte_eth_get_names_by_id returned seg fault with
"ids = NULL && values != NULL && n=0”
These now return max number of stats available, matching the other API.

rte_eth_get_by_id returned seg fault with
"ids != NULL && values = NULL && n<max”
This now returns -22,(EINVAL).

Standardized variable/parameter names between the 2 APIs.

Overall code complexity reduced.

Fixes: 79c913a42f0e ("ethdev: retrieve xstats by ID")

Signed-off-by: Lee Daly <lee.daly@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
7 years agonet/mlx4: add loopback Tx from VF
Moti Haimovsky [Thu, 12 Oct 2017 12:30:00 +0000 (14:30 +0200)]
net/mlx4: add loopback Tx from VF

This patch adds loopback functionality used when the chip is a VF in order
to enable packet transmission between VFs and PF.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: restore Rx offloads
Moti Haimovsky [Thu, 12 Oct 2017 12:29:59 +0000 (14:29 +0200)]
net/mlx4: restore Rx offloads

This patch adds hardware offloading support for IPV4, UDP and TCP checksum
verification, including inner/outer checksums on supported tunnel types.

It also restores packet type recognition support.

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: restore Tx checksum offloads
Moti Haimovsky [Thu, 12 Oct 2017 12:29:58 +0000 (14:29 +0200)]
net/mlx4: restore Tx checksum offloads

This patch adds hardware offloading support for IPv4, UDP and TCP checksum
calculation, including inner/outer checksums on supported tunnel types.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: add Rx bypassing Verbs
Moti Haimovsky [Thu, 12 Oct 2017 12:29:57 +0000 (14:29 +0200)]
net/mlx4: add Rx bypassing Verbs

This patch adds support for accessing the hardware directly when
handling Rx packets eliminating the need to use Verbs in the Rx data
path.

Rx scatter support: calculate the number of scatters on the fly
according to the maximum expected packet size.

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: add Tx bypassing Verbs
Moti Haimovsky [Thu, 12 Oct 2017 12:29:56 +0000 (14:29 +0200)]
net/mlx4: add Tx bypassing Verbs

Modify PMD to send single-buffer packets directly to the device
bypassing the Verbs Tx post and poll routines.

Tx gather support: add support for transmitting packets spanning
over multiple buffers.

Take into consideration the amount of entries a packet occupies
in the TxQ when setting the report-completion flag of the chip.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
7 years agonet/mlx4: add RSS support outside flow API
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:43 +0000 (14:19 +0200)]
net/mlx4: add RSS support outside flow API

Bring back support for automatic RSS with the default flow rules when not
in isolated mode. Balancing is done according to unspecified default
settings, as was the case before this entire rework.

Since the number of queues part of RSS contexts is limited to power of two
values, the number of configured queues is rounded down to its previous
power of two; extra queues are silently discarded. This does not prevent
dedicated flow rules from targeting them.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: disable UDP support in RSS flow rules
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:42 +0000 (14:19 +0200)]
net/mlx4: disable UDP support in RSS flow rules

When part of the RSS hash calculation, UDP packets are discarded (not
received on any queue) likely due to an issue with the kernel
implementation.

Temporarily disable UDP RSS support until this issue is resolved.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: add RSS flow rule action support
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:41 +0000 (14:19 +0200)]
net/mlx4: add RSS flow rule action support

This patch dissociates single-queue indirection tables and hash QP objects
from Rx queue structures to relinquish their control to users through the
RSS flow rule action, while simultaneously allowing multiple queues to be
associated with RSS contexts.

Flow rules share identical RSS contexts (hashed fields, hash key, target
queues) to save on memory and other resources. The trade-off is some added
complexity due to reference counters management on RSS contexts.

The QUEUE action is re-implemented on top of an automatically-generated
single-queue RSS context.

The following hardware limitations apply to RSS contexts:

- The number of queues in a group must be a power of two.
- Queue indices must be consecutive, for instance the [0 1 2 3] set is
  allowed, however [3 2 1 0], [0 2 1 3] and [0 0 1 1 2 3 3 3] are not.
- The first queue of a group must be aligned to a multiple of the context
  size, e.g. if queues [0 1 2 3 4] are defined globally, allowed group
  combinations are [0 1] and [2 3]; groups [1 2] and [3 4] are not
  supported.
- RSS hash key, while configurable per context, must be exactly 40 bytes
  long.
- The only supported hash algorithm is Toeplitz.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: remove unnecessary check
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:40 +0000 (14:19 +0200)]
net/mlx4: remove unnecessary check

Device operation callbacks are not supposed to handle a missing private
data structure.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: convert Rx path to work queues
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:39 +0000 (14:19 +0200)]
net/mlx4: convert Rx path to work queues

Work queues (WQs) are lower-level than standard queue pairs (QPs). They are
dedicated to one traffic direction and have to be used in conjunction with
indirection tables and special "hash" QPs to get the same level of
functionality.

These extra objects however are the building blocks for RSS support brought
by subsequent commits, as a single "hash" QP can manage several WQs through
an indirection table according to a hash algorithm and other parameters.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: allocate queues and mbuf rings together
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:38 +0000 (14:19 +0200)]
net/mlx4: allocate queues and mbuf rings together

Since live Tx and Rx queues cannot be reused anymore without being
destroyed first, mbuf ring sizes are fixed and known from the start.

This allows a single allocation for queue data structures and mbuf ring
together, saving space and bringing them closer in memory.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: drop live queue reconfiguration support
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:37 +0000 (14:19 +0200)]
net/mlx4: drop live queue reconfiguration support

DPDK ensures that setup functions are never called on configured queues,
or only if they have previously been released.

PMDs therefore do not need to deal with the unexpected reconfiguration of
live queues which may fail with no easy way to recover. Dropping support
for this scenario greatly simplifies the code as allocation and setup steps
and checks can be merged.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: fix invalid errno value sign
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:36 +0000 (14:19 +0200)]
net/mlx4: fix invalid errno value sign

Tx queue elements allocation function sets rte_errno properly and returns
its negative version. Reassigning this value to rte_errno is thus both
invalid and unnecessary.

Fixes: 9d14b27308a0 ("net/mlx4: standardize on negative errno values")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: update Rx/Tx callbacks consistently
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:35 +0000 (14:19 +0200)]
net/mlx4: update Rx/Tx callbacks consistently

Although their "removed" version acts as a safety against unexpected bursts
while queues are being modified by the control path, these callbacks are
set per device instead of per queue. It makes sense to update them during
start/stop/close cycles instead of queue setup.

As a side effect, this commit addresses a bug left over from a prior
commit: bringing the link down causes the "removed" Tx callback to be used,
however the normal callback is not restored when bringing it back up,
preventing the application from sending traffic at all.

Updating callbacks for a link change is not necessary as bringing the
netdevice down is normally enough to prevent traffic from flowing in.

Fixes: 3f75a0271941 ("net/mlx4: drop scatter/gather support")

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: restore promisc and allmulti support
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:34 +0000 (14:19 +0200)]
net/mlx4: restore promisc and allmulti support

Implement promiscuous and all multicast through internal flow rules
automatically generated according to the configured mode.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: add flow support for multicast traffic
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:33 +0000 (14:19 +0200)]
net/mlx4: add flow support for multicast traffic

Give users the ability to create flow rules that match all multicast
traffic. Like promiscuous flow rules, they come with restrictions such as
not allowing additional matching criteria.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: add VLAN filter configuration support
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:32 +0000 (14:19 +0200)]
net/mlx4: add VLAN filter configuration support

This commit brings back VLAN filter configuration support without any
artificial limitation on the number of simultaneous VLANs that can be
configured (previously 127).

Also thanks to the fact it does not rely on fixed per-queue arrays for
potential Verbs flow handle storage anymore, this version wastes a lot less
memory (previously 128 * 127 * pointer size, i.e. 130 kiB per Rx queue,
only one of which actually had any use for this room: the RSS parent
queue).

The number of internal flow rules generated still depends on the number of
configured MAC addresses times that of configured VLAN filters though.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: add MAC addresses configuration support
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:31 +0000 (14:19 +0200)]
net/mlx4: add MAC addresses configuration support

This commit brings back support for configuring up to 128 MAC addresses on
a port through internal flow rules automatically generated on demand.

Unlike its previous incarnation, the necessary extra flow rule for
broadcast traffic does not consume an entry from the MAC array anymore.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: refactor flow item validation code
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:30 +0000 (14:19 +0200)]
net/mlx4: refactor flow item validation code

Since flow rule validation and creation have been refactored into a common
two-pass function, having separate callback functions to validate and
convert individual items seems redundant.

The purpose of these item validation functions is to reject partial masks
as those are not supported by hardware, before handing over the item to a
separate function that performs basic sanity checks.

The current approach and related code have the following issues:

- Lack of flow handle context in validation code requires kludges such as
  the special treatment reserved to spec-less Ethernet pattern items.
- Lack of useful error reporting; users need as much help as possible to
  understand what they did wrong, particularly when they hit hardware
  limitations that aren't mentioned by the flow API. Preventing them from
  going berserk after getting a generic "item not supported" message for no
  apparent reason is mandatory.
- Generic checks should be performed by the caller, not by item-specific
  validation functions.
- Mask checks either missing or too lax in some cases (Ethernet, VLAN).

This commit addresses all the above by combining validation and conversion
callbacks as "merge" callbacks that take an additional error context
parameter. Also:

- Support for source MAC address matching is removed as it has no effect.
- Providing an empty mask no longer bypasses the Ethernet specification
  check that causes a rule to become promiscuous-like.
- VLAN VIDs must be matched exactly, as matching all VLAN traffic while
  excluding non-VLAN traffic is not supported.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: simplify trigger code for flow rules
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:29 +0000 (14:19 +0200)]
net/mlx4: simplify trigger code for flow rules

Since flow rules synchronization function mlx4_flow_sync() takes into
account the state of the device (whether it is started), trigger functions
mlx4_flow_start() and mlx4_flow_stop() are redundant. Standardize on
mlx4_flow_sync().

Use this opportunity to enhance this function with better error reporting
as the inability to start the device due to a problem with a flow rule
otherwise results in a nondescript error code.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: generalize flow rule priority support
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:28 +0000 (14:19 +0200)]
net/mlx4: generalize flow rule priority support

Since both internal and user-defined flow rules are handled by a common
implementation, flow rule priority overlaps are easier to detect. No need
to restrict their use to isolated mode only.

With this patch, only the lowest priority level remains inaccessible to
users outside isolated mode.

Also, the PMD no longer automatically assigns a fixed priority level to
user-defined flow rules, which means collisions between overlapping rules
matching a different number of protocol layers at a given priority level
won't be avoided anymore (e.g. "eth" vs. "eth / ipv4 / udp").

As a reminder, the outcome of overlapping rules for a given priority level
was, and still is, undefined territory according to API documentation.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: refactor internal flow rules
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:27 +0000 (14:19 +0200)]
net/mlx4: refactor internal flow rules

When not in isolated mode, a flow rule is automatically configured by the
PMD to receive traffic addressed to the MAC address of the device. This
somewhat duplicates flow API functionality.

Remove legacy support for internal flow rules to instead handle them
through the flow API implementation.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: relax check on missing flow rule target
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:26 +0000 (14:19 +0200)]
net/mlx4: relax check on missing flow rule target

Creating a flow rule targeting a missing (unconfigured) queue is not
possible. However, nothing really prevents the destruction of a queue with
existing flow rules still pointing at it, except currently the port must be
in a stopped state in order to avoid crashing.

Problem is that the port cannot be restarted if flow rules cannot be
re-applied due to missing queues. This flexibility will be needed by
subsequent work on this PMD.

Given that a PMD cannot decide on its own to remove problematic
user-defined flow rules in order to restart a port, work around this
restriction by making the affected ones drop-like, i.e. rules targeting
nonexistent queues drop packets instead.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: allocate drop flow resources on demand
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:25 +0000 (14:19 +0200)]
net/mlx4: allocate drop flow resources on demand

Verbs QP and CQ resources for drop flow rules do not need to be permanently
allocated, only when at least one rule needs them.

Besides, struct rte_flow_drop is outside the mlx4 PMD name space and should
never have been defined there. struct rte_flow is currently the only
exception to this rule.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: merge flow creation and validation code
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:24 +0000 (14:19 +0200)]
net/mlx4: merge flow creation and validation code

These functions share a significant amount of code and require extra
internal objects to parse and build flow rule handles.

All this can be simplified by relying directly on the internal rte_flow
structure definition, whose QP pointer (destination Verbs queue) is
replaced by a DPDK queue ID and other properties, making it more versatile
without increasing its size (at least on 64-bit platforms).

This commit also gets rid of a few unnecessary debugging messages.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: add iovec-like allocation wrappers
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:23 +0000 (14:19 +0200)]
net/mlx4: add iovec-like allocation wrappers

These wrappers implement the ability to allocate room for several disparate
objects as a single contiguous allocation while complying with their
respective alignment constraints.

This is usually more efficient than allocating and freeing them
individually if they are not expected to be reallocated with rte_realloc().

A typical use case is when several objects that cannot be dissociated must
be allocated together, as shown in the following example:

 struct b {
    ...
    struct d *d;
 }

 struct a {
     ...
     struct b *b;
     struct c *c;
 }

 struct mlx4_malloc_vec vec[] = {
     { .size = sizeof(struct a), .addr = &ptr_a, },
     { .size = sizeof(struct b), .addr = &ptr_b, },
     { .size = sizeof(struct c), .addr = &ptr_c, },
     { .size = sizeof(struct d), .addr = &ptr_d, },
 };

 if (!mlx4_mallocv(NULL, vec, RTE_DIM(vec)))
     goto error;

 struct a *a = ptr_a;

 a->b = ptr_b;
 a->c = ptr_c;
 a->b->d = ptr_d;
 ...
 rte_free(a);

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: compact flow rule error reporting
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:22 +0000 (14:19 +0200)]
net/mlx4: compact flow rule error reporting

Relying on rte_errno is not necessary where the return value of
rte_flow_error_set() can be used directly.

A related minor change is switching from RTE_FLOW_ERROR_TYPE_HANDLE to
RTE_FLOW_ERROR_TYPE_UNSPECIFIED when no rte_flow handle is involved in the
error, specifically when none is allocated yet.

This commit does not cause any functional change.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: tidy up flow rule handling code
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:21 +0000 (14:19 +0200)]
net/mlx4: tidy up flow rule handling code

- Remove unnecessary casts.
- Replace consecutive if/else blocks with switch statements.
- Use proper big endian definitions for mask values.
- Make end marker checks of item and action lists less verbose since they
  are explicitly documented as being equal to 0.
- Remove unnecessary NULL check on action configuration structure.

This commit does not cause any functional change.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: clarify flow objects naming scheme
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:20 +0000 (14:19 +0200)]
net/mlx4: clarify flow objects naming scheme

In several instances, "items" refers either to a flow pattern or a single
item, and "actions" either to the entire list of actions or only one of
them.

The fact the target of a rule (struct mlx4_flow_action) is also named
"action" and item-processing objects (struct mlx4_flow_items) as "cur_item"
("token" in one instance) contributes to the confusion.

Use this opportunity to clarify related comments and remove the unused
valid_actions[] global, whose sole purpose is to be referred by
item-processing objects as "actions".

This commit does not cause any functional change.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: expose support for flow rule priorities
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:19 +0000 (14:19 +0200)]
net/mlx4: expose support for flow rule priorities

This PMD supports up to 4096 flow rule priority levels (0 to 4095).

Applications were not allowed to use them until now due to overlaps with
the default flows (e.g. MAC address, promiscuous mode).

This is not an issue in isolated mode when such flows do not exist.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: enhance header files comments
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:18 +0000 (14:19 +0200)]
net/mlx4: enhance header files comments

Add missing comments and fix those not Doxygen-friendly.

Since the private structure definition is modified, use this opportunity to
add one remaining missing include required by one of its fields
(sys/queue.h for LIST_HEAD()).

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: remove Rx QP initializer function
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:17 +0000 (14:19 +0200)]
net/mlx4: remove Rx QP initializer function

There is no benefit in having this as a separate function.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agonet/mlx4: replace bit-field type
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:16 +0000 (14:19 +0200)]
net/mlx4: replace bit-field type

Make clear it's 32-bit wide.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agoethdev: expose flow API error helper
Adrien Mazarguil [Thu, 12 Oct 2017 12:19:15 +0000 (14:19 +0200)]
ethdev: expose flow API error helper

rte_flow_error_set() is a convenient helper to initialize error objects.

Since there is no fundamental reason to prevent applications from using it,
expose it through the public interface after modifying its return value
from positive to negative. This is done for consistency with the rest of
the public interface.

Documentation is updated accordingly.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
7 years agodoc: fix GSO guide
Mark Kavanagh [Thu, 12 Oct 2017 16:05:29 +0000 (17:05 +0100)]
doc: fix GSO guide

Correct two minor issues in the GSO programmer's guide:
- a note is rendered incorrectly in the middle of an unordered list;
  this results in the remainder of the list appearing inside the note.
  Correct indentation of the note to resolve same.
- two minor visual artifacts are present in the 'three-part-output-segment'
  diagram. Remove same.

Fixes: f6010c7655cc ("doc: add GSO programmer's guide")

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agoapp/testpmd: fix port id type
Zhiyong Yang [Thu, 12 Oct 2017 09:32:52 +0000 (17:32 +0800)]
app/testpmd: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoapp/proc_info: fix port id type
Zhiyong Yang [Thu, 12 Oct 2017 09:32:51 +0000 (17:32 +0800)]
app/proc_info: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoapp/pdump: fix port id type
Zhiyong Yang [Thu, 12 Oct 2017 09:32:50 +0000 (17:32 +0800)]
app/pdump: fix port id type

Increase port id range to 16 bits and remove the unnecessary cast.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agonet/liquidio: fix port id type
Zhiyong Yang [Thu, 12 Oct 2017 09:32:49 +0000 (17:32 +0800)]
net/liquidio: fix port id type

port_id in struct lio_device should be increased range to uint16_t since
port id in rte_eth_dev_data has already been defined as uint16_t.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agonet/bnxt: fix port id type
Zhiyong Yang [Thu, 12 Oct 2017 09:32:48 +0000 (17:32 +0800)]
net/bnxt: fix port id type

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoethdev: fix port id type
Zhiyong Yang [Thu, 12 Oct 2017 09:32:47 +0000 (17:32 +0800)]
ethdev: fix port id type

Some features applied were still developed based on older version uint8_t
port_id, but port_id has been increased range to uint16_t. The patch fixes
the issue.

Fixes: f8244c6399d9 ("ethdev: increase port id range")

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
7 years agoconfig: remove unused mrvl debug option
Tomasz Duszynski [Thu, 12 Oct 2017 08:49:35 +0000 (10:49 +0200)]
config: remove unused mrvl debug option

Remove unused MRVL_DEBUG configuration option and update driver
documentation accordingly.

Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agonet/i40e: fix mbuf free in vector Tx
Qi Zhang [Tue, 10 Oct 2017 13:22:05 +0000 (09:22 -0400)]
net/i40e: fix mbuf free in vector Tx

vPMD tx does not set sw_ring's mbuf to NULL after free.
Therefore, in cases where the vector transmit function is in
use, we must use the appropriate index and threshold values
for the queue to only free the unreleased mbufs

Fixes: b4669bb95038 ("i40e: add vector Tx")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agonet/i40e: fix flexible payload configuration
Andrey Chilikin [Fri, 6 Oct 2017 18:11:26 +0000 (19:11 +0100)]
net/i40e: fix flexible payload configuration

Removed legacy writes to ORT/PIT registers from
i40e_GLQF_reg_init(struct i40e_hw *hw) function.
Latest NVM versions contain all relevant values
and these values should not be overwritten by SW to
maintain driver/firmware compatibility and to avoid
conflicts with dynamic device personalization profiles.

Fixes: f05ec7d77e41 ("i40e: initialize flow director flexible payload setting")
Cc: stable@dpdk.org
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
7 years agotest: verify bitmap operations
Pavan Bhagavatula [Thu, 21 Sep 2017 11:50:21 +0000 (17:20 +0530)]
test: verify bitmap operations

This patch adds a test for verifying the bitmap operations.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agoeal: move bitmap from sched library
Pavan Bhagavatula [Thu, 21 Sep 2017 11:50:20 +0000 (17:20 +0530)]
eal: move bitmap from sched library

The librte_sched uses rte_bitmap to manage large arrays of bits in an
optimized method so, moving it to eal/common would allow other libraries
and applications to use it.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
7 years agomk: install symlinks before build step
Luca Boccassi [Thu, 12 Oct 2017 13:15:54 +0000 (14:15 +0100)]
mk: install symlinks before build step

A race condition can happen during parallel builds, where a header
might be installed in RTE_OUT/include before CFLAGS is recursively
expanded. This causes GCC to sometimes pick the header path as
SRCDIR/... and sometimes as RTE_OUT/include/... making the build
unreproducible, as the full path is used for the expansion of
__FILE__ and in the DWARF directory listing.

Installing all symlinks before all builds solves the problem. It is
still suboptimal, as the (fixed) path recorded in the DWARF dir
listing will include the user-configurable build output directory,
and thus will result in a different binary between different users
despite all other conditions being equal, but it is a simpler
approach that will anyway be obsolete once the build system is
switched to Meson.

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
7 years agomk: sort libraries in dependency lists
Luca Boccassi [Thu, 12 Oct 2017 13:15:53 +0000 (14:15 +0100)]
mk: sort libraries in dependency lists

In order to achieve reproducible builds, always use the same
order when listing object files to build dependencies lists.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
7 years agomk: sort source files before compilation
Luca Boccassi [Thu, 12 Oct 2017 13:15:52 +0000 (14:15 +0100)]
mk: sort source files before compilation

In order to achieve reproducible builds, always use the same
order when listing files for compilation.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
7 years agomk: sort headers before wildcard inclusion
Luca Boccassi [Thu, 12 Oct 2017 13:15:51 +0000 (14:15 +0100)]
mk: sort headers before wildcard inclusion

In order to achieve fully reproducible builds, always use the same
inclusion order for headers in the Makefiles.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
7 years agomk: sort list of examples files in doc
Luca Boccassi [Thu, 12 Oct 2017 13:15:50 +0000 (14:15 +0100)]
mk: sort list of examples files in doc

The result of find might not be stable depending on external
conditions.
Pipe it through LC_ALL=C sort to ensure reproducible results when
generating examples.dox.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
7 years agomk: sort list of shared objects in linker script
Luca Boccassi [Thu, 12 Oct 2017 13:15:49 +0000 (14:15 +0100)]
mk: sort list of shared objects in linker script

The output of wildcard might not be stable and depend on the
filesystem and other factors.
This means the content libdpdk.so linker script might change between
builds from the same sources.
Run the list through sort to ensure reproducibility.

Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
7 years agodrivers/net: enable IOVA mode for Intel PMDs
Jianfeng Tan [Wed, 11 Oct 2017 10:33:48 +0000 (10:33 +0000)]
drivers/net: enable IOVA mode for Intel PMDs

If we want to enable IOVA mode, introduced by
commit 93878cf0255e ("eal: introduce helper API for IOVA mode"),
we need PMDs (for PCI devices) to expose this flag.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agomem: honor IOVA mode for no-huge case
Jianfeng Tan [Wed, 11 Oct 2017 10:33:47 +0000 (10:33 +0000)]
mem: honor IOVA mode for no-huge case

With the introduction of IOVA mode, the only blocker to run
with 4KB pages for NICs binding to vfio-pci, is that
RTE_BAD_PHYS_ADDR is not a valid IOVA address.

We can refine this by using VA as IOVA if it's IOVA mode.

Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
7 years agotest/crypto: add mrvl crypto unit tests
Tomasz Duszynski [Tue, 10 Oct 2017 12:17:22 +0000 (14:17 +0200)]
test/crypto: add mrvl crypto unit tests

Add unit tests for MRVL CRYPTO PMD driver.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agodoc: add mrvl crypto guide
Tomasz Duszynski [Tue, 10 Oct 2017 12:17:20 +0000 (14:17 +0200)]
doc: add mrvl crypto guide

Add documentation for the MRVL CRYPTO PMD driver.

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agocrypto/mrvl: add mrvl crypto driver
Tomasz Duszynski [Tue, 10 Oct 2017 12:17:19 +0000 (14:17 +0200)]
crypto/mrvl: add mrvl crypto driver

Add support for the Marvell Security Crypto Accelerator EIP197.
Driver is based on external, publicly available, Marvell MUSDK
library that provides access to the hardware with minimum overhead
and high performance.

Driver comes with support for the following features:

* Symmetric crypto
* Sym operation chaining
* AES CBC (128)
* AES CBC (192)
* AES CBC (256)
* AES CTR (128)
* AES CTR (192)
* AES CTR (256)
* 3DES CBC
* 3DES CTR
* MD5
* MD5 HMAC
* SHA1
* SHA1 HMAC
* SHA256
* SHA256 HMAC
* SHA384
* SHA384 HMAC
* SHA512
* SHA512 HMAC
* AES GCM (128)

Driver was engineered cooperatively by Semihalf and Marvell teams.

Semihalf:
Jacek Siuda <jck@semihalf.com>
Tomasz Duszynski <tdu@semihalf.com>

Marvell:
Dmitri Epshtein <dima@marvell.com>
Natalie Samsonov <nsamsono@marvell.com>

Signed-off-by: Jacek Siuda <jck@semihalf.com>
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
7 years agodrivers/crypto: use snprintf return value correctly
Tomasz Duszynski [Wed, 11 Oct 2017 11:05:07 +0000 (13:05 +0200)]
drivers/crypto: use snprintf return value correctly

snprintf return value is the length of was encoded into destination
array excluding '\0'. Thus return value equal to the length of the
destination array or more means truncation.

This commit fixes improper use of the return value.

Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")
Fixes: 924e84f87306 ("aesni_mb: add driver for multi buffer based crypto")
Fixes: 0f548b50a160 ("crypto/aesni_mb: process crypto op on dequeue")
Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Fixes: 2773c86d061a ("crypto/kasumi: add driver for KASUMI library")
Fixes: 94b0ad8e0aa5 ("null_crypto: add driver for null crypto operations")
Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
Fixes: 3aafc423cf4d ("snow3g: add driver for SNOW 3G library")
Fixes: cf7685d68f00 ("crypto/zuc: add driver for ZUC library")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Duszynski <tdu@semihalf.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
7 years agodoc: add NXP DPAA SEC
Akhil Goyal [Mon, 9 Oct 2017 14:21:42 +0000 (19:51 +0530)]
doc: add NXP DPAA SEC

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
7 years agotest/crypto: add dpaa crypto test cases
Akhil Goyal [Mon, 9 Oct 2017 14:21:41 +0000 (19:51 +0530)]
test/crypto: add dpaa crypto test cases

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agocrypto/dpaa_sec: add crypto driver for NXP DPAA platform
Akhil Goyal [Mon, 9 Oct 2017 14:21:40 +0000 (19:51 +0530)]
crypto/dpaa_sec: add crypto driver for NXP DPAA platform

Signed-off-by: Forrest Shi <xuelin.shi@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
7 years agobus/dpaa: scan for DPAA Crypto devices
Akhil Goyal [Mon, 9 Oct 2017 14:21:39 +0000 (19:51 +0530)]
bus/dpaa: scan for DPAA Crypto devices

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
7 years agotest/crypto: add AES-CCM tests
Pablo de Lara [Thu, 21 Sep 2017 13:11:22 +0000 (14:11 +0100)]
test/crypto: add AES-CCM tests

Added AES-CCM tests for Intel QAT PMD and OpenSSL PMD.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agotest/crypto: rename GCM test code
Pablo de Lara [Thu, 21 Sep 2017 13:11:21 +0000 (14:11 +0100)]
test/crypto: rename GCM test code

Before adding AES-CCM tests, some test code used
for AES-GCM can be renamed, so it can be reused
for AES-CCM, as both need similar parameters.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/qat: support AES-CCM
Arek Kusztal [Thu, 21 Sep 2017 13:11:20 +0000 (14:11 +0100)]
crypto/qat: support AES-CCM

This patch adds AES-CCM AEAD cipher and hash algorithm to
Intel QuickAssist Technology driver.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/openssl: support AES-CCM
Pablo de Lara [Thu, 21 Sep 2017 13:11:19 +0000 (14:11 +0100)]
crypto/openssl: support AES-CCM

Add support to AES-CCM, for 128, 192 and 256-bit keys.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
7 years agocrypto/openssl: init GCM key at session creation
Pablo de Lara [Thu, 21 Sep 2017 13:11:18 +0000 (14:11 +0100)]
crypto/openssl: init GCM key at session creation

When creating a session for AES-GCM, since the key is going
to be constant, the OpenSSL context can initialize the key
at that moment, leaving the setting of the IV for the
operation handling.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>