dpdk.git
5 years agoethdev: fix errno to have positive value
Andrew Rybchenko [Mon, 21 Jan 2019 16:18:35 +0000 (16:18 +0000)]
ethdev: fix errno to have positive value

rte_errno should be set to positive value from errno.h plus
few RTE-specific values.

Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Fixes: 439a90b5f2a7 ("ethdev: reorder inline functions")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agovfio: allow secondary process to query IOMMU type
Anatoly Burakov [Fri, 18 Jan 2019 10:24:41 +0000 (10:24 +0000)]
vfio: allow secondary process to query IOMMU type

It is only possible to know IOMMU type of a given VFIO container
by attempting to initialize it. Since secondary process never
attempts to set up VFIO container itself (because they're shared
between primary and secondary), it never knows which IOMMU type
the container is using, and never sets up the appropriate config
structures. This results in inability to perform DMA mappings in
secondary process.

Fix this by allowing secondary process to query IOMMU type of
primary's default container at device initialization.

Note that this fix is assuming we're only interested in default
container.

Bugzilla ID: 174
Fixes: 6bcb7c95fe14 ("vfio: share default container in multi-process")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
5 years agoversion: 19.02-rc3
Thomas Monjalon [Sun, 20 Jan 2019 21:39:20 +0000 (22:39 +0100)]
version: 19.02-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agotest/metrics: fix a negative case
Harman Kalra [Mon, 10 Dec 2018 08:39:15 +0000 (08:39 +0000)]
test/metrics: fix a negative case

Negative test case for passing invalid count size to
rte_metrics_update_values() will pass if count value
is any value greater than 1 because set size wrt to
key id 1 is 1 and passing 0 as no of values to be
updated will not hit the ERANGE check.

Fixes: cd3804242901 ("test/metrics: add unit tests for metrics library")
Cc: stable@dpdk.org
Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Remy Horton <remy.horton@intel.com>
5 years agodoc: update qat compression guide
Tomasz Jozwiak [Mon, 14 Jan 2019 15:11:21 +0000 (16:11 +0100)]
doc: update qat compression guide

Added limitations description for the QAT compression PMD.
Updated intermediate buffers description in qat.rst file.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agodoc: add GCM AAD limitation in qat guide
Fiona Trahe [Thu, 17 Jan 2019 18:23:19 +0000 (18:23 +0000)]
doc: add GCM AAD limitation in qat guide

Add limitation that AAD buffer must be padded with zeroes
in GCM case.

Fixes: d4f44265a1d7 ("doc: add limitation of AAD size to QAT guide")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
5 years agodoc: add intel_pstate in power management
David Hunt [Tue, 15 Jan 2019 14:17:00 +0000 (14:17 +0000)]
doc: add intel_pstate in power management

With the addition of the patchset to allow auto-detection and use
of the intel_pstate kernel driver instead of the acpi-cpufreq kernel
driver, we need to reflect this in the documentation.

Now, instead of telling the user to disable intel_pstate in all cases,
it is now an optional step, should the user want to use acpi-cpufreq.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: fix references in power management guide
David Hunt [Fri, 18 Jan 2019 09:34:24 +0000 (09:34 +0000)]
doc: fix references in power management guide

In the References section in the Power Management overview,
both links pointed to the same l3fwd-power app. Fix the links
so that one points to l3fwd-power, and the other points to
the vm_power_manager sample app.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: update recommended BIOS settings in Linux guide
David Hunt [Tue, 15 Jan 2019 15:19:59 +0000 (15:19 +0000)]
doc: update recommended BIOS settings in Linux guide

Update recommended BIOS settings for performance to be more appropriate
for a wider variety of applications, and allow users to select the most
appropriate settings for their use case, e.g. some users may wish to
have Turbo Boost enabled.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: remove file listings
David Marchand [Fri, 18 Jan 2019 15:31:00 +0000 (16:31 +0100)]
doc: remove file listings

No need to keep those file listings, they are very likely to become
outdated.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agodoc: increase minimal supported Linux version
Thomas Monjalon [Wed, 16 Jan 2019 11:45:35 +0000 (12:45 +0100)]
doc: increase minimal supported Linux version

Update the Linux user guide to restrict the supported kernels
to reasonnably recent enough versions.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agotest: reorder test cases in meson
Hari Kumar Vemula [Fri, 18 Jan 2019 17:40:44 +0000 (17:40 +0000)]
test: reorder test cases in meson

Categorize testcases into suites:
- test cases that runs quickly
- performance test cases
- test cases that depend on specific drivers
- logging or dump related test cases

Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/qede: remove prefetch in Tx path
Shahed Shaikh [Fri, 18 Jan 2019 10:29:30 +0000 (02:29 -0800)]
net/qede: remove prefetch in Tx path

Incorrect placement of prefetch in Tx path is causing
a performance drop of around ~2% on AMD platform.

Fixes: 2ea6f76aff40 ("qede: add core driver")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agonet/qede: fix performance bottleneck in Rx path
Shahed Shaikh [Fri, 18 Jan 2019 10:29:29 +0000 (02:29 -0800)]
net/qede: fix performance bottleneck in Rx path

Allocating replacement buffer per received packet is expensive.
Instead, process received packets first and allocate
replacement buffers in bulk later.

This improves performance by ~25% in terms of PPS on AMD
platforms.

