dpdk.git
5 years agobuild: use integer for max ethdev ports option
Luca Boccassi [Fri, 1 Mar 2019 15:46:51 +0000 (15:46 +0000)]
build: use integer for max ethdev ports option

max_ethports was merged after the other patch was written:

e04ea7fcf03c ("build: use integers for numerical options")

So convert this one too like the others have already been.

Fixes: d5555fc900a9 ("build: add option to override max ethdev ports")

Signed-off-by: Luca Boccassi <bluca@debian.org>
5 years agoci: introduce Travis builds for GitHub repositories
Michael Santana [Mon, 25 Mar 2019 15:32:08 +0000 (11:32 -0400)]
ci: introduce Travis builds for GitHub repositories

GitHub is a service used by developers to store repositories.  GitHub
provides service integrations that allow 3rd party services to access
developer repositories and perform actions.  One of these services is
Travis-CI, a simple continuous integration platform.

This series introduces the ability for any github mirrors of the DPDK
project, including developer mirrors, to kick off builds under the
travis CI infrastructure.  For now, this just means compilation - no
other kinds of automated run exists yet.  In the future, this can be
expanded to execute and report results for any test-suites that might
exist.

This is a simple initial implementation of a travis build for the DPDK
project.  It doesn't require any changes from individual developers to
enable, but will allow those developers who opt-in to GitHub and the
travis service to get automatic builds for every push they make.

The files added under .ci/ exist so that in the future, other CI
support platforms (such as cirrus, appveyor, etc.) could have a common
place to put their requisite scripts without polluting the main tree.

Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Michael Santana <msantana@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agocompressdev: add flag to specify where processing is done
Fiona Trahe [Thu, 17 Jan 2019 17:36:23 +0000 (17:36 +0000)]
compressdev: add flag to specify where processing is done

A new device feature flag, RTE_COMPDEV_FF_OP_DONE_IN_DEQUEUE
is added. A PMD should set this if the bulk of the
processing is done during the dequeue. It should leave it
cleared if the bulk of the processing is done during the
enqueue (default).
Applications can use this as a hint for tuning.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agoexamples/ipsec-secgw: add test scripts for 3DES-CBC
Fan Zhang [Wed, 20 Mar 2019 15:38:37 +0000 (15:38 +0000)]
examples/ipsec-secgw: add test scripts for 3DES-CBC

This patch adds the functional test scripts to ipsec-secgw
sample application for both transport and tunnel working
mode.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoipsec: support 3DES-CBC
Fan Zhang [Wed, 20 Mar 2019 15:38:36 +0000 (15:38 +0000)]
ipsec: support 3DES-CBC

This patch adds triple-des CBC mode cipher algorithm to ipsec
library.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: add test scripts for AES-CTR
Fan Zhang [Wed, 20 Mar 2019 15:38:35 +0000 (15:38 +0000)]
examples/ipsec-secgw: add test scripts for AES-CTR

This patch adds the functional test scripts to ipsec-secgw
sample application for both transport and tunnel working
mode.

Updated a bit on common_defs to use "mktemp" instead of "tempfile"
as Fedora does not like the command.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agoipsec: support AES-CTR
Fan Zhang [Wed, 20 Mar 2019 15:38:34 +0000 (15:38 +0000)]
ipsec: support AES-CTR

This patch adds AES-CTR cipher algorithm support to ipsec
library.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
5 years agocryptodev: remove XTS comment duplication
Damian Nowak [Wed, 13 Mar 2019 14:52:13 +0000 (15:52 +0100)]
cryptodev: remove XTS comment duplication

This patch removes duplicated text about AES-XTS
mode.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocrypto/qat: support XTS
Damian Nowak [Wed, 13 Mar 2019 14:52:12 +0000 (15:52 +0100)]
crypto/qat: support XTS

This patch adds XTS capabilities and enables
XTS cipher mode on QAT.
It also updates the documentation for newly
supported AES XTS mode on QAT.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest/crypto: add tests for XTS on QAT
Damian Nowak [Wed, 13 Mar 2019 14:52:11 +0000 (15:52 +0100)]
test/crypto: add tests for XTS on QAT

This patch adds test vectors for AES XTS mode
on QAT. It uses different plaintext sizes
and AES keys sizes of 128 and 256 bits.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agotest/crypto: fix possible overflow using strlcat
Chaitanya Babu Talluri [Mon, 18 Mar 2019 12:36:36 +0000 (12:36 +0000)]
test/crypto: fix possible overflow using strlcat

strcat does not check the destination length and there might be
chances of string overflow so instead of strcat, strlcat is used.

Fixes: 6f4eec2565 ("test/crypto: enhance scheduler unit tests")
Cc: stable@dpdk.org
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/fips_validation: support plain SHA
Damian Nowak [Tue, 19 Mar 2019 09:43:48 +0000 (10:43 +0100)]
examples/fips_validation: support plain SHA

This patch enables plain SHA algorithm CAVP test support
in fips_validation sample application.

Signed-off-by: Damian Nowak <damianx.nowak@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>
5 years agocrypto/octeontx: move device specific code to driver
Anoob Joseph [Fri, 1 Mar 2019 18:42:32 +0000 (18:42 +0000)]
crypto/octeontx: move device specific code to driver

Moving upper level enqueue/dequeue routines to driver. The h/w interface
used to submit request has enough differences to substantiate the need
for separate routines.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
5 years agocommon/cpt: redesign propagation of error
Anoob Joseph [Fri, 1 Mar 2019 18:42:27 +0000 (18:42 +0000)]
common/cpt: redesign propagation of error

