dpdk.git
5 years agonet/mlx5: fix packet type for MPLS in UDP
Dekel Peled [Thu, 15 Nov 2018 15:17:14 +0000 (17:17 +0200)]
net/mlx5: fix packet type for MPLS in UDP

Change the relevant value in tunnels_info[] to match tunnel type.

Fixes: a4a5cd21d20a ("net/mlx5: add flow MPLS item")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix MPLS item validation
Dekel Peled [Thu, 15 Nov 2018 15:17:13 +0000 (17:17 +0200)]
net/mlx5: fix MPLS item validation

Update the mlx5_flow_validate_item_mpls() function to allow
MPLS over IP, UDP, and GRE.
Modify the flow_dv_validate() function with the new logic introduced
in previous patch of this series: set new variable last_item
after each validation, update item_flags after each item iteration.
The new variable last_item is sent to mlx5_flow_validate_item_mpls()
and used to validate the MPLS item.
Same change implemented in flow_verbs_validate().

Update the mlx5_flow_validate_item_mpls() function to verify that
device configuration has mpls_en set to 1.
This code was added earlier this year, but unintentionaly removed
in recent versions.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add MPLS to Direct Verbs flow engine
Dekel Peled [Thu, 15 Nov 2018 15:17:12 +0000 (17:17 +0200)]
net/mlx5: add MPLS to Direct Verbs flow engine

The support in MPLS on this flow engine was overlooked. It's absence is
critical because there are required actions for MPLS which can be done
only with the DV engine.

To set correctly the MPLS filter, we need to reason about the flow item
before the MPLS (UDP, GRE or other).
To do that, a new variable last_item was added and updated after each
translation. the full item flags are updated after each item iteration.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize Rx buffer replenishment threshold
Yongseok Koh [Thu, 15 Nov 2018 10:29:20 +0000 (10:29 +0000)]
net/mlx5: optimize Rx buffer replenishment threshold

Due to redundant calculation per every burst, performance drops a little.

Fixes: e10245a13b2e ("net/mlx5: fix Rx buffer replenishment threshold")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize Tx doorbell write
Yongseok Koh [Thu, 15 Nov 2018 10:29:19 +0000 (10:29 +0000)]
net/mlx5: optimize Tx doorbell write

Unnecessary volatile attribute keeps compiler from further optimizing the
code and this results in a little performance drop (~2%). Because of memory
barriers, it is safe to remove.

Fixes: 6bf10ab69be0 ("net/mlx5: support 32-bit systems")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: optimize Tx external memory registration
Yongseok Koh [Thu, 15 Nov 2018 10:29:17 +0000 (10:29 +0000)]
net/mlx5: optimize Tx external memory registration

There's some performance drop due to extra condition checks on the
datapath. Checking for external memory registration should be consolidated
to the existing bottom-half.

Fixes: 7e43a32ee060 ("net/mlx5: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: optimize Tx external memory registration
Yongseok Koh [Thu, 15 Nov 2018 10:29:16 +0000 (10:29 +0000)]
net/mlx4: optimize Tx external memory registration

There's some performance drop due to extra condition checks on the
datapath. Checking for external memory registration should be consolidated
to the existing bottom-half.

Fixes: 31912d992403 ("net/mlx4: support externally allocated static memory")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix flow destruction
Yongseok Koh [Thu, 15 Nov 2018 05:24:13 +0000 (05:24 +0000)]
net/mlx5: fix flow destruction

As flow_drv_destroy() frees dev_flow, flow_rxq_flags_trim() must be called
ahead.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix flow query routine in Direct Verbs
Viacheslav Ovsiienko [Wed, 14 Nov 2018 13:47:19 +0000 (13:47 +0000)]
net/mlx5: fix flow query routine in Direct Verbs

The flow_dv_query() just returns -ENOTSUP value and does not
set provided error parameter structure, that crashes the
port_flow_query(). The patch fixes flow_db_query(), now it
sets an error parameter structure.

Fixes: 684dafe795d0 ("net/mlx5: add flow query abstraction interface")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix initialization of struct members
Ali Alnubani [Tue, 13 Nov 2018 19:11:07 +0000 (19:11 +0000)]
net/mlx5: fix initialization of struct members

This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.

```
../drivers/net/mlx5/mlx5_mr.c:345:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx5_mr_cache entry = { 0, };
                                                  ^
../drivers/net/mlx5/mlx5_mr.c:389:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                        struct mlx5_mr_cache ret = { 0, };
                                                        ^
../drivers/net/mlx5/mlx5_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx5_mr_cache ret = { 0, };
                                                ^
```

The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.

Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action")
Fixes: db48f9db5d9f ("net/mlx5: support new flow counter API")
Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Fixes: 65c9d24170c9 ("net/mlx5: enable loopback by configured mode")
Fixes: 87011737b715 ("mlx5: add software counters")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: fix initialization of struct members
Ali Alnubani [Tue, 13 Nov 2018 19:11:06 +0000 (19:11 +0000)]
net/mlx4: fix initialization of struct members

This patch fixes compilation errors with meson and the clang
compiler caused by some of the struct members not being
initialized.

```
../drivers/net/mlx4/mlx4_mr.c:357:37: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx4_mr_cache entry = { 0, };
                                                  ^
../drivers/net/mlx4/mlx4_mr.c:401:36: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                        struct mlx4_mr_cache ret = { 0, };
                                                        ^
../drivers/net/mlx4/mlx4_mr.c:691:35: error: missing field 'end'
initializer [-Werror,-Wmissing-field-initializers]
                struct mlx4_mr_cache ret = { 0, };
                                                ^
```

The compilation errors reproduce with
clang version 3.4.2 (tags/RELEASE_34/dot2-final) on RHEL.

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix minor typos
Ali Alnubani [Wed, 14 Nov 2018 07:48:31 +0000 (07:48 +0000)]
net/mlx5: fix minor typos

Fixes: e1114ff6a5ab ("net/mlx5: support e-switch flow count action")
Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx4: fix minor typo
Ali Alnubani [Wed, 14 Nov 2018 07:48:09 +0000 (07:48 +0000)]
net/mlx4: fix minor typo

Fixes: 9797bfcce1c9 ("net/mlx4: add new memory region support")
Cc: stable@dpdk.org
Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: add E-switch rule hardware offload flag check
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:42 +0000 (20:01 +0000)]
net/mlx5: add E-switch rule hardware offload flag check

