dpdk.git
4 years agodoc: fix default symbol binding in ABI guide
Ray Kinsella [Wed, 6 May 2020 15:41:05 +0000 (16:41 +0100)]
doc: fix default symbol binding in ABI guide

The document abi_versioning.rst incorrectly instructs the developer to
add BIND_DEFAULT_SYMBOL to the public header, not the source file. This
commit fixes the issue and adds some clarifications.

The commit also clarifies the use of use_function_versioning in the
meson/ninja build system, and does some minor re-organization of the
document.

Fixes: f1ef9794f9bd ("doc: add ABI guidelines")
Cc: stable@dpdk.org
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
4 years agodoc: add reason for three-part ABI versioning
Ray Kinsella [Tue, 5 May 2020 08:56:48 +0000 (09:56 +0100)]
doc: add reason for three-part ABI versioning

Clarify the reasons behind the three part version numbering scheme.
Documents the fixes made in f26c2b3.

Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility")
Cc: stable@dpdk.org
Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: add RCU defer queue API in release notes
Honnappa Nagarahalli [Wed, 6 May 2020 03:54:15 +0000 (22:54 -0500)]
doc: add RCU defer queue API in release notes

Added a note about RCU defer queue APIs.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agodoc: fix LTO config option
Matteo Croce [Tue, 12 May 2020 19:48:56 +0000 (21:48 +0200)]
doc: fix LTO config option

The documentation says that CONFIG_ENABLE_LTO enables LTO during the
build, but the correct value actually is CONFIG_RTE_ENABLE_LTO.

Fixes: 098cc0fea3be ("build: add option to enable LTO")
Cc: stable@dpdk.org
Signed-off-by: Matteo Croce <mcroce@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrzej Ostruszka <aostruszka@marvell.com>
4 years agomempool/octeontx2: mark internal symbols
Pavan Nikhilesh [Wed, 13 May 2020 09:55:57 +0000 (15:25 +0530)]
mempool/octeontx2: mark internal symbols

Move the internal symbols to INTERNAL sections so that any
change in them is not reported as ABI breakage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agocommon/octeontx2: mark internal symbols
Pavan Nikhilesh [Wed, 13 May 2020 09:55:56 +0000 (15:25 +0530)]
common/octeontx2: mark internal symbols

Move the internal symbols to INTERNAL sections so that any
change in them is not reported as ABI breakage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agovhost: fix potential fd leak
Xuan Ding [Mon, 18 May 2020 13:17:04 +0000 (14:17 +0100)]
vhost: fix potential fd leak

Vhost will create temporary file when receiving VHOST_USER_GET_INFLIGHT_FD
message. Malicious guest can send endless this message to drain out the
resource of host.

When receiving VHOST_USER_GET_INFLIGHT_FD message repeatedly, closing the
file created during the last handling of this message.

CVE-2020-10726
Fixes: d87f1a1cb7b666550 ("vhost: support inflight info sharing")
Cc: stable@dpdk.org
Signed-off-by: Xuan Ding <xuan.ding@intel.com>
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: fix potential memory space leak
Xiaolong Ye [Mon, 18 May 2020 13:17:03 +0000 (14:17 +0100)]
vhost: fix potential memory space leak

A malicious container which has direct access to the vhost-user socket
can keep sending VHOST_USER_GET_INFLIGHT_FD messages which may cause
leaking resources until resulting a DOS. Fix it by unmapping the
dev->inflight_info->addr before assigning new mapped addr to it.

CVE-2020-10726
Fixes: d87f1a1cb7b6 ("vhost: support inflight info sharing")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost: fix translated address not checked
Marvin Liu [Mon, 18 May 2020 13:17:02 +0000 (14:17 +0100)]
vhost: fix translated address not checked

Malicious guest can construct desc with invalid address and zero buffer
length. That will request vhost to check both translated address and
translated data length. This patch will add missed address check.

CVE-2020-10725
Fixes: 75ed51697820 ("vhost: add packed ring batch dequeue")
Fixes: ef861692c398 ("vhost: add packed ring batch enqueue")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agovhost/crypto: validate keys lengths
Maxime Coquelin [Mon, 18 May 2020 13:17:01 +0000 (14:17 +0100)]
vhost/crypto: validate keys lengths

transform_cipher_param() and transform_chain_param() handle
the payload data for the VHOST_USER_CRYPTO_CREATE_SESS
message. These payloads have to be validated, since it
could come from untrusted sources.

Two buffers and their lengths are defined in this payload,
one the the auth key and one for the cipher key. But above
functions do not validate the key length inputs, which could
lead to read out of bounds, as buffers have static sizes of
64 bytes for the cipher key and 512 bytes for the auth key.

This patch adds necessary checks on the key length field
before being used.

CVE-2020-10724
Fixes: e80a98708166 ("vhost/crypto: add session message handler")
Cc: stable@dpdk.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
4 years agovhost: fix vring index check
Maxime Coquelin [Mon, 18 May 2020 13:17:00 +0000 (14:17 +0100)]
vhost: fix vring index check

vhost_user_check_and_alloc_queue_pair() is used to extract
a vring index from a payload. This function validates the
index and is called early on in when performing message
handling. Most message handlers depend on it correctly
validating the vring index.

Depending on the message type the vring index is in
different parts of the payload. The function contains a
switch/case for each type and copies the index. This is
stored in a uint16. This index is then validated. Depending
on the message, the source index is an unsigned int. If
integer truncation occurs (uint->uint16) the top 16 bits
of the index are never validated.

When they are used later on  (e.g. in
vhost_user_set_vring_num() or vhost_user_set_vring_addr())
it can lead to out of bound indexing. The out of bound
indexed data gets written to, and hence this can cause
memory corruption.

This patch fixes this vulnerability by declaring vring
index as an unsigned int in
vhost_user_check_and_alloc_queue_pair().

CVE-2020-10723
Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation")
Cc: stable@dpdk.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
4 years agovhost: check log mmap offset and size overflow
Maxime Coquelin [Mon, 18 May 2020 13:16:59 +0000 (14:16 +0100)]
vhost: check log mmap offset and size overflow