The check for prep_req is good enough to flag error. The return var
passed around is redundant. Fixing this. Also making the functions
return correct error values in case of various failures.

In addition, adding unlikely flag for all error checks.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
5 years agocommon/cpt: improve structures used in datapath
Anoob Joseph [Fri, 1 Mar 2019 18:42:20 +0000 (18:42 +0000)]
common/cpt: improve structures used in datapath

Making cpt_request_info structure cache aligned. This structure is
used from data path.

Also rearranging the pending queue structure to
prevent hole in between members.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
5 years agocryptodev: fix driver name comparison
Anoob Joseph [Mon, 11 Mar 2019 05:55:44 +0000 (05:55 +0000)]
cryptodev: fix driver name comparison

The string compare to the length of driver name might give false
positives when there are drivers with similar names (one being the
subset of another).

Following is such a naming which could result in false positive.
1. crypto_driver
2. crypto_driver1

When strncmp with len = strlen("crypto_driver") is done, it could give
a false positive when compared against "crypto_driver1". For such cases,
'strlen + 1' is done, so that the NULL termination also would be
considered for the comparison.

Fixes: d11b0f30df88 ("cryptodev: introduce API and framework for crypto devices")
Cc: stable@dpdk.org
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: fix debug logs
Bernard Iremonger [Thu, 7 Mar 2019 10:34:52 +0000 (10:34 +0000)]
examples/ipsec-secgw: fix debug logs

Improve debug code in esp.c, sa.c and ipsec-secgw.c

Fixes: f159e70b0922 ("examples/ipsec-secgw: support transport mode")
Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload")
Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
Fixes: 906257e965b7 ("examples/ipsec-secgw: support IPv6")
Cc: stable@dpdk.org
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agoexamples/ipsec-secgw: fix AES-CTR block size
Fan Zhang [Tue, 5 Mar 2019 14:40:41 +0000 (14:40 +0000)]
examples/ipsec-secgw: fix AES-CTR block size

This patch fixes the incorrect block size for AES-CTR in
legacy mode. Originally, wrong block size will cause
esp_inbound() drop AES-CTR encrypted packets if the payload
sizes not equal to multiple times of 16.

Fixes: 4470c22de2e1 ("examples/ipsec-secgw: add AES-CTR")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agocompress/qat: add fallback to fixed compression
Tomasz Jozwiak [Fri, 15 Feb 2019 09:44:32 +0000 (10:44 +0100)]
compress/qat: add fallback to fixed compression

This patch adds fallback to fixed compression
feature during dynamic compression, when the input data size
is greater than IM buffer size / 1.1. This feature doesn't
stop compression proccess when IM buffer can be too small
to handle produced data.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agocompress/isal: add version display
Tomasz Cel [Mon, 11 Feb 2019 09:18:52 +0000 (10:18 +0100)]
compress/isal: add version display

Display information about ISA-L lib version in UTs.

Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
5 years agocompress/qat: fix setup inter buffers
Marko Kovacevic [Thu, 24 Jan 2019 15:03:04 +0000 (15:03 +0000)]
compress/qat: fix setup inter buffers

This patch fixes qat comp setup inter_buffers
memory allocation size to a broader size
then just 2MB

Fixes: a124830a6f00 ("compress/qat: enable dynamic huffman encoding")
Cc: stable@dpdk.org
Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
5 years agotest: add result field to mod exp and inv
Arek Kusztal [Fri, 8 Feb 2019 11:13:38 +0000 (12:13 +0100)]
test: add result field to mod exp and inv

This patch adds result field to modular exponentiation and
modular multiplicative inverse tests

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agocrypto/openssl: add result field to mod exp and inv
Arek Kusztal [Fri, 8 Feb 2019 11:13:37 +0000 (12:13 +0100)]
crypto/openssl: add result field to mod exp and inv

This patch adds result field to modular exponentiation and modular
multiplicative inverse operations in openssl pmd functions

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
5 years agocryptodev: add result field to mod exp and inv
Arek Kusztal [Fri, 8 Feb 2019 11:13:36 +0000 (12:13 +0100)]
cryptodev: add result field to mod exp and inv

This commit adds result field to be used when modular exponentiation or
modular multiplicative inverse operation is used

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
5 years agocryptodev: restore crypto op alignment and layout
Konstantin Ananyev [Thu, 7 Mar 2019 14:13:14 +0000 (14:13 +0000)]
cryptodev: restore crypto op alignment and layout

in 18.08 new cache-aligned structure rte_crypto_asym_op was introduced.
As it also was included into rte_crypto_op, it caused implicit change
in rte_crypto_op layout and alignment: now rte_crypto_op is cache-line
aligned has a hole of 40/104 bytes between phys_addr and sym/asym op.
It looks like unintended ABI breakage, plus such change can cause
negative performance effects:
- now status and sym[0].m_src lies on different cache-lines, so
  post-process code would need extra cache-line read.
- new alignment causes grow of the space requirements and cache-line
  reads/updates for structures that contain rte_crypto_op inside.
As there seems no actual need to have rte_crypto_asym_op cache-line
aligned, and rte_crypto_asym_op is not intended to be used on it's own -
the simplest fix is just to remove cache-line alignment for it.
As the immediate positive effect: on IA ipsec-secgw performance increased
by 5-10% (depending on the crypto-dev and algo used).
My guess that on machines with 128B cache-line and lookaside-protocol
capable crypto devices the impact will be even more noticeable.

