dpdk.git
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>
5 years agoexamples/power: fix string overflow
Reshma Pattan [Wed, 10 Apr 2019 14:54:31 +0000 (15:54 +0100)]
examples/power: fix string overflow

Use strlcpy instead of strcpy to fix string overflow.

Coverity issue: 337671
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/power: fix string null termination
Reshma Pattan [Tue, 9 Apr 2019 16:00:24 +0000 (17:00 +0100)]
examples/power: fix string null termination

After the read() the jason_data null termination is missing
for the case "indent < 0", for "indent > 0" and "indent == 0"
cases null termination is already handled.

So add the missing case "indent < 0" to the existing "indent == 0"
case to fix null termination.

Coverity issue: 337680
Fixes: a63504a90f ("examples/power: add JSON string handling")
Cc: stable@dpdk.org
Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agoexamples/power: fix unreachable VF MAC init
David Hunt [Wed, 10 Apr 2019 13:13:48 +0000 (14:13 +0100)]
examples/power: fix unreachable VF MAC init

A for loop to MAX_VFS had a break as the last line, so the w++
would never get called, breaking out of the loop after the
first iteration. Remove the break so that the loop can execute
properly.

Coverity issue: 337682
Fixes: ace158c4a821 ("examples/vm_power: add check for port count")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
5 years agoexamples/power: fix resource leak
David Hunt [Tue, 9 Apr 2019 09:43:26 +0000 (10:43 +0100)]
examples/power: fix resource leak

Coverity issue: 337674
Fixes: 99a968fac0cf ("examples/vm_power: add core list parameter")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
5 years agopower: fix buffer overruns
David Hunt [Tue, 9 Apr 2019 09:22:01 +0000 (10:22 +0100)]
power: fix buffer overruns

A previous change removed the limit of 64 cores by
moving away from 64-bit masks to char arrays. However
this left a buffer overrun issue, where the max channels
was defined as 64, and max cores was defined as 256. These
should all be consistently set to RTE_MAX_LCORE.

The #defines being removed are CHANNEL_CMDS_MAX_CPUS,
CHANNEL_CMDS_MAX_CHANNELS, POWER_MGR_MAX_CPUS, and
CHANNEL_CMDS_MAX_VM_CHANNELS, and are being replaced
with RTE_MAX_LCORE for consistency and simplicity.

Coverity issue: 337672, 337673, 337678
Fixes: fd73630e95c1 ("examples/power: change 64-bit masks to arrays")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: fix max frequency after turbo disabling
Lee Daly [Fri, 12 Apr 2019 15:57:27 +0000 (16:57 +0100)]
power: fix max frequency after turbo disabling

This patch will ensure the correct max frequency of a core is set in
the lcore_power_info struct when disabling turbo, while using the
intel pstate driver.

Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
Cc: stable@dpdk.org
Signed-off-by: Lee Daly <lee.daly@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Acked-by: Liang Ma <liang.j.ma@intel.com>
5 years agotest/power: check all environment types
Marcin Hajkowski [Fri, 5 Apr 2019 16:22:05 +0000 (18:22 +0200)]
test/power: check all environment types

Test all existing power environment configuration to verify if related
data is properly initialized and clean in set/unset scenarios.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: reset function pointers on unset environment
Marcin Hajkowski [Fri, 5 Apr 2019 16:22:04 +0000 (18:22 +0200)]
power: reset function pointers on unset environment

Set all power environment related function pointers to NULL
when unset is being made.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: return error when environment already set
Marcin Hajkowski [Fri, 5 Apr 2019 16:22:03 +0000 (18:22 +0200)]
power: return error when environment already set

On attempt to set_env in already initialized state notify
user by returning error that operation cannot be performed.

Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agopower: fix thread-safety environment modification
Marcin Hajkowski [Fri, 5 Apr 2019 14:35:35 +0000 (16:35 +0200)]
power: fix thread-safety environment modification

Due to lack of thread safety in exisiting solution
use spinlock mechanism for atomic
modification of power environment related data.

Fixes: 445c6528b5 ("power: common interface for guest and host")
Cc: stable@dpdk.org
Signed-off-by: Marcin Hajkowski <marcinx.hajkowski@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoexamples/power: remove policy dependency to MAC list
Lukasz Krakowiak [Tue, 9 Apr 2019 09:54:01 +0000 (11:54 +0200)]
examples/power: remove policy dependency to MAC list