Fixes: 2ea6f76aff40 ("qede: add core driver")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agoraw/ifpga: fix memory leak
Andy Pei [Fri, 18 Jan 2019 11:14:33 +0000 (11:14 +0000)]
raw/ifpga: fix memory leak

When ifpga_rawdev_create() allocate memory for a new rawdev,
the original code allocate redundant memory for adapter,
which is a member of the rawdev. What is actually necessary is
the adapter to be initialized, not memory allocated.

Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agobus/ifpga: fix AFU probe failure handler
Andy Pei [Fri, 18 Jan 2019 11:12:33 +0000 (11:12 +0000)]
bus/ifpga: fix AFU probe failure handler

In the original code, when an AFU device probe a driver,
if the first driver in the driver list does not support
this device or some error happens, bus probe returns an error.

With this patch, a device will try to match driver in the driver
list one by one until an appropriate driver is found.

If some error happens, the error is returned. If the current driver
does not support the device, just try the next driver in the list.

If all the drivers in the list are tried and no driver matches,
0 is returned. Otherwise, the error code is returned.

Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agobus/ifpga: fix forcing optional devargs
Andy Pei [Fri, 18 Jan 2019 11:07:01 +0000 (11:07 +0000)]
bus/ifpga: fix forcing optional devargs

Original driver requires users to input "afu_bts" args.
But driver can also work without an explicit "afu_bts" args.

Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agobus/ifpga: fix build for cpp applications
Andy Pei [Fri, 18 Jan 2019 11:09:33 +0000 (11:09 +0000)]
bus/ifpga: fix build for cpp applications

Brackets unmatch when __cplusplus defined.

Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library")
Cc: stable@dpdk.org
Signed-off-by: Andy Pei <andy.pei@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agocompress/isal: fix build with old library version
Lee Daly [Thu, 17 Jan 2019 21:10:45 +0000 (21:10 +0000)]
compress/isal: fix build with old library version

This patch removes an unnecessary flag which was breaking the
build with older versions of the ISA-L library (v2.23 and older)
and replace with a more appropriate flag which is present
in older versions of library.

Fixes: bd03d3f1e4f1 ("compress/isal: enable checksum support")

Signed-off-by: Lee Daly <lee.daly@intel.com>
Tested-by: Harry van Haaren <harry.van.haaren@intel.com>
5 years agoefd: fix tail queue leak
Hari Kumar Vemula [Fri, 18 Jan 2019 07:40:42 +0000 (07:40 +0000)]
efd: fix tail queue leak

In rte_efd_create() allocated memory for tail queue entry but
not freed.
Added freeing the tail queue entry.

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agodoc: update recommended versions for i40e
Lijuan Tu [Fri, 18 Jan 2019 15:25:24 +0000 (23:25 +0800)]
doc: update recommended versions for i40e

add recommended DPDK/kernel driver/firmware version matching list for
i40e for 19.02

Signed-off-by: Lijuan Tu <lijuan.tu@intel.com>
5 years agoethdev: report error on ring name truncation
Nithin Dabilpuram [Thu, 17 Jan 2019 14:13:54 +0000 (14:13 +0000)]
ethdev: report error on ring name truncation

Currently this api doesn't report error if name is
truncated and so user is not sure about uniqueness
of name. This change reports error to help user.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: add missing loopback option in testpmd guide
Rami Rosen [Thu, 17 Jan 2019 11:39:26 +0000 (13:39 +0200)]
doc: add missing loopback option in testpmd guide

This patch adds a missing topology "loop" mode for port-topology
option in testpmd guide. The testpmd "loop" option
(PORT_TOPOLOGY_LOOP)  was added to testpmd parameter
port-topology back in 2014, but it seems that it was never added
to the testpmd guide. This patch adds it in the testpmd guide.

Fixes: 3e2006d6186c ("app/testpmd: add loopback topology")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agodoc: fix ifc naming
Rami Rosen [Thu, 17 Jan 2019 14:50:31 +0000 (16:50 +0200)]
doc: fix ifc naming

This patch fixes an error in ifc NIC document; a previous patch
changed the semantics to use CONFIG_RTE_LIBRTE_IFC_PMD
instead of CONFIG_RTE_LIBRTE_IFCVF_VDPA_PMD,
but the ifc NIC doc file remained with the old name.

Fixes: 4b614e9504a1 ("net/ifc: make driver name consistent")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/sfc: fix Rx packets counter
Andrew Rybchenko [Thu, 17 Jan 2019 06:17:32 +0000 (06:17 +0000)]
net/sfc: fix Rx packets counter

Errors, missed and pauses should not be included in delivered
good Rx packets reported by ipackets.

Fixes: 1caab2f1e684 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoexamples/vhost_crypto: fix session private mempool
Fan Zhang [Tue, 15 Jan 2019 10:38:08 +0000 (10:38 +0000)]
examples/vhost_crypto: fix session private mempool

This patch fixes the incorrect session private mempool passing
to cryptodev.

Fixes: ac5e42daca19 ("vhost/crypto: use separate session mempools")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agoexamples/vhost: fix path allocation failure handling
Tiwei Bie [Tue, 15 Jan 2019 07:13:24 +0000 (15:13 +0800)]
examples/vhost: fix path allocation failure handling

Add the missing failure handling for path allocation,
as realloc() may fail.

Fixes: ad0eef4d2203 ("examples/vhost: support multiple socket files")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix memory leak on realloc failure
Tiwei Bie [Tue, 15 Jan 2019 07:13:23 +0000 (15:13 +0800)]
vhost: fix memory leak on realloc failure