Fixes: 26008aaed14c ("cryptodev: add asymmetric xform and op definitions")
Cc: stable@dpdk.org
Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
5 years agodrivers/net: fix possible overflow using strlcat
Chaitanya Babu Talluri [Fri, 22 Mar 2019 07:51:42 +0000 (07:51 +0000)]
drivers/net: fix possible overflow using strlcat

strcat does not check the destination length and there might be
chances of string overflow so instead of strcat, strlcat is used.

Fixes: 540a211084a7 ("bnx2x: driver core")
Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info")
Cc: stable@dpdk.org
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Shahed Shaikh <shshaikh@marvell.com>
5 years agonet/bonding: fix queue index types
David Marchand [Wed, 20 Mar 2019 11:47:22 +0000 (12:47 +0100)]
net/bonding: fix queue index types

Caught by code review, rxq and txq indexes are on 16bits.

Fixes: d1d1e664c6c4 ("bonding: free queue memory when closing")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix packet count type for LACP
David Marchand [Wed, 20 Mar 2019 11:47:21 +0000 (12:47 +0100)]
net/bonding: fix packet count type for LACP

Caught by code review, those variables are supposed to be on 16bits to
avoid endless loops in the (unlikely?) case where the application asks
for receiving more than 256 packets and the accumulated num_rx_total
count reaches 256:

uint16_t num_rx_total = 0;
uint8_t j, k;

j = num_rx_total;
num_rx_total += rte_eth_rx_burst();

for (k = j; k < 2 && k < num_rx_total; k++)
rte_prefetch0(rte_pktmbuf_mtod(bufs[k], void *));

while (j < num_rx_total) {
j++;
}

Fixes: 46fb43683679 ("bond: add mode 4")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix slave id types
David Marchand [Wed, 20 Mar 2019 11:47:20 +0000 (12:47 +0100)]
net/bonding: fix slave id types

Caught by code review, with port id conversion to 16bits, the slave id
have been extended to 16bits as well (both slave index and count).

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/bonding: fix port id types
David Marchand [Wed, 20 Mar 2019 11:47:19 +0000 (12:47 +0100)]
net/bonding: fix port id types

Following the port id conversion to 16bits, two references to bonding
port id have been missed.

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agodoc: fix examples in bonding guide
David Marchand [Wed, 20 Mar 2019 11:47:18 +0000 (12:47 +0100)]
doc: fix examples in bonding guide

Removed incorrect space character and fixed PCI addresses.

Fixes: fc1f2750a3ec ("doc: programmers guide")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/cxgbe: fix missing checksum flags and packet type
Vishal Kulkarni [Wed, 20 Mar 2019 11:48:21 +0000 (17:18 +0530)]
net/cxgbe: fix missing checksum flags and packet type

Checksum good offload flags are not being set and some of the
packet type flags are missing on received packets. So, rework
Rx path to set proper ol_flags and packet_type in mbufs.

Fixes: 78fc1a716ae8 ("cxgbe: improve Rx performance")
Cc: stable@dpdk.org
Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: remove unused code in Rx path
Vishal Kulkarni [Wed, 20 Mar 2019 11:49:16 +0000 (17:19 +0530)]
net/cxgbe: remove unused code in Rx path

All Rx packet handling is done in process_responses() and hence
t4_ethrx_handler() never gets called. So, remove it.

Signed-off-by: Vishal Kulkarni <vishal@chelsio.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/bonding: fix LACP negotiation
Liang Zhang [Thu, 21 Mar 2019 10:22:47 +0000 (18:22 +0800)]
net/bonding: fix LACP negotiation

When monitor(port-mirroring) traffic from other LACP port-channel,
rx_machine_update may be receiving other LACP negotiation packets.
Thus bond mode 4 negotiation will fail.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
Cc: stable@dpdk.org
Signed-off-by: Liang Zhang <zhangliang@bigo.sg>
Acked-by: Chas Williams <chas3@att.com>
5 years agoethdev: check for invalid device name
Stephen Hemminger [Thu, 14 Mar 2019 16:20:47 +0000 (09:20 -0700)]
ethdev: check for invalid device name

Do not allow creating an Ethernet device with a name over the
allowed maximum (or zero length).
This is safer than silently truncating which is what happens now.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Ali Alnubani <alialnu@mellanox.com>
5 years agonet/sfc: fix speed capabilities reported in device info
Andrew Rybchenko [Tue, 19 Mar 2019 16:36:00 +0000 (16:36 +0000)]
net/sfc: fix speed capabilities reported in device info

Phy capabilities are bit offsets in libefx, but was used as bit masks.

Fixes: d23f3a89ab54 ("net/sfc: support link speed and duplex settings")
Fixes: f82e33afbbb9 ("net/sfc: support link speeds up to 100G")
Cc: stable@dpdk.org
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/dpaa2: accept packets with checksum error
Shreyansh Jain [Tue, 19 Mar 2019 13:10:55 +0000 (13:10 +0000)]
net/dpaa2: accept packets with checksum error

Until now, DPAA2 driver was configured to drop any packet which
was marked as malformed by hardware - which included those with
wrong checksum.
With this patch, that configuration has been removed - hereafter,
all packets arriving on a DPMAC link would be forwarded to a DPNI
and further processing would be done as configured for a standard
packet path.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
5 years agonet/tap: fix getting max iovec
Oleg Polyakov [Mon, 18 Mar 2019 18:20:47 +0000 (14:20 -0400)]
net/tap: fix getting max iovec