Removed dependency to mac_list from policies:
* BRANCH_RATIO,
* WORKLOAD,
* TIME
in function update_policy.

Fixes: 1b897991473f ("power: update error handling")

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Acked-by: David Hunt <david.hunt@intel.com>
Tested-by: Yufeng Mo <yufengx.mo@intel.com>
5 years agoapp/pdump: support multi-core capture
Vipin Varghese [Thu, 4 Apr 2019 08:55:15 +0000 (14:25 +0530)]
app/pdump: support multi-core capture

Add option --multi, to enhance pdump application to allow capture
on unique cores for each --pdump option. If option --multi is ignored
the default capture occurs on single core for all --pdump options.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agoapp/pdump: remove core restriction
Vipin Varghese [Thu, 4 Apr 2019 08:55:14 +0000 (14:25 +0530)]
app/pdump: remove core restriction

PDUMP application is being limited to run on default first core.
The patch removes the restriction, allowing user to run on any of
selected cores in EAL args. If no args are passed, logic runs on
default master core.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agoapp/bbdev: replace sprintf with snprintf or strlcpy
Pallantla Poornima [Tue, 9 Apr 2019 13:05:40 +0000 (14:05 +0100)]
app/bbdev: replace sprintf with snprintf or strlcpy

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

Fixes: f714a18885 ("app/testbbdev: add test application for bbdev")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Amr Mokhtar <amr.mokhtar@intel.com>
5 years agotest/timer: exercise new APIs in secondary process
Erik Gabriel Carrillo [Thu, 18 Apr 2019 21:00:04 +0000 (16:00 -0500)]
test/timer: exercise new APIs in secondary process

This commit adds an autotest which exercises new timer reset/stop APIs
in a secondary process. Timers are created, and sometimes stopped, in
the secondary process, and their expiration is checked for and handled
in the primary process.

Signed-off-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
5 years agoreorder: add checks for invalid function inputs
Bruce Richardson [Wed, 10 Apr 2019 11:24:47 +0000 (12:24 +0100)]
reorder: add checks for invalid function inputs

For APIs which can return an error value, do sanity checking of the input
parameters for NULL and return a suitable error value for those cases.

NOTE: The drain function is currently omitting NULL checks too, but this
function has no way to flag an error value, so checking in that case would
simply mask problems.

Reported-by: Bernard Iremonger <bernard.iremonger@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agombuf: fix big endian build
Thomas Monjalon [Tue, 9 Apr 2019 20:06:35 +0000 (22:06 +0200)]
mbuf: fix big endian build

Compilation was failing when using a big endian toolchain:

rte_mbuf.h:504:2: error: expected ',' or '}' before 'RTE_MBUF_L3_LEN_OFS'

Fixes: 8d9c2c3a1f01 ("mbuf: add function to generate raw Tx offload value")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agobus/vmbus: fix resource leak on error
Stephen Hemminger [Wed, 17 Apr 2019 18:45:06 +0000 (11:45 -0700)]
bus/vmbus: fix resource leak on error

If secondary process attempt to mmap the resource resulted in
the wrong address, then it would leave behind the bad mmap.

Coverity issue: 337675, 337664
Fixes: 2a28a502c607 ("bus/vmbus: map ring in secondary process")

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
5 years agodrivers: remove blank line at EOF
Stephen Hemminger [Wed, 10 Apr 2019 18:05:33 +0000 (11:05 -0700)]
drivers: remove blank line at EOF

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agoexamples/l3fwd: format IP addresses for printing
Stephen Hemminger [Wed, 10 Apr 2019 17:41:32 +0000 (10:41 -0700)]
examples/l3fwd: format IP addresses for printing

The IP addresses should be formatted using standard routines
rather than outputing in raw hex.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoexamples/l3fwd: use reserved IP addresses
Stephen Hemminger [Wed, 10 Apr 2019 17:41:31 +0000 (10:41 -0700)]
examples/l3fwd: use reserved IP addresses

The l3fwd example should use the IPv4 addresses defined in RFC5735 and
the IPv6 addresses defined in RFC5180 for the L3 forwarding example
Longest Prefix Match table.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoapp/testpmd: add ability to set Tx IP and UDP parameters
Stephen Hemminger [Wed, 10 Apr 2019 17:41:30 +0000 (10:41 -0700)]
app/testpmd: add ability to set Tx IP and UDP parameters