This patch adds the in_hw flag check for tc flower filter rules.
If rule is applied without skip_sw flag set driver should check
whether the in_hw flag is set after rule applying. If no in_hw
flag set found it means the rule is not hardware offloaded and
error should be returned to application.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: prepare to add E-switch rule flags check
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:41 +0000 (20:01 +0000)]
net/mlx5: prepare to add E-switch rule flags check

The tc flower filter rules are used to control E-switch from
the application side. In order to gain garanteed rule hardware
offload the skip_sw flag should be specified while applying the
rule. But some tc rules is rejected by kernel if skip_sw flag
is set by design. Currently this regards VXLAN tunneling rules,
which are applied to special VXLAN virtual devices. Albeit these
rules are applied with skip_sw flag reset kernel tries to
perform hardware offload. If kernel succeeded the in_hw flag
is set in rule properties and application should check this
flag to get know whether the applied rule is actually hardware
offloaded.

This patch prepares for the rule flags query and check in_hw flag.
The driver checks only the rules with skip_sw flag reset, so we
need to test the actual flags of rule is being applied. The pointer
to flags field into translated rule is introduced and flags are
tested directly in the rule body. It is more reliable than save and
check flags copy.

Also patch swaps the flow_tcf_apply() and flow_tcf_remove(),
we are going to call flow_tcf_remove() from flow_tcf_appy() if
no in_hw flag set found in applied rule.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix Netlink communication routine
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:40 +0000 (20:01 +0000)]
net/mlx5: fix Netlink communication routine

While receiving the Netlink reply messages we should stop at DONE
or ACK message. The existing implementation stops at DONE message
or if no multiple message flag set ( NLM_F_MULTI). It prevents
the single query requests from working, these requests send the
single reply message without multi-message flag followed by
ACK message. This patch fixes receiving part of Netlink
communication routine.

Fixes: 6e74990b3463 ("net/mlx5: update E-Switch VXLAN netlink routines")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: remove unused TC message length parameter
Viacheslav Ovsiienko [Mon, 12 Nov 2018 20:01:39 +0000 (20:01 +0000)]
net/mlx5: remove unused TC message length parameter

This patch removes the unused message length parameter, we
do not send multiple commands in the single message anymore,
message length can be taken from the prepared message header,
so length parameter can be removed.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/i40e: fix RSS key initialization
Wei Zhao [Thu, 15 Nov 2018 08:57:20 +0000 (16:57 +0800)]
net/i40e: fix RSS key initialization

The assignment should be done after initialization, or it will be zero.

Fixes: 264b23e3d2c1 ("net/i40e: add parameter check for RSS flow init")

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbe: fix maximum wait time in comment
Xiaolong Ye [Thu, 15 Nov 2018 07:20:05 +0000 (15:20 +0800)]
net/ixgbe: fix maximum wait time in comment

As the code has changed the max wait time to 1000ms, the comment should
be changed accordingly.

Fixes: 64f1c8539c8c ("net/ixgbe: wait longer for link after fiber MAC setup")
Cc: stable@dpdk.org
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/i40e: fix X710 Rx after reading some registers
Beilei Xing [Thu, 15 Nov 2018 03:17:02 +0000 (11:17 +0800)]
net/i40e: fix X710 Rx after reading some registers

There's an issue that X710 can't receive any packet after
reading some special registers. That's because these
registers are only valid for X722, read access for non-X722
will cause ECC error.

Fixes: d9efd0136ac1 ("i40e: add EEPROM and registers dumping")
Cc: stable@dpdk.org
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agosecurity: remove experimental tag
Akhil Goyal [Tue, 13 Nov 2018 11:28:21 +0000 (11:28 +0000)]
security: remove experimental tag

rte_security has been experimental since DPDK 17.11 release.
Now the library has matured and expermental tag is removed in
this patch.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Boris Pismenny <borisp@mellanox.com>
5 years agocommon/cpt: fix bit shift operation for KASUMI
Ankur Dwivedi [Thu, 15 Nov 2018 05:10:27 +0000 (05:10 +0000)]
common/cpt: fix bit shift operation for KASUMI

Using the rte_bsf32 function to find last set bit. This avoids
the for loop and hence the bad bit shift operation.

Coverity issue: 323477
Fixes: 351fbee21986 ("common/cpt: support hash")

Signed-off-by: Ankur Dwivedi <ankur.dwivedi@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
5 years agovfio: fix build with Linux < 4.0
Thomas Monjalon [Sun, 18 Nov 2018 21:14:26 +0000 (22:14 +0100)]
vfio: fix build with Linux < 4.0

drivers/bus/pci/linux/pci_vfio.c:45:23: error:
‘failure_handle_lock’ defined but not used

Fixes: 8ffe73865124 ("vfio: add lock for hot-unplug failure handler")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agoapp/testpmd: workaround deadlock in hot-unplug callback
Jeff Guo [Thu, 15 Nov 2018 09:18:24 +0000 (17:18 +0800)]
app/testpmd: workaround deadlock in hot-unplug callback

Because the user's callback is invoked in eal interrupt callback, the
interrupt callback need to be finished before it can be unregistered
when detaching device. So finish callback soon and use a deferred
removal to detach device is need.

It is a workaround, once the device detaching be moved into the eal in
the future, the deferred removal could be deleted. This patch aim to
add this workaround and refine the function name and the description to
be more explicit and comment the limitation.

Fixes: 2049c5113fe8 ("app/testpmd: use hotplug failure handler")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
5 years agovfio: add lock for hot-unplug failure handler
Jeff Guo [Thu, 15 Nov 2018 09:18:23 +0000 (17:18 +0800)]
vfio: add lock for hot-unplug failure handler

When the sigbus handler be enabled for hot-unplug, whatever hot-unplug
sigbus or origin sigbus occur, the sigbus handler will be invoked and
it will access the bus and device. While in the control path, the vfio
req handler also will process the bus and device, so a protection of
the resources in vfio req handler should be need. This patch add a lock
in vfio req handler when process bus and device resource, to avoid the
synchronization issue when device be hot-unplugged.

