dpdk.git
6 years agonet/virtio: flush Rx queues on start
Tiwei Bie [Fri, 20 Oct 2017 02:09:28 +0000 (10:09 +0800)]
net/virtio: flush Rx queues on start

After starting a device, the driver shouldn't deliver the
packets that already existed before the device is started
to applications. Otherwise it will lead to incorrect packet
collection for port state. This patch fixes this issue by
flushing the Rx queues when starting the device.

Fixes: a85786dc816f ("virtio: fix states handling during initialization")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agovhost: fix vring addresses not translated
Maxime Coquelin [Mon, 16 Oct 2017 14:56:27 +0000 (16:56 +0200)]
vhost: fix vring addresses not translated

Commit 3ea7052f4b1b ("vhost: postpone rings addresses translation")
moves rings addresses translation at either vring kick or enable
time, depending on whether protocol features are enabled or not.
This is done not interpret ring information as long as the vring
is not fully initialized.

The problem is that with old QEMU versions, like v2.5, the ring
is enabled before addresses are sent, so addresses are never
translated.

This patch fixes the issue by doing the translation in
VHOST_USER_SET_VRING_ADDR handling if ring is already enabled.

Fixes: 3ea7052f4b1b ("vhost: postpone rings addresses translation")

Reported-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yliu@fridaylinux.org>
6 years agotable: update library version
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:53 +0000 (16:03 +0100)]
table: update library version

Updated map file to current API and bumped up ABI version.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: update copyright
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:52 +0000 (16:03 +0100)]
table: update copyright

Removed incorrect white spaces and updated year in copyrigh headers.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: apply cosmetic enhancements to API
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:51 +0000 (16:03 +0100)]
table: apply cosmetic enhancements to API

Consolidated hash tables into functional groups.
Minor changes in comments.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoapps: add mask-based hash functions
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:50 +0000 (16:03 +0100)]
apps: add mask-based hash functions

Introduce mask-based hash functions in hash_func.h.

Propagate their usage in test/test, test/test-pipeline and
examples/ip_pipeline.

Remove the non-mask-based hash function prototype from API (which
was previously used as build workaround).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rework cuckoo hash table
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:49 +0000 (16:03 +0100)]
table: rework cuckoo hash table

Rework for the cuckoo hash table to use the unified parameter
structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rework 32-byte key hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:48 +0000 (16:03 +0100)]
table: rework 32-byte key hash tables

Rework for the 32-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rework 16-byte key hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:47 +0000 (16:03 +0100)]
table: rework 16-byte key hash tables

Rework for the 16-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rework 8-byte key hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:46 +0000 (16:03 +0100)]
table: rework 8-byte key hash tables

Rework for the 8-byte key hash tables (both the extendible
bucket and LRU)to use the mask-based hash function and the
unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rework variable size key lru hash table
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:45 +0000 (16:03 +0100)]
table: rework variable size key lru hash table

Rework for the variable size key LRU hash table to use the
mask-based hash function and the unified parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rework variable size key ext hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:44 +0000 (16:03 +0100)]
table: rework variable size key ext hash tables

Rework for the variable size key extendible bucket (EXT) hash
table to use the mask-based hash function and the unified
parameter structure.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: add unified params struct and mask-based hash func
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:43 +0000 (16:03 +0100)]
table: add unified params struct and mask-based hash func

Add unified parameter structure for all hash tables in librte_table.

Add mask-based hash function prototype, which is input parameter for
all hash tables.

Renamed the non-mask-based hash function prototype and all the calls
to it (to be removed later).

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: rename cuckoo hash table ops
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:42 +0000 (16:03 +0100)]
table: rename cuckoo hash table ops

The dosig particle is eliminated from the cuckoo hash ops name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: remove deprecated variable size key lru hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:41 +0000 (16:03 +0100)]
table: remove deprecated variable size key lru hash tables

The non-dosig version of the variable size key Least Recently Used
(LRU) hash tables are removed. The remaining hash tables are renamed
to eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: remove deprecated variable size key ext hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:40 +0000 (16:03 +0100)]
table: remove deprecated variable size key ext hash tables

The non-dosig version of the variable size key extendible bucket
hash tables are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: remove deprecated 16-byte key hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:39 +0000 (16:03 +0100)]
table: remove deprecated 16-byte key hash tables

The non-dosig version of the 16-byte key hash tables (both extendable
bucket and LRU) are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agotable: remove deprecated 8-byte key hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:38 +0000 (16:03 +0100)]
table: remove deprecated 8-byte key hash tables

