dpdk.git
5 years agonet/atlantic: fix flow control by sync settings on Rx
Pavel Belous [Mon, 29 Apr 2019 08:20:23 +0000 (08:20 +0000)]
net/atlantic: fix flow control by sync settings on Rx

Driver should track negotiated PHY flow control settings during
link state changes and update MAC level flow control configuration.

Otherwise there could be unexpected pause frames generation which
could lockup the datapath.

Fixes: 4c1c8f76463f ("net/atlantic: add flow control configuration")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: fix offsets for talking with firmware
Pavel Belous [Mon, 29 Apr 2019 08:20:21 +0000 (08:20 +0000)]
net/atlantic: fix offsets for talking with firmware

EEPROM write accesses start using non zero configuration memory
accesses. This revealed an issue where firmware interface was actually
always did the uploads starting with zero offset

Fixes: 86d36773bd42 ("net/atlantic: implement firmware operations")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: check EEPROM dev address validity
Igor Russkikh [Mon, 29 Apr 2019 08:20:19 +0000 (08:20 +0000)]
net/atlantic: check EEPROM dev address validity

Clients may not filling magic field, thus causing garbage
to be passed as a device address.

Limit that to maximum SMbus address.

Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix max EEPROM size
Igor Russkikh [Mon, 29 Apr 2019 08:20:17 +0000 (08:20 +0000)]
net/atlantic: fix max EEPROM size

Maximum size should be 256 bytes.
Move declaration to the top of the file

Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: consider EEPROM get/set offset
Pavel Belous [Mon, 29 Apr 2019 08:20:15 +0000 (08:20 +0000)]
net/atlantic: consider EEPROM get/set offset

EEPROM get/set offset logic should take offset into account.
Data transfers to/from FW should also correctly use
dword based transfer interface, taking into account the
remainder.
We also check error code returned from FW.

Fixes: ce4e8d418097 ("net/atlantic: implement EEPROM get/set")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: fix indentation
Igor Russkikh [Mon, 29 Apr 2019 08:20:13 +0000 (08:20 +0000)]
net/atlantic: fix indentation

Make indentation correct. No functional impact.

Fixes: f73061d53b5a ("net/atlantic: use EEPROM magic as a device address")

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: enable broadcast traffic
Igor Russkikh [Mon, 29 Apr 2019 08:20:09 +0000 (08:20 +0000)]
net/atlantic: enable broadcast traffic

Broadcast was not correctly and fully initialized

Fixes: 7906661edac6 ("net/atlantic: add b0 hardware layer")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/i40e: fix queue number check
Wei Zhao [Sun, 28 Apr 2019 06:13:18 +0000 (14:13 +0800)]
net/i40e: fix queue number check

Remove invalid queue number check which cause unexpected error return.

Fixes: ac8d22de2394 ("ethdev: flatten RSS configuration in flow API")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx4: support multicast address list interface
Adrien Mazarguil [Thu, 18 Apr 2019 13:10:34 +0000 (15:10 +0200)]
net/mlx4: support multicast address list interface

Since this driver does not distinguish unicast/multicast addresses,
applications could always rely on the standard MAC add/remove/set
interface to configure both types.

As a result, the multicast address list interface never got implemented
(rte_eth_dev_set_mc_addr_list()) however PMD-agnostic applications still
rely on it for compatibility reasons; a wrapper is therefore required.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: update memory event callback for shared context
Viacheslav Ovsiienko [Sat, 27 Apr 2019 04:32:57 +0000 (04:32 +0000)]
net/mlx5: update memory event callback for shared context

Mellanox mlx5 PMD implements the list of devices to process the memory
free events to reflect the actual memory state to Memory Regions.
Because this list contains the devices and devices may share the
same context the callback routine may be called multiple times
with the same parameter, that is not optimal. This patch modifies
the list to contain the device contexts instead of device objects
and shared context is included in the list only once.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: share Memory Regions for multiport device
Viacheslav Ovsiienko [Sat, 27 Apr 2019 04:32:56 +0000 (04:32 +0000)]
net/mlx5: share Memory Regions for multiport device

The multiport Infiniband device support was introduced [1].
All active ports, belonging to the same Infiniband device use the single
shared Infiniband context of that device and share the resources:
  - QPs are created within shared context
  - Verbs flows are also created with specifying port index
  - DV/DR resources
  - Protection Domain
  - Event Handlers

This patchset adds support for Memory Regions sharing between
ports, created on the base of multiport Infiniband device.
The datapath of mlx5 uses the layered cache subsystem for
allocating/releasing Memory Regions, only the lowest layer L3
is subject to share due to performance issues.

[1] http://patches.dpdk.org/cover/51800/

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: inherit master link settings for representors
Viacheslav Ovsiienko [Sat, 27 Apr 2019 04:19:58 +0000 (04:19 +0000)]
net/mlx5: inherit master link settings for representors

There are some physical link settings can be queried from
Ethernet devices: link status, link speed, speed capabilities,
duplex mode, etc. These setting do not make a lot of sense for
representors due to missing physical link. The new kernel drivers
dropped query for link settings for representors causing the
ioctl call to fail. This patch adds some kind of emulation
of link settings to PMD - representors inherit the link parameters
from the master device. The actual link status (up/down)
is retrieved from the representor device.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix modification action flags
Ori Kam [Mon, 22 Apr 2019 18:06:56 +0000 (18:06 +0000)]
net/mlx5: fix modification action flags