This patch changes what testpmd uses as IP addresses when
run in transmit only mode. The old code was using
192.168.0.1 -> 192.168.0.2
but these addresses are reserved for private Internet by RFC 1918.

The new code uses 192.18.0.1 and 192.18.0.2 which are on the
subnet reserved for performance testing by RFC 2544.

New command line option allows the user to pick any other src/dst
address desired.

Notice: this changes the default IP address for transmit only.
It may cause some user who has hardcoded network addresses to report
a regression.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoeventdev: promote adapter functions as stable
Jerin Jacob [Fri, 19 Apr 2019 12:10:40 +0000 (17:40 +0530)]
eventdev: promote adapter functions as stable

Promote the adapter functions and rte_event_port_unlinks_in_progress()
as stable as it's been added for a while now and multiple drivers and
test application like test-eventdev has been tested using the adapter APIs.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
5 years agoeal: promote some experimental functions as stable
Thomas Monjalon [Thu, 18 Apr 2019 00:30:58 +0000 (02:30 +0200)]
eal: promote some experimental functions as stable

The function rte_eal_cleanup() was introduced more than one year ago,
in DPDK 18.02. It is no longer experimental, allowing
pdump, proc-info and hotplug_mp apps to not need any experimental API.

The function rte_ctrl_thread_create() was introduced one year ago
in DPDK 18.05. It is no longer experimental, allowing
KNI PMD and TEP example to not need any experimental API.

The functions rte_socket_count() and rte_socket_id_by_idx() were
introduced one year ago in DPDK 18.05. They are no longer experimental.

The function rte_dev_is_probed() was introduced half a year ago
in DPDK 18.11. It is no longer experimental.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
5 years agonet/tap: fix multi process reply buffer
Herakliusz Lipiec [Fri, 19 Apr 2019 10:28:52 +0000 (11:28 +0100)]
net/tap: fix multi process reply buffer

A successful call to rte_mp_request_sync does not guarantee that there
are any messages in the buffer, and this should be checked for before
accessing data in the message. Buffer can be empty if IPC is disabled or
if we decide to ignore replies.

Fixes: c9aa56edec8e ("net/tap: access primary process queues from secondary")
Cc: stable@dpdk.org
Signed-off-by: Herakliusz Lipiec <herakliusz.lipiec@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/af_xdp: fix creating multiple instance
Xiaolong Ye [Fri, 19 Apr 2019 12:47:39 +0000 (13:47 +0100)]
net/af_xdp: fix creating multiple instance

Naming the buf_ring and umem memzone dynamically allows
to create multiple af_xdp vdevs.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: Markus Theil <markus.theil@tu-ilmenau.de>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/cxgbe: update Chelsio T5/T6 NIC device ids
Rahul Lakkireddy [Fri, 19 Apr 2019 09:22:01 +0000 (14:52 +0530)]
net/cxgbe: update Chelsio T5/T6 NIC device ids

Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix colliding function names
Stephen Hemminger [Fri, 19 Apr 2019 11:44:25 +0000 (12:44 +0100)]
net/cxgbe: fix colliding function names

This driver defines lots of functions (like init_rss) which are intended
to only be used in this device. But when doing static linking these
global functions cause link failures when similar function name is
used in application.

This patch prefixes all functions defined in cxgbe.h with cxgbe_
to avoid these kind of conflicts.

Fixes: bfcb257d3014 ("net/cxgbe: enable RSS for VF")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/vmxnet3: add v4 boot and guest UDP RSS config
Eduard Serra [Thu, 18 Apr 2019 20:59:37 +0000 (20:59 +0000)]
net/vmxnet3: add v4 boot and guest UDP RSS config

This patch introduces:
- VMxnet3 v4 negotiation and,
- entirely guest-driven UDP RSS support.

VMxnet3 v3 already has UDP RSS support, however it
depends on hypervisor provisioning on the VM through
ESX specific flags, which are not transparent or known
to the guest later on.

Vmxnet3 v4 introduces a new API transaction which allows
configuring RSS entirely from the guest. This API must be
invoked after device shared mem region is initialized.

IPv4 ESP RSS (SPI based) is also available, but currently
there are no ESP RSS definitions on rte_eth layer to
handle that.