The non-dosig version of the 8-byte key hash tables (both extendable
bucket and LRU) are removed. The remaining hash tables are renamed to
eliminate the dosig particle from their name.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoapps: remove calls to deprecated hash tables
Cristian Dumitrescu [Wed, 18 Oct 2017 15:03:37 +0000 (16:03 +0100)]
apps: remove calls to deprecated hash tables

Removing calls to hash tables that are going to be removed later.

The calls are removed from test/test, test/test-pipeline,
examples/ip_pipeline.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agomk: do not generate LDLIBS from directory dependencies
Olivier Matz [Thu, 12 Oct 2017 16:04:21 +0000 (18:04 +0200)]
mk: do not generate LDLIBS from directory dependencies

The list of libraries in LDLIBS was generated from the DEPDIRS-xyz
variable. This is valid when the subdirectory name match the library
name, but it's not always the case, especially for PMDs.

The patches removes this feature and explicitly adds the proper
libraries in LDLIBS.

Some DEPDIRS-xyz variables become useless, remove them.

Reported-by: Gage Eads <gage.eads@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Gage Eads <gage.eads@intel.com>
6 years agomempool/octeontx: fix dependency
Olivier Matz [Thu, 12 Oct 2017 16:04:20 +0000 (18:04 +0200)]
mempool/octeontx: fix dependency

The syntax "DEPDIRS-y = ..." is deprecated since
commit feb9f680cd2c ("mk: optimize directory dependencies").

Replace it with the new style.

Fixes: 8700239f7767 ("mempool/octeontx: add build and log infrastructure")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
6 years agocrypto/dpaa2_sec: remove uneffective dependency
Olivier Matz [Thu, 12 Oct 2017 16:04:19 +0000 (18:04 +0200)]
crypto/dpaa2_sec: remove uneffective dependency

The syntax "DEPDIRS-y = ..." is deprecated since
commit feb9f680cd2c ("mk: optimize directory dependencies").

Remove this uneffective lines.

The effective dependencies are already declared in
drivers/crypto/Makefile, so there is nothing to add.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
6 years agoeal: use a single version map file
Bruce Richardson [Thu, 19 Oct 2017 16:36:29 +0000 (17:36 +0100)]
eal: use a single version map file

Since the functions exported by DPDK EAL on all OS's should be
identical, we should not need separate function version files for each
OS. Therefore move existing version files to the top-level EAL
directory.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal: mark internal interrupts file as such to doxygen
Bruce Richardson [Thu, 19 Oct 2017 16:36:28 +0000 (17:36 +0100)]
eal: mark internal interrupts file as such to doxygen

Put a file-level comment on rte_eal_interrupts.h to mark it as an
internal only header.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal: merge bsdapp and linuxapp interrupt headers
Bruce Richardson [Thu, 19 Oct 2017 16:36:27 +0000 (17:36 +0100)]
eal: merge bsdapp and linuxapp interrupt headers

The linuxapp and bsdapp interrupt header files are now identical, so
merge them into a common file in common/include.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal/bsd: fix missing interrupt stub functions
Bruce Richardson [Thu, 19 Oct 2017 16:36:26 +0000 (17:36 +0100)]
eal/bsd: fix missing interrupt stub functions

A number of interrupt functions only existed on Linux. Adding in stubs
for these functions corrects this omission, and allows the map files for
both Linux and FreeBSD to be identical.

Fixes: 9efe9c6cdcac ("eal/linux: add epoll wrappers")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal/bsd: align interrupt header file with Linux version
Bruce Richardson [Thu, 19 Oct 2017 16:36:25 +0000 (17:36 +0100)]
eal/bsd: align interrupt header file with Linux version

The bsdapp-specific rte_interrupts.h file does not need to be different
from the linuxapp one, as there is nothing Linux specific in the APIs or
data structures. This will then allow us to merge the files in a common
location to avoid duplication.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agoeal: avoid error for non-existent default PMD path
Bruce Richardson [Thu, 19 Oct 2017 08:49:12 +0000 (09:49 +0100)]
eal: avoid error for non-existent default PMD path

If the default location for the PMD .so files does not exist, it should
not be treated as a fatal error condition like an incorrect path on the
command line. Therefore check that the path exists and is a directory
before adding it to the list of paths to check for PMDs.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agolog: remove deprecated functions
Olivier Matz [Mon, 23 Oct 2017 09:56:07 +0000 (11:56 +0200)]
log: remove deprecated functions

Remove rte_set_log_level(), rte_get_log_level(),
rte_set_log_type(), and rte_get_log_type().