When realloc() fails, the original block isn't freed.

Fixes: e246896178e6 ("vhost: get guest/host physical address mappings")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: remove unused function prototype
Xiaolong Ye [Tue, 15 Jan 2019 06:48:13 +0000 (14:48 +0800)]
vhost: remove unused function prototype

vhost_user_host_notifier_ctrl is not existed anymore, its statement in
header file should be removed accordingly.

Fixes: 43f34e35663f ("vhost: provide helper for host notifier ctrl")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: configure vDPA device after set vring call message
Xiaolong Ye [Mon, 14 Jan 2019 07:34:24 +0000 (15:34 +0800)]
vhost: configure vDPA device after set vring call message

As qemu will only send VHOST_USER_SET_VRING_ENABLE message for guest
enabled vrings (only first queue pair will be enabled at initialized
stage), this will cause trouble for multiqueue case, vDPA's dev_conf
callback will get no chance be invoked. Decouple the dev_conf callback from
VHOST_USER_SET_VRING_ENABLE solves this issue.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/ice/base: free flow profile entries
Qi Zhang [Wed, 16 Jan 2019 14:13:38 +0000 (22:13 +0800)]
net/ice/base: free flow profile entries

Free flow profile entries when free HW tables.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add flow module
Qi Zhang [Wed, 16 Jan 2019 14:13:37 +0000 (22:13 +0800)]
net/ice/base: add flow module

Add the module that implemented flow abstraction that base on
flexible pipeline.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add flexible pipeline module
Qi Zhang [Wed, 16 Jan 2019 14:13:36 +0000 (22:13 +0800)]
net/ice/base: add flexible pipeline module

The flexible pipeline module provide the infrastructure for ice's
flexible packet processing feature.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add some helper macros
Qi Zhang [Wed, 16 Jan 2019 14:13:35 +0000 (22:13 +0800)]
net/ice/base: add some helper macros

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: add package download related data structure
Qi Zhang [Wed, 16 Jan 2019 14:13:34 +0000 (22:13 +0800)]
net/ice/base: add package download related data structure

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: support resource allocation
Qi Zhang [Wed, 16 Jan 2019 14:13:33 +0000 (22:13 +0800)]
net/ice/base: support resource allocation

Added API ice_alloc_hw_res and ice_free_hw_res.
Added resource type macro.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/ice/base: clean up
Qi Zhang [Wed, 16 Jan 2019 14:13:32 +0000 (22:13 +0800)]
net/ice/base: clean up

Remove some unnecessary code.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
5 years agonet/sfc: fix datapath name references in logs
Ivan Malov [Wed, 16 Jan 2019 12:24:40 +0000 (12:24 +0000)]
net/sfc: fix datapath name references in logs

Rx and Tx datapath references were mixed up in a couple
of log statements and commentary blocks in the original
commit. Correct datapath name references in said places.

Fixes: f28ede500c2e ("net/sfc: support multi-process")
Cc: stable@dpdk.org
Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/sfc: fix VF error/missed stats mapping
Andrew Rybchenko [Wed, 16 Jan 2019 09:43:23 +0000 (09:43 +0000)]
net/sfc: fix VF error/missed stats mapping

VADAPTER_RX_OVERFLOW means Rx statistics overflow, not a missed
packet because of overflow.

VADAPTER_RX_BAD_PACKETS accumulates a number of error conditions,
but mainly impossibility to deliver because of no descriptors
available, so it is better to classify it as imissed.

Fixes: 1caab2f1e684 ("net/sfc: add basic statistics")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/mlx5: fix deprecated library API for Rx padding
Yongseok Koh [Tue, 15 Jan 2019 17:38:59 +0000 (09:38 -0800)]
net/mlx5: fix deprecated library API for Rx padding

In rdma-core library IBV_WQ_FLAG_RX_END_PADDING is renamed to
IBV_WQ_FLAGS_PCI_WRITE_END_PADDING. Way to query the capability is also
changed.

Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Erez Ferber <erezf@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix Rx packet padding
Yongseok Koh [Tue, 15 Jan 2019 17:38:58 +0000 (09:38 -0800)]
net/mlx5: fix Rx packet padding

Rx packet padding is supposed to be set by an environment variable -
MLX5_PMD_ENABLE_PADDING, but it has been missing for some time by mistake.
Rather than using such a variable, a PMD parameter (rxq_pkt_pad_en) is
added instead.

Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Erez Ferber <erezf@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/i40e: support request any number of queues
Zhirun Yan [Tue, 15 Jan 2019 14:57:17 +0000 (14:57 +0000)]
net/i40e: support request any number of queues

Before this patch, VF must request a specific queues(1/2/4/8/16) with
DPDK PF. This patch align the number of requested queues to next power
of 2. So VF can request any number queues from 1 to 16.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: fix VF overwrite PF RSS LUT for X722
Yanglong Wu [Tue, 15 Jan 2019 02:23:45 +0000 (10:23 +0800)]
net/i40e: fix VF overwrite PF RSS LUT for X722

i40e_aq_set_rss_lut should set register according
to the vsi->type. if not, VF may overwrite the rigister
of PF.
Note, only X722 is impacted, since flag I40E_FLAG_RSS_AQ_CAPABLE
is only enabled on X722.