vhost_user_set_log_base() is a message handler that is
called to handle the VHOST_USER_SET_LOG_BASE message.
Its payload contains a 64 bit size and offset. Both are
added up and used as a size when calling mmap().

There is no integer overflow check. If an integer overflow
occurs a smaller memory map would be created than
requested. Since the returned mapping is mapped as writable
and used for logging, a memory corruption could occur.

CVE-2020-10722
Fixes: fbc4d248b198 ("vhost: fix offset while mmaping log base address")
Cc: stable@dpdk.org
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
Reviewed-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
4 years agobuild: disable gcc 10 zero-length-bounds warning
Kevin Traynor [Thu, 14 May 2020 13:18:57 +0000 (14:18 +0100)]
build: disable gcc 10 zero-length-bounds warning

gcc 10 issues warnings about the use of rearm_data marker
from struct rte_mbuf.

e.g.
../drivers/net/enic/enic_rxtx_vec_avx2.c: In function ‘rx_one’:
../drivers/net/enic/enic_rxtx_vec_avx2.c:21:2:
warning:
array subscript 0 is outside the bounds of an interior zero-length array
‘RTE_MARKER64’ {aka ‘long unsigned int[0]’} [-Wzero-length-bounds]
   21 |  *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer;
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../lib/librte_mbuf/rte_mbuf.h:45,
                 from ../drivers/net/enic/enic_rxtx_vec_avx2.c:6:
../lib/librte_mbuf/rte_mbuf_core.h:484:15:
note: while referencing ‘rearm_data’
  484 |  RTE_MARKER64 rearm_data;
      |

Disable this warning for gcc 10 in order to allow v20.05 to build
without changes to struct rte_mbuf.

Bugzilla ID: 396
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
4 years agohash: fix gcc 10 maybe-uninitialized warning
Kevin Traynor [Fri, 15 May 2020 14:28:08 +0000 (15:28 +0100)]
hash: fix gcc 10 maybe-uninitialized warning

gcc 10.1.1 reports a warning for the ext_bkt_id variable:

../lib/librte_hash/rte_cuckoo_hash.c:
In function ‘__rte_hash_add_key_with_hash’:
../lib/librte_hash/rte_cuckoo_hash.c:1104:29:
warning: ‘ext_bkt_id’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
 1104 |  (h->buckets_ext[ext_bkt_id - 1]).sig_current[0] = short_sig;
      |                  ~~~~~~~~~~~^~~

The return value of rte_ring_sc_dequeue_elem() is already checked,
but also initialize ext_bkt_id to zero (invalid value) and check
that it also overwritten.

Fixes: fbfe568103b0 ("hash: use 32-bit elements rings to save memory")
Cc: stable@dpdk.org
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
4 years agocrypto/virtio: enable OOP feature flag
Jay Zhou [Fri, 15 May 2020 09:31:27 +0000 (17:31 +0800)]
crypto/virtio: enable OOP feature flag

Since it will check the feature mask before running out-of-place
test cases and the virtio-crypto device supports OOP_LB_IN_LB_OUT mode.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/octeontx: improve symmetric session-less path
Anoob Joseph [Sat, 16 May 2020 09:26:58 +0000 (14:56 +0530)]
crypto/octeontx: improve symmetric session-less path

Cleanup sessionless code path and improve error handling.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
4 years agocrypto/octeontx: enable non-byte aligned data
Ankur Dwivedi [Sat, 16 May 2020 09:26:57 +0000 (14:56 +0530)]
crypto/octeontx: enable non-byte aligned data

The OCTEON TX crypto PMD supports non-byte aligned data as
input for SNOW and ZUC algos. Adding the same to the feature list.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
4 years agocrypto/octeontx2: improve symmetric session algos check
Anoob Joseph [Sat, 16 May 2020 09:26:56 +0000 (14:56 +0530)]
crypto/octeontx2: improve symmetric session algos check

Session configure should return -ENOTSUP in case of unsupported xform
requests. Moving the validation of combinations out of cpt, as the
feature support will not be same across OCTEON TX and OCTEON TX2.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
4 years agocrypto/octeontx2: enable non-byte aligned data
Ankur Dwivedi [Sat, 16 May 2020 09:26:55 +0000 (14:56 +0530)]
crypto/octeontx2: enable non-byte aligned data

The OCTEON TX2 crypto PMD supports non-byte aligned data as
input for SNOW and ZUC algos. Adding the same to the feature list.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
4 years agonet/octeontx2: update max packet length for inline IPsec
Tejasree Kondoj [Sat, 16 May 2020 09:26:54 +0000 (14:56 +0530)]
net/octeontx2: update max packet length for inline IPsec

Update max packet length supported by Inline IPsec Rx to
NIX_MAX_FRS

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
4 years agocommon/octeontx2: fix port ID bound check
Anoob Joseph [Sat, 16 May 2020 09:26:53 +0000 (14:56 +0530)]
common/octeontx2: fix port ID bound check

Fix out of bounds access.

Coverity issue: 354230, 354231
Fixes: f44e71637755 ("net/octeontx2: add security session operations")
Fixes: 3fe4d07d1678 ("crypto/octeontx2: enable CPT to share QP with ethdev")
Cc: stable@dpdk.org
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
4 years agocrypto/caam_jr: fix IRQ functions return type
Yunjian Wang [Thu, 14 May 2020 11:00:07 +0000 (19:00 +0800)]
crypto/caam_jr: fix IRQ functions return type

The caam_jr_enable_irqs() and caam_jr_disable_irqs() methods maybe return a
negative error. So use int instead of uint32_t int the functions.

Fixes: e7a45f3cc245 ("crypto/caam_jr: add UIO specific operations")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
4 years agocrypto/caam_jr: fix check of file descriptors
Yunjian Wang [Thu, 14 May 2020 10:59:55 +0000 (18:59 +0800)]
crypto/caam_jr: fix check of file descriptors