When creating the modify action using Direct Rules, we need to
add flags to mark, if the action will be done on root table or on
private table.

Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/ice: fix Rx statistics
Simei Su [Wed, 24 Apr 2019 07:06:10 +0000 (15:06 +0800)]
net/ice: fix Rx statistics

The RX stats will increase even no packets sent, this patch fix this issue
by modifying ipackets and ibytes statistics based on vsi instead of port
to avoid statistics error.

Fixes: a37bde56314d ("net/ice: support statistics")
Cc: stable@dpdk.org
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/dpaa2: fix loop increment
Shreyansh Jain [Thu, 25 Apr 2019 13:34:56 +0000 (19:04 +0530)]
net/dpaa2: fix loop increment

Identified by LGTM, the loop was incorrectly incrementing a different
variable and conditional on another.

Fixes: fe2b986ac662 ("net/dpaa2: support generic flow")

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agoapp/testpmd: fix unintentional integer overflow
Tiwei Bie [Wed, 24 Apr 2019 02:29:31 +0000 (10:29 +0800)]
app/testpmd: fix unintentional integer overflow

Fix the potential overflow in expression 1 << begin by using 1ULL.

Coverity issue: 279437, 279445
Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/kni: fix return value check
Ferruh Yigit [Tue, 23 Apr 2019 15:36:21 +0000 (16:36 +0100)]
net/kni: fix return value check

'rte_kni_release()' return value is not checked, adding it.

Coverity issue: 336837
Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ring: fix return value check
Ferruh Yigit [Tue, 23 Apr 2019 15:23:32 +0000 (16:23 +0100)]
net/ring: fix return value check

'rte_eth_dev_get_port_by_name()' return value is not checked caught by
coverity, adding return value check.

Coverity issue: 305853
Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/ring: check length of ring name
Stephen Hemminger [Tue, 23 Apr 2019 16:53:35 +0000 (09:53 -0700)]
net/ring: check length of ring name