Fixes: d0a349409bd7 ("i40e: support AQ based RSS config")
Cc: stable@dpdk.org
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agotest/pdump: add unit test for pdump library
Naga Suresh Somarowthu [Mon, 8 Oct 2018 12:12:47 +0000 (13:12 +0100)]
test/pdump: add unit test for pdump library

Unit test cases are added for pdump library.
Primary process will act as server, forks a child secondary process.
Secondary process acts as client.
Server will do pdump init to serve any pdump client requests.
Server will create a vdev, send/receive packets continuously
in a separate thread.
Client will create virtual rings to receive the packet dump.
Client sends pdump enable/disable requests using either port/device id.
Packet flow direction can be tx/rx/tx&rx.
In Server, appropriate pdump callbacks are triggered,
when packets are transmitted/received.
Pdump packet is copied to client rings.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agotest/latency: add unit tests for latencystats library
Naga Suresh Somarowthu [Mon, 8 Oct 2018 12:12:46 +0000 (13:12 +0100)]
test/latency: add unit tests for latencystats library

Unit Test Cases added for latencystats library.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agotest/bitrate: add unit tests for bitrate library
Naga Suresh Somarowthu [Mon, 8 Oct 2018 12:12:45 +0000 (13:12 +0100)]
test/bitrate: add unit tests for bitrate library

Unit Test Cases for BitRate library.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Remy Horton <remy.horton@intel.com>
5 years agotest: add helpers using ring PMD Rx/Tx
Naga Suresh Somarowthu [Mon, 8 Oct 2018 12:12:44 +0000 (13:12 +0100)]
test: add helpers using ring PMD Rx/Tx

Added ring pmd based packet rx/tx helper functions
for verifying Latency, Bitrate and pdump lib UTs.

Signed-off-by: Naga Suresh Somarowthu <naga.sureshx.somarowthu@intel.com>
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agotest/compress: add varied buffer input/outputs
Marko Kovacevic [Thu, 17 Jan 2019 10:19:12 +0000 (10:19 +0000)]
test/compress: add varied buffer input/outputs

Added unit test to check if a SGL buffer
was added as an input and a Linear Buffer
as output and vice versa so we can test if the
application would process the different buffers
properly.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agotest/compress: add out of space test
Marko Kovacevic [Thu, 17 Jan 2019 10:19:11 +0000 (10:19 +0000)]
test/compress: add out of space test

This patch adds new out of space testcase to check
that the destination mbuf is smaller than required for
the output of compression to ensure the driver doesn't crash
and returns the valid error case.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agotest/compress: refactor main test function
Pablo de Lara [Thu, 17 Jan 2019 10:19:10 +0000 (10:19 +0000)]
test/compress: refactor main test function

Since the start of the compression tests,
the main test function, test_deflate_comp_decomp,
has increased its parameter with each new test added.

In order to make the code cleaner, and more scalable,
these parameters have been divided into two structures,
which are now passed as the sole arguments of the function.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agotest/ipsec: fix test suite setup
Bernard Iremonger [Thu, 17 Jan 2019 16:03:56 +0000 (16:03 +0000)]
test/ipsec: fix test suite setup

Check for valid crypto_null device before continuing.
Use valid_dev instead of valid_devs[].
Replace valid_dev_count with valid_dev_found
Call create_crypto_session for one driver only.
Refactor code so that driver capabilities can be checked in
the testsuite_setup function.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/ipsec: fix build on FreeBSD
Bernard Iremonger [Wed, 16 Jan 2019 13:45:41 +0000 (13:45 +0000)]
test/ipsec: fix build on FreeBSD

Removed ip.h and in.h headers to fix unknown type errors
when compiling on BSD.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Changqing Wu <changqingx.wu@intel.com>
5 years agotest: fix build when disabling IPsec library
David Marchand [Thu, 17 Jan 2019 10:15:22 +0000 (11:15 +0100)]
test: fix build when disabling IPsec library

Caught after pulling ipsec then compile in an existing build directory.

Fixes: 05fe65eb66b2 ("test/ipsec: introduce functional test")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoexamples/fips_validation: fix session private mempool
Fan Zhang [Tue, 15 Jan 2019 10:36:38 +0000 (10:36 +0000)]
examples/fips_validation: fix session private mempool

This patch fixes the incorrect session private mempool passing
to cryptodev.

Fixes: 41d561cbdd24 ("examples/fips_validation: add power on self test")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
5 years agoexamples/ip_fragmentation: fix MTU for i40e
Konstantin Ananyev [Wed, 16 Jan 2019 12:55:46 +0000 (12:55 +0000)]
examples/ip_fragmentation: fix MTU for i40e

Previous commit sets mtu to the same value as max_rx_pkt_len.
Though PMDs (at least Intel ones) consider MTU as
max_rx_pkt_len minus ether header, crc bytes, vlan tags.

Fixes: 73d2c1d3f33c ("examples/ip_fragmentation: support big packets")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoexamples/kni: fix crash while handling userspace request
Ferruh Yigit [Tue, 15 Jan 2019 17:28:02 +0000 (17:28 +0000)]
examples/kni: fix crash while handling userspace request

When KNI interface receives RTE_KNI_REQ_CFG_NETWORK_IF request, it
stap/start the physical device which as a result of stop() can free all
the mbufs in its queue.
Meanwhile sample application continues to read from KNI interface queues
and push into device queues. This simultaneous access may cause a crash,
crash log can be found at defect description.

As a solution KNI sample application can do the proper synchronization,
and stop transfer between KNI interface and physical interface while
physical device stop/started.