Signed-off-by: Eduard Serra <eserra@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
5 years agonet/bonding: fix potential out of bounds read
Radu Nicolau [Wed, 17 Apr 2019 14:36:47 +0000 (15:36 +0100)]
net/bonding: fix potential out of bounds read

Add validation to pointer constructed from the IPv4 header length
in order to prevent malformed packets from generating a potential
out of bounds memory read.

Fixes: 09150784a776 ("net/bonding: burst mode hash calculation")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agonet/ice: fix Tx function selection
Leyi Rong [Fri, 19 Apr 2019 03:03:50 +0000 (11:03 +0800)]
net/ice: fix Tx function selection

Add ice_set_tx_function_flag() to configure tx_simple_allowed properly.

Fixes: 6eac0b7fde95 ("net/ice: support advance Rx/Tx")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx5: add drop action to Direct Verbs E-Switch
Ori Kam [Thu, 18 Apr 2019 13:16:07 +0000 (13:16 +0000)]
net/mlx5: add drop action to Direct Verbs E-Switch

This commit adds support for drop action when creating E-Switch flow
using DV.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: add Forward Database table type
Ori Kam [Thu, 18 Apr 2019 13:16:06 +0000 (13:16 +0000)]
net/mlx5: add Forward Database table type

Actions like encap/decap, modify header require setting the flow table
type. Until now we supported only Nic RX and Nic TX, this commits adds
the support for FDB table type for those actions.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: add E-Switch port id action to Direct Verbs
Ori Kam [Thu, 18 Apr 2019 13:16:05 +0000 (13:16 +0000)]
net/mlx5: add E-Switch port id action to Direct Verbs

This commits adds matching on source port, using DV API.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: add transfer attribute to matcher
Ori Kam [Thu, 18 Apr 2019 13:16:04 +0000 (13:16 +0000)]
net/mlx5: add transfer attribute to matcher

In current implementation the DV steering supported only NIC steering.
This commit adds the transfer attribute in order to create a matcher
on the FDB tables.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: add port id item to Direct Verbs
Ori Kam [Thu, 18 Apr 2019 13:16:03 +0000 (13:16 +0000)]
net/mlx5: add port id item to Direct Verbs

Adds the port id item to the DV steering code.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: validate Direct Rule E-Switch
Ori Kam [Thu, 18 Apr 2019 13:16:02 +0000 (13:16 +0000)]
net/mlx5: validate Direct Rule E-Switch

Add validation logic for E-Switch using Direct Rules.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: support Direct Rules E-Switch
Ori Kam [Thu, 18 Apr 2019 13:16:01 +0000 (13:16 +0000)]
net/mlx5: support Direct Rules E-Switch

This commit checks the for DR E-Switch support.
The support is based on both Device and Kernel.
This commit also enables the user to manually disable this this feature.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix meson build for Direct Rules
Ori Kam [Thu, 18 Apr 2019 13:16:00 +0000 (13:16 +0000)]
net/mlx5: fix meson build for Direct Rules

The meson build was missing the define for Direct Rules.

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 agonet/mlx5: fix translate vport function name
Ori Kam [Thu, 18 Apr 2019 13:15:59 +0000 (13:15 +0000)]
net/mlx5: fix translate vport function name

Modify the translate vport function to match other translate items
naming conventions.

Fixes: 0fe3f18f78d8 ("net/mlx5: add source vport match to the ingress rules")

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix modify header action position
Ori Kam [Wed, 17 Apr 2019 20:01:45 +0000 (20:01 +0000)]
net/mlx5: fix modify header action position

According to RTE flow the action order should be the order that the
actions were given.
In the case of modify actions the position of the action was always
last.

This commit solves this issue by saving the position of the first modify
action, and then adds to this position the pointer to the modify action.

Fixes: 4bb14c83df95 ("net/mlx5: support modify header using Direct Verbs")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix release of jump to queue action
Ori Kam [Sun, 14 Apr 2019 20:17:11 +0000 (20:17 +0000)]
net/mlx5: fix release of jump to queue action

Currently the allocation of the jump to QP is done in flow apply,
this results in memory leak.

This patch fixes this issue by moving the allocation and release of the
jump to QP action to the responsibility of the hrxq.

Fixes: cbb66daa3c85 ("net/mlx5: prepare Direct Verbs for Direct Rule")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: support PF representor
Viacheslav Ovsiienko [Tue, 16 Apr 2019 14:10:28 +0000 (14:10 +0000)]
net/mlx5: support PF representor

