Xiaoyun Wang [Thu, 14 May 2020 09:29:19 +0000 (17:29 +0800)]
net/hinic: optimize RSS RETA table update
Before updating RSS indirection table, firstly determine whether
rq num in RETA table is legal, if it is invalid(such as exceeding
the maximum rxq num), driver will not update hw indirection
table and return fail.
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Xiaoyun Wang [Thu, 14 May 2020 09:29:18 +0000 (17:29 +0800)]
net/hinic: update code style
The patch modifies the comments of structures or functions, and adds
space for comments, removes extra empty lines and adjusts the
print level for VF branches in one sdk interface.
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
Xiaoyun Wang [Thu, 14 May 2020 09:29:16 +0000 (17:29 +0800)]
net/hinic: fix queues resource free
Adds tx_queues and rx_queues non-null judgment before free tx or
rx resources, because some app may set tx_queues or rx_queues to
be null before call free resource interfaces, which may cause
a segfault.
The VMXNet3 protocol has a start-of-packet (SOP) and end-of-packet (EOP)
marker. If there was a bug where mbuf arrived without SOP the code that
chains the mbuf would dereference a null pointer.
Also, record any mbuf's dropped in statistics.
Although did the initial code no longer have access to VMware.
Compile tested only!
Coverity issue: 124563 Fixes: 8ee787ce80a8 ("vmxnet3: remove asserts that confuse coverity") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Yong Wang <yongwang@vmware.com>
Dekel Peled [Wed, 13 May 2020 19:49:19 +0000 (22:49 +0300)]
net/mlx5: fix VLAN flow action with wildcard VLAN item
Previous patch added support of VLAN item without VLAN ID value,
i.e. using wildcard VLAN item, to match VLAN with any VLAN ID.
The implication on VLAN actions was not taken into consideration.
VLAN actions (e.g. push vlan) use the VLAN ID value in the VLAN item,
and expect it to be valid.
This patch updates function flow_dev_get_vlan_info_from_items() to
check the VLAN item contents before trying to use it.
Fixes: 92818d839e8e ("net/mlx5: fix match on empty VLAN item in DV mode") Cc: stable@dpdk.org Signed-off-by: Dekel Peled <dekelp@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Matan Azrad [Tue, 12 May 2020 12:52:13 +0000 (12:52 +0000)]
net/mlx5: fix flow counter container resize
The design of counter container resize used double buffer algorithm in
order to synchronize between the query thread to the control thread.
When the control thread detected resize need, it created new bigger
buffer for the counter pools in a new container and change the container
index atomically.
In case the query thread had not detect the previous resize before a new
one need was detected by the control thread, the control thread returned
EAGAIN to the flow creation API used a COUNT action.
The rte_flow API doesn't allow unblocked commands and doesn't expect to
get EAGAIN error type.
So, when a lot of flows were created between 2 different periodic
queries, 2 different resizes might try to be created and caused EAGAIN
error.
This behavior may blame flow creations.
Change the synchronization way to use lock instead of double buffer
algorithm.
The critical section of this lock is very small, so flow insertion
rate should not be decreased.
Fixes: ebbac312e448 ("net/mlx5: resize a full counter container") Cc: stable@dpdk.org Signed-off-by: Matan Azrad <matan@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Thomas Monjalon [Mon, 2 Mar 2020 23:08:53 +0000 (00:08 +0100)]
doc: add required Linux capabilities in mlx5 guide
If running DPDK as non-root, some extra capabilities may be required.
The Mellanox devices, using a bifurcated model with Linux drivers,
have some specific requirements summarized in mlx5 PMD guide.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Raslan Darawsheh <rasland@mellanox.com>
Rasesh Mody [Thu, 14 May 2020 04:09:02 +0000 (21:09 -0700)]
net/qede: fix link state configuration
Move link state enable/disable to dev_start() and dev_stop()
respectively. This will ensure when devices are stopped,
link status will be appropriately shown as down.
Jeff Guo [Wed, 13 May 2020 20:21:27 +0000 (16:21 -0400)]
common/iavf: fix RSS algorithm type
A typo need to be fixed for Simple XOR algorithm configuration.
Fixes: 57094d594324 ("common/iavf: support advanced RSS input set change") Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Shiri Kuzin [Tue, 12 May 2020 12:21:46 +0000 (15:21 +0300)]
common/mlx5: disable relaxed ordering in unsuitable CPUs
Relaxed ordering is a PCI optimization that enables reordering
reads/writes in order to improve performance.
Relaxed ordering was enabled for all processors causing
a degradation in performance in Haswell and Broadwell processors
that don't support this optimization.
In order to avoid that we check if the processor is Haswell
or Broadwell and if so we disable relaxed ordering.
Shougang Wang [Wed, 13 May 2020 02:54:50 +0000 (02:54 +0000)]
net/i40e: fix flow director MAC rule creation
This patch fixes the issue that the flow which both source MAC mask
and destination MAC mask are all zeros can not be created.
Fixes: ea0c22fd8227 ("net/i40e: enable MAC address as flow director input set") Signed-off-by: Shougang Wang <shougangx.wang@intel.com> Tested-by: Hailin Xu <hailinx.xu@intel.com> Reviewed-by: Jeff Guo <jia.guo@intel.com>
Guinan Sun [Tue, 12 May 2020 08:13:06 +0000 (08:13 +0000)]
net/ixgbe: fix statistics in flow control mode
The register autoneg can't be updated synchronously with flow control
mode setting in the state of port start, so NIC statistics error occurs.
AUTO_NEG Advt register should be updated by ixgbe_setup_fc() when
enabling flow control.
The patch fixes the issue.
Fixes: a524f550da6e ("net/ixgbe: fix flow control mode setting") Cc: stable@dpdk.org Signed-off-by: Guinan Sun <guinanx.sun@intel.com> Reviewed-by: Wei Zhao <wei.zhao1@intel.com>
Dekel Peled [Mon, 11 May 2020 10:02:45 +0000 (13:02 +0300)]
common/mlx5: fix umem buffer alignment
The value MLX5_WQE_BUF_ALIGNMENT is defined as 512.
In some cases this alignment size is not adequate, which results in
memory registration that is not accepted by FW.
The result error can be "page_offset is not aligned to page_size/64,
bad umem_offset" (syndrome 0x357275).
This patch updates the definition to match the running system.
Ophir Munk [Thu, 7 May 2020 11:31:13 +0000 (11:31 +0000)]
common/mlx5: remove DevX dependency on Verbs and DV
File mlx5_devx_cmds.c should contain pure DevX calls. It must be OS
agnostic and not include any references to ibv or dv structs (defined in
ibverbs and rdma-core linux libraries). This commit replaces all ibv
and dv references with 'void *'. Specifically, the following struct
were replaced:
1. struct ibv_context *
2. struct ibv_qp *
3. struct mlx5dv_devx_cmd_comp *
Ophir Munk [Thu, 7 May 2020 11:31:12 +0000 (11:31 +0000)]
common/mlx5: mark internal symbols
Move mlx5 symbols in the map file to the INTERNAL section and add
__internal tags to their definitions.
Those symbols were exported in 20.02 and now (20.05) they are removed.
Avoid ABI comparison issues between 20.05/20.08 and 20.02 by adding the
suppress_file directive to libabigail.abignore file. This directive will
prevent loading mlx5 common symbols and no comparison will be performed.
In addition move symbols from the EXPERIMENTAL section to the INTERNAL
section.
Qiming Yang [Fri, 8 May 2020 14:04:09 +0000 (22:04 +0800)]
doc: fix multicast filter feature announcement
Multicast MAC filter flag means device ops set_mc_addr_list support
or not. This patch fixes the wrong flag value in Intel driver's document.
Fixes: 9db3f52126fb ("doc: generate NIC overview table from ini files") Fixes: cb25d4323fbf ("net/avf: enable MAC VLAN and promisc ops") Fixes: 26e887343321 ("net/ice: support MAC ops") Cc: stable@dpdk.org Signed-off-by: Qiming Yang <qiming.yang@intel.com> Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Leyi Rong [Mon, 11 May 2020 08:36:55 +0000 (16:36 +0800)]
net/iavf: remove useless assignment in Rx
Fix coverity defects of unused value.
Coverity issue: 357745, 357769 Fixes: b8b4c54ef9b0 ("net/iavf: support flexible Rx descriptor in normal path") Signed-off-by: Leyi Rong <leyi.rong@intel.com> Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Fixes: b9eee2cb8c29 ("e1000: support port hotplug") Cc: stable@dpdk.org Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com> Tested-by: Jianwei Mei <jianweix.mei@intel.com> Reviewed-by: Jeff Guo <jia.guo@intel.com>
Fixes: 45a4103e680d ("doc: fix default symbol binding in ABI guide") Signed-off-by: Raslan Darawsheh <rasland@mellanox.com> Acked-by: Ray Kinsella <mdr@ashroe.eu> Acked-by: David Marchand <david.marchand@redhat.com>
Compiling a C++ application that includes directly or indirectly
rte_common.h will cause a warning:
include/rte_common.h:350:37: warning: ISO C++17 does not allow
‘register’ storage class specifier [-Wregister]
rte_combine32ms1b(register uint32_t x)
C++ is pickier than standard C and flags this antique usage.
The register keyword is an old K&R legacy and should be removed
everywhere in DPDK. For now, fix it where it hurts.
Fixes: 08f683174e94 ("eal: add functions for previous power of 2 alignment") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Ferruh Yigit [Fri, 15 May 2020 15:01:53 +0000 (16:01 +0100)]
compat: provide experimental alias for matured ABI
On v20.02 some APIs matured and symbols moved from EXPERIMENTAL to
DPDK_20.0.1 block.
This had the affect of breaking the applications that were using these
APIs on v19.11. Although there is no modification of the APIs and the
action is positive and matures the APIs, the affect can be negative to
applications.
When a maintainer is promoting an API to become part of the next major
ABI version by removing the experimental tag. The maintainer may
choose to offer an alias to the experimental tag, to prevent these
breakages in future.
The following changes are made to enabling aliasing:
Updated to the ABI policy and ABI versioning documents.
Created VERSION_SYMBOL_EXPERIMENTAL helper macro.
Updated the 'check-symbols.sh' tool, which was complaining that the
symbol is in EXPERIMENTAL tag in .map file but it is not in the
.experimental section (__rte_experimental tag is missing).
Updated tool in a way it won't complain if the symbol in the
EXPERIMENTAL tag duplicated in some other block in .map file (versioned)
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Acked-by: Neil Horman <nhorman@tuxdriver.com>
Ray Kinsella [Wed, 6 May 2020 15:41:05 +0000 (16:41 +0100)]
doc: fix default symbol binding in ABI guide
The document abi_versioning.rst incorrectly instructs the developer to
add BIND_DEFAULT_SYMBOL to the public header, not the source file. This
commit fixes the issue and adds some clarifications.
The commit also clarifies the use of use_function_versioning in the
meson/ninja build system, and does some minor re-organization of the
document.
Fixes: f1ef9794f9bd ("doc: add ABI guidelines") Cc: stable@dpdk.org Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
Ray Kinsella [Tue, 5 May 2020 08:56:48 +0000 (09:56 +0100)]
doc: add reason for three-part ABI versioning
Clarify the reasons behind the three part version numbering scheme.
Documents the fixes made in f26c2b3.
Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility") Cc: stable@dpdk.org Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Xuan Ding [Mon, 18 May 2020 13:17:04 +0000 (14:17 +0100)]
vhost: fix potential fd leak
Vhost will create temporary file when receiving VHOST_USER_GET_INFLIGHT_FD
message. Malicious guest can send endless this message to drain out the
resource of host.
When receiving VHOST_USER_GET_INFLIGHT_FD message repeatedly, closing the
file created during the last handling of this message.
CVE-2020-10726 Fixes: d87f1a1cb7b666550 ("vhost: support inflight info sharing") Cc: stable@dpdk.org Signed-off-by: Xuan Ding <xuan.ding@intel.com> Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Xiaolong Ye [Mon, 18 May 2020 13:17:03 +0000 (14:17 +0100)]
vhost: fix potential memory space leak
A malicious container which has direct access to the vhost-user socket
can keep sending VHOST_USER_GET_INFLIGHT_FD messages which may cause
leaking resources until resulting a DOS. Fix it by unmapping the
dev->inflight_info->addr before assigning new mapped addr to it.
CVE-2020-10726 Fixes: d87f1a1cb7b6 ("vhost: support inflight info sharing") Cc: stable@dpdk.org Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Marvin Liu [Mon, 18 May 2020 13:17:02 +0000 (14:17 +0100)]
vhost: fix translated address not checked
Malicious guest can construct desc with invalid address and zero buffer
length. That will request vhost to check both translated address and
translated data length. This patch will add missed address check.
CVE-2020-10725 Fixes: 75ed51697820 ("vhost: add packed ring batch dequeue") Fixes: ef861692c398 ("vhost: add packed ring batch enqueue") Cc: stable@dpdk.org Signed-off-by: Marvin Liu <yong.liu@intel.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Maxime Coquelin [Mon, 18 May 2020 13:17:01 +0000 (14:17 +0100)]
vhost/crypto: validate keys lengths
transform_cipher_param() and transform_chain_param() handle
the payload data for the VHOST_USER_CRYPTO_CREATE_SESS
message. These payloads have to be validated, since it
could come from untrusted sources.
Two buffers and their lengths are defined in this payload,
one the the auth key and one for the cipher key. But above
functions do not validate the key length inputs, which could
lead to read out of bounds, as buffers have static sizes of
64 bytes for the cipher key and 512 bytes for the auth key.
This patch adds necessary checks on the key length field
before being used.
CVE-2020-10724 Fixes: e80a98708166 ("vhost/crypto: add session message handler") Cc: stable@dpdk.org Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com> Reviewed-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Maxime Coquelin [Mon, 18 May 2020 13:17:00 +0000 (14:17 +0100)]
vhost: fix vring index check
vhost_user_check_and_alloc_queue_pair() is used to extract
a vring index from a payload. This function validates the
index and is called early on in when performing message
handling. Most message handlers depend on it correctly
validating the vring index.
Depending on the message type the vring index is in
different parts of the payload. The function contains a
switch/case for each type and copies the index. This is
stored in a uint16. This index is then validated. Depending
on the message, the source index is an unsigned int. If
integer truncation occurs (uint->uint16) the top 16 bits
of the index are never validated.
When they are used later on (e.g. in
vhost_user_set_vring_num() or vhost_user_set_vring_addr())
it can lead to out of bound indexing. The out of bound
indexed data gets written to, and hence this can cause
memory corruption.
This patch fixes this vulnerability by declaring vring
index as an unsigned int in
vhost_user_check_and_alloc_queue_pair().
CVE-2020-10723 Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation") Cc: stable@dpdk.org Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com> Reviewed-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Maxime Coquelin [Mon, 18 May 2020 13:16:59 +0000 (14:16 +0100)]
vhost: check log mmap offset and size overflow
vhost_user_set_log_base() is a message handler that is
called to handle the VHOST_USER_SET_LOG_BASE message.
Its payload contains a 64 bit size and offset. Both are
added up and used as a size when calling mmap().
There is no integer overflow check. If an integer overflow
occurs a smaller memory map would be created than
requested. Since the returned mapping is mapped as writable
and used for logging, a memory corruption could occur.
CVE-2020-10722 Fixes: fbc4d248b198 ("vhost: fix offset while mmaping log base address") Cc: stable@dpdk.org Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com> Reviewed-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Kevin Traynor [Thu, 14 May 2020 13:18:57 +0000 (14:18 +0100)]
build: disable gcc 10 zero-length-bounds warning
gcc 10 issues warnings about the use of rearm_data marker
from struct rte_mbuf.
e.g.
../drivers/net/enic/enic_rxtx_vec_avx2.c: In function ‘rx_one’:
../drivers/net/enic/enic_rxtx_vec_avx2.c:21:2:
warning:
array subscript 0 is outside the bounds of an interior zero-length array
‘RTE_MARKER64’ {aka ‘long unsigned int[0]’} [-Wzero-length-bounds]
21 | *(uint64_t *)&mb->rearm_data = enic->mbuf_initializer;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../lib/librte_mbuf/rte_mbuf.h:45,
from ../drivers/net/enic/enic_rxtx_vec_avx2.c:6:
../lib/librte_mbuf/rte_mbuf_core.h:484:15:
note: while referencing ‘rearm_data’
484 | RTE_MARKER64 rearm_data;
|
Disable this warning for gcc 10 in order to allow v20.05 to build
without changes to struct rte_mbuf.
Bugzilla ID: 396 Cc: stable@dpdk.org Signed-off-by: Kevin Traynor <ktraynor@redhat.com> Reviewed-by: David Marchand <david.marchand@redhat.com>
Kevin Traynor [Fri, 15 May 2020 14:28:08 +0000 (15:28 +0100)]
hash: fix gcc 10 maybe-uninitialized warning
gcc 10.1.1 reports a warning for the ext_bkt_id variable:
../lib/librte_hash/rte_cuckoo_hash.c:
In function ‘__rte_hash_add_key_with_hash’:
../lib/librte_hash/rte_cuckoo_hash.c:1104:29:
warning: ‘ext_bkt_id’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
1104 | (h->buckets_ext[ext_bkt_id - 1]).sig_current[0] = short_sig;
| ~~~~~~~~~~~^~~
The return value of rte_ring_sc_dequeue_elem() is already checked,
but also initialize ext_bkt_id to zero (invalid value) and check
that it also overwritten.
Fixes: fbfe568103b0 ("hash: use 32-bit elements rings to save memory") Cc: stable@dpdk.org Signed-off-by: Kevin Traynor <ktraynor@redhat.com> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Session configure should return -ENOTSUP in case of unsupported xform
requests. Moving the validation of combinations out of cpt, as the
feature support will not be same across OCTEON TX and OCTEON TX2.
Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Apeksha Gupta [Fri, 15 May 2020 17:24:22 +0000 (22:54 +0530)]
test/crypto: fix statistics case
The test case - test_stats is directly accessing the
cryptodev and its dev_ops which are internal to library
and should not be used directly by the application.
However, the test case is also missing to check for the
error ENOTSUP. It should skip the case if the API returns
ENOTSUP. This patch fixes these two issues.
Fixes: 202d375c60bc ("app/test: add cryptodev unit and performance tests") Cc: stable@dpdk.org Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Akhil Goyal [Wed, 13 May 2020 11:50:26 +0000 (17:20 +0530)]
drivers/crypto: fix build with -fno-common
gcc 10 defaults to -fno-common and as a result when linking
with crypto drivers:
drivers/librte_pmd_dpaa_sec.a(crypto_dpaa_sec_dpaa_sec.c.o):
(.bss+0x4): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here
drivers/librte_pmd_dpaa2_sec.a(crypto_dpaa2_sec_dpaa2_sec_dpseci.c.o):
(.data+0x0): multiple definition of `rta_sec_era';
drivers/librte_pmd_caam_jr.a(crypto_caam_jr_caam_jr.c.o):
(.bss+0x0): first defined here
This patch fixes the blunt workaround in the following commit.
Older GCC(~4) complains about uninitialized 'dip'
var though all the lanes of the vec register are set.
Hence this patch explicitly initializes vec register
to fix the issue.
In file included from ip4_lookup.c:34:0:
ip4_lookup_neon.h: n function ‘ip4_lookup_node_process’: \
ip4_lookup_neon.h:25:12: error: ‘dip’ may be used uninitialized in \
this function [-Werror=maybe-uninitialized]
int32x4_t dip;
^
Fixes: 16df6a2c6671 ("node: add IPv4 lookup for arm64") Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com> Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Dekel Peled [Wed, 6 May 2020 17:13:38 +0000 (20:13 +0300)]
net/mlx5: support match on GTP flags
This patch adds to MLX5 PMD the support of matching on
GTP header item v_pt_rsv_flags.
This item is contained in 1 byte of the format:
-------------------------------------------
| bit | 0 - 2 | 3 | 4 | 5 | 6 | 7 |
|-----------------------------------------|
| value | Version | PT | Res | E | S | PN |
-------------------------------------------
Matching is supported only for GTP flags E, S, PN.
Therefore values 0 to 7 are supported.
Mask must be set accordingly:
... gtp v_pt_rsv_flags is 1 v_pt_rsv_flags mask 0x07 ...
Program received signal SIGSEGV, Segmentation fault.
0x00000000008ef7c4 in mlx5_tx_queue_release (dpdk_txq=0x17ce01680) at
drivers/net/mlx5/mlx5_txq.c:302
301 mlx5_txq_release(ETH_DEV(priv), i);
302 DRV_LOG(DEBUG, "port %u removing Tx queue %u from list",
303 PORT_ID(priv), txq->idx);
The problem is txq is freed inside the mlx5_txq_release() function
and no longer valid in the debug log right after this invocation.
Move the debug log before the mlx5_txq_release() function to fix this.
Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com> Acked-by: Matan Azrad <matan@mellanox.com>
Michael Baum [Wed, 6 May 2020 16:24:06 +0000 (16:24 +0000)]
net/mlx5: fix meter color register consideration
The mlx5_flow_get_reg_id() function translates tag ID to register
from the registers that are supported and available for use. The
user does not know which register is available at a time and therefore
there is an array that represents mapping to the available registers.
Usually the free registers are continuous in the flow_mreg_c array but
sometimes the mtr_color_reg register is between them and it must be
skipped and the next register returned, in which case the function
returns the mapping of the next entity in the array.
When the function reads from the next entity in the array, it does not
check whether such an entity exists and in some situation invalid access
to memory occurs beyond the array boundaries.
So, when all the registers are valid from HW perspective and the meter
color register is not the default, the tag id 5 causes an out of bound
access.
Validate registers availability when meter color register is not the
default.
When creating flow rule with zero specs it will cause
matching all UDP packets like following:
eth / ipv4 / udp / vxlan / end
Such rule will match all udp packets.
This change the behavior to match the dv flow engine
which will automatically set the match on relative
outer UDP port if the user didn't specify any.
Dekel Peled [Tue, 5 May 2020 12:57:54 +0000 (15:57 +0300)]
net/mlx5: fix match on empty VLAN item in DV mode
In existing implementation, using wild card VLAN item is not allowed.
A VLAN item in flow pattern must include VLAN ID (vid) value.
This obligation contradict the flow API specification [1].
This patch updates the VLAN item validation and translation, to allow
wild card VLAN item, without VLAN ID value.
User guide and release notes are updated accordingly.
Xiaolong Ye [Fri, 8 May 2020 08:48:23 +0000 (16:48 +0800)]
doc: remove Intel PMD examples in flow bifurcation guide
Now this feature is no longer supported by kernel side, (i40e kernel
driver doesn't support it from v2.3.2 and ixgbe kernel driver isn't
guaranteed to support this feature as well in the future), so remove the
Intel PMD examples to avoid confusion.
Signed-off-by: Xiaolong Ye <xiaolong.ye@intel.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Gaetan Rivet [Wed, 6 May 2020 18:09:49 +0000 (20:09 +0200)]
net/ring: fix device pointer on allocation
When a net_ring device is allocated, its device pointer is not set
before calling rte_eth_dev_probing_finish, which is incorrect.
The following:
commit 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
commit a6992e961050 ("net/ring: set ethernet device field")
already fixed the same issue in 17.08, which was fine at the time.
Adding the hook rte_eth_dev_probing_finish() however created this bug,
as the eth_dev exposed when this hook is executed is expected to be
complete.
Remove the prior attempts to fix the issue in rte_pmd_ring_probe() and
write the pointer properly in do_eth_dev_ring_create().
Raslan Darawsheh [Sun, 10 May 2020 12:23:47 +0000 (15:23 +0300)]
net/tap: fix build for glibc < 2.24
When trying to compile with glibc < 2.24 that doesn't
support SOL_NETLINK it will cause compilation failure:
drivers/net/tap/tap_netlink.c:70:17: error:
'SOL_NETLINK' undeclared (first use in this function)
setsockopt(fd, SOL_NETLINK, NETLINK_EXT_ACK, &one, sizeof(one));
Sunil Kumar Kori [Mon, 11 May 2020 06:21:56 +0000 (11:51 +0530)]
net/octeontx2: fix minimum length to SMQ config
NIX exposes NIX_AF_SMQ(0..511)_CFG to configure minimum length
of the packet which is being used for zero padding if packet is
less than configured value.
Setting it to default minimum length i.e. 60 bytes.
Fixes: ec8ddd4fb1be ("net/octeontx2: restructure TM helper functions") Signed-off-by: Sunil Kumar Kori <skori@marvell.com> Acked-by: Jerin Jacob <jerinj@marvell.com>
Rasesh Mody [Tue, 5 May 2020 03:08:12 +0000 (20:08 -0700)]
net/bnx2x: add Rx descriptor MTU segment limitation
Add Rx descriptor limit for number of segments per MTU.
PMD doesn't support Jumbo Rx scatter gather hence set 1 segment per
MTU. Some applications can adjust mbuf_size based on this value.
For others PMD detects the condition where Rx packet length cannot
be held by configured mbuf size and logs the message.
Signed-off-by: Rasesh Mody <rmody@marvell.com> Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Wei Zhao [Thu, 7 May 2020 01:15:41 +0000 (09:15 +0800)]
net/ice/base: fix PPPoE-IPv6 dummy packet
The dummy packet for pppoe-ipv6 has an error, we should
use 0x3b for next header in ipv6 header in the dummy packet,
or some case can not be download, such as:
"eth / pppoes seid is 3 / pppoe_proto_id is 0x0057 /
end actions vf id 1 / end"
Jeff Guo [Fri, 8 May 2020 20:58:30 +0000 (16:58 -0400)]
net/iavf: fix flow API error logs
When processing a rte flow, such as creating a parse engine, or
creating or destroying a RSS rule, if they are failed, they all
need to construct the flow error structure before return the error
message back to app. If not so, it will cause app crash when
app printing the message out of a flow error.
Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") Fixes: ff2d0c345c3b ("net/iavf: support generic flow API") Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Phil Yang [Fri, 8 May 2020 10:28:27 +0000 (18:28 +0800)]
net/ixgbe: fix link state timing on fiber ports
In ixgbe_dev_link_update_share(), if the media type is fiber and the
link is down, a flag (IXGBE_FLAG_NEED_LINK_CONFIG) is set. A callback
to ixgbe_dev_setup_link_thread_handler() is scheduled which should
try to set up the link and clear the flag afterwards. This flag works
as a guard variable between threads.
To avoid potential race condition between threads, set the
IXGBE_FLAG_NEED_LINK_CONFIG flag only when there is no link thread
running.
Bugzilla ID: 388 Fixes: 819d0d1d57f1 ("net/ixgbe: fix blocking system events") Cc: stable@dpdk.org Signed-off-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Lijian Zhang <lijian.zhang@arm.com> Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Jeff Guo [Sat, 9 May 2020 19:29:34 +0000 (15:29 -0400)]
net/iavf: fix input set for RSS hash
Since some specific RSS hash type need to combine with the protocol
hash type when configure a RSS hash rule, so add the corresponding
input set to support these case for iavf hash.
Fixes: 7be10c3004be ("net/iavf: add RSS configuration for VF") Signed-off-by: Jeff Guo <jia.guo@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Jun Yang [Fri, 8 May 2020 13:02:09 +0000 (18:32 +0530)]
net/dpaa2: fix congestion ID for multiple traffic classes
When using a single TC, flow id is same as congestion group id.
However in case of multiple traffic classes, same flow id values
are used within each traffic class, which causes incorrect
traffic behavior e.g. halting of traffic.
This patches changes to use the cgid as the index which works
for single as well as multiple traffic classes.
Fixes: 13b856ac02a8 ("net/dpaa2: support taildrop on frame count basis") Cc: stable@dpdk.org Signed-off-by: Jun Yang <jun.yang@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Nipun Gupta [Fri, 8 May 2020 13:02:04 +0000 (18:32 +0530)]
net/dpaa2: do not prefetch annotation for physical mode
When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.
Rohit Raj [Fri, 8 May 2020 13:02:03 +0000 (18:32 +0530)]
net/dpaa2: fix 10G port negotiation
Fixed 10G port negotiation issue with another 10G/non 10G port.
When running testpmd with 10G interfaces on 10BaseT interface
on LS2088ARDB, the ports were showing link as down.
This was identified to be caused by the setting of link as down
during config.
Also, the line rate was not being updated in device link params,
thus having the incorrect link speed in status (as 0).
Fixes: c5acbb5ea20e ("net/dpaa2: support link status event") Cc: stable@dpdk.org Signed-off-by: Rohit Raj <rohit.raj@nxp.com> Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>