Bugzilla ID: 116
Fixes: 3fc5ca2f6352 ("kni: initial import")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Phil Yang <phil.yang@arm.com>
5 years agodoc: add GRO limitations in programmers guide
Jiayu Hu [Wed, 16 Jan 2019 02:13:42 +0000 (10:13 +0800)]
doc: add GRO limitations in programmers guide

This patch adds GRO limitations in the programmer guide.

Fixes: 2c900d09055e ("doc: add GRO guide")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agogro: check invalid TCP header length
Jiayu Hu [Wed, 16 Jan 2019 00:45:33 +0000 (08:45 +0800)]
gro: check invalid TCP header length

When the TCP header length of input packets is invalid (i.e., less
than 20 bytes or greater than 60 bytes), check_seq_option() will
access illegal memory area when compare TCP Options, which may
cause a segmentation fault.

This patch adds missing invalid TCP header length check to avoid
illegal memory accesses.

Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4")
Fixes: 9e0b9d2ec0f4 ("gro: support VxLAN GRO")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoapp/pdump: fix vdev cleanup
Reshma Pattan [Tue, 15 Jan 2019 13:45:04 +0000 (13:45 +0000)]
app/pdump: fix vdev cleanup

Virtual devices added in pdump application
using rte_eal_hotplug_add should be removed explicitly
while exiting the pdump application, otherwise the
subsequent run of the pdump application will fail with the reason
that virtual devices with the same name already exists in primary.

Fixes: 6362f362a2 ("app/pdump: use EAL hotplug instead of ethdev attach")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agopower: fix file descriptor leak
Liang Ma [Tue, 15 Jan 2019 10:01:37 +0000 (10:01 +0000)]
power: fix file descriptor leak

Coverity issue: 328528
Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: Liang Ma <liang.j.ma@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agobuild: fix meson check for binutils 2.30
Harry van Haaren [Thu, 17 Jan 2019 17:17:44 +0000 (17:17 +0000)]
build: fix meson check for binutils 2.30

This commit reworks the checks for binutils 2.30 and how
the flags to disable AVX512F are passed to the compiler.

Previously the #define for including AVX512 code was set,
while the -mno-avx512f argument was given to the compiler.
This would cause gcc to correctly refuse to emit AVX512
instructions, but the rte_memcpy code that includes AVX512
optimizations was being added to the build.

The check for binutils check is now moved to x86 as it is
irrelevant for other architectures, and the -mno-avx512f
flag is passed to a march_opts array in meson. As the
-mno-avx512 flag is added earlier in the build, the code
in rte_memcpy is no longer attempted to be compiled.

This commit also adds a message print in the meson configure
stage to alert the user of the workaround being employed.

Fixes: a32ca9a4ebc1 ("mk: fix scope of disabling AVX512F support")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoeal: fix clang build with intrinsics forced
Ilya Maximets [Tue, 15 Jan 2019 11:29:39 +0000 (14:29 +0300)]
eal: fix clang build with intrinsics forced

This fixes x86_64-native-linuxapp-clang build with
CONFIG_RTE_FORCE_INTRINSICS=y:

    include/generic/rte_atomic.h:218:9: error:
        implicit declaration of function '__atomic_exchange_2'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    include/generic/rte_atomic.h:501:9: error:
        implicit declaration of function '__atomic_exchange_4'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    include/generic/rte_atomic.h:783:9: error:
        implicit declaration of function '__atomic_exchange_8'
        is invalid in C99 [-Werror,-Wimplicit-function-declaration]

We didn't caught this issue previously on other platforms because
CONFIG_RTE_FORCE_INTRINSICS enabled by default only for armv8.

Fixes: 7bdccb93078e ("eal: fix ARM build with clang")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
5 years agoeal: check string parameter lengths
Anatoly Burakov [Wed, 16 Jan 2019 12:12:53 +0000 (12:12 +0000)]
eal: check string parameter lengths

When specifying parameters such as hugefile prefix from the
command-line, it is possibly to supply an empty string. This may
lead to various problems: for example, if hugefile prefix is
empty, the runtime config path construction may end up
looking like "/var/run/dpdk//_config", which will technically
work, but is wrong and places files in the wrong place.

To fix it, check lengths of such user-specified parameters for
hugefile prefix, as well as hugepage dir and user-specified
mbuf pool ops string.

Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: fix out of bound access when no CPU available
David Marchand [Thu, 17 Jan 2019 13:12:57 +0000 (14:12 +0100)]
eal: fix out of bound access when no CPU available

In the unlikely case when the dpdk application is started with no cpu
available in the [0, RTE_MAX_LCORE - 1] range, the master_lcore is
automatically chosen as RTE_MAX_LCORE which triggers an out of bound
access.

Either you have a crash then, or the initialisation fails later when
trying to pin the master thread on it.
In my test, with RTE_MAX_LCORE == 2:

$ taskset -c 2 ./master/app/testpmd --no-huge -m 512 --log-level *:debug
[...]
EAL: pthread_setaffinity_np failed
PANIC in eal_thread_init_master():
cannot set affinity
7: [./master/app/testpmd() [0x47f629]]

Bugzilla ID: 19
Fixes: 2eba8d21f3c9 ("eal: restrict cores auto detection")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
5 years agoeal: fix core number validation
Hari Kumar Vemula [Thu, 17 Jan 2019 12:13:12 +0000 (12:13 +0000)]
eal: fix core number validation