Fixes: c115fd000c32 ("vfio: handle hotplug request notifier")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
5 years agoeal: fix deadlock in hot-unplug
Jeff Guo [Thu, 15 Nov 2018 09:18:22 +0000 (17:18 +0800)]
eal: fix deadlock in hot-unplug

When device be hot-unplugged, the hot-unplug handler will be invoked by uio
remove event and the device will be detached, then kernel will sent another
pci remove event. So if there is any unlock miss, it will cause a dead lock
issue. This patch will add this missing unlock for hot-unplug handler.

Fixes: 0fc54536b14a ("eal: add failure handling for hot-unplug")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
5 years agoefd: fix write unlock during ring creation
Chaitanya Babu Talluri [Wed, 14 Nov 2018 11:24:06 +0000 (11:24 +0000)]
efd: fix write unlock during ring creation

In rte_efd_create() write lock has already been unlocked
before ring creation itself.
So second unlock after the ring creation has been removed.

Fixes: 56b6ef874f80 ("efd: new Elastic Flow Distributor library")
Cc: stable@dpdk.org
Signed-off-by: Chaitanya Babu Talluri <tallurix.chaitanya.babu@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agobuild: establish an invariant machine type
Christian Ehrhardt [Wed, 14 Nov 2018 19:40:12 +0000 (20:40 +0100)]
build: establish an invariant machine type

Add the machine definition 'default' which is special compared
to 'native' (most optimized for current system) or any explicit
type (external entity has to decide on the type).

It defaults to the per arch agreed common minimal baseline
needed for DPDK to reasonable work.

That might not be the most optimized, but the most portable
version while still being able to support the CPU features
required for DPDK.

Going forward this can be bumped up by the DPDK project, but it
can never be an invariant like 'native'.

Distributions and other needing portable code are expected to
define the machine as 'default'.

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <bluca@debian.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agobuild: avoid non supported -march on ppc with meson
Christian Ehrhardt [Wed, 14 Nov 2018 19:40:11 +0000 (20:40 +0100)]
build: avoid non supported -march on ppc with meson

So far only if machine was "native" it did use the re-direction to
not set -march on ppc64 (where -march is not supported).
We have to use mcpu/mtune in any case on ppc for whatever someone using
the build system defines as machine.

Fixes: 54d609a13876 ("build: add ppc64 meson build")

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Luca Boccassi <bluca@debian.org>
5 years agobuild: set -mfpu=neon flag for armv7-a with meson
Luca Boccassi [Thu, 15 Nov 2018 16:54:18 +0000 (16:54 +0000)]
build: set -mfpu=neon flag for armv7-a with meson

Building on armv7a with meson currenctly fails:

/usr/lib/gcc/arm-linux-gnueabihf/8/include/arm_neon.h:10369:1: error:
    inlining failed in call to always_inline ‘vld1q_s32’: target
    specific option mismatch

Set -mfpu=neon on that architecture like the legacy makefiles do to fix
the issue.

Fixes: b1d48c41189a ("build: support ARM with meson")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
5 years agomem: fix anonymous mapping on Power9
David Wilder [Fri, 16 Nov 2018 17:35:38 +0000 (09:35 -0800)]
mem: fix anonymous mapping on Power9

Removed the use of MAP_HUGETLB for anonymous mapping on ppc64.  The
MAP_HUGETLB had previously been added to workaround issues on IBM Power8
systems when mapping /dev/zero.
In the current code the MAP_HUGETLB flag will cause the anonymous mapping
to fail on Power9.
Note, Power8 is currently failing to correctly mmap Hugepages, with and
without this change.

Fixes: 284ae3e9ff9a ("eal/ppc: fix mmap for memory initialization")

Signed-off-by: David Wilder <dwilder@us.ibm.com>
Reviewed-by: Pradeep Satyanarayana <pradeep@us.ibm.com>
5 years agomalloc: fix adjacency check to also include segment list
Anatoly Burakov [Wed, 14 Nov 2018 15:00:58 +0000 (15:00 +0000)]
malloc: fix adjacency check to also include segment list

It may so happen that two memory locations may be adjacent in
virtual memory, but belong to different segment lists. With
current code, such segments will be concatenated. Fix the
adjacency checking code to also check if the adjacent malloc
elements belong to the same memseg list.

Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agomem: check for contiguousness in external segments
Anatoly Burakov [Wed, 14 Nov 2018 14:51:11 +0000 (14:51 +0000)]
mem: check for contiguousness in external segments

For IOVA as VA mode, we assume that memory is contiguous. However,
for external segments that assumption may not necessarily hold.
Fix the code to not assume that external memory segments are
contiguous even in IOVA as VA mode.

Fixes: 5282bb1c3695 ("mem: allow memseg lists to be marked as external")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoeal: fix duplicate function declaration
Kevin Laatz [Wed, 14 Nov 2018 11:20:05 +0000 (11:20 +0000)]
eal: fix duplicate function declaration

The rte_eal_get_runtime_dir() function is currently being declared in two
header files.