On BlueField platform we have the new entity - PF representor.
This one represents the PCI PF attached to external host on the
side of ARM. The traffic sent by the external host to the NIC
via PF will be seem by ARM on this PF representor.

This patch refactors port recognizing capability on the base of
physical port name. We have two groups of name formats. Legacy
name formats are supported by kernels before ver 5.0 (being
more precise - before the patch [1]) or before Mellanox OFED 4.6,
and new naming formats added by the patch [1].

Legacy naming formats are supported:

  - missing physical port name (no sysfs/netlink key) at all,
    master is assumed

  - decimal digits (for example "12"), representor is assumed,
    the value is the index of attached VF

New naming formats are supported:

  - "p" followed by decimal digits, for example "p2", master
    is assumed

  - "pf" followed by PF index concatenated with "vf" followed by
    VF index, for example "pf0vf1", representor is assumed.
    If index of VF is "-1" it is a special case  of host PF
    representor, this representor must be indexed in devargs
    as 65535, for example representor=[0-3,65535] will
    allow representors for VF0, VF1, VF2, VF3 and for host PF.

    Note: do not specify representor=[0-65535], it causes devargs
    processing error, because number of ports (rte_eth_dev) is
    limited.

Applications should distinguish representors and master devices
exclusively by device flag RTE_ETH_DEV_REPRESENTOR and do not
rely on switch port_id (mlx5 PMD deduces ones from representor_id)
values returned by dev_infos_get() API.

[1] https://www.spinics.net/lists/netdev/msg547007.html
    Linux-tree: c12ecc23 (Or Gerlitz 2018-04-25 17:32 +0300)
    "net/mlx5e: Move to use common phys port names for vport representors"

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: fix memory region cleanup
Viacheslav Ovsiienko [Mon, 15 Apr 2019 08:40:58 +0000 (08:40 +0000)]
net/mlx4: fix memory region cleanup

mlx4 driver has a global list of Memory Regions created by
device, and there is a ml4_mr_release() routine which makes
a memory cleanup at device closing. The head of device MR list
was fetched outside the rwlock protected section. Also some
noticed typos are fixed.

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix memory region cleanup
Viacheslav Ovsiienko [Fri, 12 Apr 2019 15:45:27 +0000 (15:45 +0000)]
net/mlx5: fix memory region cleanup

mlx5 driver has a global list of Memory Regions created by
device, and there is a ml5_mr_release() routine which makes
a memory cleanup at device closing. The head of device MR list
was fetched outside the rwlock protected section. Also some
noticed typos are fixed.

Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/failsafe: fix source port id in Rx packets
Adrien Mazarguil [Thu, 18 Apr 2019 17:20:55 +0000 (19:20 +0200)]
net/failsafe: fix source port id in Rx packets

When passed to the application, Rx packets retain the port ID value
originally set by slave devices. Unfortunately these IDs have no
meaning to applications, which are typically unaware of their existence.

This confuses those caring about the source port field in mbufs
(m->port) which experience issues ranging from traffic drop to crashes.

Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
5 years agoethdev: promote function for port count as stable
Thomas Monjalon [Wed, 17 Apr 2019 22:59:28 +0000 (00:59 +0200)]
ethdev: promote function for port count as stable

The function rte_eth_dev_count_total() was introduced one year ago
in the release 18.05. It can be declared non experimental in 19.05.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: avoid explicit check of valid port state
Thomas Monjalon [Wed, 17 Apr 2019 22:59:27 +0000 (00:59 +0200)]
ethdev: avoid explicit check of valid port state

Some port iterations are manually checking against RTE_ETH_DEV_UNUSED
instead of using the iterators based on rte_eth_find_next().

A new macro RTE_ETH_FOREACH_VALID_DEV() is introduced, but kept private
because there should be no need of iterating over all devices in the
API. The public iterators have additional filters for ownership, parent
device or sibling ports.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoethdev: deprecate legacy filter API
Thomas Monjalon [Wed, 17 Apr 2019 00:36:27 +0000 (02:36 +0200)]
ethdev: deprecate legacy filter API

As stated in the deprecation notice from December 2016,
"the legacy filter API, including rte_eth_dev_filter_supported(),
rte_eth_dev_filter_ctrl() as well as filter types MACVLAN, ETHERTYPE,
FLEXIBLE, SYN, NTUPLE, TUNNEL, FDIR, HASH and L2_TUNNEL, is superseded
by the generic flow API (rte_flow)".