Also update librte_eal.so version in docuementation.
The LIBABIVER variable in eal has already been modified in
commit f26ab687a74f ("eal: remove Xen dom0 support").

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
6 years agovfio: fix secondary process initialization
Anatoly Burakov [Fri, 20 Oct 2017 13:23:52 +0000 (14:23 +0100)]
vfio: fix secondary process initialization

When getting group fd from primary process, secondary wasn't storing
the fd anywhere, leading to a (harmless) error message in EAL logs,
and (not so harmless) potential problems when hot-unplugging devices
managed by VFIO in a secondary process.

Fix it by actually storing the group fd whenever we get a valid one
from the secondary process.

Fixes: 94c0776b1bad ("vfio: support hotplug")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agovfio: enable independently of PCI bus
Hemant Agrawal [Wed, 11 Oct 2017 06:42:18 +0000 (12:12 +0530)]
vfio: enable independently of PCI bus

VFIO may be used by buses other than PCI. This patch enables
the VFIO on the basis of vfio root presence.

Since vfio_enable should be called only once, pci_vfio_enable
is also removed.

A debug print is added in case vfio_pci module is not present.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
6 years agodoc: fix highlight of bumped libs in release notes
Thomas Monjalon [Sat, 14 Oct 2017 00:05:37 +0000 (02:05 +0200)]
doc: fix highlight of bumped libs in release notes

The libraries which have their ABI version increased in this release
must be prepended with a + sign to make them appear clearly.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Fixes: ec51443cc99a ("gso: add Generic Segmentation Offload API framework")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agodoc: group classification libraries in doxygen index
Thomas Monjalon [Fri, 20 Oct 2017 10:26:30 +0000 (12:26 +0200)]
doc: group classification libraries in doxygen index

The libraries reorder, distributor, EFD, ACL and member seem
to belong to the same category.
The previous categories "layers" and "containers" do not fit well.
It is proposed to group them under "classification" category.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agomempool/octeontx: move mbox from event to mempool
Santosh Shukla [Mon, 16 Oct 2017 13:42:46 +0000 (13:42 +0000)]
mempool/octeontx: move mbox from event to mempool