This API was made public in commit 6911c9fd8fbe ("eal: export function to
get runtime directory"), adding it to rte_eal.h. To make it public, the
'rte' prefix was added to the function so it needed to be modified in the
original location of the declaration, eal_filesystem.h.  By only modifying,
and not removing the decalration, it is now a duplicate.

This patch removes the declaration from eal_filesystem.h.

Fixes: 6911c9fd8fbe ("eal: export function to get runtime directory")

Reported-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: Kevin Laatz <kevin.laatz@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agoversion: 18.11-rc3
Thomas Monjalon [Wed, 14 Nov 2018 04:05:29 +0000 (05:05 +0100)]
version: 18.11-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
5 years agotest: fix clean up on failure
Anatoly Burakov [Thu, 8 Nov 2018 11:44:16 +0000 (11:44 +0000)]
test: fix clean up on failure

One of the failure paths were not updated to clean up on exit,
most likely due to rebase error. Fix the failure path to clean
up instead of simply exiting.

Fixes: 3f9e31d71d63 ("test: clean up on exit")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
5 years agotest/reorder: fix out of bound access
Ferruh Yigit [Tue, 13 Nov 2018 23:31:37 +0000 (23:31 +0000)]
test/reorder: fix out of bound access

The value of array index 'i' is out of bound because of the previous
loop it has been used.

Assuming intention is using '0' since the check before free is robufs[0]
check, fixing according.

Fixes: ecd867faa860 ("test/reorder: fix freeing mbuf twice")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agotest/kni: fix module miss fallback
Pallantla Poornima [Tue, 13 Nov 2018 14:00:15 +0000 (14:00 +0000)]
test/kni: fix module miss fallback

Kni_autotest should be skipped if rte_kni.ko module is not loaded.
Hence changed return as TEST_SKIPPED.

Fixes: ee1caebc4d ("test/kni: check module dependency")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agotest/power: fix ACPI cpufreq module miss fallback
Pallantla Poornima [Tue, 13 Nov 2018 13:58:20 +0000 (13:58 +0000)]
test/power: fix ACPI cpufreq module miss fallback

Power_acpi_cpufreq_autotest should not be run on VM and platforms
which dont have acpi_cpufreq module loaded.
Hence changed return as TEST_SKIPPED

Fixes: 0ea2dd4409 ("test: skip when required lib not available")
Cc: stable@dpdk.org
Signed-off-by: Pallantla Poornima <pallantlax.poornima@intel.com>
Acked-by: Reshma Pattan <reshma.pattan@intel.com>
5 years agoexamples/l3fwd-power: fix power library fallback
Moti Haimovsky [Wed, 7 Nov 2018 14:09:28 +0000 (14:09 +0000)]
examples/l3fwd-power: fix power library fallback

This patch replaces the rte_exit routine with error printing when
init_power_library() fails and by that restores the previous behavior
of the program (which was to issue an error message and continue
working if init_power_library fails). This allows the user to still
experience the Rx interrupts feature of the DPDK demonstrated in
this program.

Fixes: f88e7c175a68 ("examples/l3fwd-power: add high/regular perf cores options")
Cc: stable@dpdk.org
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: David Hunt <david.hunt@intel.com>
5 years agocrypto/octeontx: fix null pointer dereferencing
Anoob Joseph [Mon, 12 Nov 2018 18:14:12 +0000 (18:14 +0000)]
crypto/octeontx: fix null pointer dereferencing

The function otx_cpt_get_resource() would be setting the pointer
'instance'. In case of error, 'instance' would be set to NULL, and
returns rte_errno. If rte_errno when 'instance' is set to NULL, it can
lead to NULL pointer dereferencing.

Coverity Issue: 323486, 323489
Fixes: bfe2ae495ee2 ("crypto/octeontx: add PMD skeleton")
Fixes: 0961348fdf52 ("crypto/octeontx: add queue pair functions")

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
5 years agocrypto/octeontx: fix non null terminated device name
Anoob Joseph [Mon, 12 Nov 2018 18:14:12 +0000 (18:14 +0000)]
crypto/octeontx: fix non null terminated device name

If the length of string pointed by 'name' is equal to or greater than
the sizeof cptvf->dev_name string, the resultant string will not be
null terminated. Using strlcpy would make sure the string would always
be null terminated.

Coverity Issue: 323492
Fixes: 0dc1cffa4d33 ("crypto/octeontx: add hardware init routine")

Signed-off-by: Ankur Dwivedi <ankur.dwivedi@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
5 years agocrypto/aesni_mb: fix queue pair free
Fan Zhang [Tue, 16 Oct 2018 09:45:54 +0000 (10:45 +0100)]
crypto/aesni_mb: fix queue pair free

This patch fixes the queue pair free for AESNI-MB PMD. Originally
the queue pair ring name are different than the object name,
caused the aesni_mb_pmd_qp_release() cannot find the ring to
release. This patch uses the same name between queue pair object
name and ring name.

Fixes: a831c318c54d ("crypto/aesni_mb: free ring memory on queue release")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
5 years agocrypto/ccp: fix resource leak
Ferruh Yigit [Sun, 28 Oct 2018 03:19:27 +0000 (03:19 +0000)]
crypto/ccp: fix resource leak

File *fp, opened but not closed, this patch add fclose(fp)

Fixes: ef4b04f87fa6 ("crypto/ccp: support device init")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Ravi Kumar <ravi1.kumar@amd.com>
5 years agoapp/testpmd: fix memory allocation for DSCP table
Jasvinder Singh [Tue, 6 Nov 2018 10:26:40 +0000 (10:26 +0000)]
app/testpmd: fix memory allocation for DSCP table

The patch fixes the memory allocation for the meter DSCP table.

Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: fix memory leak for TM object
Jasvinder Singh [Tue, 6 Nov 2018 10:23:06 +0000 (10:23 +0000)]
app/testpmd: fix memory leak for TM object

Fixes memory leak for shared shaper object of the traffic manager.

Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Cc: stable@dpdk.org
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoexamples/ip_pipeline: fix null pointer dereference
Jasvinder Singh [Fri, 9 Nov 2018 16:12:25 +0000 (16:12 +0000)]
examples/ip_pipeline: fix null pointer dereference

Fixes NULL pointer dereference issue raised by Coverity.

Coverity issue: 325728, 325729, 325731, 325738
Fixes: 27b333b23237 ("examples/ip_pipeline: track table rules on add bulk")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
5 years agopipeline: fix logically dead code
Fan Zhang [Mon, 5 Nov 2018 12:27:02 +0000 (12:27 +0000)]
pipeline: fix logically dead code

This patches fixes the coverity issue of logically dead code.

Coverity issue: 323523
Fixes: 96303217a606 ("pipeline: add symmetric crypto table action")

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
5 years agonet/i40e: add parameter check for RSS flow init
Wei Zhao [Mon, 12 Nov 2018 09:25:24 +0000 (17:25 +0800)]
net/i40e: add parameter check for RSS flow init

There need an parameter check for RSS flow init, or it may cause
core dump if pointer is NULL in memory copy.

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/ixgbevf: fix link state
Yanglong Wu [Tue, 13 Nov 2018 06:34:43 +0000 (14:34 +0800)]
net/ixgbevf: fix link state

For ixgbevf kernel driver, link status changes from down to up
will trigger vf kernel driver send IXGBE_VF_RESET message to pf
kernel driver, after this, vf kernel driver will disable and enable
it self. By these series operations, the vf kernel driver report
link up. Besides, all these operations handles in kernel thread.
For DPDK user space driver, it only gets link status changes from
down to up, but miss IXGBE_VF_RESET message sending and reset itself.
If we will add fully implementation of link status change for DPDK
user space driver, we need take much more modification. We have
aligned that for link status changes from down to up we only notify
link is up, users need to reset vf port.

Fixes: dc66e5fd01b9 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org
Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Signed-off-by: Yanglong Wu <yanglong.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx5: fix Direct Verbs RSS hash field
Yongseok Koh [Tue, 13 Nov 2018 06:00:16 +0000 (08:00 +0200)]
net/mlx5: fix Direct Verbs RSS hash field

As mlx5_flow_hashfields_adjust() refers to flow->rss, actions must be
translated prior to items like in Verbs. Otherwise, hash fields are not
correctly set.

Fixes: d02cb0691299 ("net/mlx5: add Direct Verbs translate actions")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agodoc: add mlx5 IPv6 multicast limitation in VM
Dekel Peled [Mon, 12 Nov 2018 11:31:06 +0000 (13:31 +0200)]
doc: add mlx5 IPv6 multicast limitation in VM

This patch adds limitation notice for MLX5 PMD.
IPv6 multicast messages are not received on VM when promiscuous
and allmulticast modes are off, due to netlink restriction.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/enic: fix size check in Tx prepare handler
Hyong Youb Kim [Tue, 13 Nov 2018 15:38:10 +0000 (07:38 -0800)]
net/enic: fix size check in Tx prepare handler

The current code wrongly assumes that packets are non-TSO and ends up
rejecting large TSO packets. Check non-TSO and TSO max packet sizes
separately.

Fixes: 5a12c387405a ("net/enic: check maximum packet size in Tx prepare handler")
Cc: stable@dpdk.org
Signed-off-by: Hyong Youb Kim <hyonkim@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
5 years agonet/sfc/base: fix field order in filter spec struct
Igor Romanov [Tue, 13 Nov 2018 15:02:44 +0000 (15:02 +0000)]
net/sfc/base: fix field order in filter spec struct

Fields in the struct efx_filter_spec_t starting from efs_outer_vid
are hashed for software filter lookup. efs_mark is not a matching
criteria. Exclude efs_mark from hash.

Fixes: 5f78af523912 ("net/sfc: support MARK and FLAG actions in flow API")
Cc: stable@dpdk.org
Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: eliminate interim variable
Ferruh Yigit [Tue, 13 Nov 2018 11:12:38 +0000 (11:12 +0000)]
ethdev: eliminate interim variable

`local_conf` variable was needed for offload conversions but no more
required. No functional difference, only interim variable eliminated.

Fixes: ab3ce1e0c193 ("ethdev: remove old offload API")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: fix device info getting
Wenzhuo Lu [Tue, 13 Nov 2018 11:12:37 +0000 (11:12 +0000)]
ethdev: fix device info getting

The device information cannot be gotten correctly before
the configuration is set. Because on some NICs the
information has dependence on the configuration.

Fixes: 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agoethdev: fix invalid configuration after failure
Wenzhuo Lu [Tue, 13 Nov 2018 11:12:36 +0000 (11:12 +0000)]
ethdev: fix invalid configuration after failure

The new configuration is stored during the rte_eth_dev_configure() API
but the API may fail. After failure stored configuration will be
invalid since it is not fully applied to the device.

We better roll the configuration back after failure.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
5 years agonet/qede: fix Tx tunnel offload support mask
Shahed Shaikh [Mon, 12 Nov 2018 18:19:38 +0000 (18:19 +0000)]
net/qede: fix Tx tunnel offload support mask

Tunneling offloads are represented by multi-bit values. So, feature
wise tunneling offload can only be entirely supported/unsupported
using PKT_TX_TUNNEL_MASK. Its upon PMDs to further isolate which of
the tunneling offload types are supported by respective PMD.
Using subset of bits from PKT_TX_TUNNEL_MASK to indicate supported vs
unsupported offloads can lead to undesired result.

Use PKT_TX_TUNNEL_MASK in QEDE_TX_OFFLOAD_MASK and use independent
value of supported PKT_TX_TUNNEL_* in .tx_pkt_prepare() to mark
supported tunnel offloads.

Fixes: 44346c24b790 ("net/qede: fix VXLAN tunnel Tx offload flag setting")
Cc: stable@dpdk.org
Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@cavium.com>
Reviewed-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/octeontx: fix mbuf corruption with large private sizes
Nitin Saxena [Mon, 12 Nov 2018 17:54:09 +0000 (17:54 +0000)]
net/octeontx: fix mbuf corruption with large private sizes

When the priv_size of the mbuf is > 128 bytes, the mbuf would not be
properly constructed. This would lead to a corrupt mbuf.

This patch fixes the issue by accounting for
rte_pktmbuf_priv_size(pool) and RTE_PKTMBUF_HEADROOM
while configuring first skip register calculation.

Fixes: 197438ee9f18 ("net/octeontx: add Rx queue setup and release ops")
Cc: stable@dpdk.org
Suggested-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
Signed-off-by: Nitin Saxena <nitin.saxena@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agodrivers/net: set close behaviour flag at probing
Thomas Monjalon [Sun, 11 Nov 2018 22:46:11 +0000 (23:46 +0100)]
drivers/net: set close behaviour flag at probing

The ethdev flag RTE_ETH_DEV_CLOSE_REMOVE is set for drivers
having migrated to the new behaviour of rte_eth_dev_close().

As any other flag, it can be useful to know about its value
as soon as the port is probed.
Unfortunately, it was set inside the close operation,
just before being erased by memset() in rte_eth_dev_release_port().
The flag assignment is moved to the probing stage, so it can
be checked by the application in order to anticipate the behaviour.

Fixes: 42603bbdb58e ("net/mlx5: release port on close")
Fixes: 6c99085d972b ("net/vmxnet3: fix hot-unplug")
Fixes: 4d7877fde2ef ("net/ena: remove resources when port is being closed")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: revert setting default RSS
Ophir Munk [Fri, 9 Nov 2018 09:38:10 +0000 (09:38 +0000)]
app/testpmd: revert setting default RSS

This reverts the patch that enables default RSS action by setting
key=NULL and key_len=0.
In current testpmd implementation a key pointer must exist if
key_len!=0. For example, the following flow rule will cause a
segmentation fault:
flow create 0 <pattern> actions rss queues 0 1 end key_len 40 / end

Fixes: a4391f8bae85 ("app/testpmd: set default RSS key as null")
Cc: stable@dpdk.org
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agoapp/testpmd: fix L4 length for UDP checksum
Raslan Darawsheh [Sun, 11 Nov 2018 15:31:37 +0000 (15:31 +0000)]
app/testpmd: fix L4 length for UDP checksum

testpmd only sets the L4 len in case of TCP packets.
some PMD's like tap rely on mbuf meta data to calculate csum

This will set the L4 len for UDP packets same as TCP

Fixes: 160c3dc9458c ("app/testpmd: introduce IP parsing functions in csum fwd engine")
CC: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
5 years agonet/qede: fix crash when configure fails
Timothy Redaelli [Fri, 9 Nov 2018 15:45:40 +0000 (16:45 +0100)]
net/qede: fix crash when configure fails

Currently, if configuration fails (for example if a 100G card is used
with an odd number of RX/TX queues) QEDE crashes due to a null pointer
dereference.

This commit fixes it by checking that the pointer is not NULL before
using it.

Fixes: 7105b24f4bb8 ("net/qede: fix memory alloc for multiple port reconfig")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agodoc: add mlx5 Direct Verbs flow engine limitation
Shahaf Shuler [Mon, 12 Nov 2018 05:58:22 +0000 (07:58 +0200)]
doc: add mlx5 Direct Verbs flow engine limitation

Would be good to add also a code which disable the dv_flow_en
the user requested. However such support will need to use new netlink
command to query the switchdev mode from the underlying kernel.

Considering the current 18.11 release is close to RC3, only a
documentation is added.

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: remove GRE inner IPv6 matching limitation
Shahaf Shuler [Sun, 11 Nov 2018 11:15:26 +0000 (13:15 +0200)]
net/mlx5: remove GRE inner IPv6 matching limitation

Such limitation seems not to exist on:
 - MLNX_OFED_linux-4.5-0.3.0.0 (Beta)
 - MLNX_OFED_LINUX-4.4-2.0.7.0 (GA)
 - upstream kernel 4.19.0-rc7

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix VXLAN device rollback if rule apply fails
Viacheslav Ovsiienko [Sat, 10 Nov 2018 10:01:59 +0000 (10:01 +0000)]
net/mlx5: fix VXLAN device rollback if rule apply fails

If rule contains tunneling action (like VXLAN encapsulation)
the VTEP (Virtual Tunneling EndPoint) device is pre-configured
before applying the rule. If kernel returns an error this
VTEP configuration should be rolled back to the origin state.
The patch adds the missing VTEP configuration restoration.

Fixes: 95a464cecc21 ("net/mlx5: add E-switch VXLAN tunnel devices management")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix rule cleanup Netlink command sending
Viacheslav Ovsiienko [Sat, 10 Nov 2018 09:59:26 +0000 (09:59 +0000)]
net/mlx5: fix rule cleanup Netlink command sending

The VXLAN related rule cleanup routine queries and gathers all
existing local IP and neigh rules into buffer list. One buffer
may contain multiple rule deletion commands and is prepared
to send into Netlink as single message. But, if error occurs
for some deletion commands in the buffer, the multiple ACK
message with errors can be send back by the kernel. It breaks
the Netlink communication sequence numbers, because we expect
only one ACK message and it smashes out futher Netlik
communication.

The workaround of this problem is to send rule deletion commands
from buffer in one-by-one fashion and get ACK message for every
command sent. We do not expect too may rules preexist, so there
should not be critical performance degradation at VXLAN outer
interface initialization.

Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: add Netlink message size check in rule cleanup
Viacheslav Ovsiienko [Sat, 10 Nov 2018 09:59:26 +0000 (09:59 +0000)]
net/mlx5: add Netlink message size check in rule cleanup

This patch is preparation for the following fix, we are going to send
Netlink message from buffer in one-by-one fashion. It is highly
desirable to check multimessage buffer consistency for debug purposes.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fix buffer allocation check in rule cleanup
Viacheslav Ovsiienko [Sat, 10 Nov 2018 09:59:25 +0000 (09:59 +0000)]
net/mlx5: fix buffer allocation check in rule cleanup

The Netlink message buffer is allocated and there is the typo,
the other pointer is checked instead of returned one. If no
memory is allocated and NULL is returned by allocation routine
the bug causes segmentation fault. The patch fixes typo,
returned pointer is validated.

Fixes: f420f03d6772 ("net/mlx5: add E-switch VXLAN rule cleanup routines")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/mlx5: fallback quietly if pkg-config is unavailable
Luca Boccassi [Fri, 9 Nov 2018 22:48:07 +0000 (22:48 +0000)]
net/mlx5: fallback quietly if pkg-config is unavailable

Don't fail the build if pkg-config can't be found, instead print the
linker flag as it was doing before the change.

Fixes: b6b87939193a ("net/mlx5: use pkg-config to handle SUSE libmnl")
Cc: stable@dpdk.org
Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix flow director add and delete
Dekel Peled [Thu, 8 Nov 2018 21:29:45 +0000 (23:29 +0200)]
net/mlx5: fix flow director add and delete

Fix the flow_fdir_cmp() function, used by flow_fdir_filter_lookup().
This function is used by flow_fdir_filter_add() to check if same rule
exists, and by flow_fdir_filter_delete() to find flow rule to delete.

The function compared actions conf pointers, changed to compare
actions type only.

Fixes: 2720f833d461 ("net/mlx5: add missing flow director delete")
Cc: stable@dpdk.org
Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
5 years agonet/bonding: fix crash when stopping mode 4 port
Radu Nicolau [Thu, 8 Nov 2018 15:26:42 +0000 (15:26 +0000)]
net/bonding: fix crash when stopping mode 4 port

When stopping a bonded port all slaves are deactivated. Attempting
to deactivate a slave that was never activated will result in a segfault
when mode 4 is used.

Fixes: 7486331308f6 ("net/bonding: stop and deactivate slaves on stop")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
5 years agonet/bnx2x: fix VF link state update
Rasesh Mody [Thu, 8 Nov 2018 21:19:30 +0000 (21:19 +0000)]
net/bnx2x: fix VF link state update

In general the VF driver should not access the chip. For VF link status
update, VF driver should not use HW lock, use bnx2x_link_report_locked()
instead.
Add few prints for releasing previously held HW locks.

Fixes: a9b58b15ed51 ("net/bnx2x: fix to add PHY lock")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
5 years agonet/bnx2x: fix dynamic logging
Rasesh Mody [Thu, 8 Nov 2018 21:19:26 +0000 (21:19 +0000)]
net/bnx2x: fix dynamic logging

Use rte_log() rather than RTE_LOG() for dynamic logging. Rearrange
dynamic log types to the top and configurable log types to bottom.
Remove unused RTE_LIBRTE_BNX2X_DEBUG_TX_FREE

Fixes: ba7eeb035a5f ("net/bnx2x: fix logging to include device name")
Cc: stable@dpdk.org
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agovhost: remove unneeded null pointer check
Tiwei Bie [Wed, 7 Nov 2018 09:01:02 +0000 (17:01 +0800)]
vhost: remove unneeded null pointer check

The caller will guarantee that msg won't be null. Remove
the unneeded null pointer check which caused a Coverity
warning.

Coverity issue: 323484
Fixes: 8f972312b8f4 ("vhost: support vhost-user")
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 unchecked return value
Tiwei Bie [Wed, 7 Nov 2018 09:01:01 +0000 (17:01 +0800)]
net/virtio: fix unchecked return value

Coverity issue: 302861
Fixes: 6ba1f63b5ab0 ("virtio: support specification 1.0")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agovhost/crypto: fix packet copy in chaining mode
Fan Zhang [Tue, 6 Nov 2018 16:22:48 +0000 (16:22 +0000)]
vhost/crypto: fix packet copy in chaining mode

This patch fixes the incorrect packet content copy in the
chaining mode. Originally the content before cipher offset is
overwritten by all zeros. This patch fixes the problem by
making sure the correct write back source and destination
settings during set up.

Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Cc: stable@dpdk.org
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/virtio-user: fix typo in error message
Tiwei Bie [Tue, 6 Nov 2018 06:40:22 +0000 (14:40 +0800)]
net/virtio-user: fix typo in error message

The param we are checking is VIRTIO_USER_ARG_PATH, instead
of VIRTIO_USER_ARG_QUEUE_SIZE.

Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
5 years agovhost: fix IOVA access for packed ring
Tiwei Bie [Tue, 6 Nov 2018 06:40:21 +0000 (14:40 +0800)]
vhost: fix IOVA access for packed ring

We should apply for RO access when receiving packets from the
VM and apply for RW access when sending packets to the VM.

Fixes: a922401f35cc ("vhost: add Rx support for packed ring")
Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
5 years agonet/thunderx: fix Tx desc corruption in scatter-gather mode
Subrahmanyam Nilla [Fri, 9 Nov 2018 05:50:55 +0000 (05:50 +0000)]
net/thunderx: fix Tx desc corruption in scatter-gather mode

For performance reasons, word1 of send_hdr_s
sub descriptor was not cleared assuming it is always
having default value of zero since it comes from fixed
offsets of SQ buffer.
This is causing issues in case of SG mode because,
the size of send command might change and hence the word1
of send_hdr_s is not always at fixed offsets of the SQ buffer
and hence not having default value of zero.

This fixes the issue by clearing the word1 in case of SG mode
for every packet.

Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx")
Cc: stable@dpdk.org
Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <nithin.dabilpuram@caviumnetworks.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
5 years agonet/cxgbevf: fix illegal memory access when freeing MPS TCAM
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:28 +0000 (13:26 +0530)]
net/cxgbevf: fix illegal memory access when freeing MPS TCAM

