dpdk.git
4 years agonet/ixgbe: remove redundant MAC flag check
Haiyue Wang [Thu, 12 Nov 2020 02:00:06 +0000 (10:00 +0800)]
net/ixgbe: remove redundant MAC flag check

The flag of RTE_ETHTYPE_FLAGS_MAC has been checked twice, so remove the
first error message "Not supported by ethertype filter" which is not so
specific, and keep the error message "mac compare is unsupported" which
aligns to the definition of RTE_ETHTYPE_FLAGS_MAC.

Fixes: eb3539fc8550 ("net/ixgbe: parse ethertype filter")
Cc: stable@dpdk.org
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/bnxt: fix assignment instead of comparison
Mike Baucom [Thu, 12 Nov 2020 15:29:45 +0000 (07:29 -0800)]
net/bnxt: fix assignment instead of comparison

Use comparison operator instead of incorrectly using the assignment
operator.

Coverity issue: 363566, 36357
Fixes: 42c40f8902f7 ("net/bnxt: consolidate template table processing")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agonet/txgbe: fix build by simplifying xstats return
Conor Walsh [Wed, 11 Nov 2020 15:39:33 +0000 (15:39 +0000)]
net/txgbe: fix build by simplifying xstats return

When DPDK is compiled with gcc 7.5 with the optimization level set to 1
gcc sees the 'offset' variable in txgbe_ethdev.c as possibly being
uninitialised.
The 'txgbe_get_offset_by_id()' return value, "-(int)(id + 1)", seems
confusing gcc that it assumes '0' can be returned in the failure case.
To correct this the return statement for error case in
'txgbe_get_offset_by_id()' is simplified to return '-1'.

Fixes: 91fe49c87d76 ("net/txgbe: support device xstats")

Signed-off-by: Conor Walsh <conor.walsh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/hinic/base: add message check for command channel
Guoyang Zhou [Wed, 11 Nov 2020 06:33:37 +0000 (14:33 +0800)]
net/hinic/base: add message check for command channel

In the command channel, a message may has several fragments,
and the several fragments should have same message id. To
prevent problems, this check is added.

Fixes: 1e4593db1d58 ("net/hinic/base: fix log info for PF command channel")
Cc: stable@dpdk.org
Signed-off-by: Guoyang Zhou <zhouguoyang@huawei.com>
4 years agonet/iavf: fix performance drop after port reset
Leyi Rong [Thu, 12 Nov 2020 05:51:54 +0000 (13:51 +0800)]
net/iavf: fix performance drop after port reset

Needs to reset rxq->rxrearm_start to 0 when reset_rx_queue(),
otherwise, the random value of rxrearm_start will cause performance drop
due to L3 contested accesses.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agodoc: update firmware/driver mapping table for i40e
Shougang Wang [Wed, 11 Nov 2020 03:27:17 +0000 (03:27 +0000)]
doc: update firmware/driver mapping table for i40e

Update i40e PMD firmware/driver mapping table.

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
4 years agonet/ice: fix perfect match for ACL rule
Simei Su [Wed, 11 Nov 2020 11:30:05 +0000 (19:30 +0800)]
net/ice: fix perfect match for ACL rule

A rule with an imperfect match (wildcarding) will be routed through
ACL. A perfect match should be rejected by ACL.

Fixes: 40d466fa9f76 ("net/ice: support ACL filter in DCF")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/af_xdp: fix pointer storage size
Ferruh Yigit [Mon, 9 Nov 2020 13:30:05 +0000 (13:30 +0000)]
net/af_xdp: fix pointer storage size

'uint64_t' is used to hold the pointer, for 32-bits build this
assumption is wrong and giving following build error:

rte_eth_af_xdp.c: In function ‘xdp_umem_configure’:
rte_eth_af_xdp.c:970:15:
    error: cast to pointer from integer of different size
           [-Werror=int-to-pointer-cast]
  970 |   base_addr = (void *)get_base_addr(mb_pool, &align);
      |               ^

Replacing the 'uint64_t' return type of the 'get_base_addr()' to the
'uintptr_t'.
Although not sure if the overall logic supports the 32-bits, using
'uintptr_t' should be safe both for 64/32 bits.

Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
4 years agoapp/testpmd: support age shared action context
Matan Azrad [Tue, 10 Nov 2020 17:06:39 +0000 (17:06 +0000)]
app/testpmd: support age shared action context

When an age action becomes aged-out the next call for
rte_flow_get_aged_flows API should return the action context supplied
by the action configuration structure.

In case the age action is created by the shared action API, the shared
action context of the Testpmd application was not set.

In addition, the application handler of the contexts returned by the
rte_flow_get_aged_flows API didn't consider the fact that the action
could be set by the shared action API and considered it as regular flow
context.

This caused a crash in Testpmd when the context is parsed.

This patch set context type in the flow and shared action context and
uses it to parse the aged-out contexts correctly.

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Dekel Peled <dekelp@nvidia.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix shared RSS action release
Suanming Mou [Tue, 10 Nov 2020 03:28:02 +0000 (11:28 +0800)]
net/mlx5: fix shared RSS action release

As shared RSS action will be shared by multiple flows, the action
is created as global standalone action and managed only by the
relevant shared action management functions.

Currently, hrxqs will be created by shared RSS action or general
queue action. For hrxqs created by shared RSS action, they should
also only be released with shared RSS action. It's not correct to
release the shared RSS action hrxqs as general queue actions do
in flow destroy.

This commit adds a new fate action type for shared RSS action to
handle the shared RSS action hrxq release correctly.

Fixes: e1592b6c4dea ("net/mlx5: make Rx queue thread safe")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix missing meter packet
Xueming Li [Tue, 3 Nov 2020 11:01:39 +0000 (11:01 +0000)]
net/mlx5: fix missing meter packet

For transfer flow with meter, packet was passed without applying flow
action. The group level was multiplied by 10 for group level 65531.

This patch fixes this issue by correcting suffix table group level
calculation.

Fixes: 3e8f3e51fd93 ("net/mlx5: fix meter table definitions")
Cc: stable@dpdk.org
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/iavf: check RSS rule queue region size
Ting Xu [Wed, 11 Nov 2020 06:42:50 +0000 (14:42 +0800)]
net/iavf: check RSS rule queue region size

When a rule is set to do RSS to redirect flows to a group of queues, the
queue region size should not be larger than the max RSS queue region
supported by HW. This patch added the step to check the queue region
size, and report failure if the size does not meet the requirement.

Fixes: e436cd43835b ("net/iavf: negotiate large VF and request more queues")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix releasing mbufs
Ting Xu [Wed, 11 Nov 2020 03:06:51 +0000 (11:06 +0800)]
net/iavf: fix releasing mbufs

In the function _iavf_rx_queue_release_mbufs_vec to release rx mbufs,
rxq->rxrearm_nb is given the value of rx descriptor number at last.
However, since the process to release and allocate mbufs lacks the
initialization of rxrearm_nb, if we try to release mbufs next time, it
will return without releasing directly. In this patch, rxrearm_nb is
initialized to be zero in rx queue reset.