Zero is a valid fd. It will fail to check the fd if the fd is zero.
The "job_ring->uio_fd" is an fd, so define it as "int".

Fixes: e7a45f3cc245 ("crypto/caam_jr: add UIO specific operations")
Fixes: a5e1018d5e67 ("crypto/caam_jr: add routines to configure HW")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
4 years agotest/crypto: fix statistics case
Apeksha Gupta [Fri, 15 May 2020 17:24:22 +0000 (22:54 +0530)]
test/crypto: fix statistics case

The test case - test_stats is directly accessing the
cryptodev and its dev_ops which are internal to library
and should not be used directly by the application.
However, the test case is also missing to check for the
error ENOTSUP. It should skip the case if the API returns
ENOTSUP. This patch fixes these two issues.

Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests")
Cc: stable@dpdk.org
Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agocrypto/qat: add DOCSIS AES-256 to release notes
Mairtin o Loingsigh [Fri, 15 May 2020 10:08:25 +0000 (11:08 +0100)]
crypto/qat: add DOCSIS AES-256 to release notes

Add release notes update for QAT DOCSIS AES-256 support

Fixes: 2aab3ff3d8cf ("crypto/qat: support DOCSIS AES-256")

Signed-off-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
4 years agodrivers/crypto: fix build with -fno-common
Akhil Goyal [Wed, 13 May 2020 11:50:26 +0000 (17:20 +0530)]
drivers/crypto: fix build with -fno-common

gcc 10 defaults to -fno-common and as a result when linking
with crypto drivers:

drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o):
(.bss+0x4): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o):
(.data+0x0): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here

This patch fixes the blunt workaround in the following commit.

Fixes: 50b03f3b8eaf ("drivers/crypto: disable gcc 10 no-common errors")

Bugzilla ID: 469
Cc: stable@dpdk.org
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
4 years agotest/crypto: remove tests for unsupported descriptors
Anoob Joseph [Tue, 12 May 2020 07:12:24 +0000 (12:42 +0530)]
test/crypto: remove tests for unsupported descriptors

Cryptodev doesn't limit the number of descriptors that can be supported
by the PMD.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
4 years agoapp/eventdev: check Tx adapter service ID
Pavan Nikhilesh [Wed, 13 May 2020 20:22:48 +0000 (01:52 +0530)]
app/eventdev: check Tx adapter service ID

Fix unchecked return values reported by coverity.

Coverity issue: 357755
Fixes: 032a965a8f1d ("app/eventdev: support Tx adapter")
Cc: stable@dpdk.org
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoevent/dsw: update release notes
Mattias Rönnblom [Mon, 11 May 2020 07:53:14 +0000 (09:53 +0200)]
event/dsw: update release notes

Update release notes with recent DSW event device improvements.

Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agoevent/dsw: fix enqueue burst return value
Yuri Chipchev [Wed, 6 May 2020 20:18:37 +0000 (23:18 +0300)]
event/dsw: fix enqueue burst return value

The returned number from rte_event_enqueue_*()
wouldn't include events marked with RTE_EVENT_OP_RELEASE.

Fixes: 1c8e3caa3 ("event/dsw: add event scheduling and device start/stop")
Cc: stable@dpdk.org
Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
4 years agotest/graph: fix memory leaks in performance tests
Pavan Nikhilesh [Wed, 13 May 2020 20:56:00 +0000 (02:26 +0530)]
test/graph: fix memory leaks in performance tests

Fix memory leaks reported by Coverity.

Fixes: 61d77071ab99 ("test/graph: add performance tests")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agotest/graph: fix memory leaks in functional tests
Kiran Kumar K [Fri, 15 May 2020 07:28:24 +0000 (12:58 +0530)]
test/graph: fix memory leaks in functional tests

Fix memory leaks reported by Coverity.

Fixes: 6b89650418 ("test/graph: add functional tests")

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agotest/graph: use better randomness
Kiran Kumar K [Fri, 15 May 2020 07:28:24 +0000 (12:58 +0530)]
test/graph: use better randomness

Fix weak crypto issues reported by Coverity.

Fixes: 6b89650418 ("test/graph: add functional tests")

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agonode: fix arm64 build with old gcc
Nithin Dabilpuram [Wed, 13 May 2020 12:06:04 +0000 (17:36 +0530)]
node: fix arm64 build with old gcc

Older GCC(~4) complains about uninitialized 'dip'
var though all the lanes of the vec register are set.
Hence this patch explicitly initializes vec register
to fix the issue.

In file included from ip4_lookup.c:34:0:
ip4_lookup_neon.h: n function ‘ip4_lookup_node_process’: \
ip4_lookup_neon.h:25:12: error: ‘dip’ may be used uninitialized in \
this function [-Werror=maybe-uninitialized]
  int32x4_t dip;
            ^

Fixes: 16df6a2c6671 ("node: add IPv4 lookup for arm64")

Reported-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
4 years agoversion: 20.05-rc2
Thomas Monjalon [Tue, 12 May 2020 02:09:20 +0000 (04:09 +0200)]
version: 20.05-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoexamples: remove extra new line after link duplex
Ivan Dyukov [Thu, 7 May 2020 18:26:02 +0000 (21:26 +0300)]
examples: remove extra new line after link duplex

This patch removes extra 'new line' in few app examples.