Individual MPS TCAM entries are not allocated as separate entities.
All entries are allocated once as an array. So, fix bug with attempting
to free illegal memory location.

Also add missing MPS TCAM initialization for CXGBEVF.

Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix wrong ingress port value set in filter spec
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:27 +0000 (13:26 +0530)]
net/cxgbe: fix wrong ingress port value set in filter spec

Set the "value" in the filter spec and not the "mask". Also, remove
duplicate comparison for hardware supported match items already done
earlier.

Fixes: af44a577988b ("net/cxgbe: support to offload flows to HASH region")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: increase completion wait time for flow operations
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:26 +0000 (13:26 +0530)]
net/cxgbe: increase completion wait time for flow operations

Under heavy load, flow related operations can take more time to
complete. Increase max completion wait time to 10 seconds. Also
increase max receive budget to read more replies from firmware
in every cycle.

Fixes: 9eb2c9a48072 ("net/cxgbe: implement flow create operation")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: fix check for redefined match items
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:25 +0000 (13:26 +0530)]
net/cxgbe: fix check for redefined match items

Fix issue where ethertype is set to 0x800 for IPv4 by ether match
item and IPv4 match item also inherently sets ethertype to 0x800.

Current logic returns error when IPv4 match item is parsed. So, fix
by only bailing if the redefined match items have different values.