If the value _SC_IOV_MAX is missing, sysconf returns -1.
In this case, iov_max is set to a default value of 1024.
This should never happen except for redhat bug:
   https://bugzilla.redhat.com/show_bug.cgi?id=1504165

Fixes: ec12df9504fe ("net/tap: fix support for large Rx queues")
Cc: stable@dpdk.org
Signed-off-by: Oleg Polyakov <olegp123@walla.co.il>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agonet/nfp: fix possible buffer overflow
Pallantla Poornima [Fri, 8 Mar 2019 10:28:05 +0000 (10:28 +0000)]
net/nfp: fix possible buffer overflow

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

Fixes: 896c265ef954 ("net/nfp: use new CPP interface")
Fixes: c4171b520b3f ("net/nfp: support PF multiport")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Tested-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agoapp/testpmd: fix stdout flush after printing stats
Igor Romanov [Mon, 18 Mar 2019 11:35:47 +0000 (11:35 +0000)]
app/testpmd: fix stdout flush after printing stats

User can specify stats period(n). The statistics should be available
to user every n second. But the print_stats() function does not
force stdout to be flushed, so for instance, a user reading testpmd's
stdout through pipe will not be able to read it until the stdout
buffer is filled.

Fixes: cfea1f3048d1 ("app/testpmd: print statistics periodically")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoethdev: highlight that all-multicast is retained on restart
Andrew Rybchenko [Wed, 19 Dec 2018 06:23:00 +0000 (06:23 +0000)]
ethdev: highlight that all-multicast is retained on restart

All-multicast is a part of receive mode configuration and it is
better to mention explicitly that it is retained across restart.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoethdev: advertise default MAC as retained on restart
Andrew Rybchenko [Wed, 19 Dec 2018 06:22:59 +0000 (06:22 +0000)]
ethdev: advertise default MAC as retained on restart

The documentation says MAC addresses array is retained and
it is logical to assume that default MAC address is retained
as well.

Also some PMDs do not allow to change the default MAC in
running state (see RTE_ETH_DEV_NOLIVE_MAC_ADDR).

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoethdev: advertise MTU as retained across stop/start
Andrew Rybchenko [Wed, 19 Dec 2018 06:22:58 +0000 (06:22 +0000)]
ethdev: advertise MTU as retained across stop/start

Changing MTU in running state may return -EBUSY saying that
MTU cannot be changed when the port is running. It assumes
that changes may be done in stopped and started (but some
PMDs may reject it) state and it is logical to require that
changes done in any of these states are retained.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
5 years agonet/ice: speed up to retrieve EEPROM
Leyi Rong [Mon, 18 Mar 2019 05:50:39 +0000 (13:50 +0800)]
net/ice: speed up to retrieve EEPROM

Replace ice_read_sr_word with ice_read_sr_buf in ice_get_eeprom.

Fixes: d0dd1c8e1997 ("net/ice: support EEPROM information getting")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agovhost: support requests only handled by external backend
Maxime Coquelin [Tue, 19 Mar 2019 10:54:17 +0000 (11:54 +0100)]
vhost: support requests only handled by external backend

External backends may have specific requests to handle, and so
we don't want the vhost-user lib to handle these requests as
errors.

This patch also changes the experimental API by introducing
RTE_VHOST_MSG_RESULT_NOT_HANDLED so that vhost-user lib
can report an error if a message is handled neither by
the vhost-user library nor by the external backend.

The logic changes a bit so that if the callback returns
with ERR, OK or REPLY, it is considered the message
is handled by the external backend so it won't be
handled by the vhost-user library.
It is still possible for an external backend to listen
to requests that have to be handled by the vhost-user
library like SET_MEM_TABLE, but the callback have to
return NOT_HANDLED in that case.

Vhost-crypto backend is also adapted to this API change.

Suggested-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agovhost: add API to set protocol features flags
Maxime Coquelin [Tue, 19 Mar 2019 10:54:16 +0000 (11:54 +0100)]
vhost: add API to set protocol features flags

rte_vhost_driver_set_protocol_features API is to be used
by external backends to advertise vhost-user protocol
features it supports.

It has to be called after rte_vhost_driver_register() and
before rte_vhost_driver_start().

Example of usage to advertize VHOST_USER_PROTOCOL_F_FOOBAR
protocol feature:

const char *path = "/tmp/vhost-user";
uint64_t protocol_features;
rte_vhost_driver_register(path, 0);
rte_vhost_driver_get_protocol_features(path, &protocol_features);
protocol_features |= VHOST_USER_PROTOCOL_F_FOOBAR;
rte_vhost_driver_set_protocol_features(path, protocol_features);
rte_vhost_driver_start(path);

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Tested-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio: improve batching in standard Rx path
Tiwei Bie [Tue, 19 Mar 2019 06:43:12 +0000 (14:43 +0800)]
net/virtio: improve batching in standard Rx path

This patch improves descriptors refill by using the same
batching strategy as done in in-order and mergeable path.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add control queue helper for split ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:11 +0000 (14:43 +0800)]
net/virtio: add control queue helper for split ring

Add a helper for sending commands in split ring to make the
code consistent with the corresponding code in packed ring.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add interrupt helper for split ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:10 +0000 (14:43 +0800)]
net/virtio: add interrupt helper for split ring