When incorrect core value or range provided,
as part of -l command line option, a crash occurs.

Added valid range checks to fix the crash.

Added ut check for negative core values.
Added unit test case for invalid core number range.

Fixes: d888cb8b9613 ("eal: add core list input format")
Cc: stable@dpdk.org
Signed-off-by: Hari Kumar Vemula <hari.kumarx.vemula@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoversion: 19.02-rc2
Thomas Monjalon [Tue, 15 Jan 2019 02:08:43 +0000 (03:08 +0100)]
version: 19.02-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoexamples/vhost: fix a typo
Rami Rosen [Mon, 14 Jan 2019 14:47:47 +0000 (16:47 +0200)]
examples/vhost: fix a typo

This minor patch fixes a typo in examples/vhost/main.c.

Fixes: d19533e86f1d ("examples/vhost: copy old vhost example")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
5 years agoexamples/tep_term: remove unused constant
Rami Rosen [Sun, 13 Jan 2019 15:02:12 +0000 (17:02 +0200)]
examples/tep_term: remove unused constant

The  definition of MAX_PRINT_BUFF in examples/tep_termination/main.c
is not necessary as it is not used. This cleanup patch removes it.

Fixes: a50245ede72a ("examples/tep_term: initialize VXLAN sample")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
5 years agoexamples/ip_fragmentation: support big packets
Noa Ezra [Sun, 13 Jan 2019 11:37:06 +0000 (11:37 +0000)]
examples/ip_fragmentation: support big packets

In some vendors the RX and TX configuration must be the same, therefore
the MTU size need to be equal to max_rx_pkt_len.
The MTU is the largest size packet in bytes that can be sent on the
network, therefore before changing this parameter, the NIC could not
receive packets larger than 1500 bytes, which is the default MTU size.
In addition, scatter-gather need to be enabled in order to receive
frames bigger than mbuf size.

Signed-off-by: Noa Ezra <noae@mellanox.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agotest/hash: fix perf result
Dharmik Thakkar [Mon, 14 Jan 2019 09:23:04 +0000 (03:23 -0600)]
test/hash: fix perf result

Reset 'iter' and 'tbl_rw_test_param.found' on each iteration
to give correct result for lost and duplicated keys.

This patch also changes the default return value of the test to -1
when not enough resources are provided.

Fixes: 0eb3726ebcf14 ("test/hash: add test for read/write concurrency")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Yipeng Wang <yipeng1.wang@intel.com>
5 years agodoc: fix a typo in power management guide
Yong Wang [Mon, 7 Jan 2019 09:10:47 +0000 (04:10 -0500)]
doc: fix a typo in power management guide

This patch fixes a typo in programmer's guide. It should be Frequency,
not Fequence.

Fixes: 450f0791312c ("power: add traffic pattern aware power control")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
5 years agoexamples/power: fix core id with JSON commands
David Hunt [Mon, 7 Jan 2019 11:39:20 +0000 (11:39 +0000)]
examples/power: fix core id with JSON commands

This patch fixes a bug introduced in the 64-core limitation
enhancement where the core_id is inadvertently converted from
virtual to physical even though it may already be a physical
core_id.

We should be using the core_type field, and only converting via
hypervisor when core_type is set to CORE_TYPE_VIRTUAL

Fixes: 5776b7a371d1 ("examples/power: allow VM to use lcores over 63")

Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Lei Yao <lei.a.yao@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
5 years agoexamples/power: fix for p-state
David Hunt [Tue, 8 Jan 2019 15:25:23 +0000 (15:25 +0000)]
examples/power: fix for p-state

The vm_power_manager starts by setting the environment to acpi
using rte_power_set_env(PM_ENV_ACPI_CPUFREQ). This causes a problem
starting vm_power_manager when the system is using the intel_pstate
driver. The env should be set to none, or not called at all, because
the library now auto-detects the environment to be either acpi or
intel_pstate. This patch sets the environment to none so that the
library can successfully auto-detect.

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agotest/power: handle p-state mode
David Hunt [Mon, 7 Jan 2019 14:40:51 +0000 (14:40 +0000)]
test/power: handle p-state mode

The cpufreq test breakes when the system is using the intel_pstate
driver for frequency management. The power library has recentyly been
updated to allow use of the intel_pstate driver, this patch fixes the
cpufreq test so that it can now use either acpi or pstate modes.
The library will auto-detect, and set the environment appropriately.

Fixes: ed7c51a6a680 ("app/test: vm power management")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix frequency list return code
David Hunt [Mon, 7 Jan 2019 14:40:23 +0000 (14:40 +0000)]
power: fix frequency list return code

The power_pstate_cpufreq_freqs() function was returning -1 in an
unsigned int, causing buffer over-runs when the results were being
processed. This function should be returning zero for all error
conditions, similar to it's acpi relation, power_acpi_cpufreq_freqs().

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix frequency list to handle null buffer
David Hunt [Mon, 7 Jan 2019 14:39:34 +0000 (14:39 +0000)]
power: fix frequency list to handle null buffer

This patch fixes a segfault in the case where a null buffer is passed
to the following functions:
   power_acpi_cpufreq_freqs()
   power_pstate_cpufreq_freqs()

Fixes: 445c6528b55f ("power: common interface for guest and host")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix error handling on setting governor
David Hunt [Tue, 8 Jan 2019 14:59:26 +0000 (14:59 +0000)]
power: fix error handling on setting governor