Fixes: d3641ae863 ("examples: update link status checks")
Fixes: 387259bd6c ("examples/l2fwd-crypto: add sample application")
Fixes: 4ff457986f ("examples/l2fwd-event: add default poll mode routines")
Fixes: e64833f227 ("examples/l2fwd-keepalive: add sample application")
Fixes: 204896f8d6 ("examples/l2fwd-jobstats: add new example")
Fixes: c8e6ceeceb ("examples/ioat: add new sample app for ioat driver")
Fixes: cc8f4d020c ("examples/ip_reassembly: initial import")
Fixes: d299106e8e ("examples/ipsec-secgw: add IPsec sample application")
Fixes: 39aad0e88c ("examples/flow_distributor: new example to demonstrate EFD")
Fixes: d48415e1fe ("examples/performance-thread: add l3fwd-thread app")
Fixes: 20c78ac9ee ("examples/vm_power_mgr: add port initialisation")
Fixes: 361b2e9559 ("acl: new sample l3fwd-acl")
Fixes: de3cfa2c98 ("sched: initial import")
Fixes: d7937e2e3d ("power: initial import")
Fixes: 3fc5ca2f63 ("kni: initial import")
Cc: stable@dpdk.org
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
4 years agoapp: remove extra new line after link duplex
Ivan Dyukov [Thu, 7 May 2020 18:26:01 +0000 (21:26 +0300)]
app: remove extra new line after link duplex

This is testpmd part of new line cleanup.

Fixes: 002ade70e9 ("app/test: measure cycles per packet in Rx/Tx")
Fixes: ce8d561418 ("app/testpmd: add port configuration settings")
Cc: stable@dpdk.org
Signed-off-by: Ivan Dyukov <i.dyukov@samsung.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
4 years agonet/virtio: fix AVX512 datapath selection
Maxime Coquelin [Mon, 11 May 2020 14:47:20 +0000 (16:47 +0200)]
net/virtio: fix AVX512 datapath selection

The AVX512 packed ring datapath selection was only done
at build time, but it should also be checked at runtime
that the CPU supports it.

This patch add a CPU flags check so that non-vectorized
path is selected at runtime if AVX512 is not supported.

Also in meson build enable vectorization only for relevant file, not for
all driver.

Fixes: ccb10995c2ad ("net/virtio: add election for vectorized path")

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/hinic/base: support IPv6 flow rules
Xiaoyun Wang [Sat, 9 May 2020 04:04:16 +0000 (12:04 +0800)]
net/hinic/base: support IPv6 flow rules

The patch supports ipv6 flow rules for BGP or ICMP packets.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: fail initialization for not supported device
Xiaoyun Wang [Sat, 9 May 2020 04:04:15 +0000 (12:04 +0800)]
net/hinic: fail initialization for not supported device

If hardware mode for this card does not support nic,
the network features for this card will not be supported
and driver will be initialized failed.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/hinic: set jumbo frame offload flag
Xiaoyun Wang [Sat, 9 May 2020 04:04:14 +0000 (12:04 +0800)]
net/hinic: set jumbo frame offload flag

The patch adds DEV_RX_OFFLOAD_JUMBO_FRAME flag for jumbo when set mtu.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
4 years agonet/mlx5: support match on GTP flags
Dekel Peled [Wed, 6 May 2020 17:13:38 +0000 (20:13 +0300)]
net/mlx5: support match on GTP flags

This patch adds to MLX5 PMD the support of matching on
GTP header item v_pt_rsv_flags.

This item is contained in 1 byte of the format:
-------------------------------------------
| bit   | 0 - 2   | 3  | 4   | 5 | 6 | 7  |
|-----------------------------------------|
| value | Version | PT | Res | E | S | PN |
-------------------------------------------

Matching is supported only for GTP flags E, S, PN.
Therefore values 0 to 7 are supported.

Mask must be set accordingly:
... gtp v_pt_rsv_flags is 1 v_pt_rsv_flags mask 0x07 ...

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix Tx queue release debug log timing
Alexander Kozyrev [Wed, 6 May 2020 18:10:59 +0000 (18:10 +0000)]
net/mlx5: fix Tx queue release debug log timing

Program received signal SIGSEGV, Segmentation fault.
0x00000000008ef7c4 in mlx5_tx_queue_release (dpdk_txq=0x17ce01680) at
drivers/net/mlx5/mlx5_txq.c:302
301 mlx5_txq_release(ETH_DEV(priv), i);
302 DRV_LOG(DEBUG, "port %u removing Tx queue %u from list",
303         PORT_ID(priv), txq->idx);
The problem is txq is freed inside the mlx5_txq_release() function
and no longer valid in the debug log right after this invocation.
Move the debug log before the mlx5_txq_release() function to fix this.

Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values")
Cc: stable@dpdk.org
Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx4: fix drop queue error handling
Michael Baum [Wed, 6 May 2020 16:27:54 +0000 (16:27 +0000)]
net/mlx4: fix drop queue error handling

The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
if needed allocates by rte_malloc.

If the allocation is failed the function goes to label “error”, and
there does dereference to a null pointer.

Skip resources cleaning when the memory allocation is failed.

Coverity issue: 146206
Coverity issue: 146146
Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix meter color register consideration
Michael Baum [Wed, 6 May 2020 16:24:06 +0000 (16:24 +0000)]
net/mlx5: fix meter color register consideration

The mlx5_flow_get_reg_id() function translates tag ID to register
from the registers that are supported and available for use. The
user does not know which register is available at a time and therefore
there is an array that represents mapping to the available registers.
Usually the free registers are continuous in the flow_mreg_c array but
sometimes the mtr_color_reg register is between them and it must be
skipped and the next register returned, in which case the function
returns the mapping of the next entity in the array.

When the function reads from the next entity in the array, it does not
check whether such an entity exists and in some situation invalid access
to memory occurs beyond the array boundaries.

So, when all the registers are valid from HW perspective and the meter
color register is not the default, the tag id 5 causes an out of bound
access.

Validate registers availability when meter color register is not the
default.

Coverity issue: 146355
Fixes: 792e749e92d5 ("net/mlx5: fix register usage in meter")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix matching for UDP tunnels with Verbs
Raslan Darawsheh [Wed, 6 May 2020 06:57:56 +0000 (09:57 +0300)]
net/mlx5: fix matching for UDP tunnels with Verbs

When creating flow rule with zero specs it will cause
matching all UDP packets like following:
 eth / ipv4 / udp / vxlan / end
Such rule will match all udp packets.

This change the behavior to match the dv flow engine
which will automatically set the match on relative
outer UDP port if the user didn't specify any.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/mlx5: fix match on empty VLAN item in DV mode
Dekel Peled [Tue, 5 May 2020 12:57:54 +0000 (15:57 +0300)]
net/mlx5: fix match on empty VLAN item in DV mode