Add a helper for disabling interrupts in split ring to make the
code consistent with the corresponding code in packed ring.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: drop unused field in Tx region structure
Tiwei Bie [Tue, 19 Mar 2019 06:43:09 +0000 (14:43 +0800)]
net/virtio: drop unused field in Tx region structure

Drop the unused field tx_indir_pq from virtio_tx_region
structure.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: drop redundant suffix in packed ring structure
Tiwei Bie [Tue, 19 Mar 2019 06:43:08 +0000 (14:43 +0800)]
net/virtio: drop redundant suffix in packed ring structure

Drop redundant suffix (_packed and _event) from the fields in
packed ring structure.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: refactor virtqueue structure
Tiwei Bie [Tue, 19 Mar 2019 06:43:07 +0000 (14:43 +0800)]
net/virtio: refactor virtqueue structure

Put split ring and packed ring specific fields into separate
sub-structures, and also union them as they won't be available
at the same time.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: optimize flags update for packed ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:06 +0000 (14:43 +0800)]
net/virtio: optimize flags update for packed ring

Cache the AVAIL, USED and WRITE bits to avoid calculating
them as much as possible. Note that, the WRITE bit isn't
cached for control queue.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: add barrier in interrupt enable
Tiwei Bie [Tue, 19 Mar 2019 06:43:05 +0000 (14:43 +0800)]
net/virtio: add barrier in interrupt enable

Typically, after enabling Rx interrupt, a check should be done
to make sure that there is no new incoming packets before going
to sleep. So a barrier is needed to make sure that any following
check won't happen before the interrupt is actually enabled.

Fixes: c056be239db5 ("net/virtio: add Rx interrupt enable/disable functions")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix interrupt helper for packed ring
Tiwei Bie [Tue, 19 Mar 2019 06:43:04 +0000 (14:43 +0800)]
net/virtio: fix interrupt helper for packed ring

When disabling interrupt, the shadow event flags should also be
updated accordingly. The unnecessary wmb is also dropped.

Fixes: e9f4feb7e622 ("net/virtio: add packed virtqueue helpers")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio: fix typo in packed ring init
Tiwei Bie [Tue, 19 Mar 2019 06:43:03 +0000 (14:43 +0800)]
net/virtio: fix typo in packed ring init

The pointer to event structure should be cast to uintptr_t first.

Fixes: f803734b0f2e ("net/virtio: vring init for packed queues")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost: fix interrupt suppression for the split ring
Jiayu Hu [Sun, 17 Mar 2019 06:38:32 +0000 (14:38 +0800)]
vhost: fix interrupt suppression for the split ring

The VIRTIO_RING_F_EVENT_IDX feature of split ring might
be broken, as the value of signalled_used is invalid
after live migration, start up and virtio driver reload.
This patch fixes it by using signalled_used_valid.

In addition, this patch makes the VIRTIO_RING_F_EVENT_IDX
implementation of split ring match kernel backend to suppress
more interrupts.

Fixes: e37ff954405a ("vhost: support virtqueue interrupt/notification suppression")
Cc: stable@dpdk.org
Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Yinan Wang <yinan.wang@intel.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/virtio-user: fix multiqueue with vhost kernel
Tiwei Bie [Tue, 12 Mar 2019 07:13:07 +0000 (15:13 +0800)]
net/virtio-user: fix multiqueue with vhost kernel

The multiqueue support in virtio-user with vhost kernel backend
is broken when tap name isn't specified by users explicitly,
because the tap name returned by ioctl(TUNSETIFF) isn't saved
properly, and multiple tap interfaces will be created in this
case. Fix this by saving the dynamically allocated tap name
first before reusing the ifr structure. Besides, also make it
possible to support the format string in tap name (e.g. foo%d)
specified by users explicitly.

Fixes: 791b43e08842 ("net/virtio-user: specify MAC of the tap")
Cc: stable@dpdk.org
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agovhost: prevent disabled rings to be processed with zero-copy
Maxime Coquelin [Thu, 28 Feb 2019 17:57:04 +0000 (18:57 +0100)]
vhost: prevent disabled rings to be processed with zero-copy

The vhost-user spec says that once the vring is disabled, the
client has to stop processing it. But it can happen when
dequeue zero-copy is enabled if outstanding descriptors buffers
are still being processed by an external NIC or another guest.

The fix consists in draining the zmbufs list to ensure no more
descriptors buffers are in the wild.

Note that this fix is only working in the case REPLY_ACK
protocol feature is enabled, which is not the case by default
for now (it is only enabled when IOMMU feature is enabled in
the vhost library).

Fixes: b0a985d1f340 ("vhost: add dequeue zero copy")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
5 years agonet/octeontx: fix vdev name
Stephen Hemminger [Wed, 13 Mar 2019 21:58:15 +0000 (14:58 -0700)]
net/octeontx: fix vdev name

The octeontx driver is creating vdev with name  "OCTEONTX_PMD"
which is an artifact from how RTE_PMD_REGISTER_VDEV arguments
work.

Change to use the same convention as all the other network
drivers ie "net_octeontx").

Fixes: f7be70e5130e ("net/octeontx: add net device probe and remove")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agonet/enic: fix max MTU calculation
Hyong Youb Kim [Thu, 14 Mar 2019 11:05:32 +0000 (04:05 -0700)]
net/enic: fix max MTU calculation