The ring name is passed in as part of this drivers API, but it
doesn't check that the name is not truncated.

Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
Fixes: e1e4017751f1 ("ring: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ring: use calloc style where appropriate
Stephen Hemminger [Tue, 23 Apr 2019 16:53:34 +0000 (09:53 -0700)]
net/ring: use calloc style where appropriate

Use rte_calloc_socket instead of computing size.

Fixes: 651c505af862 ("ring: enhance device setup from rings")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ring: avoid hard-coded length
Stephen Hemminger [Tue, 23 Apr 2019 16:53:33 +0000 (09:53 -0700)]
net/ring: avoid hard-coded length

Don't hard code string length in two place; use sizeof() instead.
Ring name should use RTE_RING_NAMESIZE.

Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ring: fix coding style
Stephen Hemminger [Tue, 23 Apr 2019 16:53:32 +0000 (09:53 -0700)]
net/ring: fix coding style

Whitespace fixes to bring inline with current DPDK style.

Fixes: e1e4017751f1 ("ring: add new driver")
Fixes: a74a99bbb8ed ("ring: free rings when detaching device")
Fixes: 61934c0956d4 ("ring: convert to use of PMD_REGISTER_DRIVER and fix linking")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/ice: fix possible null pointer dereference
Wenzhuo Lu [Wed, 24 Apr 2019 02:43:42 +0000 (10:43 +0800)]
net/ice: fix possible null pointer dereference

Fix the issues reported by Coverity check, "Null-checking
vsi suggests that it may be null, but it has already been
dereferenced on all paths leading to the check."

Coverity issue: 328509, 328519, 328523
Fixes: e0dcf94a0d7f ("net/ice: support VLAN ops")
Fixes: ff963bfa7cb1 ("net/ice: support RSS")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agoapp/testpmd: fix help info for interactive commands
Agalya Babu RadhaKrishnan [Tue, 23 Apr 2019 13:51:56 +0000 (14:51 +0100)]
app/testpmd: fix help info for interactive commands

Added some missing help info for interactive mode commands

Fixes: 6673fe0ce213 ("app/testpmd: add TM commands to mark packets")
Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Fixes: e977e4199a8d ("app/testpmd: add commands to load/unload BPF filters")
Fixes: c18feafa193c ("app/testpmd: support metadata as flow rule item")
Cc: stable@dpdk.org
Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix interactive commands in testpmd guide
Agalya Babu RadhaKrishnan [Tue, 23 Apr 2019 10:44:27 +0000 (11:44 +0100)]
doc: fix interactive commands in testpmd guide

Added some missing documentation for interactive mode commands

Fixes: 01b2092a5e4b ("testpmd: add dump commands for debug")
Fixes: caf05a1b8608 ("app/testpmd: new command to dump log types")
Fixes: 0f62d63593ed ("app/testpmd: support tunneled TSO in checksum engine")
Fixes: 8fff667578a7 ("app/testpmd: new command to add/remove multicast MAC addresses")
Fixes: ae03d0d18adf ("app/testpmd: command to configure MTU")
Fixes: f79959ea1504 ("app/testpmd: allow to configure RSS hash key")
Fixes: caf05a1b8608 ("app/testpmd: new command to dump log types")
Cc: stable@dpdk.org
Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agonet/sfc: fix MTU change to check Rx scatter consistency
Igor Romanov [Tue, 23 Apr 2019 08:14:30 +0000 (09:14 +0100)]
net/sfc: fix MTU change to check Rx scatter consistency

Rx queue setup function checks configured MTU to make sure that
no oversized packets can be received. But a following call to
set MTU function might make this check irrelevant.

Add a function to check MTU size against Rx buffer size and
additional Rx queue info, including Rx scatter offload.

Fixes: e961cf425e02 ("net/sfc: support MTU change")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/mlx5: fix probing if DevX disabled
Viacheslav Ovsiienko [Mon, 22 Apr 2019 12:38:17 +0000 (12:38 +0000)]
net/mlx5: fix probing if DevX disabled

If there is the support of DevX is exposed by rdma-core but
DevX is not supported by or disabled for the specific interface
the mlx5_devx_cmd_query_hca_attr() routine returns an error
preventing the device from successful probing. The routine
should be invoked only in case of enabled DevX.

Fixes: e2b4925ef7c1 ("net/mlx5: support Direct Rules E-Switch")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix comments mixing Rx and Tx
Dekel Peled [Mon, 22 Apr 2019 15:24:11 +0000 (18:24 +0300)]
net/mlx5: fix comments mixing Rx and Tx

In mlx5_rxq.c, in some comments, text includes "Tx" instead of "Rx".
In mlx5_txq.c, in some comments, text includes "Rx" instead of "Tx".

This patch fixes these typos.

Fixes: faf2667fe8d5 ("net/mlx5: separate DPDK from verbs Tx queue objects")
Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix Direct Rules build
Yongseok Koh [Sat, 20 Apr 2019 00:02:43 +0000 (17:02 -0700)]
net/mlx5: fix Direct Rules build

All the library calls must be called via the glue layer.

Fixes: b2177648b8de ("net/mlx5: add Direct Rules flow data alloc/free routines")
Fixes: 79e35d0d5979 ("net/mlx5: share Direct Rules/Verbs flow related structures")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: replace a port lookup with ethdev API
Thomas Monjalon [Thu, 18 Apr 2019 00:15:29 +0000 (02:15 +0200)]
net/mlx5: replace a port lookup with ethdev API

Looking for an ethdev port is better (and more efficient)
with an ethdev API than an EAL one.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix initialization for flow group
Ori Kam [Sun, 14 Apr 2019 20:18:55 +0000 (20:18 +0000)]
net/mlx5: fix initialization for flow group

The flow group should be initialized.
For example selecting if the encapsulation is for root or private tables
is based on the flow->group value.

Fixes: 4f84a19779ca ("net/mlx5: add Direct Rules API")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agodoc: update ice guide for MDD
Wenzhuo Lu [Fri, 12 Apr 2019 03:33:47 +0000 (11:33 +0800)]
doc: update ice guide for MDD

Update ICE document to describe a MDD event.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/iavf: fix stats reset
Qiming Yang [Mon, 22 Apr 2019 02:18:37 +0000 (10:18 +0800)]
net/iavf: fix stats reset

stats_reset has been missed when support stats in iavf driver.
This patch add statistics reset function.

Fixes: f4a41a6953af ("net/avf: support stats")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agotimer: fix reset/stop in callback for new API
Erik Gabriel Carrillo [Fri, 26 Apr 2019 14:41:24 +0000 (09:41 -0500)]
timer: fix reset/stop in callback for new API

The rte_timer_alt_manage function should track which is the running
timer and whether or not it was updated by a callback in the priv_timer
structure that corresponds to the running lcore, so that restarting
or stopping the timer from the callback works correctly.

Fixes: c0749f7096c7 ("timer: allow management in shared memory")

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agotimer: fix pointer to local outside scope
Erik Gabriel Carrillo [Wed, 24 Apr 2019 14:33:50 +0000 (09:33 -0500)]
timer: fix pointer to local outside scope

A null array is allowed to be passed as one of the parameters to
rte_timer_alt_manage() as a convenience.  When that happened, an
anonymous array was created using compound literal syntax, and Coverity
detected that the object was out of scope in later uses of it. Create
an object in the proper scope instead.

Coverity issue: 337919
Fixes: c0749f7096c7 ("timer: allow management in shared memory")

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agoevent/dsw: fix capability flags
Mattias Rönnblom [Fri, 3 May 2019 16:45:53 +0000 (18:45 +0200)]
event/dsw: fix capability flags

The DSW event device didn't set RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT
and RTE_EVENT_DEV_CAP_NONSEQ_MODE, even though it has both these
capabilities.

Fixes: 4540ee9c68 ("event/dsw: add device and queue configuration")
Cc: stable@dpdk.org
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agovfio: expand non-viable group error message
Kevin Traynor [Fri, 26 Apr 2019 16:22:30 +0000 (17:22 +0100)]
vfio: expand non-viable group error message

"VFIO group is not viable" error message is correct
but not very user friendly for something which can
usually be easily rectified.

Add some additional text to give more of a hint.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agopower: clarify comment about SST-BF priority core
David Hunt [Thu, 2 May 2019 11:18:15 +0000 (12:18 +0100)]
power: clarify comment about SST-BF priority core

As part of the documentation update on the changes made to the power
library for 19.05, information on SST-BF was added. This patch updates
the comment to clarify that a priority core is an SST-BF high
frequency core.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: add SST-BF info
David Hunt [Thu, 2 May 2019 11:18:13 +0000 (12:18 +0100)]
doc: add SST-BF info

In the Power Library, a new bit has been added to the mask returned by
rte_power_get_capabilities which indicates whether the core is an
Intel SST-BF high frequency core.

The distributor sample application has been enhanced to be aware of
Intel SST-BF high frequency cores. Docs also contain a link to
the Intel SST-BF application note.

Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoipc: replace bool checks with explicit non-zero
Thomas Monjalon [Fri, 3 May 2019 15:35:39 +0000 (17:35 +0200)]
ipc: replace bool checks with explicit non-zero

The function check_input() was returning a bool as error code.
It is changed to return an int, semantically more correct.
While at it, make checks of validate_action_name() return
explicit as described in the coding guidelines.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agomaintainers: claim maintainership of IPC
Anatoly Burakov [Thu, 25 Apr 2019 13:17:51 +0000 (14:17 +0100)]
maintainers: claim maintainership of IPC

IPC is a big part of secondary process infrastructure now,
and I have been de-facto maintainer for it since 18.05.
Update MAINTAINERS file to match.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoipc: handle more invalid parameter cases
Anatoly Burakov [Mon, 29 Apr 2019 13:59:28 +0000 (14:59 +0100)]
ipc: handle more invalid parameter cases

Length of buffer and number of fd's to send are signed values, so
they can be negative, but the API doesn't check for that. Fix it
by checking for negative values as well.

Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoipc: harden message receive
Anatoly Burakov [Mon, 29 Apr 2019 14:22:50 +0000 (15:22 +0100)]
ipc: harden message receive

Currently, IPC does not check received messages for invalid data
and passes them to user code unchanged. This may result in buffer
overruns on reading message data. Fix this by checking the message
length and fd number on receive, and discard any messages that
are not valid.

Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoipc: fix send error handling
Anatoly Burakov [Fri, 26 Apr 2019 10:27:17 +0000 (11:27 +0100)]
ipc: fix send error handling

According to manpage, ENOBUFS error indicates that either the
input or the output queue is full. This should be considered
an error, but it is treated as an "ignore" condition. Fix the
code to report an error instead.

Fixes: bacaa2754017 ("eal: add channel for multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/tap: fix memory leak on IPC request
Herakliusz Lipiec [Thu, 25 Apr 2019 12:48:17 +0000 (13:48 +0100)]
net/tap: fix memory leak on IPC request

When sending synchronous IPC requests, the caller must free the response
buffer if the request was successful and reply is no longer needed.
Fix the code to correctly
use the IPC API.

Bugzilla ID: 228
Fixes: c9aa56edec8e ("net/tap: access primary process queues from secondary")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agoipc: fix memory leak on request failure
Herakliusz Lipiec [Thu, 25 Apr 2019 12:48:16 +0000 (13:48 +0100)]
ipc: fix memory leak on request failure

When sending multiple requests, rte_mp_request_sync
can succeed sending a few of those requests, but then
fail on a later one and in the end return with rc=-1.
The upper layers - e.g. device hotplug - currently
handles this case as if no messages were sent and no
memory for response buffers was allocated, which is
not true. Fixed by always freeing memory buffers on
failure.

Bugzilla ID: 228
Fixes: 783b6e54971d ("eal: add synchronous multi-process communication")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: fix formatting of hotplug error message
Stephen Hemminger [Wed, 24 Apr 2019 16:46:19 +0000 (09:46 -0700)]
eal: fix formatting of hotplug error message

This message was missing newline, and should capitalize
"Cannot" like all the others in this area.

Fixes: ac9e4a17370f ("eal: support attach/detach shared device from secondary")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agoexamples/power: fix json null termination
David Hunt [Fri, 26 Apr 2019 14:04:54 +0000 (15:04 +0100)]
examples/power: fix json null termination

coverity complains about a null-termination after a read,
so we terminate once we exit the do-while read loop.

Coverity issue: 337680
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/power: fix buffer overrun
David Hunt [Fri, 26 Apr 2019 08:42:09 +0000 (09:42 +0100)]
examples/power: fix buffer overrun

The freqs array in freq_info struct has RTE_MAX_LCORE_FREQS elements,
yet the code can attempt to look at the index at  RTE_MAX_LCORE,
which may be greater than RTE_MAX_LCORE_FREQS. Fix to limit index to
RTE_MAX_LCORE_FREQS.

Coverity issue: 337660
Fixes: d26c18c93260 ("examples/vm_power: cpu frequency in host")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agoexamples/multi_process: fix buffer underrun
Yongseok Koh [Wed, 10 Apr 2019 19:41:54 +0000 (12:41 -0700)]
examples/multi_process: fix buffer underrun

For client_server_mp, the total number of buffers for the mbuf mempool
should be correctly calculated. Otherwise, having more clients will stop
traffic.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
5 years agoexamples/l3fwd: support separate buffer pool per port
Shreyansh Jain [Thu, 25 Apr 2019 09:40:19 +0000 (15:10 +0530)]
examples/l3fwd: support separate buffer pool per port

Traditionally, only a single buffer pool per port
(or, per-port-per-socket) is created in l3fwd application.

If separate pools are created per-port, it might lead to gain in
performance as packet alloc/dealloc requests would be isolated
across ports (and their corresponding lcores).

This patch adds an argument '--per-port-pool' to the l3fwd application.
By default, old mode of single pool per port (split on sockets) is
active.

L3fwd user guide is also updated by this patch.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
5 years agodoc: fix spelling reported by aspell in comments
John McNamara [Fri, 26 Apr 2019 15:14:22 +0000 (16:14 +0100)]
doc: fix spelling reported by aspell in comments

Fix spelling errors in the doxygen docs.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
5 years agodoc: fix spelling reported by aspell in guides
John McNamara [Fri, 26 Apr 2019 15:14:21 +0000 (16:14 +0100)]
doc: fix spelling reported by aspell in guides

Fix spelling errors in the guide docs.

Signed-off-by: John McNamara <john.mcnamara@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agoraw/ifpga: fix file descriptor leak in error path
Li Qiang [Tue, 16 Apr 2019 05:05:14 +0000 (13:05 +0800)]
raw/ifpga: fix file descriptor leak in error path

In rte_fpga_do_pr() function, if 'stat' return error the
'file_fd' is never closed thus leading a fd leak.
This patch avoids this.

Coverity issue: 279441
Fixes: ef1e8ede3da59e ("raw/ifpga: add Intel FPGA bus rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Li Qiang <liq3ea@163.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
5 years agoraw/dpaa2_cmdif: remove driver name assignment
Hemant Agrawal [Wed, 24 Apr 2019 11:45:20 +0000 (17:15 +0530)]
raw/dpaa2_cmdif: remove driver name assignment

vdev driver names are not available in create if called from probe.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agodoc: update dpaaX platform guides
Hemant Agrawal [Wed, 24 Apr 2019 11:45:19 +0000 (17:15 +0530)]
doc: update dpaaX platform guides

Update the dpaa platform guides with latest SDK dependency.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agonet/dpaa2: fix loopback spelling
Hemant Agrawal [Wed, 24 Apr 2019 11:45:18 +0000 (17:15 +0530)]
net/dpaa2: fix loopback spelling

Fixes: a3a997f02d07 ("net/dpaa2: support low level loopback tester")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoraw/dpaa2_qdma: fix spin lock release
Hemant Agrawal [Wed, 24 Apr 2019 11:45:17 +0000 (17:15 +0530)]
raw/dpaa2_qdma: fix spin lock release

This shall be unlock post the lock

Fixes: 4d9a3f2a0159 ("raw/dpaa2_qdma: support RBP mode")

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoraw/dpaa2_qdma: fix spin lock release
Hemant Agrawal [Wed, 24 Apr 2019 11:45:16 +0000 (17:15 +0530)]
raw/dpaa2_qdma: fix spin lock release

The code shall be unlock post the lock.

Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agobuild: add libbsd to pkg-config file if enabled
Bruce Richardson [Thu, 2 May 2019 16:51:54 +0000 (17:51 +0100)]
build: add libbsd to pkg-config file if enabled

If libbsd is enabled in DPDK, the strlcpy and strlcat functions in
rte_string_fns.h redirect to the varients in libbsd, only using the
fallbacks if it is not enabled. Therefore, if libbsd is enabled, it needs
to be called out as a DPDK dependency in the pkgconfig file.

To ensure that we don't have undefined variables on non-Linux platforms, we
can remove the linux condition around the libbsd check - no harm comes in
looking for it on other OS, since it's an optional dependency.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: fix ninja install on FreeBSD
Bruce Richardson [Thu, 2 May 2019 16:51:53 +0000 (17:51 +0100)]
build: fix ninja install on FreeBSD

The post-install script to symlink the PMDs from their own PMD directory to
the regular lib directory (so they would be found by ld at runtime) was
using the "-r" flag to ln to create relative symlinks. This flag is
unsupported by ln on FreeBSD causing the ninja install step to fail.

Reworking the script to take the relative driver path as parameter removes
the need for ln to calculate the relative path ensuring compatibility with
FreeBSD.

As part of the fix, we move the registration of the install script to the
config/meson.build file, from the top level one. This improves readability
as the script takes as parameters the variables set in that file.

Fixes: ed4d43d73e2b ("build: symlink drivers to library directory")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples: install as part of ninja install
Bruce Richardson [Thu, 2 May 2019 16:51:52 +0000 (17:51 +0100)]
examples: install as part of ninja install

When we install dpdk onto a system, we want to put the examples into
the /usr/share/dpdk (or /usr/local/share) directory for reference.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/l3fwd: fix build on FreeBSD
Bruce Richardson [Thu, 2 May 2019 16:51:51 +0000 (17:51 +0100)]
examples/l3fwd: fix build on FreeBSD

On freebsd we need to include sys/socket.h to get the definition of
AF_INET in order to compile.

Fixes: d5ceea4ab160 ("examples/l3fwd: format IP addresses for printing")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agomk: disable warning for packed member pointer
Reshma Pattan [Thu, 2 May 2019 09:33:34 +0000 (10:33 +0100)]
mk: disable warning for packed member pointer

gcc 9 on Fedora 30 gives an error
"taking address of packed member may result in an
unaligned pointer value" warnings.

For clang builds this warning is already disabled,
so disable "-Waddress-of-packed-member" for gcc builds
also.

Snippet of build error:
lib/librte_eal/linux/eal/eal_memalloc.c: In function ‘alloc_seg_walk’:
lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error:
taking address of packed member of ‘struct rte_mem_config’ may result
in an unaligned pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
5 years agomaintainers: fix added or removed files
Thomas Monjalon [Thu, 2 May 2019 14:53:45 +0000 (16:53 +0200)]
maintainers: fix added or removed files

Reference to test/Makefile was forgotten when removing this file.
Reference to app/test/test_rcu* was forgotten when adding the files.

Fixes: a9de470cc7c0 ("test: move to app directory")
Fixes: b87089b0bb19 ("test/rcu: add API and functional tests")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agobuild: reduce indentation in meson check
Ferruh Yigit [Thu, 2 May 2019 13:35:27 +0000 (14:35 +0100)]
build: reduce indentation in meson check

Just syntax change to reduce indentation, no functional change.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: fix crash by disabling AVX512 with binutils 2.31
Ferruh Yigit [Thu, 2 May 2019 13:35:26 +0000 (14:35 +0100)]
build: fix crash by disabling AVX512 with binutils 2.31

On Skylake platform, with native build, KNI kernel module crashes
because of the corrupted values passed to kernel module.

The corruption occurs because the userspace kni library works
unexpectedly. Compiler [1] is using AVX512 instructions and generated
binary is wrong [2].

It turned around gcc does its job correct, but gas is generating binary
wrong. And expected binutils 2.30, 2.31 & 2.31.1 are affected. Issue has
been fixed in binutils 2.32 with:
Commit x86: don't mistakenly scale non-8-bit displacements

AVX512 was already disabled with bintuils 2.30 [3], extending it to
2.31 & 2.31.1 too.

[1] gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)

[2] gcc bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90028

[3] Bugzilla ID 97 has the details.

Bugzilla ID: 249
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: fix meson binutils workaround
Ferruh Yigit [Thu, 2 May 2019 13:35:25 +0000 (14:35 +0100)]
build: fix meson binutils workaround

The '-mno-avx512f' compiler flag is not passed to the compiler,
detection of the binutils and setting flags works fine, but the flag
itself not used by compiler.

Removing the interim 'march_opt' variable and using directly
'machine_args' and setting '-mno-avx512f' to 'machine_args'

Fixes: 566b4d7a968f ("build: fix meson check for binutils 2.30")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoraw/dpaa2_cmdif: fix warnings with GCC 9
Bruce Richardson [Wed, 1 May 2019 19:50:14 +0000 (20:50 +0100)]
raw/dpaa2_cmdif: fix warnings with GCC 9

GCC9 gives warnings if the parameter passed to printf for "%s" could be
NULL, so we need to add checks in some cases to ensure that is not the
case.

Fixes: 3298fa4853b8 ("raw/dpaa2_cmdif: introduce DPAA2 command interface driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoraw/skeleton: fix warnings with GCC 9
Bruce Richardson [Wed, 1 May 2019 19:50:13 +0000 (20:50 +0100)]
raw/skeleton: fix warnings with GCC 9

GCC9 gives warnings if the parameter passed to printf for "%s" could be
NULL, so we need to add checks in some cases to ensure that is not the
case.

Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobus/fslmc: fix warning with GCC 9
Bruce Richardson [Wed, 1 May 2019 19:50:12 +0000 (20:50 +0100)]
bus/fslmc: fix warning with GCC 9

Printing a null pointer with %s is flagged as a warning by GCC 9, and
should not be done. Replace the %s with the word "null" itself.

Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agonet/ixgbe: fix warning with GCC 9
Bruce Richardson [Wed, 1 May 2019 19:50:11 +0000 (20:50 +0100)]
net/ixgbe: fix warning with GCC 9

Compiling on Fedora 30, we get the following warning, causing build failure
when Werror flag is set:

../drivers/net/ixgbe/ixgbe_rxtx.c:2141:14: warning:
‘nmb’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 2141 |    rxe->mbuf = nmb;
      |    ~~~~~~~~~~^~~~~

Initializing the value to "NULL" fixes the issue.

Fixes: 8eecb3295aed ("ixgbe: add LRO support")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agocrypto/zuc: fix dependency check
Bruce Richardson [Wed, 1 May 2019 15:53:29 +0000 (16:53 +0100)]
crypto/zuc: fix dependency check

The check for the zuc library dependency did not check for the include
file needed for compilation. It's also recommended when looking for a
library to use the name without the lib prefix.

Fixes: df1740a8db5f ("crypto/zuc: enable meson build")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agocrypto/kasumi: fix dependency check
Bruce Richardson [Wed, 1 May 2019 15:53:28 +0000 (16:53 +0100)]
crypto/kasumi: fix dependency check

The check for the kasumi library dependency did not check for the include
file needed for compilation. It's also recommended when looking for a
library to use the name without the lib prefix.

Fixes: 2ec2d46c6255 ("crypto/kasumi: enable meson build")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agocrypto/snow3g: add to meson build
Bruce Richardson [Wed, 1 May 2019 15:53:27 +0000 (16:53 +0100)]
crypto/snow3g: add to meson build

Snow3G driver is missing support for building with meson. Add a new
meson.build file so it can be included in the builds.

Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodevtools: fix ABI compatibility check
Peng Huang [Wed, 24 Apr 2019 15:11:59 +0000 (15:11 +0000)]
devtools: fix ABI compatibility check

The new default-taget "linux" is introduced in v19.05-rc1
but not exist in before release such as v19.02 which have
default-target "linuxapp", there is no compatibility report
when run validate-abi.sh to check ABI compatibility between
v19.05-rc1 and v19.02, changed default-target from "linux"
to "linuxapp" in validate-abi.sh

Fixes: 218c4e68c1d9 ("mk: use linux and freebsd in config names")
Cc: stable@dpdk.org
Signed-off-by: Peng Huang <peng.huang@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agodoc: add RCU guide
Honnappa Nagarahalli [Wed, 1 May 2019 03:54:18 +0000 (22:54 -0500)]
doc: add RCU guide

Add lib RCU QSBR programmer guide documentation.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agotest/rcu: add API and functional tests
Dharmik Thakkar [Wed, 1 May 2019 03:54:17 +0000 (22:54 -0500)]
test/rcu: add API and functional tests

Add API positive/negative test cases, functional tests and
performance tests.

Signed-off-by: Malvika Gupta <malvika.gupta@arm.com>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agorcu: add RCU library supporting QSBR mechanism
Honnappa Nagarahalli [Wed, 1 May 2019 03:54:16 +0000 (22:54 -0500)]
rcu: add RCU library supporting QSBR mechanism

Add RCU library supporting quiescent state based memory reclamation method.
This library helps identify the quiescent state of the reader threads so
that the writers can free the memory associated with the lock less data
structures.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ola Liljedahl <ola.liljedahl@arm.com>
Acked-by: Paul E. McKenney <paulmck@linux.ibm.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoeventdev: add experimental tag back for Rx adapter
Nikhil Rao [Fri, 26 Apr 2019 16:33:36 +0000 (22:03 +0530)]
eventdev: add experimental tag back for Rx adapter

Add the experimental tag back to the Rx event adapter callback,
the Rx event callback register and the Rx event adapter statistics
retrieval functions due to an API change to be proposed in a
future patch.

This patch also adds the experimental tag to these
function definitions and adds the functions to the EXPERIMENTAL
section of the map file, these were missing previously.

Fixes: 80bdf91dc8ee ("eventdev: promote adapter functions as stable")

Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoeventdev: fix crypto adapter
Abhinandan Gujjar [Wed, 24 Apr 2019 16:34:38 +0000 (22:04 +0530)]
eventdev: fix crypto adapter

This patch fixes null pointer dereference and control
flow issues reported in event crypto adapter by coverity

Coverity issue: 279439, 279446, 279450, 279462
Fixes: 7901eac3409 ("eventdev: add crypto adapter implementation")
Cc: stable@dpdk.org
Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agodoc: update guide and release notes for QAT crypto
Arek Kusztal [Thu, 18 Apr 2019 16:45:04 +0000 (17:45 +0100)]
doc: update guide and release notes for QAT crypto

This patch adds release notes to 19.05 release document, and more
detailed description to Intel QuickAssist Technology driver
documentation files for asymmmetric crypto PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
5 years agocrypto/octeontx: use distinct metabuf pool for each queue
Anoob Joseph [Thu, 18 Apr 2019 05:20:29 +0000 (10:50 +0530)]
crypto/octeontx: use distinct metabuf pool for each queue

The metabuf pool is shared across all queue pairs belonging to the
PMD. In order to prevent one queue pair from starving another,
use a distinct mempool for each queue pair.

Fixes: 273487f7b381 ("crypto/octeontx: add global resource init")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agocrypto/qat: fix null cipher algo for non 8-byte multiple
Fiona Trahe [Fri, 26 Apr 2019 19:28:03 +0000 (20:28 +0100)]
crypto/qat: fix null cipher algo for non 8-byte multiple

NULL cipher algo of 4-byte multiple and other sizes caused firmware hang
due to use of wrong mode. Changed from ECB mode to CTR mode to fix.

Fixes: 98f060891615 ("crypto/qat: add symmetric session file")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocryptodev: include dependency in asym header
Ayuj Verma [Tue, 23 Apr 2019 15:41:03 +0000 (21:11 +0530)]
cryptodev: include dependency in asym header

include rte_crypto_sym.h in asym header file.

Signed-off-by: Ayuj Verma <ayverma@marvell.com>
Signed-off-by: Shally Verma <shallyv@marvell.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/aesni_gcm: check dependency version with make
Bruce Richardson [Tue, 23 Apr 2019 15:43:57 +0000 (16:43 +0100)]
crypto/aesni_gcm: check dependency version with make

The aesni_mb driver has a check in its Makefile for the correct version of
the IPsec_MB library, but this check was missed for the aesni_gcm driver.
Add this check to the makefile, removing an unnecessary assignment in the
process.

Suggested-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agocrypto/aesni_mb: cleanup version check
Bruce Richardson [Tue, 23 Apr 2019 15:43:56 +0000 (16:43 +0100)]
crypto/aesni_mb: cleanup version check

The version check for the IPSec_MB library present in the aesni_gcm
library's meson.build file is a little cleaner than that given here,
so update this one so that both work identically.

While one could use the checks done in the other right now, potentially in
future they may have different version dependencies, or may be compiled in
different orders, so keep the code duplicated for safety, since it's only a
few lines.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agocrypto/aesni_gcm: check dependency version with meson
Bruce Richardson [Tue, 23 Apr 2019 15:43:55 +0000 (16:43 +0100)]
crypto/aesni_gcm: check dependency version with meson

The aesni_mb driver and the aesni_gcm driver both require the same version
of the IPSec_MB library, but only the former has a check of the library
found by meson to see if it's the correct version. Add a similar check to
the aesni_gcm library's meson.build file, so that the auto-detection of
dependencies works correctly.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agoexamples/ipsec-secgw: fix pool usage for security session
Akhil Goyal [Mon, 22 Apr 2019 14:14:16 +0000 (19:44 +0530)]
examples/ipsec-secgw: fix pool usage for security session

Currently, two separate mempools are being used for creating crypto
sessions and its private data.
crypto sessions are created and initialized separately, so a separate
mempool is passed to each API, but in case of security sessions, where
only one API create and initialize the private data as well.
So if session mempool is passed to create a security session, the
mempool element size is not sufficient enough to hold the private
data as well.
As a perfect solution, the security session create API should take 2
mempools for header and private data and initiatlize accordingly,
but that would mean an API breakage, which will be done in the next
release cycle. So introducing this patch as a workaround to resolve this
issue.

Fixes: 261bbff75e34 ("examples: use separate crypto session mempools")
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoexamples/ipsec-secgw: fix SPD no-match case
Konstantin Ananyev [Thu, 4 Apr 2019 12:13:26 +0000 (13:13 +0100)]
examples/ipsec-secgw: fix SPD no-match case

acl_classify() returns zero value when no matching rule was found.
Currently ipsec-secgw treats it as a valid SPI value, though it has
to discard such packets.
Error could be easily observed by sending outbound unmatched packets,
user will see something like that in the log:
IPSEC: No cryptodev: core 7, cipher_algo 0, auth_algo 0, aead_algo 0

To fix it we need to treat packets with zero result from acl_classify()
as invalid ones. Also we can change DISCARD and BYPASS values to
simplify checks and save some extra space for valid SPI values.
To summarize the approach:
1. have special SPI values for DISCARD and BYPASS.
2. store in SPD full SPI value.
3. after acl_classify(), first check SPI value for DISCARD and BYPASS,
   then convert it in SA index.
4. add check at initilisation time that for each SPD rule there is a
   corresponding SA entry (with the same SPI).

Also marked few global variables as *static*.

Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Fixes: 2a5106af132b ("examples/ipsec-secgw: fix corner case for SPI value")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoversion: 19.05-rc2
Thomas Monjalon [Mon, 22 Apr 2019 22:43:52 +0000 (00:43 +0200)]
version: 19.05-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agodoc: fix heading levels in bbdev test guide
Thomas Monjalon [Mon, 15 Apr 2019 11:58:38 +0000 (13:58 +0200)]
doc: fix heading levels in bbdev test guide

The section "Test Vector files" should not be at the same level as
the main title "dpdk-test-bbdev Application".

Fixes: f714a18885a6 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agobitrate: fix unchecked return value
Andrius Sirvys [Thu, 18 Apr 2019 08:52:06 +0000 (09:52 +0100)]
bitrate: fix unchecked return value

Checking the return value of rte_metrics_update_values, if failed
returning that value.
Coverity had picked up that that the return value wasn't being checked.

Coverity issue: 336863
Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library")
Cc: stable@dpdk.org
Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
5 years agoapp/testpmd: fix variable use before null check
Bruce Richardson [Mon, 8 Apr 2019 09:46:39 +0000 (10:46 +0100)]
app/testpmd: fix variable use before null check

The value returned from rte_eth_dev_tx_offload_name() function is used
for string comparison before being checked for NULL. Move the NULL check
up to be done first.

Coverity issue: 279438
Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/i40e: fix dereference before check when getting EEPROM
Bruce Richardson [Mon, 8 Apr 2019 09:46:40 +0000 (10:46 +0100)]
net/i40e: fix dereference before check when getting EEPROM

As flagged by coverity, the "info" structure is being explicitly
dereferenced before being checked later for a NULL value.

Coverity issue: 277241
Fixes: 98e60c0d43f1 ("net/i40e: add module EEPROM callbacks for i40e")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/i40e: fix dereference before null check in mbuf release
Bruce Richardson [Mon, 8 Apr 2019 09:46:38 +0000 (10:46 +0100)]
net/i40e: fix dereference before null check in mbuf release

Coverity flags that the txq variable is used before it's checked for NULL.
Also fix typo in error message.

Coverity issue: 195023
Fixes: 24853544c84c ("net/i40e: fix mbuf free in vector Tx")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agoexamples/vhost_scsi: fix null-check for parameter
Bruce Richardson [Mon, 8 Apr 2019 09:46:37 +0000 (10:46 +0100)]
examples/vhost_scsi: fix null-check for parameter

Coverity points out that there is a check in the main thread loop for the
ctrlr->bdev being NULL, but by that stage the pointer has already been
dereferenced. Therefore, for safety, before we enter the loop do an
initial check on the parameter structure.

Coverity issue: 158657
Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample app")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agoexamples/vhost_scsi: fix header check for meson build
Bruce Richardson [Mon, 8 Apr 2019 09:46:36 +0000 (10:46 +0100)]
examples/vhost_scsi: fix header check for meson build

The header check for the example app was looking for virtio_scsi.h without
the "linux/" prefix, which meant it was never getting found when it should
have been.

Fixes: 8d47a753b7cb ("examples/vhost_scsi: disable build if missing dependency")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agoexamples/power: fix build with some disabled PMDs
David Christensen [Tue, 2 Apr 2019 18:46:12 +0000 (14:46 -0400)]
examples/power: fix build with some disabled PMDs

Running the devtools/test-build.sh script on IBM Power systems fails
because the IXGBE_PMD is explicity disabled for Power as an untested
driver, but the examples/vm_power_manager application has a hard
dependency on a function call in the IXGBE_PMD.

Modify the example application so that all dependencies on PMD code
are conditionally compiled.

Bugzilla ID: 237
Fixes: c9a4779135c9 ("examples/vm_power_mgr: set MAC address of VF")

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/power: fix overflowed value
Reshma Pattan [Thu, 11 Apr 2019 11:13:36 +0000 (12:13 +0100)]
examples/power: fix overflowed value

Fix the data type of last_branches, last_branch_misses
from uint32_t to uint64_t, and for hits_diff, miss_diff
from int to int64_t respectively to fix possible
overflow or truncation.

Coverity issue: 337677
Fixes: 4b1a631b8a ("examples/vm_power: add oob monitoring functions")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>