In existing implementation, using wild card VLAN item is not allowed.
A VLAN item in flow pattern must include VLAN ID (vid) value.
This obligation contradict the flow API specification [1].

This patch updates the VLAN item validation and translation, to allow
wild card VLAN item, without VLAN ID value.
User guide and release notes are updated accordingly.

[1]
commit 40513808b165 ("doc: refine ethernet and VLAN flow rule items")

Fixes: 00f75a40576b ("net/mlx5: fix VLAN match for DV mode")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agodoc: remove Intel PMD examples in flow bifurcation guide
Xiaolong Ye [Fri, 8 May 2020 08:48:23 +0000 (16:48 +0800)]
doc: remove Intel PMD examples in flow bifurcation guide

Now this feature is no longer supported by kernel side, (i40e kernel
driver doesn't support it from v2.3.2 and ixgbe kernel driver isn't
guaranteed to support this feature as well in the future), so remove the
Intel PMD examples to avoid confusion.

Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/ring: fix device pointer on allocation
Gaetan Rivet [Wed, 6 May 2020 18:09:49 +0000 (20:09 +0200)]
net/ring: fix device pointer on allocation

When a net_ring device is allocated, its device pointer is not set
before calling rte_eth_dev_probing_finish, which is incorrect.

The following:
  commit 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
  commit a6992e961050 ("net/ring: set ethernet device field")

already fixed the same issue in 17.08, which was fine at the time.
Adding the hook rte_eth_dev_probing_finish() however created this bug,
as the eth_dev exposed when this hook is executed is expected to be
complete.

Remove the prior attempts to fix the issue in rte_pmd_ring_probe() and
write the pointer properly in do_eth_dev_ring_create().

Fixes: fbe90cdd776c ("ethdev: add probing finish function")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <grive@u256.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/tap: fix build for glibc < 2.24
Raslan Darawsheh [Sun, 10 May 2020 12:23:47 +0000 (15:23 +0300)]
net/tap: fix build for glibc < 2.24

When trying to compile with glibc < 2.24 that doesn't
support SOL_NETLINK it will cause compilation failure:

drivers/net/tap/tap_netlink.c:70:17: error:
 'SOL_NETLINK' undeclared (first use in this function)
  setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one));

The glibc commits adds the SOL_NETLINK support:
https://github.com/bminor/glibc/commit/f9b437d5efce93800b51ad2a437c8b1c9

Fixes: 647909bcf34b ("net/tap: use netlink extended ack support")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/octeontx2: fix minimum length to SMQ config
Sunil Kumar Kori [Mon, 11 May 2020 06:21:56 +0000 (11:51 +0530)]
net/octeontx2: fix minimum length to SMQ config

NIX exposes NIX_AF_SMQ(0..511)_CFG to configure minimum length
of the packet which is being used for zero padding if packet is
less than configured value.

Setting it to default minimum length i.e. 60 bytes.

Fixes: ec8ddd4fb1be ("net/octeontx2: restructure TM helper functions")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agocommon/octeontx2: upgrade mbox definition to version 7
Jerin Jacob [Thu, 7 May 2020 08:58:07 +0000 (14:28 +0530)]
common/octeontx2: upgrade mbox definition to version 7

Upgrade mailbox definitions to version 0x0007 of kernel AF driver.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
4 years agonet/bnx2x: add Rx descriptor MTU segment limitation
Rasesh Mody [Tue, 5 May 2020 03:08:12 +0000 (20:08 -0700)]
net/bnx2x: add Rx descriptor MTU segment limitation

Add Rx descriptor limit for number of segments per MTU.
PMD doesn't support Jumbo Rx scatter gather hence set 1 segment per
MTU. Some applications can adjust mbuf_size based on this value.
For others PMD detects the condition where Rx packet length cannot
be held by configured mbuf size and logs the message.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
4 years agonet/ice: fix variable initialization
Qi Zhang [Wed, 6 May 2020 10:43:15 +0000 (18:43 +0800)]
net/ice: fix variable initialization

Fix coverity defect due to uninitialized scalar variable.

Coverity issue: 357763
Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/igc: remove useless log
Alvin Zhang [Thu, 7 May 2020 09:36:36 +0000 (17:36 +0800)]
net/igc: remove useless log

Some log will always be printed when the device is initialized
and shut down, which will mislead users and should be removed.

Fixes: 746664d546fb ("net/igc: support flow API")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix PPPoE-IPv6 dummy packet
Wei Zhao [Thu, 7 May 2020 01:15:41 +0000 (09:15 +0800)]
net/ice/base: fix PPPoE-IPv6 dummy packet

The dummy packet for pppoe-ipv6 has an error, we should
use 0x3b for next header in ipv6 header in the dummy packet,
or some case can not be download, such as:

"eth / pppoes seid is 3 / pppoe_proto_id is 0x0057 /
end actions vf id 1 / end"

Fixes: 55d61fb27a5e ("net/ice/base: add PPPoE IPv6 dummy packet")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Nannan Lu <nannan.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix flow API error logs
Jeff Guo [Fri, 8 May 2020 20:58:30 +0000 (16:58 -0400)]
net/iavf: fix flow API error logs

When processing a rte flow, such as creating a parse engine, or
creating or destroying a RSS rule, if they are failed, they all
need to construct the flow error structure before return the error
message back to app. If not so, it will cause app crash when
app printing the message out of a flow error.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")
Fixes: ff2d0c345c3b ("net/iavf: support generic flow API")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix link state timing on fiber ports
Phil Yang [Fri, 8 May 2020 10:28:27 +0000 (18:28 +0800)]
net/ixgbe: fix link state timing on fiber ports

In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
to ixgbe_dev_setup_link_thread_handler() is scheduled which should
try to set up the link and clear the flag afterwards. This flag works
as a guard variable between threads.