Fixes: ee61f5113b17 ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbe: check Rx config before doing VLAN strip offload
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:24 +0000 (13:26 +0530)]
net/cxgbe: check Rx config before doing VLAN strip offload

Fixes: 436125e64174 ("net/cxgbe: update to Rx/Tx offload API")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/cxgbevf: add PCI uninitialization for VF
Rahul Lakkireddy [Fri, 9 Nov 2018 07:56:23 +0000 (13:26 +0530)]
net/cxgbevf: add PCI uninitialization for VF

Fixes: 2195df6d11bd ("net/cxgbe: rework ethdev device allocation")
Cc: stable@dpdk.org
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
5 years agonet/ixgbe: stop link setup alarm handler before start
Ilya Maximets [Thu, 8 Nov 2018 10:24:01 +0000 (13:24 +0300)]
net/ixgbe: stop link setup alarm handler before start

We should stop alarm handler before resetting the HW to
avoid concurrent device reconfiguration.

Fixes: 0408f47ba4d6 ("net/ixgbe: fix busy polling while fiber link update")
CC: stable@dpdk.org
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Tested-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/mlx5: fix build on PPC64
Thomas Monjalon [Wed, 7 Nov 2018 16:00:28 +0000 (17:00 +0100)]
net/mlx5: fix build on PPC64