In the power_set_governor_*() functions, we using fputs() on /sys
filesystem. However, we also need to call fflush() to ensure that
the write completes successfully. Otherwise the attempt to set the
power governor fails and the function returns as if it has
succeeded. This patch adds an fflush to ensure that the
write succeeds, otherwise returns an error.

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")

Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agoipsec: fix build with gcc 6
Konstantin Ananyev [Mon, 14 Jan 2019 15:58:03 +0000 (15:58 +0000)]
ipsec: fix build with gcc 6

gcc 6.2 and 6.4 fails to compile lib/librte_ipsec/sa.c
with the following errors:
lib/librte_ipsec/sa.c:
 In function inline_outb_tun_pkt_process:
 x86_64-native-linuxapp-gcc/include/rte_memcpy.h:337:2:
 error: array subscript is above array bounds [-Werror=array-bounds]
  rte_mov32((uint8_t *)dst + 1 * 32, (const uint8_t *)src + 1 * 32);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ...

It complains about the following lines of code:
esp_outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t
        ....
        /* update spi, seqn and iv */
        esph = (struct esp_hdr *)(ph + sa->hdr_len);
        iv = (uint64_t *)(esph + 1);
        rte_memcpy(iv, ivp, sa->iv_len);

While I believe it is a false positive,
it is too excessive to use rte_memcpy() here,
as IV length could be only 0/8/16 bytes.
So introduce small helper function to copy IV and use it
instead of rte_memcpy().

Fixes: 4d7ea3e1459b ("ipsec: implement SA data-path API")

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoeal: return error when option register fails
Gaetan Rivet [Thu, 20 Dec 2018 17:06:47 +0000 (18:06 +0100)]
eal: return error when option register fails

Make rte_option_register return a negative value when
an error occur.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: improve option API documentation
Gaetan Rivet [Thu, 20 Dec 2018 17:06:46 +0000 (18:06 +0100)]
eal: improve option API documentation

Use doxygen to describe the main structure and describe a little more
why it exists.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: fix log level of error in option register
Gaetan Rivet [Thu, 20 Dec 2018 17:06:45 +0000 (18:06 +0100)]
eal: fix log level of error in option register

INFO is not correct when logging an error.

Fixes: 2395332798d0 ("eal: add option register infrastructure")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: check against common option on register
Gaetan Rivet [Thu, 20 Dec 2018 17:06:44 +0000 (18:06 +0100)]
eal: check against common option on register

Not only check against other registered options, but also common EAL
options. This will mitigate user confusion.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: rename option name field
Gaetan Rivet [Thu, 20 Dec 2018 17:06:43 +0000 (18:06 +0100)]
eal: rename option name field

option->opt_* is redundant.
The field should also be constant.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: add option usage string
Gaetan Rivet [Thu, 20 Dec 2018 17:06:42 +0000 (18:06 +0100)]
eal: add option usage string

Add a usage string field in rte_option, allowing to display
help to the user and describe which options are currently available.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: do not use static option iterator
Gaetan Rivet [Thu, 20 Dec 2018 17:06:41 +0000 (18:06 +0100)]
eal: do not use static option iterator

This is rather weird. Someone should have caught that during review.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoeal: use bare option string as name
Gaetan Rivet [Thu, 20 Dec 2018 17:06:40 +0000 (18:06 +0100)]
eal: use bare option string as name

Current options name can be passed with arbitrary format.
Force the use of "--" prefix and thus POSIX long options format.

This restricts the ability to introduce surprising options and will help
future additional checks.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agonet/mlx5: fix instruction hotspot on replenishing Rx buffer
Yongseok Koh [Mon, 14 Jan 2019 21:16:22 +0000 (13:16 -0800)]
net/mlx5: fix instruction hotspot on replenishing Rx buffer

On replenishing Rx buffers for vectorized Rx, mbuf->buf_addr isn't needed
to be accessed as it is static and easily calculated from the mbuf address.
Accessing the mbuf content causes unnecessary load stall and it is worsened
on ARM.

Fixes: 545b884b1da3 ("net/mlx5: fix buffer address posting in SSE Rx")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agombuf: add function returning buffer address
Yongseok Koh [Mon, 14 Jan 2019 21:16:21 +0000 (13:16 -0800)]
mbuf: add function returning buffer address

This patch introduces two new functions - rte_mbuf_buf_addr() and
rte_mbuf_data_addr_default().

rte_mbuf_buf_addr() reutrns the buffer address of given mbuf which comes
after mbuf structure and private data.

rte_mbuf_data_addr_default() returns the default address of mbuf data
taking the headroom into account.

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoapp/testpmd: check mbufs in verbose mode
David Marchand [Mon, 7 Jan 2019 08:57:12 +0000 (09:57 +0100)]
app/testpmd: check mbufs in verbose mode

Let's check the received/sent mbufs, it can help debugging.

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agombuf: add a non fatal sanity check helper
David Marchand [Mon, 7 Jan 2019 08:57:11 +0000 (09:57 +0100)]
mbuf: add a non fatal sanity check helper

Let's add a little helper that does the same as rte_mbuf_sanity_check but
without the panic.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agombuf: add sanity checks on segment metadata
David Marchand [Mon, 7 Jan 2019 08:57:10 +0000 (09:57 +0100)]
mbuf: add sanity checks on segment metadata