To avoid potential race condition between threads, set the
IXGBE_FLAG_NEED_LINK_CONFIG flag only when there is no link thread
running.

Bugzilla ID: 388
Fixes: 819d0d1d57f1 ("net/ixgbe: fix blocking system events")
Cc: stable@dpdk.org
Signed-off-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Lijian Zhang <lijian.zhang@arm.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/iavf: fix input set for RSS hash
Jeff Guo [Sat, 9 May 2020 19:29:34 +0000 (15:29 -0400)]
net/iavf: fix input set for RSS hash

Since some specific RSS hash type need to combine with the protocol
hash type when configure a RSS hash rule, so add the corresponding
input set to support these case for iavf hash.

Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/dpaa2: support additional link speeds
Hemant Agrawal [Fri, 8 May 2020 13:02:11 +0000 (18:32 +0530)]
net/dpaa2: support additional link speeds

This patch adds the support for additional link speed
supported by LX2160A platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: fix size of qman fq descriptor
Hemant Agrawal [Fri, 8 May 2020 13:02:10 +0000 (18:32 +0530)]
bus/fslmc: fix size of qman fq descriptor

Correct the qman_fq_desc as per the HW defined size

Fixes: 6fef517e17cf ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: fix congestion ID for multiple traffic classes
Jun Yang [Fri, 8 May 2020 13:02:09 +0000 (18:32 +0530)]
net/dpaa2: fix congestion ID for multiple traffic classes

When using a single TC, flow id is same as congestion group id.
However in case of multiple traffic classes, same flow id values
are used within each traffic class, which causes incorrect
traffic behavior e.g. halting of traffic.
This patches changes to use the cgid as the index which works
for single as well as multiple traffic classes.

Fixes: 13b856ac02a8 ("net/dpaa2: support taildrop on frame count basis")
Cc: stable@dpdk.org
Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: reduce logs in Rx queue count
Hemant Agrawal [Fri, 8 May 2020 13:02:08 +0000 (18:32 +0530)]
net/dpaa2: reduce logs in Rx queue count

Changing them to DP as it is impacting l3fwd-power apps

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: support UDP destination port based muxing
Nipun Gupta [Fri, 8 May 2020 13:02:07 +0000 (18:32 +0530)]
net/dpaa2: support UDP destination port based muxing

This change adds DPDMUX support to bifurcate traffic on
the basis of UDP destination port.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agodrivers: enhance DPAA2 portal allocation error logs
Nipun Gupta [Fri, 8 May 2020 13:02:06 +0000 (18:32 +0530)]
drivers: enhance DPAA2 portal allocation error logs

Update the portal allocation failure log to print the thread id
as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: add default Rx/Tx configuration
Hemant Agrawal [Fri, 8 May 2020 13:02:05 +0000 (18:32 +0530)]
net/dpaa2: add default Rx/Tx configuration

This patch adds default/preferred rx/tx params in dev info,
specially the advertised burst size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: do not prefetch annotation for physical mode
Nipun Gupta [Fri, 8 May 2020 13:02:04 +0000 (18:32 +0530)]
net/dpaa2: do not prefetch annotation for physical mode

When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agonet/dpaa2: fix 10G port negotiation
Rohit Raj [Fri, 8 May 2020 13:02:03 +0000 (18:32 +0530)]
net/dpaa2: fix 10G port negotiation

Fixed 10G port negotiation issue with another 10G/non 10G port.

When running testpmd with 10G interfaces on 10BaseT interface
on LS2088ARDB, the ports were showing link as down.

This was identified to be caused by the setting of link as down
during config.
Also, the line rate was not being updated in device link params,
thus having the incorrect link speed in status (as 0).

Fixes: c5acbb5ea20e ("net/dpaa2: support link status event")
Cc: stable@dpdk.org
Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agobus/fslmc: fix dereferencing null pointer
Apeksha Gupta [Fri, 8 May 2020 13:02:02 +0000 (18:32 +0530)]
bus/fslmc: fix dereferencing null pointer

Fixes: 6fef517e17cf ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org
Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agoapp/testpmd: fix memory failure handling for i40e DDP
Kalesh AP [Fri, 8 May 2020 04:50:24 +0000 (10:20 +0530)]
app/testpmd: fix memory failure handling for i40e DDP

In cmd_ddp_get_list_parsed(), elements of "p_list" are accessed
even after the memory allocation for "p_list" fails.

With this patch, this null pointer dereference is avoided as we
return when there is malloc failure.

Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/ice/base: fix flow director rule completion report
Simei Su [Fri, 8 May 2020 01:36:50 +0000 (09:36 +0800)]
net/ice/base: fix flow director rule completion report

IAVF FDIR needs to check program status from FD completion descriptors
for both successful and failed case, rather than only ask for completion
on error. This patch corrects completion report value so that the called
can determine whether to report completion on error or other cases.

Fixes: 55daca4e45fc ("net/ice/base: change function to static")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bnxt: fix FW version query
Ajit Khaparde [Thu, 7 May 2020 05:43:28 +0000 (22:43 -0700)]
net/bnxt: fix FW version query

bnxt_fw_version_get is not indicating the complete FW version.
Fix it to indicate complete version string.

Fixes: e2652b0a20a0 ("net/bnxt: support get FW version")
Cc: stable@dpdk.org
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix uninitialized variable
Ajit Khaparde [Thu, 30 Apr 2020 04:11:51 +0000 (21:11 -0700)]
net/bnxt: fix uninitialized variable

Fix uninitialized variable error reported by coverity.

Coverity issue: 357771
Fixes: 69c410b8448d ("net/bnxt: support EM/EEM")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
4 years agonet/bnxt: fix overrun of ULP device params array
Kishore Padmanabha [Thu, 30 Apr 2020 21:42:12 +0000 (17:42 -0400)]
net/bnxt: fix overrun of ULP device params array

Fix a buffer overrun issue spotted by coverity while accessing
the array ulp_device_params.
Note that the issue was observed in an internal Coverity scan.

Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init")

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/virtio: fix 32-bit build with clang 6
Marvin Liu [Wed, 6 May 2020 06:47:37 +0000 (14:47 +0800)]
net/virtio: fix 32-bit build with clang 6