After a long wait of more than two years, the legacy filter API
is marked as deprecated, while still tested with testpmd and
the tep_termination example.

The next step will be to announce a deadline for complete removal.
As preparation of the removal of rte_eth_ctrl.h,
RTE_ETH_FLOW_*, RTE_TUNNEL_TYPE_* and RTE_ETH_HASH_FUNCTION_* definitions
are moved to rte_ethdev.h and rte_flow.h.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/atlantic: bump internal driver version
Igor Russkikh [Thu, 18 Apr 2019 11:40:04 +0000 (11:40 +0000)]
net/atlantic: bump internal driver version

Version is synced with internal Aquantia's driver versioning

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: implement MACsec statistics
Pavel Belous [Thu, 18 Apr 2019 11:40:01 +0000 (11:40 +0000)]
net/atlantic: implement MACsec statistics

We add extra xstat fields to include MACsec counters and stats

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: configure MACsec from interrupt handler
Pavel Belous [Thu, 18 Apr 2019 11:39:57 +0000 (11:39 +0000)]
net/atlantic: configure MACsec from interrupt handler

MACSEC should be configured only after link up event, thus we use
link interrupt to file an alarm for configuration.

FW also uses link interrupt line to indicate incoming events from
MACSEC. These may include key expiration, packet counter wrap, etc.
We pass these events to the upper layers.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: implement MACsec firmware interface
Pavel Belous [Thu, 18 Apr 2019 11:39:55 +0000 (11:39 +0000)]
net/atlantic: implement MACsec firmware interface

Implementation of firmware interface for MACsec configuration.
Structure with config data is written into FW memory, then we trigger
FW to execute the request and wait for result.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: enable MACsec configuration
Pavel Belous [Thu, 18 Apr 2019 11:39:51 +0000 (11:39 +0000)]
net/atlantic: enable MACsec configuration

These are driver MACsec configuration routines.
They fill in config structures and prepare these
to be send to FW. Actual configuration will happen in
link interrupt handler.

We declare MACsec offload bits in DPDK offload capabilities
and provide external experimental MACsec API wrappers.

Also update documentation with feature matrix for the
enabled feature.

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: declare MACsec hardware structures
Pavel Belous [Thu, 18 Apr 2019 11:39:48 +0000 (11:39 +0000)]
net/atlantic: declare MACsec hardware structures

Here we define hardware and software configuration structures
for MACsec interface. MACSEC itself is implemented in Phy module,
but its configuration is done via firmware interface

Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/i40e: fix logging on VF close
Beilei Xing [Thu, 18 Apr 2019 05:52:27 +0000 (13:52 +0800)]
net/i40e: fix logging on VF close

When launch testpmd with VF and quit testpmd, there'll
be lots of messages "i40evf_handle_aq_msg(): Request 0
is not supported yet", which are triggered during VF
reset and VF needn't do anything. So cancel alarm handler
before VF reset to ignore the admin queue messages.

Fixes: e0e6a7f2154e ("net/i40e: cancel alarm handler at the end of closure")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/iavf: fix queue interrupt for ice
Wei Zhao [Thu, 18 Apr 2019 04:58:15 +0000 (12:58 +0800)]
net/iavf: fix queue interrupt for ice

Enable CLEARPBA bit is required by ice NIC of A0/A1 version to
enable Tx and Rx queue interrupt.
Also enable CLEARPBA bit does no impact on IAVF behaviour when be
hosted by other devices, so we can make it as default.