The AltiVec header file breaks boolean type:

error: incompatible types when initializing type
'__vector _bool int' {aka '_vector(4) __bool int'} using type 'int'

If __APPLE_ALTIVEC__ is defined, then bool type is redefined
and conflicts with stdbool.h.

There is no good solution to fix it for the whole project without
breaking something else, so a workaround is inserted in mlx5 PMD.
This workaround is not compatible with C++ but there is no C++ in DPDK.

Suggested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Suggested-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: David Wilder <dwilder@us.ibm.com>
Acked-by: Chao Zhu <chaozhu@linux.vnet.ibm.com>
5 years agonet/e1000/base: fix uninitialized variable
Yunjian Wang [Tue, 6 Nov 2018 07:57:01 +0000 (15:57 +0800)]
net/e1000/base: fix uninitialized variable

This patch fixes the variable 'phy_word' may be used uninitialized.

Fixes: 5b6439cf03a4 ("e1000/base: support different EEARBC for i210")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
5 years agonet/tap: fix probe for multiq or flowq failure
Vipin Varghese [Wed, 7 Nov 2018 13:58:17 +0000 (19:28 +0530)]
net/tap: fix probe for multiq or flowq failure

In scenarios for multiq or flowq setup failure
`rte_eth_dev_probing_finish()` has to be invoked for successful device
registration.