Clang 6.0.0 will undefine function _mm512_maskz_set1_epi64 on i686
target. Fix it by replacing the function with _mm512_set4_epi64 when
doing 32-bit build.

Warning message during build:
../drivers/net/virtio/virtio_rxtx_packed_avx.c:385:19: warning:
implicit declaration of function '_mm512_maskz_set1_epi64' is invalid
in C99 [-Wimplicit-function-declaration]

Fixes: 77d66da83834 ("net/virtio: add vectorized packed ring Rx")

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/virtio: fix crash when device reconnecting
Marvin Liu [Wed, 6 May 2020 15:07:24 +0000 (23:07 +0800)]
net/virtio: fix crash when device reconnecting

When doing virtio device initialization, virtqueues will be reset in
server mode if ring type is packed. It will cause issue because queues
have been freed in the beginning of device initialization.

Fix this issue by checking whether device has been initialized before
reset. If device hasn't been initialized, there's no need to reset
queues.

Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agodoc: refine ethernet and VLAN flow rule items
Dekel Peled [Sun, 3 May 2020 07:17:22 +0000 (10:17 +0300)]
doc: refine ethernet and VLAN flow rule items

Specified pattern may be translated in different manner.
For example the pattern "eth / ipv4" can be translated to match
untagged packets only, since the pattern doesn't specify a VLAN item.
It can also be translated to match both tagged and untagged packets,
for the same reason.
This patch updates the rte_flow documentation to clearly specify the
required pattern to use.
For example:
To match tagged ipv4 packets, the pattern "eth / vlan / ipv4 / end"
should be used.
To match untagged ipv4 packets, the pattern "eth / ipv4 / end"
should be used.
To match all IPV4 packets, both tagged and untagged, need to apply
two rules with the patterns above.
To match both tagged and untagged packets of any type, the pattern
"eth / end" should be used.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Ori Kam <orika@mellanox.com>
4 years agoapp/testpmd: add option for Rx multi-queue mode
Xiaoyu Min [Thu, 7 May 2020 00:51:59 +0000 (03:51 +0300)]
app/testpmd: add option for Rx multi-queue mode

One new cmdline option `--rx-mq-mode` is added in order to have the
possibility to check whether PMD handle the mq mode correctly or not.

The reason is some NICs need to do different settings based on different
RX mq mode, i.e RSS or not.

With this support in testpmd, the above scenario can be tested easily.

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
4 years agonet/bnxt: fix TQM ring context memory size
Kalesh AP [Wed, 6 May 2020 06:27:10 +0000 (11:57 +0530)]
net/bnxt: fix TQM ring context memory size

The current formulas to calculate the TQM slow path and fast path ring
context memory sizes are not quite correct. TQM slow path entry is
array index 0 of ctx->tqm_mem[]. The other array entries are for fast
path. Fix these sizes according to firmware spec. for 57500 and newer
chips.

Fixes: cc5e26b8ef98 ("net/bnxt: increase TQM entry allocation")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix number of TQM ring
Kalesh AP [Wed, 6 May 2020 06:27:09 +0000 (11:57 +0530)]
net/bnxt: fix number of TQM ring

Newer firmware advertises the number of TQM rings to allocate
context memory for.  Use the firmware specified value and fall back
to the old value derived from "bp->max_q" if it is not available.

Fixes: f8168ca0e690 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/mlx5: support 200G link speed
Asaf Penso [Wed, 6 May 2020 12:22:08 +0000 (12:22 +0000)]
net/mlx5: support 200G link speed

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
4 years agoethdev: add 200G link speed
Asaf Penso [Wed, 6 May 2020 12:22:08 +0000 (12:22 +0000)]
ethdev: add 200G link speed

There is no way to report back a link speed of 200Gbps.

Adding 200G link speed.

Signed-off-by: Asaf Penso <asafp@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/tap: use netlink extended ack support
Stephen Hemminger [Fri, 24 Apr 2020 23:36:57 +0000 (16:36 -0700)]
net/tap: use netlink extended ack support

In recent Linux kernels, there is support for extended acknowledgment
to netlink messages. This is quite useful for diagnosing errors
in configuration in the kernel with TAP.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
4 years agonet/tap: simplify netlink send/receive functions
Stephen Hemminger [Fri, 24 Apr 2020 23:36:56 +0000 (16:36 -0700)]
net/tap: simplify netlink send/receive functions

The tap_nl_recv() function does not need to use the full
complex recvmsg() system call, basic recv() will work here.

Ditto for tap_nl_send() full sendmsg is not needed.

Add logic to retry in case EINTR rather than forcing
error handling back in driver or worse to ethdev API.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
4 years agonet/tap: fix crash in flow destroy
Stephen Hemminger [Mon, 27 Apr 2020 21:39:26 +0000 (14:39 -0700)]
net/tap: fix crash in flow destroy

The TAP driver does not initialize all the elements of the rte_flow
structure. This can lead to crash in rte_flow_destroy.

(gdb) where
    flow=0x100e99280, error=0x0)
    at drivers/net/tap/tap_flow.c:1514

(gdb) p remote_flow
$1 = (struct rte_flow *) 0x6b6b6b6b6b6b6b6b