Fixes: d6bde6b5eae9 ("net/avf: enable Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/af_xdp: fix typos in Rx function
Xiaolong Ye [Wed, 17 Apr 2019 13:49:46 +0000 (21:49 +0800)]
net/af_xdp: fix typos in Rx function

We should use ETH_AF_XDP_RX_BATCH_SIZE in Rx function rather than
ETH_AF_XDP_TX_BATCH_SIZE.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/af_xdp: make reserve/submit peek/release consistent
Xiaolong Ye [Wed, 17 Apr 2019 13:49:45 +0000 (21:49 +0800)]
net/af_xdp: make reserve/submit peek/release consistent

As David pointed out, if we reserve N slots for Tx, but only submit n
slots, we would end up with an incorrect opinion of the number of available
slots later, we also would get wrong idx when we call
xsk_ring_prod__reserve next time. It also applies to
xsk_ring_cons__peek()/xsk_ring_cons__release().

This patch ensures that both reserve/submit and peek/release are
consistent.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/af_xdp: specify minimal and maximal MTU
Xiaolong Ye [Wed, 17 Apr 2019 13:49:44 +0000 (21:49 +0800)]
net/af_xdp: specify minimal and maximal MTU

Properly report mtu capability in port device info.

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/af_xdp: enqueue buf ring when allocate Tx queue fails
Xiaolong Ye [Wed, 17 Apr 2019 13:49:43 +0000 (21:49 +0800)]
net/af_xdp: enqueue buf ring when allocate Tx queue fails

When it fails to allocate enough slots in Tx queue for transmitting
packets, we need to return the dequeued addrs to buf ring.

Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD")

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agonet/virtio: fix dangling pointer on failure
Aaron Conole [Mon, 15 Apr 2019 14:48:18 +0000 (10:48 -0400)]
net/virtio: fix dangling pointer on failure

When eth_virtio_dev_init() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Found during unit-test fixes.

Fixes: 43d18765c027 ("net/virtio: fix memory leak on failure")
Cc: stable@dpdk.org
Reported-by: Michael Santana <msantana@redhat.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix silent queue enabling with legacy guests
Ilya Maximets [Fri, 12 Apr 2019 13:09:49 +0000 (16:09 +0300)]
vhost: fix silent queue enabling with legacy guests

vhost should notify the application in case of all vring state changes.

In general, application should not care about negotiation of
VHOST_USER_F_PROTOCOL_FEATURES. Protocol details like this should
be hidden by the vhost library.

With this patch applications like OVS will be able to assume that
all vrings disabled by default and only process 'vring_state_changed'
events.

Fixes: 321203a54ba7 ("vhost: enable rings at the right time")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix passing destroyed device to destroy callback
Ilya Maximets [Fri, 12 Apr 2019 08:32:28 +0000 (11:32 +0300)]
vhost: fix passing destroyed device to destroy callback

Application should be able to obtain information like 'ifname' from
the 'vid' passed to 'destroy_connection' callback. Currently, all the
API calls with passed 'vid' fails with 'device not found'.

Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
Cc: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix null pointer checking
Mohammad Abdul Awal [Thu, 11 Apr 2019 14:48:40 +0000 (15:48 +0100)]
vhost: fix null pointer checking

Null value for parameters will cause segfault.

Fixes: d7280c9fffcb ("vhost: support selective datapath")
Fixes: 72e8543093df ("vhost: add API to get MTU value")
Fixes: a277c7159876 ("vhost: refactor code structure")
Fixes: ca33faf9ef10 ("vhost: introduce API to fetch negotiated features")
Fixes: eb32247457fe ("vhost: export guest memory regions")
Fixes: 40ef286f236a ("vhost: export vhost vring info")
Fixes: bd2e0c3fe5ac ("vhost: add APIs for live migration")
Fixes: 0b8572a0c101 ("vhost: add external message handling to the API")
Fixes: b4953225cea4 ("vhost: add APIs for datapath configuration")
Fixes: 5fbb3941da9f ("vhost: introduce driver features related APIs")
Fixes: 292959c71961 ("vhost: cleanup unix socket")
Cc: stable@dpdk.org
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: fix device leak on connection add failure
Ilya Maximets [Thu, 11 Apr 2019 10:23:06 +0000 (13:23 +0300)]
vhost: fix device leak on connection add failure

Need to destroy allocated device if application fails to
add new connection or we have fdset failure.

Fixes: acbff5c67ea7 ("vhost: fix crash when exceeding file descriptors")
Fixes: efba12a78ddf ("vhost: add user callbacks for socket open/close")
Cc: stable@dpdk.org
Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio-user: fix return value check
Chenbo Xia [Wed, 10 Apr 2019 02:44:05 +0000 (02:44 +0000)]
net/virtio-user: fix return value check

Fix unchecked return value for fcntl.

Coverity issue: 277210
Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: fix buffer leak on VLAN insert
Stephen Hemminger [Fri, 5 Apr 2019 16:31:15 +0000 (09:31 -0700)]
net/virtio: fix buffer leak on VLAN insert

The function rte_vlan_insert may allocate a new buffer for the
vlan header and return a different mbuf than originally passed.
In this case, the stored mbuf in txm[] array could point to wrong
buffer.

Fixes: dd856dfcb9e7 ("virtio: use any layout on Tx")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agocrypto/virtio: fix IV offset
Fan Zhang [Fri, 5 Apr 2019 16:04:24 +0000 (17:04 +0100)]
crypto/virtio: fix IV offset

This patch fixes the incorrect iv offset calculation.

Fixes: b063e843fa03 ("crypto/virtio: fix IV physical address")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/ice: fix promiscuous mode
Ying A Wang [Wed, 17 Apr 2019 01:47:52 +0000 (09:47 +0800)]
net/ice: fix promiscuous mode

When device promiscuous mode has already been enabled,
should not return error if user re-enable it.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/ice: fix variable storage type
Ying A Wang [Wed, 17 Apr 2019 01:47:51 +0000 (09:47 +0800)]
net/ice: fix variable storage type

Variable "status" should be defined as "enum ice_status"
instead of "uint16_t". This patch fixes the issue.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
5 years agonet/iavf: fix info get
Qiming Yang [Wed, 17 Apr 2019 16:08:34 +0000 (00:08 +0800)]
net/iavf: fix info get

iavf driver reset the dev_info structure. This action will clear
the setting in core library. This patch fix that issue.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
5 years agoapp/testpmd: fix port detach cleanup
Viacheslav Ovsiienko [Fri, 12 Apr 2019 15:48:11 +0000 (15:48 +0000)]
app/testpmd: fix port detach cleanup

At port detach routine after calling the rte_dev_remove()
testpmd performs some cleanup, checking the statuses of
remaining ports and closes the appropriate ones. The port
scanning is based on the new sibling iterator which uses the
invalid (already closed) port for reference. This patch
replaces the foreach iterator and uses the device object for
reference. It is worth to note this cleanup is not needed
for some drivers (at least for mlx5 and probably for others)
and is preserved due to possible compatibility issues.

Fixes: 13302cd5bd63 ("app/testpmd: use port sibling iterator in device cleanup")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agonet/ifc: fix used ring update
Xiao Wang [Mon, 15 Apr 2019 07:56:25 +0000 (15:56 +0800)]
net/ifc: fix used ring update

The vring relay thread is created after HW datapath start and is
canceled before HW datapath stop, so we need to take care of the
ring update when the relay thread is not on duty.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/ifc: fix mediated vring initialization
Xiao Wang [Mon, 15 Apr 2019 07:56:24 +0000 (15:56 +0800)]
net/ifc: fix mediated vring initialization

The mediated vring's index should be set as initial value before
enabling HW datapath.

Fixes: 4bb531e152d3 ("net/ifc: support SW assisted VDPA live migration")
Cc: stable@dpdk.org
Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agonet/ifc: do not relay for Tx queue
Xiao Wang [Mon, 15 Apr 2019 07:56:23 +0000 (15:56 +0800)]
net/ifc: do not relay for Tx queue

Relay for Tx queue doesn't provide any benefit, since the packet buffer
in Tx queue is read-only, there's no dirty page logging for Tx buffer.
This change further reduces CPU usage and improves throughput.

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
5 years agoapp/testpmd: set fixed flag for exact link speed
Andrew Rybchenko [Fri, 12 Apr 2019 13:12:33 +0000 (14:12 +0100)]
app/testpmd: set fixed flag for exact link speed

Setting exact link speed makes sense if auto-negotiation is
disabled. Fixed flag is required to disable auto-negotiation.

Fixes: 88fbedcd5e5a ("app/testpmd: move speed and duplex parsing in a function")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoraw/ifpga: support ipn3ke
Rosen Xu [Tue, 16 Apr 2019 03:17:51 +0000 (11:17 +0800)]
raw/ifpga: support ipn3ke

Add Intel FPGA Acceleration NIC IPN3KE support for IFPGA Rawdev.

Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>
Signed-off-by: Andy Pei <andy.pei@intel.com>
5 years agoraw/ifpga/base: add prefix for feature and its ops
Tianfei Zhang [Tue, 16 Apr 2019 03:17:50 +0000 (11:17 +0800)]
raw/ifpga/base: add prefix for feature and its ops

Using prefix name "ifpga_" for feature and feature_ops data
struct on ifpga base code, which is suggested by Yigit, Ferruh.

Signed-off-by: Tianfei Zhang <tianfei.zhang@intel.com>