Add some basic checks on the segments offset and length metadata:
always funny to have a < 0 tailroom cast to uint16_t ;-).

Signed-off-by: David Marchand <david.marchand@6wind.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
5 years agodrivers: fix sprintf with snprintf
Pallantla Poornima [Mon, 7 Jan 2019 10:46:23 +0000 (10:46 +0000)]
drivers: fix sprintf with snprintf

sprintf function is not secure as it doesn't check the length of string.
More secure function snprintf is used

Fixes: 828d51d8fc ("bus/fslmc: refactor scan and probe functions")
Fixes: c22fab9a6c ("raw/dpaa2_qdma: support configuration APIs")
Fixes: e5cbdfc537 ("crypto/dpaa2_sec: add basic operations")
Fixes: b23d4e898a ("crypto/dpaa2_sec: add per dev mempool to store FLE")
Fixes: 623326dded ("crypto/dpaa2_sec: introduce poll mode driver")
Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")
Fixes: f44bccadd8 ("crypto/caam_jr: add device basic operations")
Fixes: 7e3e2954e0 ("crypto/dpaa_sec: move mempool allocation to config")
Fixes: c3e85bdcc6 ("crypto/dpaa_sec: add crypto driver for NXP DPAA platform")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agonet/nfp: add CPP bridge as service
Alejandro Lucero [Fri, 11 Jan 2019 13:25:53 +0000 (13:25 +0000)]
net/nfp: add CPP bridge as service

The Netronome's Network Flow Processor chip is highly programmable
with the goal of processing packets at high speed. Processing units
and other chip components are available from the host through the
PCIe CPP(Command Push Pull bus) interface. The NFP PF PMD configures
a CPP handler for setting up and working with vNICs, perform actions
like link up or down, or accessing extended stats from the MAC component.

There exist NFP host tools which access the NFP components for
programming and debugging but they require the CPP interface. When the
PMD is bound to the PF, the DPDK app owns the CPP interface, so these
host tools can not access the NFP through other means like NFP kernel
drivers.

This patch adds a CPP bridge using the rte_service API which can be
enabled by a DPDK app. Interestingly, DPDK clients like OVS will not
enable specific service cores, but this can be performed with a
secondary process specifically enabling this CPP bridge service and
therefore giving access to the NFP to those host tools.

Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/enic: remove redundant log level check
Hyong Youb Kim [Mon, 14 Jan 2019 15:01:22 +0000 (07:01 -0800)]
net/enic: remove redundant log level check

Fixes: 8d496995346c ("net/enic: support multicast filtering")
Cc: stable@dpdk.org
Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/enic: remove useless include
Hyong Youb Kim [Mon, 14 Jan 2019 15:01:21 +0000 (07:01 -0800)]
net/enic: remove useless include

libgen.h is not used, so do not include it.

Fixes: fefed3d1e62c ("enic: new driver")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
5 years agonet/mlx5: validate TOS and TTL on E-Switch
Viacheslav Ovsiienko [Sun, 13 Jan 2019 14:15:24 +0000 (14:15 +0000)]
net/mlx5: validate TOS and TTL on E-Switch

This patch adds the type-of-service and time-to-live IP header
fields validation on E-Switch, both for match pattern and
VXLAN encapsulation action IP header itesm. The E-Switch flows
will use the common mlx5_flow_validate_item_ipv4/6 routines
with added extra parameter, specifying the supported fields
mask.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: support TOS and TTL fields on E-Switch
Viacheslav Ovsiienko [Sun, 13 Jan 2019 14:15:23 +0000 (14:15 +0000)]
net/mlx5: support TOS and TTL fields on E-Switch

This patch adds the type-of-service and time-to-live IP header
fields support on E-Switch. There match pattern for both fields
with masking is added. Also these fields can be set for VXLAN
tunnel encapsulation header.

This issue is critical for some Open VSwitch configuration
on overlayed (tunneled) networks, where the tos field can be
inherited from outer header to inner header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add TOS and TTL flower match and tunnel keys
Viacheslav Ovsiienko [Sun, 13 Jan 2019 14:15:22 +0000 (14:15 +0000)]
net/mlx5: add TOS and TTL flower match and tunnel keys

This patch is a preparation for adding the type-of-service and
time-to-live IP header fields support on E-Switch. There are
two types of keys added - one for match pattern, other for
tunnel encapsulation header.

This issue is critical for some Open VSwitch configuration
on overlayed (tunneled) networks, where the tos field can be
inherited from outer header to inner header.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add RHEL-7.2 VXLAN device metadata workaround
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:40 +0000 (19:55 +0000)]
net/mlx5: add RHEL-7.2 VXLAN device metadata workaround

RH7.2 with kernel 3.10.0-327 does not support VXLAN
devices metadata and IFLA_VXLAN_COLLECT_METADATA
key is neither defined nor supported. We must specify
VNI parameter, which will be actually ignored by kernel,
applied rules will be processed by mlx5 kernel driver
and the actual VNI from rules will be used.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: switch to detached VXLAN network devices
Viacheslav Ovsiienko [Sat, 29 Dec 2018 19:55:39 +0000 (19:55 +0000)]
net/mlx5: switch to detached VXLAN network devices

Current design uses the VXLAN virtual devices attached
to outer network interface for decapsulation. Kernel
allows to use non-attached devices, so now we can create
not attached device and use it both for encapsulation
and decapsulation. Devices management becomes simpler,
less VXLAN devices are created and used.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>