Fixes: 319c421f3890 ("net/avf: enable SSE Rx Tx")
Cc: stable@dpdk.org
Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
4 years agonet/i40e: fix build for log format specifier
Ferruh Yigit [Tue, 10 Nov 2020 17:54:57 +0000 (17:54 +0000)]
net/i40e: fix build for log format specifier

Build error:
i40e_common.c: In function "i40e_parse_discover_capabilities":
../drivers/net/i40e/base/../i40e_logs.h:43:50:
    error: format "%llX" expects argument of type "long long unsigned
           int", but argument 7 has type "u64" {aka "long unsigned int"
           [-Werror=format=]
   43 |  rte_log(RTE_LOG_ ## level, i40e_logtype_driver, "%s(): " fmt, \
      |                                                  ^~~~~~~~
.../i40e_osdep.h:87:3: note: in expansion of macro "PMD_DRV_LOG_RAW"
   87 |   PMD_DRV_LOG_RAW(DEBUG, "i40e %02x.%x " s,       \
      |   ^~~~~~~~~~~~~~~
.../base/i40e_common.c:4100:4: note: in expansion of macro "i40e_debug"
 4100 |    i40e_debug(hw, I40E_DEBUG_INIT,
      |    ^~~~~~~~~~

There are multiple build error because of same reason, all fixed.

Using 'PRIX64' to fix the build error.

Fixes: 889bc9f0cd3a ("i40e/base: unify the capability function")
Fixes: 9b1041574cd4 ("i40e/base: enhance polling of NVM semaphore")
Fixes: 8db9e2a1b232 ("i40e: base driver")
Fixes: 3b7271f3958a ("i40e/base: catch NVM write semaphore timeout and retry")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agonet/ice: fix some RSS hash fields
Junfeng Guo [Tue, 10 Nov 2020 08:45:03 +0000 (16:45 +0800)]
net/ice: fix some RSS hash fields

Previous code in ice_rss_hash_set has mismatched hash fields and
headers for UDP and TCP.

Fixes: 16187528a923 ("net/ice/base: refactor RSS configure API")

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/i40e: add C++ include guard
Prateek Agarwal [Sat, 7 Nov 2020 09:00:38 +0000 (14:30 +0530)]
net/i40e: add C++ include guard

Add extern "C" in rte_pmd_i40e.h when be compiled with CPP.

Fixes: 17e906a1ea9c ("net/i40e: support link status notification")
Cc: stable@dpdk.org
Signed-off-by: Prateek Agarwal <prateekag@cse.iitb.ac.in>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: check cache pointer before dereference
Wenzhuo Lu [Tue, 10 Nov 2020 06:46:01 +0000 (14:46 +0800)]
net/iavf: check cache pointer before dereference

The return value of rte_mempool_default_cache should be
checked as it can be NULL.

Fixes: 9ab9514c150e ("net/iavf: enable AVX512 for Tx")

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agonet/ice: check cache pointer before dereference
Wenzhuo Lu [Tue, 10 Nov 2020 06:45:52 +0000 (14:45 +0800)]
net/ice: check cache pointer before dereference

The return value of rte_mempool_default_cache should be
checked as it can be NULL.

Fixes: a4e480de268e ("net/ice: optimize Tx by using AVX512")

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
4 years agonet/i40e: fix flow director flex configuration
Chenxu Di [Tue, 10 Nov 2020 07:08:14 +0000 (07:08 +0000)]
net/i40e: fix flow director flex configuration

The configuration of FDIR flex mask and flex pit should not be set
during flow validate. It should be set when flow create.

Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR")
Cc: stable@dpdk.org
Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Tested-by: Jun W Zhou <junx.w.zhou@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
4 years agonet/ice: fix crash when device reset
Simei Su [Tue, 10 Nov 2020 02:01:50 +0000 (10:01 +0800)]
net/ice: fix crash when device reset

When device resets, it should not implement ACL initialization
which is only executed in DCF. This patch disable ACL init and
uninit when in DPDK PF only mode.

Fixes: 40d466fa9f76 ("net/ice: support ACL filter in DCF")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/iavf: fix RXDID configure
Jeff Guo [Mon, 9 Nov 2020 06:05:17 +0000 (14:05 +0800)]
net/iavf: fix RXDID configure

When configure Rx queue by virtchnnl, the RXDID (Rx Descriptor ID)
should be configured only if the Rx queue has been set up.

Fixes: 12b435bf8f2f ("net/iavf: support flex desc metadata extraction")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Tested-by: Yingya Han <yingyax.han@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agodoc: add large iavf support to release notes
Ting Xu [Tue, 10 Nov 2020 01:56:05 +0000 (09:56 +0800)]
doc: add large iavf support to release notes

Update release note for large VF, supporting up to 256 queue pairs per
VF.

Fixes: e436cd43835b ("net/iavf: negotiate large VF and request more queues")

Signed-off-by: Ting Xu <ting.xu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
4 years agonet/hns3: use unsigned types for bit operator
Hongbo Zheng [Mon, 9 Nov 2020 14:28:58 +0000 (22:28 +0800)]
net/hns3: use unsigned types for bit operator

According to bit operator reliability style, variables in
the right expression participating int bit operation
must be an unsigned type.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/hns3: remove some blank lines
Lijun Ou [Mon, 9 Nov 2020 14:29:02 +0000 (22:29 +0800)]
net/hns3: remove some blank lines

According to the rule of the static check tools
that arrange blank lines properly to keep the
code compact, here remove some unnecessary blank
line to fix the above rule warning.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/hns3: fix queue state after reset
Chengchang Tang [Mon, 9 Nov 2020 14:29:01 +0000 (22:29 +0800)]
net/hns3: fix queue state after reset

FLR operation will reset the queue enabling state and
the driver needs to restore the state after reset.
If the driver does not restore the state, it will result
in unpredictable behavior with reset when user start or
stop queue by calling the relevant function if.

This patch fix it by add a queue enabling state restore
function to the reset handler.

Fixes: fa29fe45a7b4 ("net/hns3: support queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/hns3: check PCI config space write
Lijun Ou [Mon, 9 Nov 2020 14:29:00 +0000 (22:29 +0800)]
net/hns3: check PCI config space write

Here adds a check for the return value when calling
rte_pci_write_config.

Coverity issue: 363714
Fixes: cea37e513329 ("net/hns3: fix FLR reset")
Cc: stable@dpdk.org
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/hns3: adjust code style for struct initialization
Hongbo Zheng [Mon, 9 Nov 2020 14:28:59 +0000 (22:28 +0800)]
net/hns3: adjust code style for struct initialization

According to the rule of the used static check tool,
each member is initialized on a separate lines when
struct and union members are initialized, here is
tempting to adjust some code lines in order to remove
the warning.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/hns3: use correct logging format specifiers
Hongbo Zheng [Mon, 9 Nov 2020 14:28:57 +0000 (22:28 +0800)]
net/hns3: use correct logging format specifiers

In current driver print log function, some print format
symbols does not match with the actual variable types.

Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
4 years agonet/sfc: use more robust string comparison
Ivan Malov [Mon, 9 Nov 2020 11:46:06 +0000 (14:46 +0300)]
net/sfc: use more robust string comparison

When it comes to comparing HW switch ID strings,
use strncmp to avoid reading past the buffer.

Fixes: e86b48aa46d4 ("net/sfc: add HW switch ID helpers")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
4 years agocommon/sfc_efx/base: improve MCDI version/boot clarity
Ivan Malov [Mon, 9 Nov 2020 11:46:05 +0000 (14:46 +0300)]
common/sfc_efx/base: improve MCDI version/boot clarity

Improve the clarity of the code.

Fixes: 833cfcd590e2 ("common/sfc_efx/base: add API for querying board info")
Fixes: 312191e86eb0 ("common/sfc_efx/base: refactor version / boot info get helper")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
4 years agonet/txgbe: remove direct use of compiler attribute
Jiawen Wu [Mon, 9 Nov 2020 07:43:46 +0000 (15:43 +0800)]
net/txgbe: remove direct use of compiler attribute

Remove direct use of compiler attribute.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agovhost: fix virtqueue initialization
Maxime Coquelin [Fri, 6 Nov 2020 14:47:44 +0000 (15:47 +0100)]
vhost: fix virtqueue initialization

This patches fixes virtqueue initialization issue causing
segfault or file descriptor being closed unexpectedly.

The wrong index was passed to init_vring_queue() by
alloc_vring_queue() when a hole in the virtqueue array was
met.

Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation")
Cc: stable@dpdk.org
Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Tested-by: Yu Jiang <yux.jiang@intel.com>
4 years agovhost: fix async inflight packet counter
Patrick Fu [Tue, 3 Nov 2020 05:35:01 +0000 (13:35 +0800)]
vhost: fix async inflight packet counter

Async inflight packet counter should take failed packets into account.
Failed packets will be deducted in the error handling logic.

Fixes: 6b3c81db8bb7 ("vhost: simplify async copy completion")
Fixes: cd6760da1076 ("vhost: introduce async enqueue for split ring")
Cc: stable@dpdk.org
Signed-off-by: Patrick Fu <patrick.fu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agoexamples/vhost_crypto: add new line character in usage
Ibtisam Tariq [Mon, 2 Nov 2020 11:38:25 +0000 (11:38 +0000)]
examples/vhost_crypto: add new line character in usage

Add new line character(\n) in the usage of vhost_crypto example for
better readability

Fixes: 709521f4c2cd ("examples/vhost_crypto: support multi-core")
Cc: stable@dpdk.org
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agonet/mlx5: fix Tx queue completion on stop
Viacheslav Ovsiienko [Fri, 6 Nov 2020 16:58:03 +0000 (16:58 +0000)]
net/mlx5: fix Tx queue completion on stop

The Tx queue completion production index was not reset
on Tx queue stop and there were completions remaining
from the previous queue run. This caused the wrong
completion queue operating and overall Tx queue malfunction
on queue restart.

Fixes: 161d103b231c ("net/mlx5: add queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix Rx queue completion index consistency
Viacheslav Ovsiienko [Fri, 6 Nov 2020 17:16:10 +0000 (17:16 +0000)]
net/mlx5: fix Rx queue completion index consistency

The Rx queue completion consumer index got temporary
wrong value pointing to the midst of the compressed CQE
session. If application crashed at the moment the next
queue restart caused handling wrong CQEs pointed by index
and losing consuming index synchronization, that made
reliable queue restart impossible.

Fixes: 88c0733535d6 ("net/mlx5: extend Rx completion with error handling")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix hash list entry assert
Suanming Mou [Fri, 6 Nov 2020 03:02:21 +0000 (11:02 +0800)]
net/mlx5: fix hash list entry assert

The entry variable assert in the mlx5_hlist_register() function is not
correct. Remove the invalid entry variable.

Fixes: e69a59227db0 ("net/mlx5: support concurrent access for hash list")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix use of local array for global error
Dekel Peled [Wed, 4 Nov 2020 14:25:19 +0000 (16:25 +0200)]
net/mlx5: fix use of local array for global error

Recent patch uses a local string array as input for function
rte_flow_error_set().
This stack memory may be later used by other code sections,
overwriting the desired error string.

This patch implements an error string for the specific case
requested, of ICMP item not supported in Verbs flow engine.

Fixes: d51475d1bfa5 ("net/mlx5: support item type error message in flow Verbs")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix group value of sample suffix flow
Jiawei Wang [Wed, 4 Nov 2020 13:29:49 +0000 (15:29 +0200)]
net/mlx5: fix group value of sample suffix flow

mlx5 PMD split the sampling flow into prefix flow and suffix
flow. On the sample action translation function, the scaled
group value of suffix flow be attached into sample object and
saved into sample resource.

mlx5 PMD fetched the group value from the sample resource to
create the suffix flow. On the mlx5_flow_group_to_table
function the group value of suffix flow was scaled with table
factor again and translated into HW table. That caused the
incorrect group value of sample suffix flow.

The fix introduces a 'skip_scale' flag and sets it to 1 for the
sample suffix flow creation. On the mlx5_flow_group_to_table
function skips the scale with table factor to use the correct
group value.

Fixes: 4ec6360de37d ("net/mlx5: implement tunnel offload")

Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix switch port id when representor in bonding
Dong Zhou [Wed, 4 Nov 2020 06:04:55 +0000 (08:04 +0200)]
net/mlx5: fix switch port id when representor in bonding

In the bonding configurations the port switch id for representors was
composed of pf index in bonding as the 1 MSB and the representor's index
as the remaining 15 LSBs. The special corner case for the host PF
representor on BF setups with representor id 0xFFFF was missed as well.

The new switch port id consists of 4 MSBs for the pf bonding index and
the remaining 12 LSBs for the representor index. The switch port id
ranges for each type of representors are as follows:

Uplink representor(AKA master): 0xFFFF
Host PF representor: 0x<pf_bond>FFF
VF representor: 0x<pf_bond>[0-FFE]

Fixes: bee57a0a3565 ("net/mlx5: update switch port id in bonding configuration")
Cc: stable@dpdk.org
Signed-off-by: Dong Zhou <dongzhou@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix aging queue doorbell ringing
Dekel Peled [Tue, 3 Nov 2020 10:38:04 +0000 (12:38 +0200)]
net/mlx5: fix aging queue doorbell ringing

Recent patch introduced a new SQ for ASO flow hit management.
This SQ uses two WQEBB's for each WQE.
The SQ producer index is 16 bits wide.

The enqueue loop posts new WQEs to the ASO SQ, using WQE index for
the SQ management.
This 16 bits index multiplied by 2 was wrongly used also for SQ
doorbell ringing.
The multiplication caused the SW index overlapping to be out of sync
with the hardware index, causing it to get stuck.

This patch separates the WQE index management from the doorbell index
management.
So, for each WQE index incrementation by 1, the doorbell index is
incremented by 2.

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix eCPRI common header endianness
Bing Zhao [Tue, 3 Nov 2020 05:41:58 +0000 (13:41 +0800)]
net/mlx5: fix eCPRI common header endianness

The input header of a RTE flow item is with network byte order. In
the host with little endian, the bit field order are the same as the
byte order.
When checking the eCPRI message type, the wrong field will be selected.
Fixing to use correct field.

Fixes: daa38a8924a0 ("net/mlx5: add flow translation of eCPRI header")
Cc: stable@dpdk.org
Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agoraw/ifpga/base: check adapter pointer before dereference
Wei Huang [Thu, 5 Nov 2020 02:05:40 +0000 (21:05 -0500)]
raw/ifpga/base: check adapter pointer before dereference

In opae_adapter_destroy(), pointer "adapter" is not validated before
passing it to opae_adapter_shm_free() and opae_adapter_mutex_close()
which dereference it.

Coverity issue: 363752
Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
4 years agoraw/ifpga/base: unlock mutex on Nios init failure
Wei Huang [Thu, 5 Nov 2020 02:05:39 +0000 (21:05 -0500)]
raw/ifpga/base: unlock mutex on Nios init failure

In fme_nios_spi_init(), a mutex is locked for protecting nios
initialization process, the mutex is only unlocked when process
is successful, it should also be unlocked when process fail.

Coverity issue: 363751
Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
4 years agocommon/sfc_efx/base: avoid reading past buffer
Ivan Malov [Thu, 5 Nov 2020 20:46:12 +0000 (23:46 +0300)]
common/sfc_efx/base: avoid reading past buffer

Existing field ID validity check does not validate the field
descriptor availability. Make it more rigorous to avoid
reading past the buffer containing field descriptors.

Coverity issue: 363742
Fixes: 370ed675a952 ("common/sfc_efx/base: support setting PPORT in match spec")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
4 years agonet/ring: fix typo in log message
Olivier Matz [Wed, 4 Nov 2020 17:01:25 +0000 (18:01 +0100)]
net/ring: fix typo in log message

Add a missing space.

Fixes: 869bf6d222bb ("net/ring: fix coding style")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/txgbe: replace forbidden functions
Jiawen Wu [Fri, 6 Nov 2020 02:10:53 +0000 (10:10 +0800)]
net/txgbe: replace forbidden functions

Remove rte_panic(), and use rte_atomic_thread_fence()
instead of rte_smp_[r/w]mb.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agonet/mlx5: fix Tx queue stop state
Matan Azrad [Tue, 3 Nov 2020 06:48:32 +0000 (06:48 +0000)]
net/mlx5: fix Tx queue stop state

The Tx queue stop API doesn't call the PMD callback when the state of
the queue is stopped.
The drivers should update the state to be stopped when the queue stop
callback is done successfully or when the port is stopped.
The drivers should update the state to be started when the queue start
callback is done successfully or when the port is started.

The driver wrongly didn't update the state as started when the port
start callback was done which kept the state as stopped.
Following call to a queue stop API was not completed by ethdev layer
because the state is already stopped.

Move the state update from the Tx queue setup to the port start
callback.

Fixes: 161d103b231c ("net/mlx5: add queue start and stop")
Cc: stable@dpdk.org
Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix Tx queue reference count check
Matan Azrad [Tue, 3 Nov 2020 06:47:44 +0000 (06:47 +0000)]
net/mlx5: fix Tx queue reference count check

The Txq refcnt 1 value means that there is no real reference to the
queue and only the control configurations are saved in the struct.

The patch below wrongly didn't consider it and caused a leak in the Txq
object resource.

Revert the specific update in the refcnt.

Fixes: b5c8b3e70cdf ("net/mlx5: use C11 atomics for RxQ/TxQ refcounts")

Signed-off-by: Matan Azrad <matan@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agocommon/mlx5: free MR resource on device DMA unmap
Jiawei Wang [Mon, 2 Nov 2020 02:22:28 +0000 (04:22 +0200)]
common/mlx5: free MR resource on device DMA unmap

mlx5 PMD created the MR (Memory Region) resource on the
mlx5_dma_map call to make the memory available for DMA
operations. On the mlx5_dma_unmap call the MR resource
was not freed but inserted to MR Free list for further
garbage collection.
Actual MR resource destroying happened on device stop
call. That caused the runtime out of memory in case of
application performed multiple DMA map/unmap calls.

The fix immediately frees the MR resource on mlx5_dma_unmap
call not engaging the list. The export for mlx5_mr_free
function from common PMD part is added as well.

Fixes: 989e999d9305 ("net/mlx5: support PCI device DMA map and unmap")
Cc: stable@dpdk.org
Signed-off-by: Jiawei Wang <jiaweiw@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
4 years agonet/mlx5: fix SQ resources release in error flow
Tal Shnaiderman [Wed, 28 Oct 2020 17:10:40 +0000 (19:10 +0200)]
net/mlx5: fix SQ resources release in error flow

Fix in error flow in which the function
mlx5_txq_release_devx_sq_resources is called twice by setting the
release object to NULL after the first call

The incorrect flow was introduced in the work done on generic
object creation.

Once an error flow inside mlx5_txq_create_devx_sq_resources
occurs the function will call mlx5_txq_release_devx_sq_resources
however the released pointers are not set to NULL after the release
calls and undefined memory is released in the same call in
mlx5_txq_release_devx_resources.

This results in calls to MLX5_FREE with
an already released memory addresses and assert in mlx5_release_dbr:

EAL: Error: Invalid memory
EAL: Error: Invalid memory

PANIC in mlx5_txq_release_devx_sq_resources():
assert "(mlx5_release_dbr(&txq_obj->txq_ctrl->priv->dbrpgs,
 mlx5_os_get_umem_id (txq_obj->sq_dbrec_page->umem),
 txq_obj->sq_dbrec_offset)) == 0" failed

The fix is setting the released pointers to NULL after the first release
calls.

Fixes: 86d259cec852 ("net/mlx5: separate Tx queue object creations")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/mlx5: fix Rx queue object allocation with MPRQ
Ophir Munk [Wed, 4 Nov 2020 07:55:20 +0000 (07:55 +0000)]
net/mlx5: fix Rx queue object allocation with MPRQ

The space for extra buffer pointers used by MPRQ routines was not
allocated in Rx queue object creation structure causing memory
corruption.
The fix allocates the extra memory for the pointers in case MPRQ is
engaged.

Fixes: a0a45e8af723 ("net/mlx5: configure Rx queue for buffer split")

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agonet/bnxt: remove useless prefetches
Stephen Hemminger [Wed, 4 Nov 2020 17:03:10 +0000 (09:03 -0800)]
net/bnxt: remove useless prefetches

Prefetching only helps performance if it is done several 100
instructions before the actual use. The purpose of the prefetch
is to read ahead, it doesn't help if the next instruction
will block.

The code in the bnxt driver was doing these unnecessary prefetches.

Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
4 years agoconfig: enable packet prefetching with Meson
Maxime Coquelin [Fri, 13 Nov 2020 14:52:12 +0000 (15:52 +0100)]
config: enable packet prefetching with Meson

With Make build system, RTE_PMD_PACKET_PREFETCH was enabled
by default. It got lost when transitioning to Meson build
system.

In order to avoid performance changes, this patch enables
packet prefetching in rte_config.h.

Fixes: 9314afb68a53 ("drivers: add infrastructure for meson build")
Cc: stable@dpdk.org
Reported-by: Marvin Liu <yong.liu@intel.com>
Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
4 years agogro: fix packet type detection with IPv6 tunnel
Yi Yang [Thu, 5 Nov 2020 02:54:44 +0000 (10:54 +0800)]
gro: fix packet type detection with IPv6 tunnel

For VxLAN packets, GRO will mistakenly reassemble them
if inner L3 is IPv6, inner L4 is TCP or UDP, and outer L3
is IPv4 because the value of IS_IPV4_VXLAN_TCP4/UDP4_PKT
is true for them.

This fix makes sure IS_IPV4_TCP_PKT, IS_IPV4_UDP_PKT,
IS_IPV4_VXLAN_TCP4_PKT and IS_IPV4_VXLAN_UDP4_PKT can make
decision precisely.

Fixes: e2d811063673 ("gro: support VXLAN UDP/IPv4")
Fixes: 1ca5e6740852 ("gro: support UDP/IPv4")
Fixes: 9e0b9d2ec0f4 ("gro: support VxLAN GRO")
Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4")
Cc: stable@dpdk.org
Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
4 years agonet/mlx5: fix UAR used by ASO queues
Viacheslav Ovsiienko [Tue, 10 Nov 2020 16:04:19 +0000 (16:04 +0000)]
net/mlx5: fix UAR used by ASO queues

The dedicated UAR was allocated for the ASO queues.
The shared UAR created for Tx queues can be used instead.

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agovdpa/mlx5: fix UAR allocation
Viacheslav Ovsiienko [Tue, 10 Nov 2020 16:04:18 +0000 (16:04 +0000)]
vdpa/mlx5: fix UAR allocation

This patch provides the UAR allocation workaround for the
hosts where UAR allocation with Write-Combining memory
mapping type fails.

Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agoregex/mlx5: fix UAR allocation
Viacheslav Ovsiienko [Tue, 10 Nov 2020 16:04:17 +0000 (16:04 +0000)]
regex/mlx5: fix UAR allocation

This patch provides the UAR allocation workaround for the
hosts where UAR allocation with Write-Combining memory
mapping type fails.

Fixes: b34d816363b5 ("regex/mlx5: support rules import")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agocommon/mlx5: share UAR allocation routine
Viacheslav Ovsiienko [Tue, 10 Nov 2020 16:04:16 +0000 (16:04 +0000)]
common/mlx5: share UAR allocation routine

This patch introduces the routine to allocate the UAR (User
Access Region) with various memory mapping types. The origin
patch being fixed provided the UAR allocation workaround
for the mlx5 net PMD only. As it was found the other mlx5
based drivers - vdpa and regex are affected by the issue
as well and must be fixed.

Fixes: a0bfe9d56f74 ("net/mlx5: fix UAR memory mapping type")
Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
4 years agousertools: fix CPU layout script to be PEP8 compliant
Ciara Power [Fri, 6 Nov 2020 12:40:53 +0000 (12:40 +0000)]
usertools: fix CPU layout script to be PEP8 compliant

The pycodestyle tool flagged the following issues, which are now fixed.

$ pycodestyle cpu_layout.py
  cpu_layout.py:18:5: E722 do not use bare 'except'
  cpu_layout.py:62:14: E231 missing whitespace after ','

Fixes: deb87e6777c0 ("usertools: use sysfs for CPU layout")
Fixes: c9208f1dc967 ("usertools: fix CPU layout with python 3")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
4 years agoraw/ioat: fix queue index calculation
Bruce Richardson [Thu, 5 Nov 2020 10:41:04 +0000 (10:41 +0000)]
raw/ioat: fix queue index calculation

Coverity flags a possible problem where the 8-bit wq_idx value may have
errors when shifted and sign-extended to pointer size. Since this can
only occur if the shift index is larger than any expected value from
hardware, it's unlikely to cause any real problems, but we can eliminate
any possible errors, and the coverity issue, by explicitly typecasting
the uint8_t value to uintptr_t before any shift operations occur.

Coverity issue: 363695
Fixes: a33969462135 ("raw/ioat: fix work-queue config size")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agobuild: fix MS linker flag with meson 0.54
Nick Connolly [Sat, 31 Oct 2020 06:44:55 +0000 (06:44 +0000)]
build: fix MS linker flag with meson 0.54

Meson versions >= 0.54.0 include support for handling /implib
with msvc link. Specifying it explicitly causes failures when
linking against the dll. Tested using Link 14.27.29112.0 and
Clang 11.0.0.

There were a number of changes to the way that import libraries
are handled between 0.47.1 and 0.54.0. Only make the change
for >= 0.54.0, leaving the behaviour unchanged for earlier
versions.

Fixes: 77cca7ccec13 ("build: fix drivers library path on Windows")
Cc: stable@dpdk.org
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Tested-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Khoa To <khot@microsoft.com>
4 years agobuild: fix install on Windows
Nick Connolly [Sat, 31 Oct 2020 06:56:50 +0000 (06:56 +0000)]
build: fix install on Windows

Don't run symlink-drivers-solibs.sh as part of 'install' because
Windows doesn't support shell scripts.

Fixes: 82ba4416dd87 ("build: add module definition files for Windows")
Cc: stable@dpdk.org
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Tested-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
4 years agoexamples/qos_sched: fix usage string
Ibtisam Tariq [Mon, 2 Nov 2020 11:43:03 +0000 (11:43 +0000)]
examples/qos_sched: fix usage string

The short option written for interactive mode is --i in usage of
this qos_sched example. Actually, it is -i.

Fixes: cfd5c971e5e ("examples/qos_sched: add stats")
Cc: stable@dpdk.org
Signed-off-by: Ibtisam Tariq <ibtisam.tariq@emumba.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
4 years agotable: fix exact match SWX table lookup
Cristian Dumitrescu [Thu, 5 Nov 2020 15:27:46 +0000 (15:27 +0000)]
table: fix exact match SWX table lookup

Fix for the exact match lookup function.

Fixes: d0a00966618b ("table: add exact match SWX table")

Signed-off-by: Churchill Khangar <churchill.khangar@intel.com>
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agodoc: describe the SWX pipeline type
Cristian Dumitrescu [Tue, 10 Nov 2020 20:02:54 +0000 (20:02 +0000)]
doc: describe the SWX pipeline type

Add the new SWX pipeline type to the Programmer's Guide.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
4 years agocrypto/armv8: replace meson option with pkg-config support
Dharmik Thakkar [Thu, 5 Nov 2020 15:33:15 +0000 (09:33 -0600)]
crypto/armv8: replace meson option with pkg-config support

With pkg-config support available within AArch64crypto library,
meson option 'armv8_crypto_dir' can be removed.
PKG_CONFIG_PATH environment variable should be set appropriately
to use the crypto library.

Suggested-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoeal/arm: fix clang build of native target
Ruifeng Wang [Thu, 12 Nov 2020 10:31:57 +0000 (18:31 +0800)]
eal/arm: fix clang build of native target

When doing Clang build with '-mcpu=native' on N1 platform, build failed
with:
../lib/librte_eal/arm/include/rte_atomic_64.h:76:39:
error: instruction requires: lse
__ATOMIC128_CAS_OP(__cas_128_release, "caspl")

This is because native detection for Neoverse N1 was added in Clang-11.
Prior version of Clang's assembler doesn't know LSE support on hardware.
Fixed this for Clang earlier than version 11 by specifying architecture
for assembler.
Referred to [1] for this fix.

Fixes: 7e2c3e17fe2c ("eal/arm64: add 128-bit atomic compare exchange")
Cc: stable@dpdk.org
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0d5896bd356cd577f9710a02d7a474cdf58426b

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
4 years agovfio: use static window sizing for sPAPR IOMMU
David Christensen [Tue, 10 Nov 2020 17:43:32 +0000 (09:43 -0800)]
vfio: use static window sizing for sPAPR IOMMU

The SPAPR IOMMU requires that a DMA window size be defined before memory
can be mapped for DMA. Current code dynamically modifies the DMA window
size in response to every new memory allocation which is potentially
dangerous because all existing mappings need to be unmapped/remapped in
order to resize the DMA window, leaving hardware holding IOVA addresses
that are temporarily unmapped.  The new SPAPR code statically assigns
the DMA window size on first use, using the largest physical memory
memory address when IOVA=PA and the highest existing memseg virtual
address when IOVA=VA.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
4 years agodevtools: fix directory filter in forbidden token check
David Marchand [Tue, 10 Nov 2020 15:40:05 +0000 (16:40 +0100)]
devtools: fix directory filter in forbidden token check

checkpatches.sh current complains on a patch [1] adding
ALLOW_EXPERIMENTAL_API in an example while this check is for app, lib
and drivers directories:

Warning in examples/ethtool/ethtool-app/Makefile:
Using experimental build flag for in-tree compilation

The regexp on entering files concerned by this filter is incorrect.
In the [1] case, the file full name is matched against "app" rather than
"+++ b/app".

1: https://patchwork.dpdk.org/patch/83902/

Fixes: 7413e7f2aeb3 ("devtools: alert on new calls to exit from libs")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agoexamples: stop processing meson file if build impossible
Bruce Richardson [Thu, 12 Nov 2020 09:41:41 +0000 (09:41 +0000)]
examples: stop processing meson file if build impossible

Once it has been determined that an example cannot be built, there is
little point in continuing to process the meson.build file for that
example, so we can use subdir_done() to return to the calling file.
This can potentially prevent problems where later statement in the file
may cause an error on systems where the app cannot be built, e.g. on
Windows or FreeBSD.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples/l2fwd-keepalive: skip meson build if no librt
Bruce Richardson [Thu, 12 Nov 2020 09:41:40 +0000 (09:41 +0000)]
examples/l2fwd-keepalive: skip meson build if no librt

When librt is not present on a system, processing the meson.build file
for this example application causes an error. Make the library
non-mandatory and just mark the example as unbuildable if it is
not present.

Fixes: 89f0711f9ddf ("examples: build some samples with meson")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agoexamples: fix flattening directory layout on install
Bruce Richardson [Thu, 12 Nov 2020 09:41:39 +0000 (09:41 +0000)]
examples: fix flattening directory layout on install

By installing the examples one-by-one in a loop in the examples
meson.build file we effectively flattened out the structure of the examples
folder and omitted some common and shared subfolders that were never
directly built.  Instead, we can remove the loop and just have the whole
"examples" folder installed as-is in a single statement, preserving its
directory structure, and thereby fixing the build of a number of the
examples.

Fixes: 2daf565f91b5 ("examples: install as part of ninja install")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agombuf: move pool pointer in first half
Thomas Monjalon [Thu, 29 Oct 2020 00:55:43 +0000 (01:55 +0100)]
mbuf: move pool pointer in first half

According to the Technical Board decision
(http://mails.dpdk.org/archives/dev/2020-November/191859.html),
the mempool pointer in the mbuf struct is moved
from the second to the first half.
It may increase performance in some cases
on systems having 64-byte cache line, i.e. mbuf split in two cache lines.

Due to this change, all fields after "pool" are moved up.
Hopefully no vector data path is impacted.

Moving this field gives more space to dynfield1
while dropping the temporary dynfield0.

This is how the mbuf layout looks like (pahole-style):

word  type                              name                byte  size
 0    void *                            buf_addr;         /*   0 +  8 */
 1    rte_iova_t                        buf_iova          /*   8 +  8 */
      /* --- RTE_MARKER64               rearm_data;                   */
 2    uint16_t                          data_off;         /*  16 +  2 */
      uint16_t                          refcnt;           /*  18 +  2 */
      uint16_t                          nb_segs;          /*  20 +  2 */
      uint16_t                          port;             /*  22 +  2 */
 3    uint64_t                          ol_flags;         /*  24 +  8 */
      /* --- RTE_MARKER                 rx_descriptor_fields1;        */
 4    uint32_t             union        packet_type;      /*  32 +  4 */
      uint32_t                          pkt_len;          /*  36 +  4 */
 5    uint16_t                          data_len;         /*  40 +  2 */
      uint16_t                          vlan_tci;         /*  42 +  2 */
 5.5  uint64_t             union        hash;             /*  44 +  8 */
 6.5  uint16_t                          vlan_tci_outer;   /*  52 +  2 */
      uint16_t                          buf_len;          /*  54 +  2 */
 7    struct rte_mempool *              pool;             /*  56 +  8 */
      /* --- RTE_MARKER                 cacheline1;                   */
 8    struct rte_mbuf *                 next;             /*  64 +  8 */
 9    uint64_t             union        tx_offload;       /*  72 +  8 */
10    struct rte_mbuf_ext_shared_info * shinfo;           /*  80 +  8 */
11    uint16_t                          priv_size;        /*  88 +  2 */
      uint16_t                          timesync;         /*  90 +  2 */
11.5  uint32_t                          dynfield1[9];     /*  92 + 36 */
16    /* --- END                                             128      */

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
4 years agodrivers: disable OCTEON TX2 in 32-bit build
Thomas Monjalon [Mon, 9 Nov 2020 16:44:30 +0000 (17:44 +0100)]
drivers: disable OCTEON TX2 in 32-bit build

The drivers for OCTEON TX2 are not supported in 32-bit mode.

Suggested-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Jerin Jacob <jerinj@marvell.com>
4 years agodevtools: allow custom set of examples in build test
Bruce Richardson [Tue, 27 Oct 2020 17:38:36 +0000 (17:38 +0000)]
devtools: allow custom set of examples in build test

To test the installation process of DPDK using "ninja install"
test-meson-builds.sh builds a subset of the examples using "make". To allow
more flexibility for people testing, allow the set of examples chosen for
this make test to be overridden using variable "DPDK_BUILD_TEST_EXAMPLES"
in the environment.

Since a number of example apps link against drivers directly even for
shared builds, we need to ensure that LD_LIBRARY_PATH points to the main
DPDK lib folder so any dependencies of those drivers can be found e.g. that
the PCI/vdev bus driver .so is found. [All drivers are symlinked from
drivers dir back to lib dir on install, so only one dir rather than two is
needed in the path.]

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
4 years agodevtools: fix x86-default build test install env
David Marchand [Thu, 12 Nov 2020 13:38:43 +0000 (14:38 +0100)]
devtools: fix x86-default build test install env

The x86-default environment was loaded after installing this target.
I did not see any problem with it, yet we should load corresponding
environment before installing a target.

Fixes: bd253daa7717 ("devtools: fix test of ninja install")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
4 years agodevtools: reduce build test verbosity
Thomas Monjalon [Fri, 6 Nov 2020 17:28:54 +0000 (18:28 +0100)]
devtools: reduce build test verbosity

The default verbosity of test-meson-builds.sh is to be quiet.
In order to better apply the verbosity policy, some file descriptors
are open to redirect to stdout or /dev/null accordingly.

The target variable and meson/ninja commands are printed in verbose modes.
The installation commands are printed only in very verbose mode.
The examples build commands are printed only in very verbose mode.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodevtools: fix build test config inheritance from env
Thomas Monjalon [Mon, 9 Nov 2020 21:00:08 +0000 (22:00 +0100)]
devtools: fix build test config inheritance from env

The variables DPDK_MESON_OPTIONS, PATH, PKG_CONFIG_PATH,
CPPFLAGS, CFLAGS and LDFLAGS can be customized in the config file
loaded by devtools/load-devel-config at each build.
The configuration can be adjusted per target thanks to the value set
in the DPDK_TARGET variable.

PKG_CONFIG_PATH is specific to each target, so it must be empty
before configuring each build from the file according to DPDK_TARGET.
Inheriting a default PKG_CONFIG_PATH for all targets does not make sense
and is prone to confusion.

DPDK_MESON_OPTIONS might take a global initial value from environment
to customize a build test from the shell. Example:
DPDK_MESON_OPTIONS="b_lto=true"
Some target-specific options can be added in the configuration file:
DPDK_MESON_OPTIONS="$DPDK_MESON_OPTIONS kernel_dir=$MYKERNEL"

Fixes: 272236741258 ("devtools: load target-specific compilation environment")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
4 years agousertools: fix pmdinfo parsing
David Marchand [Wed, 4 Nov 2020 15:57:21 +0000 (16:57 +0100)]
usertools: fix pmdinfo parsing

This script inspects an ELF file (binary or shared library) and its
linked dependencies by following DT_NEEDED tags.
So far a simple librte_pmd prefix was used as a filter to only parse
DPDK drivers dependencies.
While the reason is not clear from the commitlog of the patch that
introduced this filter, it was probably added for performance reasons,
since going through all dependencies can be quite long.
Testing with a DPDK built before the driver name changes:
- running the script takes ~0.3s with the filter,
- running the script takes ~9s without the filter,

Now that we changed the driver library names, it becomes more difficult
to identify only DPDK drivers, but we can just filter on the librte_
prefix to identify DPDK libraries: the script later checks for the
PMD_INFO_STRING string in .rodata and it is enough to differentiate the
DPDK drivers from the other DPDK libraries.

Running the script with this patch takes ~0.5s.

A debug message was logged for each inspected file, it gives no useful
information and is removed.

Fixes: a20b2c01a7a1 ("build: standardize component names and defines")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Robin Jarry <robin.jarry@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
4 years agodoc: add instructions for building 32-bit DPDK
Bruce Richardson [Fri, 16 Oct 2020 15:09:55 +0000 (16:09 +0100)]
doc: add instructions for building 32-bit DPDK

For users with 32-bit applications who wish to use DPDK we need to provide
instructions on creating a 32-bit build of DPDK with meson. Therefore add a
section with this information to the GSG.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Luca Boccassi <bluca@debian.org>
4 years agodevtools: test 32-bit build
Bruce Richardson [Thu, 5 Nov 2020 17:21:45 +0000 (17:21 +0000)]
devtools: test 32-bit build

It's reasonably common for patches to have issues when built on 32-bits, so
to prevent this, we can add a 32-bit build (if supported) to the
"test-meson-builds.sh" script. The tricky bit is using a valid
PKG_CONFIG_LIBDIR, so for now we use two common possibilities for where that
should point to in order to get a successful build.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoversion: 20.11-rc3
Thomas Monjalon [Thu, 5 Nov 2020 18:30:22 +0000 (19:30 +0100)]
version: 20.11-rc3

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agoapp/testpmd: revert max Rx packet length adjustment
Thomas Monjalon [Thu, 5 Nov 2020 17:05:41 +0000 (18:05 +0100)]
app/testpmd: revert max Rx packet length adjustment

The fix of max_rx_pkt_len for allowing VLAN packets in all cases
was breaking configuration of some drivers. Example with virtio:

Ethdev port_id=0 max_rx_pkt_len 11229 > max valid value 9728
Fail to configure port 0

Trying to fix the logic was revealing other issues in some drivers.
That's why it is decided to revert.

The workaround for the original issue would be
to set the MTU explicitly from the application
with rte_eth_dev_set_mtu().
See RFC: https://patches.dpdk.org/patch/83756/

Fixes: f6870a7ed6b3 ("app/testpmd: fix max Rx packet length for VLAN packet")
Cc: stable@dpdk.org
Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
4 years agombuf: clean up comments and prefix
Morten Brørup [Mon, 26 Oct 2020 14:42:01 +0000 (15:42 +0100)]
mbuf: clean up comments and prefix

The mbuf header files had some commenting style errors that affected the
API documentation.
Also, the RTE_ prefix was missing on a macro and a definition.

Note: This patch does not touch the offload and attachment flags that are
also missing the RTE_ prefix.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agocmdline: avoid name clash with Windows system types
Dmitry Kozlyuk [Fri, 30 Oct 2020 01:01:26 +0000 (04:01 +0300)]
cmdline: avoid name clash with Windows system types

cmdline_numtype member names clash with Windows system identifiers.
Add RTE_ prefix to cmdline constants to avoid this and possible
future conflicts.

Suggested-by: Ranjit Menon <ranjit.menon@intel.com>
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Ranjit Menon <ranjit.menon@intel.com>
Acked-by: Jie Zhou <jizh@microsoft.com>
Tested-by: Jie Zhou <jizh@microsoft.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agotest/lpm: avoid code duplication in RCU perf tests
Dharmik Thakkar [Wed, 4 Nov 2020 18:58:58 +0000 (12:58 -0600)]
test/lpm: avoid code duplication in RCU perf tests

Avoid code duplication by combining single and multi threaded tests

Also, enable support for more than 2 writers

Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agotest/lpm: remove unneeded checks in RCU perf tests
Dharmik Thakkar [Wed, 4 Nov 2020 18:58:57 +0000 (12:58 -0600)]
test/lpm: remove unneeded checks in RCU perf tests

Remove redundant error checking for reader threads
since they never return error.

Fixes: eff30b59cc2e ("test/lpm: add RCU performance tests")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agotest/lpm: report errors in RCU perf tests
Dharmik Thakkar [Wed, 4 Nov 2020 18:58:56 +0000 (12:58 -0600)]
test/lpm: report errors in RCU perf tests

Return error if Add/Delete fail in multiwriter perf test
Return error if single or multi writer test fails

Fixes: eff30b59cc2e ("test/lpm: add RCU performance tests")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agotest/lpm: fix cycle calculation in RCU perf tests
Dharmik Thakkar [Wed, 4 Nov 2020 18:58:55 +0000 (12:58 -0600)]
test/lpm: fix cycle calculation in RCU perf tests

Fix incorrect calculations for LPM adds, LPM deletes,
and average cycles in RCU QSBR perf tests

Since, rcu qsbr tests run for 'RCU_ITERATIONS' and not
'ITERATIONS', replace 'ITERATIONS' with 'RCU_ITERATIONS'
for calculating adds, deletes, and cycles.

Also, for multi-writer perf test, each writer only writes
half of NUM_LDEPTH_ROUTE_ENTRIES.
For 2 writers, total adds (or deletes) should be
(RCU_ITERATIONS * NUM_LDEPTH_ROUTE_ENTRIES) instead of
(2 * RCU_ITERATIONS * NUM_LDEPTH_ROUTE_ENTRIES).

Since, for both the single and multi writer tests, total adds/deletes
is equal to (RCU_ITERATIONS * NUM_LDEPTH_ROUTE_ENTRIES),
this has been replaced with a macro 'TOTAL_WRITES' and furthermore,
'g_writes' has been removed since it is always a fixed value
equal to TOTAL_WRITES.

Fixes: eff30b59cc2e ("test/lpm: add RCU performance tests")
Cc: stable@dpdk.org
Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
4 years agoeal: fix MCS lock and ticketlock headers install
Olivier Matz [Wed, 4 Nov 2020 17:03:33 +0000 (18:03 +0100)]
eal: fix MCS lock and ticketlock headers install

Add missing arch-specific headers in meson.build.

Fixes: 2173f3333b61 ("mcslock: add MCS queued lock implementation")
Fixes: ca49b92079df ("ticketlock: enable generic ticketlock on all arch")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: David Christensen <drc@linux.vnet.ibm.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
4 years agoversion: 20.11-rc2
Thomas Monjalon [Wed, 4 Nov 2020 21:09:09 +0000 (22:09 +0100)]
version: 20.11-rc2

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
4 years agotest/telemetry: fix typo at beginning of line
Ciara Power [Wed, 4 Nov 2020 17:22:03 +0000 (17:22 +0000)]
test/telemetry: fix typo at beginning of line

A "+" symbol was incorrectly placed at the beginning of a line,
this is now removed.

Fixes: 52af6ccb2b39 ("telemetry: add utility functions for creating JSON")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
4 years agoapp/flow-perf: configure rule batches
Georgios Katsikas [Sun, 11 Oct 2020 10:03:26 +0000 (12:03 +0200)]
app/flow-perf: configure rule batches

Currently, flow-perf measures the performance of
rule installation/deletion operations by breaking
down the entire number of operations into windows
of fixed size (i.e., 100000 operations per window).
Then, flow-perf measures the total time per window
and computes an average time across all windows.

This commit allows flow-perf users to configure
the number of rules per window instead of using
a fixed pre-compiled value. To do so, users must
pass --rules-batch=N, where N is the number of
rules per window (or batch).
For consistency reasons, flow_count variable is
now renamed to rules_count. This variable is the
total number of rules to be installed/deleted.

For example, if a user wants to measure how much
time it takes to install 1M rules in a certain NIC,
he/she can input:
--rules-count=1000000
This way flow-perf will break down 1M flow rules into
10 batches of 100k flow rules each (this is the default
batch size) and compute an average across the 10
measurements.
Now, if the user modifies the number of rules per
batch as follows:
--rules-count=1000000 --rules-batch=500000
then flow-perf will break down 1M flow rules into
2 batches of 500k flow rules each and compute the
average across the 2 measurements.

Finally, this commit also adds default variables
to the usage function instead of hardcoded values.

Signed-off-by: Georgios Katsikas <katsikas.gp@gmail.com>
Acked-by: Wisam Jaddo <wisamm@nvidia.com>
4 years agodoc: remove obsolete deprecation notice for power library
David Hunt [Wed, 4 Nov 2020 09:28:10 +0000 (09:28 +0000)]
doc: remove obsolete deprecation notice for power library

Remove notice announcing an already-implemented change.

In 19.05, rte_power_set_env was changed to return -1 in cases where
the environment was already set up, and for the same release, a
deprecation notice was added.
This patch removes that notice.

The API change was tested by calling rte_power_set_env twice. The first
call succeeded, and the second call failed, as expected.

Fixes: 5a5f3178d4a8 ("power: return error when environment already set")
Cc: stable@dpdk.org
Signed-off-by: David Hunt <david.hunt@intel.com>
4 years agodoc: fix typo in KNI guide
Ciara Power [Mon, 2 Nov 2020 15:23:48 +0000 (15:23 +0000)]
doc: fix typo in KNI guide

The typo "withe" should have been "with the". This is now fixed.

Fixes: 89397a01ce4a ("kni: set default carrier state of interface")
Cc: stable@dpdk.org
Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
4 years agombuf: fix dynamic fields and flags with multiprocess
Stephen Hemminger [Wed, 4 Nov 2020 16:20:00 +0000 (08:20 -0800)]
mbuf: fix dynamic fields and flags with multiprocess

The dynamic flag management is broken if rte_mbuf_dynflag_lookup()
is done in a secondary process because the local pointer to
the memzone is not ever initialized.

Fix it by using the same checks as dynfield_register().
I.e if shared memory zone has not been looked up already,
then discover it.

Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
4 years agolicense: remove dual prefix
Hemant Agrawal [Tue, 28 Jul 2020 05:58:40 +0000 (11:28 +0530)]
license: remove dual prefix

This patch removes the dual keyword from dual license
definitions to avoid confusion. As the *dual* word is
not required to be added SPDX license.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
4 years agofix spellings that Lintian complains about
Luca Boccassi [Thu, 29 Oct 2020 13:36:33 +0000 (13:36 +0000)]
fix spellings that Lintian complains about

Fixes: 103809d032cd ("app/test-fib: add test application for FIB")
Fixes: 1265b5372d9d ("net/hns3: add some definitions for data structure and macro")
Fixes: a85e378cc606 ("net/ixgbe/base: add debug traces")
Fixes: 4861cde46116 ("i40e: new poll mode driver")
Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Fixes: 1db4d2330bc8 ("net/virtio-user: check negotiated features before set")
Cc: stable@dpdk.org
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
4 years agocommon/mlx5: split PCI relaxed ordering for read and write
Tal Shnaiderman [Tue, 3 Nov 2020 08:51:22 +0000 (10:51 +0200)]
common/mlx5: split PCI relaxed ordering for read and write

The current DevX implementation of the relaxed ordering feature is
enabling relaxed ordering usage only if both relaxed ordering read AND
write are supported.  In that case both relaxed ordering read and write
are activated.

This commit will optimize the usage of relaxed ordering by enabling it
when the read OR write features are supported.  Each relaxed ordering
type will be activated according to its own capability bit.

This will align the DevX flow with the verbs implementation of
ibv_reg_mr when using the flag IBV_ACCESS_RELAXED_ORDERING

Fixes: 53ac93f71ad1 ("net/mlx5: create relaxed ordering memory regions")
Cc: stable@dpdk.org
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>