Octeontx mempool pmd need mailbox for pool setup.
That mailbox was defined at drivers/event/octeontx.
So mempool has dependency on event/octeontx driver and
commit:8700239f7767 has added make rule which makes sure event/*
get build before mempool, but this rule introduces
cyclic dependency and may create problem to future
feature addition in drivers/Makefile.

Same problem noticed and reported in below thread:
http://dpdk.org/ml/archives/dev/2017-October/079187.html

The patch solves problem by moving mbox definition from
drivers/event/octeontx to drivers/mempool/octeontx.
Moving mbox files involves below changes:

* Renamed ssovf_mbox.[ch] --> octeontx_mbox.[ch]
* Renamed ssovf_probe.c  --> octeontx_ssovf.c
* Introduced pool logger file.
* Moved API from rte_pmd_octeontx_ssovf_version.map to
  rte_mempool_octeontx_version.map.
* Respective Makefile changes done in
  drivers/event/octeontx/Makefile and drivers/mempool/octeontx/Makefile.

Fixes: 8700239f7767 ("mempool/octeontx: add build and log infrastructure")

Reported-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
6 years agomempool/octeontx: remove dead code
Santosh Shukla [Fri, 20 Oct 2017 15:39:58 +0000 (15:39 +0000)]
mempool/octeontx: remove dead code

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

Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoapp/testpmd: add commands for TM nodes and hierarchy commit
Jasvinder Singh [Mon, 16 Oct 2017 18:55:10 +0000 (19:55 +0100)]
app/testpmd: add commands for TM nodes and hierarchy commit

Add following CLIs in testpmd application for device traffic management;
- commands to add TM hierarchy nodes (leaf and nonleaf).
- command for runtime update of node weight.
- command to commit the TM hierarchy

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoapp/testpmd: add commands for shaper and wred profiles
Jasvinder Singh [Mon, 16 Oct 2017 18:55:09 +0000 (19:55 +0100)]
app/testpmd: add commands for shaper and wred profiles

Add following CLIs in testpmd application for device traffic management;
- commands to add/del shaper profile for TM hieraqrchy nodes.
- commands to add/update shared shapers
- commands to add/del WRED profiles for TM hiearchy leaf nodes.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoapp/testpmd: add commands for TM capability and stats
Jasvinder Singh [Mon, 16 Oct 2017 18:55:08 +0000 (19:55 +0100)]
app/testpmd: add commands for TM capability and stats

Add following CLIs to testpmd application for device traffic management;
- commands to display TM capability information.
  (per port, per hierarchy level and per hierarchy node)
- command to display hiearchy node type
- stats collection

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Tested-by: Yulong Pei <yulong.pei@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
6 years agoapp/testpmd: add commands traffic metering and policing
Cristian Dumitrescu [Fri, 13 Oct 2017 12:22:18 +0000 (13:22 +0100)]
app/testpmd: add commands traffic metering and policing

Add CLI commands to exercise the ethdev Traffic Metering and Policing
(MTR) API.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
6 years agodoc: add ethdev traffic metering and policing guide
Cristian Dumitrescu [Fri, 13 Oct 2017 12:22:17 +0000 (13:22 +0100)]
doc: add ethdev traffic metering and policing guide

Add new section in the Programmer Guide for the ethdev traffic metering
and policing (MTR) API.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agoethdev: add API for traffic metering and policing
Cristian Dumitrescu [Fri, 13 Oct 2017 12:22:16 +0000 (13:22 +0100)]
ethdev: add API for traffic metering and policing

This patch introduces new ethdev generic API for Traffic Metering and
Policing (MTR), which is yet another standard RX offload for Ethernet
devices.

Similar to rte_flow and rte_tm APIs, the configuration of MTR objects is
done in their own namespace (rte_mtr) within the librte_ether library.

Main features:
1. Traffic metering: determine the color for the current packet (green,
   yellow, red) based on history maintained by the MTR object. Supported
   algorithms: srTCM (RFC 2697), trTCM (RFC 2698 and RFC 4115).
2. Policing (per meter output color actions): re-color the packet (keep
   or change the meter output color) or drop the packet.
3. Statistics
4. Capability API

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoethdev: add operation to get MTR ops
Cristian Dumitrescu [Fri, 13 Oct 2017 12:22:15 +0000 (13:22 +0100)]
ethdev: add operation to get MTR ops

Following similar approach as rte_flow and rte_tm for modularity reasons,
the ops for the new rte_mtr API are retrieved through a new eth_dev_ops
function.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
6 years agoethdev: add flow action for metering and policing
Cristian Dumitrescu [Fri, 13 Oct 2017 12:22:14 +0000 (13:22 +0100)]
ethdev: add flow action for metering and policing

Metering and policing action typically sits on top of flow classification,
which is why MTR objects are enabled through a newly introduced flow
action.

The configuration of MTR objects is done in their own namespace (rte_mtr)
within the librte_ether library. The MTR object is hooked into ethdev RX
processing path using the "meter" flow action.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
6 years agoigb_uio: fix build with kernel <= 3.17
Jingjing Wu [Mon, 16 Oct 2017 01:58:13 +0000 (09:58 +0800)]
igb_uio: fix build with kernel <= 3.17

Compile fails when kernel version is <= 3.17 with error:
"dereferencing pointer to incomplete type". This is because struct
uio_device definition is not exposed in kernel earlier than 3.17.

This patch fixes it by using pointer of rte_uio_pci_dev as
dev_id instead of uio_device for irq device handler.

Fixes: 5f6ff30dc507 ("igb_uio: fix interrupt enablement after FLR in VM")
Cc: stable@dpdk.org
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
6 years agoversion: 17.11-rc1
Thomas Monjalon [Fri, 13 Oct 2017 23:29:59 +0000 (01:29 +0200)]
version: 17.11-rc1

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
6 years agoexamples/performance-thread: fix out-of-bounds tls array
Slawomir Mrozowicz [Wed, 20 Sep 2017 08:20:24 +0000 (10:20 +0200)]
examples/performance-thread: fix out-of-bounds tls array

Overrunning array per_lcore_this_sched->current_lthread->tls->data of
1024 8-byte elements at element index 1024 using index k.
Fixed by correct check k condition.

Coverity issue: 143462, 143463
Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
6 years agoexamples/performance-thread: fix out-of-bounds sched array
Slawomir Mrozowicz [Wed, 20 Sep 2017 07:47:34 +0000 (09:47 +0200)]
examples/performance-thread: fix out-of-bounds sched array

Overrunning array schedcore of 128 8-byte elements at element index 128
using index core id.
Fixed by correct check index lcoreid condition and
change type of lcoreid to unsigned.

Coverity issue: 143459, 143461
Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
6 years agoexamples/performance-thread: check thread creation
Jacek Piasecki [Thu, 12 Oct 2017 11:44:44 +0000 (13:44 +0200)]
examples/performance-thread: check thread creation

There was a call for thread create function without result check.
Added result check and message printout after failure.

Coverity issue: 143441
Fixes: 433ba6228f9a ("examples/performance-thread: add pthread_shim app")

Signed-off-by: Jacek Piasecki <jacekx.piasecki@intel.com>
Acked-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
6 years agoexamples/ip_reassembly: use pktmbuf to create mempool
Ashish Jain [Thu, 12 Oct 2017 13:25:17 +0000 (18:55 +0530)]
examples/ip_reassembly: use pktmbuf to create mempool

Use of rte_mempool_create() with the helper provided in
librte_mbuf: rte_pktmbuf_pool_create().
This is the preferred way to create a mbuf pool else
it may not work on implementation using the HW buffer pool

Signed-off-by: Ashish Jain <ashish.jain@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
6 years agoexamples/l3fwd: optimize packet processing on powerpc
Gowrishankar Muthukrishnan [Thu, 21 Sep 2017 10:05:24 +0000 (15:35 +0530)]
examples/l3fwd: optimize packet processing on powerpc

This patch adds altivec support for lpm packet processing in powerpc.

Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
6 years agoexamples/l3fwd-power: remove dead code
Tonghao Zhang [Fri, 13 Oct 2017 17:20:35 +0000 (10:20 -0700)]
examples/l3fwd-power: remove dead code

Signed-off-by: Tonghao Zhang <nic@opencloud.tech>
6 years agoexamples/l3fwd-acl: check fseek return
Kuba Kozak [Tue, 3 Oct 2017 11:48:02 +0000 (13:48 +0200)]
examples/l3fwd-acl: check fseek return

Add return value check and error handling for fseek call.

Coverity issue: 143435
Fixes: 361b2e9559fc ("acl: new sample l3fwd-acl")

Signed-off-by: Kuba Kozak <kubax.kozak@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
6 years agoexamples/l2fwd_fork: fix message pool init
Xueming Li [Fri, 15 Sep 2017 15:37:21 +0000 (23:37 +0800)]
examples/l2fwd_fork: fix message pool init

Some invalid callback functions are provided to rte_pktmbuf_pool_init()
without their associated data causing a segmentation fault when the
function tries to use it. In this example, those callbacks are not
necessary, they can be safely replaced by NULL pointers.

Fixes: 95e8005a56e8 ("examples/l2fwd_fork: new app")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
6 years agoexamples/l2fwd-cat: fix build with PQOS 1.4
Vladimir Kuramshin [Tue, 19 Sep 2017 09:40:44 +0000 (12:40 +0300)]
examples/l2fwd-cat: fix build with PQOS 1.4

Current version is compatible with PQOS version 1.3
but not compatible with higher versions. This change
makes l2fwd-cat example compatible with versions since 1.4

Signed-off-by: Vladimir Kuramshin <v.kuramshin@samsung.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
6 years agokni: fix build on SLE12 SP3
Nirmoy Das [Mon, 9 Oct 2017 22:04:09 +0000 (23:04 +0100)]
kni: fix build on SLE12 SP3

build error:
build/lib/librte_eal/linuxapp/kni/kni_net.c:215:5: error:
‘struct net_device’ has no member named ‘trans_start’
  dev->trans_start = jiffies;

Signed-off-by: Nirmoy Das <ndas@suse.de>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
6 years agodoc: add arm64 to Linux guide
Brian Brooks [Wed, 6 Sep 2017 15:55:03 +0000 (10:55 -0500)]
doc: add arm64 to Linux guide

Signed-off-by: Brian Brooks <brian.brooks@arm.com>
Reviewed-by: Song Zhu <song.zhu@arm.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: remove fm10k features description for SSE
Thomas Monjalon [Thu, 12 Oct 2017 01:26:44 +0000 (03:26 +0200)]
doc: remove fm10k features description for SSE

The features described for scalar fm10k and its vector implementations
are the same.
No need to distinguish them in features description.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agodoc: add note on hardware support deprecation
Bruce Richardson [Mon, 18 Sep 2017 13:59:55 +0000 (14:59 +0100)]
doc: add note on hardware support deprecation

Following agreement at the DPDK Technical Board meeting [1], the policy
that hardware support deprecation should be treated as though it were an
ABI break needs to be documented in the contributors guide.

[1] http://dpdk.org/ml/archives/dev/2017-September/074613.html

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
6 years agomaintainers: sort crypto drivers list
Pablo de Lara [Fri, 13 Oct 2017 13:52:08 +0000 (14:52 +0100)]
maintainers: sort crypto drivers list

In order to improve consistency, the list of crypto
drivers are sorted alphabetically and the word
PMD is removed from their names.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>