Fixes: fbe90cdd776c ("ethdev: add probing finish function")
Cc: stable@dpdk.org
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agoapp/testpmd: fix Rx offload search
Wei Zhao [Wed, 7 Nov 2018 06:14:29 +0000 (14:14 +0800)]
app/testpmd: fix Rx offload search

There is an error in function search_rx_offload(),
it will break when get unexpected return value from function
rte_eth_dev_rx_offload_name(), but rte_eth_dev_rx_offload_name()
will return some unexpected value indeed.

Fixes: c73a9071877a ("app/testpmd: add commands to test new offload API")
Cc: stable@dpdk.org
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
5 years agoexamples/flow_filtering: fix capability setting
Ori Kam [Tue, 6 Nov 2018 06:32:20 +0000 (06:32 +0000)]
examples/flow_filtering: fix capability setting

The tx offloads should be compared to tx capability

Fixes: c82f2f8b4b3a ("examples/flow_filtering: filter out unsupported offloads")
Cc: stable@dpdk.org
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Wei Zhao <wei.zhao1@intel.com>
5 years agonet/mlx5: fix L4 protocol validation
Yongseok Koh [Tue, 6 Nov 2018 08:14:18 +0000 (08:14 +0000)]
net/mlx5: fix L4 protocol validation

- Currently, no device supports partial mask for protocol in IP header.
- As there could be multiple IP items, next_protocol variable in flow
  validation has to be reset for inner layer. Otherwise, inner TCP/UDP
  will see protocol number of outer IP header.
- Remove redundant protocol checking for MPLS, which is done in
  mlx5_flow_validate_item_mpls().

Fixes: 3d69434113d1 ("net/mlx5: add Direct Verbs validation function")
Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/mlx5: fix device flow reference
Yongseok Koh [Tue, 6 Nov 2018 07:42:49 +0000 (07:42 +0000)]
net/mlx5: fix device flow reference

dev_flow->verbs is mistakenly used instead of dev_flow->dv. A sanity
check is added for debugging purpose.

Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
5 years agonet/tap: fix file descriptor check
Stephen Hemminger [Tue, 6 Nov 2018 19:30:05 +0000 (11:30 -0800)]
net/tap: fix file descriptor check

Static analysis tools don't like the fact that fd could be zero
in the error path. This won't happen in real world because
stdin would have to be closed, then other error occurring.

Coverity issue: 14079
Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agonet/tap: fix file descriptor leak on error
Stephen Hemminger [Tue, 6 Nov 2018 19:30:04 +0000 (11:30 -0800)]
net/tap: fix file descriptor leak on error

If netlink socket setup fails the file descriptor was leaked.

Coverity issue: 257040
Fixes: 7c25284e30c2 ("net/tap: add netlink back-end for flow API")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
5 years agobus/vmbus: fix directory handle leak on error
Stephen Hemminger [Tue, 6 Nov 2018 19:30:03 +0000 (11:30 -0800)]
bus/vmbus: fix directory handle leak on error

If sysfs directory was incorrectly formatted then the vmbus
setup code would leak a directory handle in the error path.

Coverity issue: 302848
Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
5 years agomk: allow renaming of build directories
Bruce Richardson [Mon, 12 Nov 2018 12:26:15 +0000 (12:26 +0000)]
mk: allow renaming of build directories

When building using make, the Makefile in the build directory contained
the name of the build directory to be passed as an "O=" parameter to
the DPDK SDK makefiles. Unfortunately, this meant that the compilation
would always fail if the build directory was renamed. To remove this
limitation, we can use $(CURDIR) instead of the directory name.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agoeal/x86: move header to standard BSD license
Bruce Richardson [Thu, 21 Dec 2017 16:53:35 +0000 (16:53 +0000)]
eal/x86: move header to standard BSD license

This updates the license on the rte_rtm.h file to be the standard
BSD-3-Clause license used for the rest of DPDK, thus bringing the file in
compliance with the DPDK licensing policy.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
5 years agotest/hash: improve output for r/w test
Bruce Richardson [Mon, 12 Nov 2018 10:47:19 +0000 (10:47 +0000)]
test/hash: improve output for r/w test

The hash read-write autotest generates a lot of text, which is very dense
on the screen. Even the summary at the end is hard to follow as everything
is very compact. We can improve readability by highlighting the starts of
the various sections, and by indenting the values within subsections.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>