The maximum packet length (max_pkt_len) from the firmware does not
include CRC, so do not subtract 4 when deriving the max MTU. This
change effectively increases the max MTU by 4B. Apps often assume max
MTU = max_rx_pkt_len - 14 (ethernet header), and attempt to set the
MTU to that value (i.e. set MTU to max HW value). This change
incidentally allows such apps to change MTU to max value successfully.

Fixes: bb34ffb848a0 ("net/enic: determine max egress packet size and max MTU")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agoexamples/ethtool: remove query of default config
Thomas Monjalon [Wed, 13 Mar 2019 10:09:09 +0000 (11:09 +0100)]
examples/ethtool: remove query of default config

The default config is used if the setup parameter is NULL.
No need to query the default config with rte_eth_dev_info_get().
The function call will be removed with another useless info.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/atlantic: fix xstats return
Igor Russkikh [Tue, 12 Mar 2019 15:25:10 +0000 (15:25 +0000)]
net/atlantic: fix xstats return

Max number of xstats items was returned instead of actual number
of filled in records.

Fixes: fbe059e87209 ("net/atlantic: implement device statistics")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix missing VLAN filter offload
Igor Russkikh [Tue, 12 Mar 2019 15:25:07 +0000 (15:25 +0000)]
net/atlantic: fix missing VLAN filter offload

Original vlan offload code declared callbacks, but did not
enable the feature offload bit

Fixes: f7c2c2c8c558 ("net/atlantic: implement VLAN filters and offloads")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: eliminate excessive log levels on Rx/Tx
Igor Russkikh [Tue, 12 Mar 2019 15:25:05 +0000 (15:25 +0000)]
net/atlantic: eliminate excessive log levels on Rx/Tx

Default rxtx logging used ERR level, that caused logger to always
trigger. That may cause perf degradation even if logger was not enabled
but compiled in.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix link configuration
Igor Russkikh [Tue, 12 Mar 2019 15:25:03 +0000 (15:25 +0000)]
net/atlantic: fix link configuration

In case link speed is re configured after port start, it does not
takes the requested speed value, but instead just sets full autoneg
mask.

Fixes: 7943ba05f67c ("net/atlantic: add link status and interrupt management")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix EEPROM get for small and uneven lengths
Pavel Belous [Tue, 12 Mar 2019 15:25:01 +0000 (15:25 +0000)]
net/atlantic: fix EEPROM get for small and uneven lengths

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: use EEPROM magic as a device address
Pavel Belous [Tue, 12 Mar 2019 15:24:59 +0000 (15:24 +0000)]
net/atlantic: use EEPROM magic as a device address

Default dev addr is replaced with magic field from the request.
Length is allowed to be less than maximum.
SMBUS access bit definitions also better organised now.

Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: Pavel Belous <pavel.belous@aquantia.com>
5 years agonet/atlantic: fix buffer overflow
Pavel Belous [Tue, 12 Mar 2019 15:24:57 +0000 (15:24 +0000)]
net/atlantic: fix buffer overflow

Found by Coverity scan. This is a real memory corruption.
There is no need in extra RTE_ALIGN macros since the
request/result structures are 4-byte aligned by definition.

Coverity issue: 323518, 323520
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: remove extra checks for error codes
Igor Russkikh [Tue, 12 Mar 2019 15:24:55 +0000 (15:24 +0000)]
net/atlantic: remove extra checks for error codes

Found by Coverity scan. Checks are useless
because at these code places err is always zero.

Fixes: 86d36773bd42 ("net/atlantic: implement firmware operations")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: remove unused variable
Igor Russkikh [Tue, 12 Mar 2019 15:24:53 +0000 (15:24 +0000)]
net/atlantic: remove unused variable

Found by coverity scan.

Coverity issue: 323512
Fixes: 7906661edac6 ("net/atlantic: add b0 hardware layer")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/atlantic: fix negative error codes
Igor Russkikh [Tue, 12 Mar 2019 15:24:52 +0000 (15:24 +0000)]
net/atlantic: fix negative error codes

These are just convention breakage on rte_errno,
no real harm from that.

Fixes: 2b1472d7150c ("net/atlantic: implement Tx path")
Cc: stable@dpdk.org
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
5 years agonet/qede: fix Rx packet drop
Shahed Shaikh [Tue, 12 Mar 2019 16:51:14 +0000 (09:51 -0700)]
net/qede: fix Rx packet drop

There is a corner case in which driver won't post
receive buffers when driver has processed all received packets
in single loop (i.e. hw_consumer == sw_consumer) and then
HW will start dropping packets since it did not see new receive
buffers posted.

This corner case is seen when size of Rx ring is less than or equals
Rx packet burst count for dev->rx_pkt_burst().

Fixes: 8f2312474529 ("net/qede: fix performance bottleneck in Rx path")
Cc: stable@dpdk.org
Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
5 years agoethdev: fix method name in doxygen comment
Rami Rosen [Tue, 12 Mar 2019 16:07:42 +0000 (18:07 +0200)]
ethdev: fix method name in doxygen comment

This patch fixes rte_ethdev header file to use the correct method name,
namely to use rte_eth_dev_info_get() instead of
rte_eth_dev_infos_get().

Fixes: a4996bd89c42 ("ethdev: new Rx/Tx offloads API")
Fixes: 4f5701f28bd4 ("examples: fix RSS hash function configuration")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agoapp/testpmd: fix a typo in log message
Rami Rosen [Tue, 12 Mar 2019 05:48:43 +0000 (07:48 +0200)]
app/testpmd: fix a typo in log message