Which is here:
static int
tap_flow_destroy_pmd(struct pmd_internals *pmd,
     struct rte_flow *flow,
     struct rte_flow_error *error)
{
struct rte_flow *remote_flow = flow->remote_flow;
...
if (remote_flow) {
remote_flow->msg.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;

Simplest fix is to use rte_zmalloc() so remote_flow and other fields
are always set at zero.

Fixes: 2bc06869cd94 ("net/tap: add remote netdevice traffic capture")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agodoc: update LRO limitation in mlx5 guide
Dekel Peled [Sun, 12 Apr 2020 10:48:32 +0000 (13:48 +0300)]
doc: update LRO limitation in mlx5 guide

MLX5 PMD limitation regarding use of LRO is updated.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
4 years agonet/ice: fix crash in switch filter
Junyu Jiang [Wed, 6 May 2020 03:05:25 +0000 (03:05 +0000)]
net/ice: fix crash in switch filter

The number of queues in queue group should be checked before
using it. This patch fixed the issue.

Fixes: 47d460d63233 ("net/ice: rework switch filter")
Cc: stable@dpdk.org
Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
4 years agonet/ice: support mark only action for flow director
Simei Su [Tue, 14 Apr 2020 15:11:13 +0000 (23:11 +0800)]
net/ice: support mark only action for flow director

This patch fixes issue that doesn't support mark only case.
Mark only action is equal to mark + passthru action.

Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
Cc: stable@dpdk.org
Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/ixgbe: fix link status synchronization on BSD
Zhihong Peng [Fri, 17 Apr 2020 03:52:12 +0000 (23:52 -0400)]
net/ixgbe: fix link status synchronization on BSD

DPDK does not implement interrupt mechanism on BSD,
so force NIC status synchronization.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org
Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
4 years agonet/ice/base: fix switch rule for IPsec
Wei Zhao [Wed, 29 Apr 2020 08:42:27 +0000 (16:42 +0800)]
net/ice/base: fix switch rule for IPsec

When we download a switch rule for ipv6 with esp payload
"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

if we don't add bm bit set check for tun_type, then a packet of
ipv4 with esp payload

"sendp([Ether(dst="00:00:00:00:01:00")/IP(proto=50)/ESP(spi=1)/
("X"*480)], iface="ens5f0", count=10)"

Will also go to queue index 2. And also, we need to do tun_type
check, or the second rule of following can not be download because
of rejection from switch rule download function ice_aq_sw_rules().

"eth / ipv4 / esp spi is 1 / end actions queue index 5 / end"

"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

Fixes: 4f11962fce84 ("net/ice/base: support AH ESP and NAT-T on switch")
Fixes: 99d8ba79efbe ("net/ice/base: force switch to use different recipe")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qi Fu <qi.fu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix link speed
Alvin Zhang [Thu, 30 Apr 2020 03:21:11 +0000 (11:21 +0800)]
net/iavf: fix link speed

If the PF driver does not support the new speed reporting capabilities
then use link_event instead of link_event_adv to get the speed.

Fixes: 48de41ca11f0 ("net/avf: enable link status update")
Cc: stable@dpdk.org
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
4 years agonet/bnxt: fix possible stack smashing
Linsi Yuan [Thu, 30 Apr 2020 13:37:52 +0000 (21:37 +0800)]
net/bnxt: fix possible stack smashing

We see a stack smashing as a result of defensive code missing. Once the
nb_pkts is less than RTE_BNXT_DESCS_PER_LOOP, it will be modified to
zero after doing a floor align, and we can not exit the following
receiving packets loop. And the buffers will be overwrite, then the
stack frame was ruined.

Fix the problem by adding defensive code, once the nb_pkts is zero, just
directly return with no packets.

Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")
Cc: stable@dpdk.org
Signed-off-by: Linsi Yuan <yuanlinsi01@baidu.com>
Signed-off-by: Dongsheng Rong <rongdongsheng@baidu.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/bnxt: fix build with gcc 10 default no-common
Randy Schacher [Mon, 4 May 2020 15:06:19 +0000 (11:06 -0400)]
net/bnxt: fix build with gcc 10 default no-common

Remove the defensive compile-time checker macro.

Bugzilla ID: 468
Fixes: 8430a8b841c8 ("net/bnxt: add initial TruFlow core session open")

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/netvsc: do not configure RSS if disabled
Stephen Hemminger [Thu, 30 Apr 2020 19:08:53 +0000 (12:08 -0700)]
net/netvsc: do not configure RSS if disabled

This fixes the problem where driver would not start if only
have a single Rx queue and multiple Txq. In that case, RSS
should stay disabled.

Fixes: 92d23a57cafe ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: do RSS across Rx queue only
Stephen Hemminger [Thu, 30 Apr 2020 19:08:52 +0000 (12:08 -0700)]
net/netvsc: do RSS across Rx queue only

If number of tx queues is greater than the number of rx queues;
the driver ends up allocating more channels than rx queues.
The problem is that the RSS indirection table is programmed such
that some packets will end up on a channel that would never be
polled. The fix is to limit the RSS indirection table by number
of rx queues not channels.

Fixes: 92d23a57cafe ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: manage VF port under read/write lock
Stephen Hemminger [Thu, 30 Apr 2020 19:08:51 +0000 (12:08 -0700)]
net/netvsc: manage VF port under read/write lock

With multiple channels, the primary channel may receive notification
that VF has been added or removed while secondary channel is in
process of doing receive or transmit.  Resolve this race by converting
existing vf_lock to a reader/writer lock.

Users of lock (tx/rx/stats) acquire for read, and actions like
add/remove acquire it for write.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: check vmbus ring buffer more often
Stephen Hemminger [Thu, 30 Apr 2020 19:08:50 +0000 (12:08 -0700)]
net/netvsc: check vmbus ring buffer more often

Since VF notifications are handled as VMBUS notifications on the
primary channel (and not as hotplug). The channel should be checked
before deciding to use VF for Rx or Tx.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agobus/vmbus: add missing barrier
Stephen Hemminger [Thu, 30 Apr 2020 19:08:49 +0000 (12:08 -0700)]
bus/vmbus: add missing barrier

The check for event ring being empty needs a barrier
to avoid any over aggressive optimization.
This is same barrier as Linux kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agobus/vmbus: fix comment spelling
Stephen Hemminger [Thu, 30 Apr 2020 19:08:48 +0000 (12:08 -0700)]
bus/vmbus: fix comment spelling

No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agonet/netvsc: fix comment spelling
Stephen Hemminger [Thu, 30 Apr 2020 19:08:47 +0000 (12:08 -0700)]
net/netvsc: fix comment spelling

No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>