This patch fixes a typo in test-pmd/cmdline.c,
succcessfully->successfully
Two C's are good enough for success...

Fixes: a09f3e4c5046 ("app/testpmd: add hash configuration")
Cc: stable@dpdk.org
Signed-off-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
5 years agoapp/testpmd: remove unused field from port struct
David Marchand [Mon, 11 Mar 2019 15:35:19 +0000 (16:35 +0100)]
app/testpmd: remove unused field from port struct

Remove some leftover from a previous rework.

Fixes: c4bcc342c8ee ("app/testpmd: refactor ieee1588 forwarding")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agonet/ixgbe: restore VLAN filter for VF
David Harton [Fri, 15 Mar 2019 16:08:32 +0000 (12:08 -0400)]
net/ixgbe: restore VLAN filter for VF

ixgbevf VLAN strip and extend capabilities were removed when
migrating to the bit flags implementation.

Restoring the capability to enable the VLAN strip offload at
configuration time.

Fixes: ec3b1124d14d ("net/ixgbe: convert to new Rx offloads API")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/mlx5: support new representor naming format
Dekel Peled [Sun, 17 Mar 2019 06:23:03 +0000 (08:23 +0200)]
net/mlx5: support new representor naming format

Kernel update [1] introduce new format of representors names.
This patch implements RFC [2], updating MLX5 PMD to support the new
format, while maintaining support of the existing format.

[1] https://github.com/torvalds/linux/commit/c12ecc2
[2] http://mails.dpdk.org/archives/dev/2019-March/125676.html

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/nfp: fix RSS query
Alejandro Lucero [Tue, 12 Mar 2019 10:19:27 +0000 (10:19 +0000)]
net/nfp: fix RSS query

Current code is not properly giving the RSS information
regarding the redirection table.

Fixes: 934e4c60fbff ("nfp: add RSS")
Cc: stable@dpdk.org
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agoapp/testpmd: optimize MAC swap for Arm
Ruifeng Wang [Tue, 12 Mar 2019 05:35:27 +0000 (13:35 +0800)]
app/testpmd: optimize MAC swap for Arm

Improved MAC swap performance for ARM platform.
The improvement was achieved by using neon intrinsics
to save CPU cycles and doing swap for four packets
at a time.
The optimization had 15% - 20% throughput boost
in testpmd MAC swap mode.

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
5 years agonet/bnxt: suppress spurious error log
Stephen Hemminger [Thu, 14 Mar 2019 21:32:14 +0000 (14:32 -0700)]
net/bnxt: suppress spurious error log

The driver multiple rxq allocation logs a message at error level
but it really is a debug message.

Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
5 years agonet/bnxt: silence IOVA warnings
Stephen Hemminger [Thu, 14 Mar 2019 21:32:13 +0000 (14:32 -0700)]
net/bnxt: silence IOVA warnings

When using bnxt on bare-metal with vfio-pci, the driver logs an
unnecessary warning. Hardware works fine, message is not urgent.
Change it to INFO level.

Fixes: 62196f4e0941 ("mem: rename address mapping function to IOVA")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: use notice as default log level
Stephen Hemminger [Mon, 11 Mar 2019 18:11:43 +0000 (11:11 -0700)]
net/bnxt: use notice as default log level

Make bnxt driver consistent with all other network drivers
by setting default to NOTICE for log level.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: do not double space version message
Stephen Hemminger [Mon, 11 Mar 2019 18:11:42 +0000 (11:11 -0700)]
net/bnxt: do not double space version message

The version message is double spaced in the log.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/bnxt: change PTP message to debug level
Stephen Hemminger [Mon, 11 Mar 2019 18:11:41 +0000 (11:11 -0700)]
net/bnxt: change PTP message to debug level

This message doesn't need to be at INFO level, it is a normal
situation and only useful for debugging.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
5 years agonet/mlx5: fix packet inline on Tx queue wraparound
Shahaf Shuler [Sun, 10 Mar 2019 08:14:10 +0000 (10:14 +0200)]
net/mlx5: fix packet inline on Tx queue wraparound

Inlining a packet to WQE that cross the WQ wraparound, i.e. the WQE
starts on the end of the ring and ends on the beginning, is not
supported and blocked by the data path logic.

However, in case of TSO, an extra inline header is required before
inlining. This inline header is not taken into account when checking if
there is enough room left for the required inline size.
On some corner cases were
(ring_tailroom - inline header) < inline size < ring_tailroom ,
this can lead to WQE being written outsize of the ring buffer.

Fixing it by always assuming the worse case that inline of packet will
require the inline header.

Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO")
Cc: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/qede: support IOVA VA mode
Kevin Traynor [Fri, 8 Mar 2019 09:28:55 +0000 (09:28 +0000)]
net/qede: support IOVA VA mode

Set RTE_PCI_DRV_IOVA_AS_VA in drv_flags. This allows initializing qede
PMD as non-root also on Linux v4.x, where /proc/self/pagemap can't be
acccessed without CAP_SYS_ADMIN privileges.

The flag was introduced generically but not in pmds in:
commit 815c7deaed2d ("pci: get IOMMU class on Linux")

Cc: stable@dpdk.org
Acked-by: Shahed Shaikh <shshaikh@marvell.com>
Acked-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
5 years agoethdev: replace snprintf with strlcpy on init
Stephen Hemminger [Thu, 28 Feb 2019 22:47:54 +0000 (14:47 -0800)]
ethdev: replace snprintf with strlcpy on init

Don't need to use snprintf for simple name copy.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Rami Rosen <ramirose@gmail.com>
5 years agoethdev: replace snprintf with strlcpy for owner
Stephen Hemminger [Thu, 28 Feb 2019 22:47:53 +0000 (14:47 -0800)]
ethdev: replace snprintf with strlcpy for owner

The set_port_owner was copying a string between structures of the
same type, therefore the name could never be truncated (unless source
string was not null terminated).  Use strlcpy which does it better.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/i40e: fix time sync for 25G
Qi Zhang [Mon, 11 Mar 2019 07:42:20 +0000 (15:42 +0800)]
net/i40e: fix time sync for 25G

Time sync increment value is not configured for 25G device.

The patch fix this issue by setting the same value as 40G, this
aligned with kernel driver's behaviour.

Fixes: 75d133dd3296 ("net/i40e: enable 25G device")
Cc: stable@dpdk.org
Reported-by: Michael Luo <michael.luo@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Michael Luo <michael.luo@intel.com>
5 years agonet/nfp: fix setting MAC address
Pablo Cascón [Fri, 8 Mar 2019 15:40:47 +0000 (15:40 +0000)]
net/nfp: fix setting MAC address

Some firmwares, mostly for VFs, do not advertise the feature /
capability of changing the MAC address while the interface is up. With
such firmware a request to change the MAC address that at the same
time also tries to enable the not available feature will be denied by
the firmware resulting in an error message like:

nfp_net_reconfig(): Error nfp_net reconfig for ctrl: 80000000 update: 800

Fix set_mac_addr by not trying to enable a feature if it is not
advertised by the firmware.

Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change")
Cc: stable@dpdk.org
Signed-off-by: Pablo Cascón <pablo.cascon@netronome.com>
Acked-by: Alejandro Lucero <alejandro.lucero@netronome.com>
5 years agonet/i40e: update queue number check for rounding
Kevin Traynor [Tue, 5 Mar 2019 16:30:39 +0000 (16:30 +0000)]
net/i40e: update queue number check for rounding

Since rounding up the requested queue pairs to allow the VF to
request a non-aligned number was added, it may happen that the
requested number is less than the available num of queues but the
rounded up number is greater. In this case, it is not caught with
the usual checks but later when there is a reset and failed setup.

By rounding earlier the checks can be done before a failed reset
occurs, and a rounded max amount of available queues can be returned
to the VF.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agomalloc: add NUMA-aware realloc function
Tomasz Jozwiak [Fri, 1 Mar 2019 08:46:16 +0000 (09:46 +0100)]
malloc: add NUMA-aware realloc function

Currently, rte_realloc will not respect original allocation's
NUMA node when memory cannot be resized, and there is no
NUMA-aware equivalent of rte_realloc. This patch adds such a function.

The new API will ensure that reallocated memory stays on
requested NUMA node, as well as allow moving allocated memory
to a different NUMA node.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agodoc: add notes about eventdev producer/consumer dependency
Pavan Nikhilesh [Tue, 12 Mar 2019 20:41:13 +0000 (20:41 +0000)]
doc: add notes about eventdev producer/consumer dependency

EventDev i.e consumer needs to be started before starting the
event producers.
Update documentation of EventDev and EventDev adapters.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
Reviewed-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
5 years agoexamples/eventdev: start ethdev after adapter setup
Pavan Nikhilesh [Tue, 12 Mar 2019 20:41:09 +0000 (20:41 +0000)]
examples/eventdev: start ethdev after adapter setup

Start ethdev after the Rx/Tx adapter setup is complete as in some
architectures it might lead to undefined behaviour or events being
dropped.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Nikhil Rao <nikhil.rao@intel.com>
5 years agoapp/eventdev: start event producers after eventdev
Pavan Nikhilesh [Tue, 12 Mar 2019 20:41:05 +0000 (20:41 +0000)]
app/eventdev: start event producers after eventdev

Start event producers after eventdev i.e. consumer is started as in some
architectures it might lead to undefined behaviour or events being
dropped.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
5 years agoevent/opdl: replace sprintf with snprintf
Pallantla Poornima [Mon, 4 Feb 2019 07:18:02 +0000 (07:18 +0000)]
event/opdl: replace sprintf with snprintf

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

Fixes: 3c7f3dcfb0 ("event/opdl: add PMD main body and helper function")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
5 years agoapp/eventdev: configure optimum timers per adapter
Pavan Nikhilesh [Mon, 11 Mar 2019 06:49:28 +0000 (06:49 +0000)]
app/eventdev: configure optimum timers per adapter

Previously, the total number of event timers per adapter was set to an
arbitrary value, set it to mempool size instead as it defines the max
event timers that can be armed.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
5 years agoapp/eventdev: follow proper teardown sequence
Pavan Nikhilesh [Fri, 1 Mar 2019 07:16:47 +0000 (07:16 +0000)]
app/eventdev: follow proper teardown sequence

Stop eventdev before closing it.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
5 years agoexamples/eventdev: follow proper teardown sequence
Pavan Nikhilesh [Fri, 1 Mar 2019 07:16:45 +0000 (07:16 +0000)]
examples/eventdev: follow proper teardown sequence

Stop eventdev before closing it.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>