Commit Graph

11465 Commits

Author SHA1 Message Date
Dekel Peled
ff55182ce3 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: 92818d839e ("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>
2020-05-18 20:35:57 +02:00
Matan Azrad
5af61440dd 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: ebbac312e4 ("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>
2020-05-18 20:35:57 +02:00
Rasesh Mody
d789705873 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.

Fixes: dd28bc8c6e ("net/qede: fix VF port creation sequence")
Cc: stable@dpdk.org

Signed-off-by: Shahed Shaikh <shshaikh@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-18 20:35:57 +02:00
Shougang Wang
670af291ea net/i40e: fix RSS rule creation with L2 payload
This patch fixes the issue that failed to create an RSS rule with type
L2-payload.

Fixes: feaae285b3 ("net/i40e: support hash configuration in RSS flow")

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>
2020-05-18 20:35:57 +02:00
Jeff Guo
aeef461fd6 net/iavf: fix RSS algorithm configuration
When configure RSS rule, the etherdev rss hash function type should be
mapped to the corresponding virtchnl rss algorithm type.

Fixes: 7be10c3004 ("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>
2020-05-18 20:35:57 +02:00
Jeff Guo
56e15e83b8 common/iavf: fix RSS algorithm type
A typo need to be fixed for Simple XOR algorithm configuration.

Fixes: 57094d5943 ("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>
2020-05-18 20:35:57 +02:00
Kalesh AP
b27f9e9005 net/bnxt: support 200G link speed
When the driver is loaded on a 200G NIC, the port speed is not
displayed correctly. Parse the 200G speed before displaying it.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-18 20:35:57 +02:00
Shiri Kuzin
4c204fe5e5 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.

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:57 +02:00
Shiri Kuzin
ffd5b302ba common/mlx5: fix relaxed ordering count object
In order to improve performance relaxed ordering was enabled
when creating count object using Devx.

Currently rte enables this optimization by default when using
Devx.

This causes an issue when using firmware that does not have this
capability causing a count object failure.

In order to fix this issue a check of firmware capabilities was
added before enabling relaxed ordering.

Fixes: 53ac93f71a ("net/mlx5: create relaxed ordering memory regions")

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Shiri Kuzin
2b152cc97c common/mlx5: fix relaxed ordering support detection
Relaxed ordering is a PCI optimization that allows reordering
of reads/writes in order to improve performance.

In order to enable this optimization only when relaxed ordering
is supported, it is checked if IBV_ACCESS_RELAXED_ORDERING is
defined in verbs.h.

Since IBV_ACCESS_RELAXED_ORDERING is an enum and not
defined relaxed ordering wasn't enabled even when supported.

This issue is fixed by using AUTOCONF to check if relaxed
ordering is supported and disabling only if it isn't.

Fixes: 53ac93f71a ("net/mlx5: create relaxed ordering memory regions")

Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Shougang Wang
103e2c0226 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: ea0c22fd82 ("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>
2020-05-18 20:35:56 +02:00
Guinan Sun
861ca8b1e9 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: a524f550da ("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>
2020-05-18 20:35:56 +02:00
Dekel Peled
4240b11e7b 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.

Fixes: 18a68e046b ("net/mlx5: fix DevX Rx queue memory alignment")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Dekel Peled
d237d22fbe net/mlx5: prefer DevX API to create Rx objects
Currently, DevX API is used to create Rx objects (RQ, RQT, TIR) only
if LRO or hairpin features are enabled on this RQ.

This patch uses DevX API by default, if DevX is supported and can be
used. Otherwise, Verbs API is used.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Ophir Munk
e09d350eb5 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 *

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Ophir Munk
64c563f8b1 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.

Fixes: 7b4f1e6bd3 ("common/mlx5: introduce common library")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-18 20:35:56 +02:00
Leyi Rong
717ca21131 net/iavf: remove useless assignment in Rx
Fix coverity defects of unused value.

Coverity issue: 357745, 357769
Fixes: b8b4c54ef9 ("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>
2020-05-18 20:35:07 +02:00
Alvin Zhang
23d8a6648f net/igc: fix boundary checks for RSS
Fix some out-of-bounds memory issues, they may lead to wrong results
or affect application stability.

Coverity issue: 357759, 357713
Fixes: bd3fcf0d0f ("net/igc: support RSS")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-18 20:35:07 +02:00
Alvin Zhang
3a19eeb0c3 net/e1000: fix port hotplug for multi-process
Enable detach device on secondary process.

Fixes: b9eee2cb8c ("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>
2020-05-18 20:35:07 +02:00
Pavan Nikhilesh
03a4e635cf mempool/octeontx2: mark internal symbols
Move the internal symbols to INTERNAL sections so that any
change in them is not reported as ABI breakage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-05-18 17:29:24 +02:00
Pavan Nikhilesh
8614cb6afd common/octeontx2: mark internal symbols
Move the internal symbols to INTERNAL sections so that any
change in them is not reported as ABI breakage.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2020-05-18 17:29:20 +02:00
Jay Zhou
b7aa3b5b88 crypto/virtio: enable OOP feature flag
Since it will check the feature mask before running out-of-place
test cases and the virtio-crypto device supports OOP_LB_IN_LB_OUT mode.

Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-17 16:10:44 +02:00
Anoob Joseph
caeba5062c crypto/octeontx: improve symmetric session-less path
Cleanup sessionless code path and improve error handling.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Ankur Dwivedi
32b8f26adf crypto/octeontx: enable non-byte aligned data
The OCTEON TX crypto PMD supports non-byte aligned data as
input for SNOW and ZUC algos. Adding the same to the feature list.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Anoob Joseph
96330d215f crypto/octeontx2: improve symmetric session algos check
Session configure should return -ENOTSUP in case of unsupported xform
requests. Moving the validation of combinations out of cpt, as the
feature support will not be same across OCTEON TX and OCTEON TX2.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Ankur Dwivedi
51f3e107ac crypto/octeontx2: enable non-byte aligned data
The OCTEON TX2 crypto PMD supports non-byte aligned data as
input for SNOW and ZUC algos. Adding the same to the feature list.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Tejasree Kondoj
120d13db35 net/octeontx2: update max packet length for inline IPsec
Update max packet length supported by Inline IPsec Rx to
NIX_MAX_FRS

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2020-05-17 16:10:44 +02:00
Anoob Joseph
18839177b8 common/octeontx2: fix port ID bound check
Fix out of bounds access.

Coverity issue: 354230, 354231
Fixes: f44e716377 ("net/octeontx2: add security session operations")
Fixes: 3fe4d07d16 ("crypto/octeontx2: enable CPT to share QP with ethdev")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2020-05-17 16:10:44 +02:00
Yunjian Wang
c40b4fcd98 crypto/caam_jr: fix IRQ functions return type
The caam_jr_enable_irqs() and caam_jr_disable_irqs() methods maybe return a
negative error. So use int instead of uint32_t int the functions.

Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
2020-05-17 16:10:44 +02:00
Yunjian Wang
61552661e2 crypto/caam_jr: fix check of file descriptors
Zero is a valid fd. It will fail to check the fd if the fd is zero.
The "job_ring->uio_fd" is an fd, so define it as "int".

Fixes: e7a45f3cc2 ("crypto/caam_jr: add UIO specific operations")
Fixes: a5e1018d5e ("crypto/caam_jr: add routines to configure HW")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Gagandeep Singh <g.singh@nxp.com>
2020-05-17 16:10:44 +02:00
Akhil Goyal
eef9e0412a drivers/crypto: fix build with -fno-common
gcc 10 defaults to -fno-common and as a result when linking
with crypto drivers:

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

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

This patch fixes the blunt workaround in the following commit.

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

Bugzilla ID: 469
Cc: stable@dpdk.org

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Tested-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2020-05-15 19:43:17 +02:00
Yuri Chipchev
1c4975d6df event/dsw: fix enqueue burst return value
The returned number from rte_event_enqueue_*()
wouldn't include events marked with RTE_EVENT_OP_RELEASE.

Fixes: 1c8e3caa3 ("event/dsw: add event scheduling and device start/stop")
Cc: stable@dpdk.org

Signed-off-by: Yuri Chipchev <yuric@marvell.com>
Reviewed-by: Liron Himi <lironh@marvell.com>
Acked-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2020-05-14 09:15:37 +02:00
Maxime Coquelin
9036180f61 net/virtio: fix AVX512 datapath selection
The AVX512 packed ring datapath selection was only done
at build time, but it should also be checked at runtime
that the CPU supports it.

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

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

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

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-11 23:04:33 +02:00
Xiaoyun Wang
9d441c4551 net/hinic/base: support IPv6 flow rules
The patch supports ipv6 flow rules for BGP or ICMP packets.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-11 22:27:39 +02:00
Xiaoyun Wang
13850e88a4 net/hinic: fail initialization for not supported device
If hardware mode for this card does not support nic,
the network features for this card will not be supported
and driver will be initialized failed.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-11 22:27:39 +02:00
Xiaoyun Wang
254bd849b1 net/hinic: set jumbo frame offload flag
The patch adds DEV_RX_OFFLOAD_JUMBO_FRAME flag for jumbo when set mtu.

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-11 22:27:39 +02:00
Dekel Peled
563ac307a4 net/mlx5: support match on GTP flags
This patch adds to MLX5 PMD the support of matching on
GTP header item v_pt_rsv_flags.

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

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

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

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Alexander Kozyrev
776aec28fc net/mlx5: fix Tx queue release debug log timing
Program received signal SIGSEGV, Segmentation fault.
0x00000000008ef7c4 in mlx5_tx_queue_release (dpdk_txq=0x17ce01680) at
drivers/net/mlx5/mlx5_txq.c:302
301 mlx5_txq_release(ETH_DEV(priv), i);
302 DRV_LOG(DEBUG, "port %u removing Tx queue %u from list",
303         PORT_ID(priv), txq->idx);
The problem is txq is freed inside the mlx5_txq_release() function
and no longer valid in the debug log right after this invocation.
Move the debug log before the mlx5_txq_release() function to fix this.

Fixes: a6d83b6a92 ("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>
2020-05-11 22:27:39 +02:00
Michael Baum
6f155c0b9d net/mlx4: fix drop queue error handling
The function mlx4_drop_get() creates pointer to a struct mlx4_drop and
if needed allocates by rte_malloc.

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

Skip resources cleaning when the memory allocation is failed.

Coverity issue: 146206
Coverity issue: 146146
Fixes: d3a7e09234 ("net/mlx4: allocate drop flow resources on demand")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Michael Baum
c8f0abe7f8 net/mlx5: fix meter color register consideration
The mlx5_flow_get_reg_id() function translates tag ID to register
from the registers that are supported and available for use. The
user does not know which register is available at a time and therefore
there is an array that represents mapping to the available registers.
Usually the free registers are continuous in the flow_mreg_c array but
sometimes the mtr_color_reg register is between them and it must be
skipped and the next register returned, in which case the function
returns the mapping of the next entity in the array.

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

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

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

Coverity issue: 146355
Fixes: 792e749e92 ("net/mlx5: fix register usage in meter")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Raslan Darawsheh
8a2e026add net/mlx5: fix matching for UDP tunnels with Verbs
When creating flow rule with zero specs it will cause
matching all UDP packets like following:
 eth / ipv4 / udp / vxlan / end
Such rule will match all udp packets.

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

Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-11 22:27:39 +02:00
Dekel Peled
92818d839e net/mlx5: fix match on empty VLAN item in DV mode
In existing implementation, using wild card VLAN item is not allowed.
A VLAN item in flow pattern must include VLAN ID (vid) value.
This obligation contradict the flow API specification [1].

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

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

Fixes: 00f75a4057 ("net/mlx5: fix VLAN match for DV mode")
Cc: stable@dpdk.org

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-11 22:27:39 +02:00
Gaetan Rivet
8459f5ab32 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 96cb195211 ("net/ring: use EAL APIs in PMD specific API")
  commit a6992e9610 ("net/ring: set ethernet device field")

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

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

Fixes: fbe90cdd77 ("ethdev: add probing finish function")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <grive@u256.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
Raslan Darawsheh
53601aefc4 net/tap: fix build for glibc < 2.24
When trying to compile with glibc < 2.24 that doesn't
support SOL_NETLINK it will cause compilation failure:

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

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

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

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
Sunil Kumar Kori
241546237c 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: ec8ddd4fb1 ("net/octeontx2: restructure TM helper functions")

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 22:27:39 +02:00
Jerin Jacob
251dab27d5 common/octeontx2: upgrade mbox definition to version 7
Upgrade mailbox definitions to version 0x0007 of kernel AF driver.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 22:27:39 +02:00
Rasesh Mody
80a73194de 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>
2020-05-11 22:27:39 +02:00
Qi Zhang
0beafe7b04 net/ice: fix variable initialization
Fix coverity defect due to uninitialized scalar variable.

Coverity issue: 357763
Fixes: 47d460d632 ("net/ice: rework switch filter")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Alvin Zhang
82d806b7ec net/igc: remove useless log
Some log will always be printed when the device is initialized
and shut down, which will mislead users and should be removed.

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

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Wei Zhao
55f0335e90 net/ice/base: fix PPPoE-IPv6 dummy packet
The dummy packet for pppoe-ipv6 has an error, we should
use 0x3b for next header in ipv6 header in the dummy packet,
or some case can not be download, such as:

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

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

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Nannan Lu <nannan.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Jeff Guo
ba37f7bf11 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: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Fixes: ff2d0c345c ("net/iavf: support generic flow API")

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Phil Yang
d70a869db2 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: 819d0d1d57 ("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>
2020-05-11 22:27:39 +02:00
Jeff Guo
bd8cf9c0b0 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: 7be10c3004 ("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>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
7e2c3f1436 net/dpaa2: support additional link speeds
This patch adds the support for additional link speed
supported by LX2160A platforms.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
231366ba5f bus/fslmc: fix size of qman fq descriptor
Correct the qman_fq_desc as per the HW defined size

Fixes: 6fef517e17 ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Jun Yang
7a3a9d5660 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: 13b856ac02 ("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>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
46dca1d544 net/dpaa2: reduce logs in Rx queue count
Changing them to DP as it is impacting l3fwd-power apps

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
7a5823182d net/dpaa2: support UDP destination port based muxing
This change adds DPDMUX support to bifurcate traffic on
the basis of UDP destination port.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
d527f5d9bb drivers: enhance DPAA2 portal allocation error logs
Update the portal allocation failure log to print the thread id
as well.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Hemant Agrawal
e35ead3379 net/dpaa2: add default Rx/Tx configuration
This patch adds default/preferred rx/tx params in dev info,
specially the advertised burst size.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Nipun Gupta
2f41c93034 net/dpaa2: do not prefetch annotation for physical mode
When IOVA is physical address do not prefetch the annotation
of the next frame, as there is a cost involved there to convert
the physical address to virtual address.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Rohit Raj
7e6ecac281 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: c5acbb5ea2 ("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>
2020-05-11 22:27:39 +02:00
Apeksha Gupta
27ede02945 bus/fslmc: fix dereferencing null pointer
Fixes: 6fef517e17 ("bus/fslmc: add qman HW fq query count API")
Cc: stable@dpdk.org

Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 22:27:39 +02:00
Simei Su
f002ee9c8e net/ice/base: fix flow director rule completion report
IAVF FDIR needs to check program status from FD completion descriptors
for both successful and failed case, rather than only ask for completion
on error. This patch corrects completion report value so that the called
can determine whether to report completion on error or other cases.

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

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Ajit Khaparde
cfa9e98d3c net/bnxt: fix FW version query
bnxt_fw_version_get is not indicating the complete FW version.
Fix it to indicate complete version string.

Fixes: e2652b0a20 ("net/bnxt: support get FW version")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Ajit Khaparde
4bcc5ccfe6 net/bnxt: fix uninitialized variable
Fix uninitialized variable error reported by coverity.

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

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Randy Schacher <stuart.schacher@broadcom.com>
2020-05-11 22:27:39 +02:00
Kishore Padmanabha
45e5e9518c net/bnxt: fix overrun of ULP device params array
Fix a buffer overrun issue spotted by coverity while accessing
the array ulp_device_params.
Note that the issue was observed in an internal Coverity scan.

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

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Marvin Liu
b62c5f0df5 net/virtio: fix 32-bit build with clang 6
Clang 6.0.0 will undefine function _mm512_maskz_set1_epi64 on i686
target. Fix it by replacing the function with _mm512_set4_epi64 when
doing 32-bit build.

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

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

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-11 22:27:39 +02:00
Marvin Liu
01996a034a net/virtio: fix crash when device reconnecting
When doing virtio device initialization, virtqueues will be reset in
server mode if ring type is packed. It will cause issue because queues
have been freed in the beginning of device initialization.

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

Fixes: 6ebbf4109f ("net/virtio-user: fix packed ring server mode")
Cc: stable@dpdk.org

Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-11 22:27:39 +02:00
Kalesh AP
2f8cc21f09 net/bnxt: fix TQM ring context memory size
The current formulas to calculate the TQM slow path and fast path ring
context memory sizes are not quite correct. TQM slow path entry is
array index 0 of ctx->tqm_mem[]. The other array entries are for fast
path. Fix these sizes according to firmware spec. for 57500 and newer
chips.

Fixes: cc5e26b8ef ("net/bnxt: increase TQM entry allocation")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Kalesh AP
fd14f72296 net/bnxt: fix number of TQM ring
Newer firmware advertises the number of TQM rings to allocate
context memory for.  Use the firmware specified value and fall back
to the old value derived from "bp->max_q" if it is not available.

Fixes: f8168ca0e6 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Asaf Penso
6e3a4595a7 net/mlx5: support 200G link speed
Signed-off-by: Asaf Penso <asafp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
647909bcf3 net/tap: use netlink extended ack support
In recent Linux kernels, there is support for extended acknowledgment
to netlink messages. This is quite useful for diagnosing errors
in configuration in the kernel with TAP.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
6d81801d84 net/tap: simplify netlink send/receive functions
The tap_nl_recv() function does not need to use the full
complex recvmsg() system call, basic recv() will work here.

Ditto for tap_nl_send() full sendmsg is not needed.

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Keith Wiles <keith.wiles@intel.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
8451387df2 net/tap: fix crash in flow destroy
The TAP driver does not initialize all the elements of the rte_flow
structure. This can lead to crash in rte_flow_destroy.

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

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

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

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

Fixes: 2bc06869cd ("net/tap: add remote netdevice traffic capture")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-11 22:27:39 +02:00
Junyu Jiang
1f8672be42 net/ice: fix crash in switch filter
The number of queues in queue group should be checked before
using it. This patch fixed the issue.

Fixes: 47d460d632 ("net/ice: rework switch filter")
Cc: stable@dpdk.org

Signed-off-by: Junyu Jiang <junyux.jiang@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-05-11 22:27:39 +02:00
Simei Su
0f664f7d57 net/ice: support mark only action for flow director
This patch fixes issue that doesn't support mark only case.
Mark only action is equal to mark + passthru action.

Fixes: f5cafa961f ("net/ice: add flow director create and destroy")
Cc: stable@dpdk.org

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Zhihong Peng
0012111a3d net/ixgbe: fix link status synchronization on BSD
DPDK does not implement interrupt mechanism on BSD,
so force NIC status synchronization.

Fixes: dc66e5fd01 ("net/ixgbe: improve link state check on VF")
Cc: stable@dpdk.org

Signed-off-by: Zhihong Peng <zhihongx.peng@intel.com>
Tested-by: Zhimin Huang <zhiminx.huang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-11 22:27:39 +02:00
Wei Zhao
2e873cf407 net/ice/base: fix switch rule for IPsec
When we download a switch rule for ipv6 with esp payload
"eth / ipv6 / esp spi is 1 / end actions queue index 2 / end"

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

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

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

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

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

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

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qi Fu <qi.fu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-11 22:27:39 +02:00
Alvin Zhang
5330b04297 net/iavf: fix link speed
If the PF driver does not support the new speed reporting capabilities
then use link_event instead of link_event_adv to get the speed.

Fixes: 48de41ca11 ("net/avf: enable link status update")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
2020-05-11 22:27:39 +02:00
Linsi Yuan
6ebabb76a5 net/bnxt: fix possible stack smashing
We see a stack smashing as a result of defensive code missing. Once the
nb_pkts is less than RTE_BNXT_DESCS_PER_LOOP, it will be modified to
zero after doing a floor align, and we can not exit the following
receiving packets loop. And the buffers will be overwrite, then the
stack frame was ruined.

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

Fixes: bc4a000f2f ("net/bnxt: implement SSE vector mode")
Cc: stable@dpdk.org

Signed-off-by: Linsi Yuan <yuanlinsi01@baidu.com>
Signed-off-by: Dongsheng Rong <rongdongsheng@baidu.com>
Acked-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Randy Schacher
34ce841502 net/bnxt: fix build with gcc 10 default no-common
Remove the defensive compile-time checker macro.

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

Signed-off-by: Randy Schacher <stuart.schacher@broadcom.com>
Reviewed-by: Peter Spreadborough <peter.spreadborough@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
c6611b77d0 net/netvsc: do not configure RSS if disabled
This fixes the problem where driver would not start if only
have a single Rx queue and multiple Txq. In that case, RSS
should stay disabled.

Fixes: 92d23a57ca ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
019a28912b net/netvsc: do RSS across Rx queue only
If number of tx queues is greater than the number of rx queues;
the driver ends up allocating more channels than rx queues.
The problem is that the RSS indirection table is programmed such
that some packets will end up on a channel that would never be
polled. The fix is to limit the RSS indirection table by number
of rx queues not channels.

Fixes: 92d23a57ca ("net/netvsc: support configuring RSS parameters")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
81938ebb54 net/netvsc: manage VF port under read/write lock
With multiple channels, the primary channel may receive notification
that VF has been added or removed while secondary channel is in
process of doing receive or transmit.  Resolve this race by converting
existing vf_lock to a reader/writer lock.

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
33fd81cdb5 net/netvsc: check vmbus ring buffer more often
Since VF notifications are handled as VMBUS notifications on the
primary channel (and not as hotplug). The channel should be checked
before deciding to use VF for Rx or Tx.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
1c33435a58 bus/vmbus: add missing barrier
The check for event ring being empty needs a barrier
to avoid any over aggressive optimization.
This is same barrier as Linux kernel.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
3a185ff42e bus/vmbus: fix comment spelling
No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Stephen Hemminger
672f4d127b net/netvsc: fix comment spelling
No code change here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-11 22:27:39 +02:00
Gaetan Rivet
94a6f2def2 net/failsafe: avoid crash on malformed ethdev
Some PMD do not respect the eth_dev API when allocating their
rte_eth_dev. As a result, on device add event resulting from
rte_eth_dev_probing_finish() call, the eth_dev processed is incomplete.

The segfault is a good way to focus the developer on the issue, but does
not inspire confidence. Instead, warn the user of the error repeatedly.

The failsafe PMD can warn of the issue and continue. It will repeatedly
attempt to initialize the failed port and complain about it, which
should result in the same developer focus but with less crashing.

Signed-off-by: Gaetan Rivet <grive@u256.net>
2020-05-11 22:27:39 +02:00
Yunjian Wang
b9663f6035 net/failsafe: fix fd leak
Zero is a valid fd. The fd won't be closed thus leading fd leak,
when it is zero.

Also the service proxy is initialized at 0. This is assuming that all of
its fields are invalid at 0. The issue is that a file descriptor at 0 is
a valid one.

The value -1 is used as sentinel during cleanup. Initialize the RX proxy
file descriptor to -1.

Fixes: f234e5bd99 ("net/failsafe: register slaves Rx interrupts")
Fixes: 9e0360aebf ("net/failsafe: register as Rx interrupt mode")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Signed-off-by: Gaetan Rivet <grive@u256.net>
Tested-by: Ali Alnubani <alialnu@mellanox.com>
2020-05-11 22:27:39 +02:00
Pablo de Lara
0b133c36ad crypto/zuc: support IPsec Multi-buffer lib v0.54
The latest version of the Intel IPSec Multi-buffer library
adds an API to authenticate multiple buffers in parallel.
The PMD is modified to use this API, improving
performance of the ZUC-EIA3 algorithm.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-05-11 13:17:43 +02:00
Akhil Goyal
e11bdd3774 cryptodev: add feature flag for non-byte aligned data
Some wireless algos like SNOW, ZUC may support input
data in bits which are not byte aligned. However, not
all PMDs can support this requirement. Hence added a
new feature flag RTE_CRYPTODEV_FF_NON_BYTE_ALIGNED_DATA
to identify which all PMDs can support non-byte aligned
data.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2020-05-11 13:17:43 +02:00
Kevin Traynor
50b03f3b8e drivers/crypto: disable gcc 10 no-common errors
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 is a blunt fix for the issue by enabling fcommon for
dpaa_sec/dpaa2_sec/caam_jr.

Bugzilla ID: 469
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Akhil Goyal
c08ced9a9a crypto/dpaa_sec: improve error handling
The return values in cases of errors were not
specified properly. With this patch appropriate
error numbers are returned.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 13:17:43 +02:00
Akhil Goyal
94ae7667f7 crypto/dpaa2_sec: improve error handling
The return values in cases of errors were not
specified properly. With this patch appropriate
error numbers are returned.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-11 13:17:43 +02:00
Adam Dybkowski
b5d704b92a common/qat: remove redundant check
This patch removed the non-essential check for NULL pointer.

Coverity issue: 357770
Fixes: c13cecf60f ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-05-11 13:17:43 +02:00
Adam Dybkowski
7277e63f59 common/qat: fix enqueue/dequeue statistics
This patch fixes enqueued and dequeued count statistics that should
contain the number of operations enqueued by the end user app
instead of the total number of QAT requests - bigger in case of
a multiple-request dynamic Huffman compression operation.

Fixes: c13cecf60f ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-05-11 13:17:43 +02:00
Kevin Traynor
6a6b5d5616 crypto/kasumi: fix extern declaration
gcc 10 defaults to fno-common and it reports:

crypto_kasumi_rte_kasumi_pmd_ops.c.o:(.data.rel+0x0):
multiple definition of `rte_kasumi_pmd_ops';
crypto_kasumi_rte_kasumi_pmd.c.o:(.bss+0x8): first defined here

Fix by making rte_kasumi_pmd_ops extern in the header file.

Fixes: 2773c86d06 ("crypto/kasumi: add driver for KASUMI library")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-05-11 13:17:43 +02:00
Lukasz Wojciechowski
2eaf352d3d crypto/dpaa_sec: repair memory allocations
This patch repairs 2 memory allocations issues:

1) possible leak of memory
    In cryptodev_dpaa_sec_probe() function in case of portal
    initialization failure, function exited without cleanup.

    The patch redirects flow to out label, which provides
    proper cleanup in case of error: freeing cryptodevice private
    data and releasing cryptodevice.

2) double free of cryptodev private data
    The function dpaa_sec_dev_init() in case of failure called
    dpaa_sec_uninit() which freed both private data and security
    context. However one layer above in cryptodev_dpaa_sec_probe()
    function, the private data were freed one more time.

    The patch limits cleanup of the dpaa_sec_dev_init() function
    to freeing only the security context.

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Lukasz Wojciechowski
6290de2c3f crypto/dpaa_sec: improve memory freeing
This patch fixes management of memory for authentication
and encryption keys.
There were two issues with former state of implementation:

1) Invalid access to dpaa_sec_session union members
    The dpaa_sec_session structure includes an anonymous union:
    union {
        struct {...} aead_key;
        struct {
            struct {...} cipher_key;
            struct {...} auth_key;
        };
    };
    Depending on the used algorithm a rte_zmalloc() function
    allocated memory that was kept in aead_key, cipher_key
    or auth_key. However every time the memory was released,
    rte_free() was called only on cipher and auth keys, even
    if pointer to allocated memory was stored in aead_key.

    The C language specification defines such behavior as undefined.
    As the cipher_key and aead_key are similar, have same sizes and
    alignment, it has worked, but it's directly against C specification.

    This patch fixes this, providing a free_session_data() function
    to free the keys data. It verifies which algorithm was used
    (aead or auth+cipher) and frees proper part of the union.

2) Some keys might have been freed multiple times
    In functions like: dpaa_sec_cipher_init(), dpaa_sec_auth_init(),
    dpaa_sec_chain_init(), dpaa_sec_aead_init() keys data were freed
    before returning due to some error conditions. However the pointers
    were not zeroed causing another calls to ret_free from higher
    layers of code. This causes an error log about invalid memory address
    to be printed.

    This patch fixes it by making only one layer responsible for freeing
    memory

Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
2020-05-11 13:17:43 +02:00
Adam Dybkowski
e703b80152 common/qat: fix queue head update
This patch fixes missing queue head update that occurred when
a multiple-request dynamic Huffman compression operation was not
complete within one qat_dequeue_op_burst function call.

Fixes: c13cecf60f ("compress/qat: support IM buffer too small operation")

Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Tested-by: Xinfeng Zhao <xinfengx.zhao@intel.com>
2020-05-11 13:17:43 +02:00
Arek Kusztal
fae347cb34 crypto/qat: fix cipher descriptor for ZUC and SNOW
Offset of cd pointer is too big by state1size + state2size, so few extra
unnecessary bytes will be copied into cd. Snow offset was improved as well.

Fixes: d9b7d5bbc8 ("crypto/qat: add ZUC EEA3/EIA3 capability")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
2020-05-11 13:17:43 +02:00
Yunjian Wang
4f429be4c0 crypto/ccp: fix fd leak on probe failure
Zero is a valid fd. When ccp_probe_device() is failed, the uio_fd won't be
closed thus leading fd leak.

Fixes: ef4b04f87f ("crypto/ccp: support device init")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Ravi Kumar <ravi1.kumar@amd.com>
2020-05-11 13:17:43 +02:00
Pablo de Lara
6ab5245040 crypto/aesni_mb: fix DOCSIS AES-256
When adding support for DOCSIS AES-256,
when setting the cipher parameters, all key sizes
were accepted, but only 128-bit and 256-bit keys
are supported.

Fixes: 9536622b86 ("crypto/aesni_mb: support DOCSIS AES-256")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
2020-05-11 13:17:43 +02:00
Pablo de Lara
20731cd8cb crypto/aesni_mb: check if session is valid
Check if session is valid after getting operation
out of the internal IPSec MB manager, in case the
session has been freed while the operation was still
inside the manager.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2020-05-11 13:17:43 +02:00
Ferruh Yigit
ea153cc853 event/octeontx2: fix build for O1 optimization
Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc 7.3.0

Build error
In file included from .../drivers/event/octeontx2/ot
x2_evdev.c:15:0:
.../drivers/event/octeontx2/otx2_evdev_stats.h:
    In function ‘otx2_sso_xstats_get’:
.../drivers/event/octeontx2/otx2_evdev_stats.h:124:9:
    error: ‘xstats’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
   xstat = &xstats[ids[i] - start_offset];
   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is false positive, 'xstats_mode_count' should be preventing taking
the loop and accessing 'xstats'.
Returning in that case to silence the compiler warning.

Reported-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Tested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 21:09:20 +02:00
Ferruh Yigit
5f267cb01b net/ena: fix build for O1 optimization
Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

Build error:
.../drivers/net/ena/ena_ethdev.c: In function ‘eth_ena_dev_init’:
.../drivers/net/ena/ena_ethdev.c:1815:20:
    error: ‘wd_state’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
 1815 |  adapter->wd_state = wd_state;
      |  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~

This looks like false positive, fixing by assigning initial value to
'wd_state' variable.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
2020-05-11 19:21:31 +02:00
Ferruh Yigit
0403b233ee mempool/octeontx2: fix build for gcc O1 optimization
Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)

Build error:
In file included from .../drivers/mempool/octeontx2/otx2_mempool.h:13,
                from .../drivers/mempool/octeontx2/otx2_mempool_ops.c:8:
.../drivers/mempool/octeontx2/otx2_mempool_ops.c:
	In function ‘otx2_npa_alloc’:
.../drivers/common/octeontx2/otx2_common.h:94:2:
    error: ‘aura_handle’ may be used uninitialized in this function
           [-Werror=maybe-uninitialized]
   94 |  rte_log(RTE_LOG_DEBUG, otx2_logtype_ ## subsystem,  \
      |  ^~~~~~~
.../drivers/mempool/octeontx2/otx2_mempool_ops.c:643:11:
    note: ‘aura_handle’ was declared here
  643 |  uint64_t aura_handle;
      |           ^~~~~~~~~~~

This looks like false positive, assigning an initial value to
'aura_handle' to fix the build error.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 19:21:18 +02:00
Radu Nicolau
299e282f62 raw/ioat: support ICX
Add support for Ice Lake IOAT DMA engine PCI Device ID.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
2020-05-11 17:18:58 +02:00
Sunil Kumar Kori
463a5245d5 bus/pci: optimise scanning with whitelist/blacklist
rte_bus_scan API scans all the available PCI devices irrespective of white
or black listing parameters then further devices are probed based on white
or black listing parameters. So unnecessary CPU cycles are wasted during
rte_pci_scan.

For Octeontx2 platform with core frequency 2.4 Ghz, rte_bus_scan consumes
around 26ms to scan around 90 PCI devices but all may not be used by the
application. So for the application which uses 2 NICs, rte_bus_scan
consumes few microseconds and rest time is saved with this patch.

Patch restricts devices to be scanned as per below mentioned conditions:
 - All devices will be scanned if no parameters are passed.
 - Only white listed devices will be scanned if white list is available.
 - All devices, except black listed, will be scanned if black list is
   available.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Gaetan Rivet <grive@u256.net>
2020-05-11 16:59:58 +02:00
David Marchand
87db93e07a remove references to private PCI probe function
rte_pci_probe() is private to the PCI bus.
Clean the remaining references in the documentation and comments.

Fixes: c752998b5e ("pci: introduce library and driver")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Gaetan Rivet <grive@u256.net>
2020-05-11 16:59:58 +02:00
Jerin Jacob
e4f27af0f4 bus/pci: reduce boot-up logs to absolute minimum
Some machines may have a lot of PCI devices and all of them are
not bound to DPDK. In such case the logs from EAL creates a lot of
clutter on boot-up, typically one needs to scroll the screen to
find other issues in boot-up.

This patch changes the following to reduce the clutter in
the default boot-up logs.

- Change the log-level of PCI probes to `debug`
- Introduce new driver probe as `info` log-level for the successful probe.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
2020-05-11 16:36:00 +02:00
Pavan Nikhilesh
838d94399b common/octeontx: fix gcc 9.1 ABI break
GCC 9.1 fixes a bug with passing bitfields as pass by value in function
parameters and generates a warning for the same as below:

drivers/common/octeontx/octeontx_mbox.c:282:1: note: parameter passing
for argument of type ‘struct mbox_intf_ver’ changed in GCC 9.1

Fix the warning generated by passing bitfield as pass by reference.

Fixes: b4134b2d31 ("common/octeontx: update mbox to version 1.1.3")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
Tested-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-06 23:53:19 +02:00
Mattias Rönnblom
52b66b2f20 event/dsw: avoid reusing previously recorded events
Avoid reusing recorded events when performing a migration, since this
may make the migration selection logic pick an already-moved flow.

Fixes: f6257b22e7 ("event/dsw: add load balancing")
Cc: stable@dpdk.org

Reported-by: Venky Venkatesh <vvenkatesh@paloaltonetworks.com>
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
2020-05-04 13:48:28 +02:00
Harman Kalra
cf55f04a0c event/octeontx: support Rx/Tx checksum offload
Adding support for rx checksum offload. In case of wrong
checksum received (inner/outer l3/l4) it reports the
corresponding layer which has bad checksum. It also adds
rx burst function pointer hook for rx checksum offload to
event PMD.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 16:37:30 +02:00
Vamsi Attunuru
45231cc6fa event/octeontx: support VLAN filter offload
Adding rx burst function pointer hooks for vlan filter
offload in event PMD.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 12:19:07 +02:00
Harman Kalra
56a96aa424 event/octeontx: add framework for Rx/Tx offloads
Adding macro based framework to hook dequeue/enqueue function
pointers to the appropriate function based on rx/tx offloads.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 12:08:31 +02:00
Harman Kalra
844d302d73 event/octeontx: support multi-segment
Adding support for multi segment to the eventdev PMD.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-03 11:57:56 +02:00
Lukasz Bartosik
534d1d4b65 event/octeontx2: fix queue removal from Rx adapter
When eth port queue is removed from Rx adapter using
rte_event_eth_rx_adapter_queue_del() it incorrectly
initializes CQ context instead of modifying it. This
might lead to a crash when CQ context is modified
as a part of rte_eth_dev_stop() sequence as CQ will
hold invalid entries. This is responsibility of an
application to call rte_event_eth_rx_adapter_queue_del()
to remove eth port queue from Rx adapter in tear down
sequence.

Fixes: 37720fc1fb ("event/octeontx2: add Rx adapter")
Cc: stable@dpdk.org

Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2020-05-02 11:47:00 +02:00
Ophir Munk
0efc99bed3 net/mlx5: fix flow rules with Verbs
The flow_verbs_translate() function accumulates hash fields while
iterating through the flow items (SRC_IPV4, DST_IPV4, SRC_IPV6,
DST_IPV6, SRC_PORT_TCP, DST_PORT_TCP, SRC_PORT_UDP, DST_PORT_UDP).
Before this commit the dev_flow handle structure was reused in each new
flow_verbs_translate() call, however the dev_flow->hash_fields variable
was not reset before each call. As a result hash_fields from previous
calls remained present in the current flow which lead to invalid
combinations (e.g.  simultaneous IPv4 and IPv6 specs). This scenario
happens for example in the next flows sequence, when running in verbs
mode (dv_flow_en=0).

flow create 0 ingress group 0 pattern eth / ipv4 / end <rss actions>
flow create 0 ingress group 0 pattern eth / ipv6 / end <rss actions>

The fix is to reset dev_flow->hash_fields in flow_verbs_prepare().

Fixes: e7bfa3596a ("net/mlx5: separate the flow handle resource")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Eli Britstein
6030e1d452 net/mlx5: optimize IPv4/IPv6 matching
The HW is optimized for IPv4/IPv6. For such cases avoid matching on
ethertype, and use ip_version field instead.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Eli Britstein
dd5374bcf0 net/mlx5: introduce helper to set IP version match
Introduce a helper function to set the ip_version match.

Signed-off-by: Eli Britstein <elibr@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Kevin Traynor
869ea2e62d net/mlx5: fix gcc 10 enum-conversion warning
gcc 10.0.1 reports warnings when using mlx5_rte_flow enums
with rte_flow type enums. For example:

../drivers/net/mlx5/mlx5_flow.c: In function ‘flow_hairpin_split’:
../drivers/net/mlx5/mlx5_flow.c:3406:19:
warning: implicit conversion from ‘enum mlx5_rtedflow_action_type’ to
         ‘enum rte_flow_action_type’ [-Wenum-conversion]
 3406 |  tag_action->type = MLX5_RTE_FLOW_ACTION_TYPE_TAG;
      |                   ^
../drivers/net/mlx5/mlx5_flow.c:3419:13:
warning: implicit conversion from ‘enum mlx5_rte_flow_item_type’
         to ‘enum rte_flow_item_type’ [-Wenum-conversion]
 3419 |  item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG;
      |             ^

Fix by casting to the correct enum.

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:27 +02:00
Wisam Jaddo
b756f29807 net/mlx5: fix VLAN ID check
All comparison should be done in CPU endianness, otherwise
it will not give right results.

for example:
255 after converting into RTE_BE16 will be biger than 4096 after
converting into RTE_BE16.

Fixes: a5f2da0b81 ("net/mlx5: support modify VLAN ID on new VLAN header")
Cc: stable@dpdk.org

Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:27 +02:00
Bing Zhao
c8fa92f6c1 net/mlx5: fix assert in modify converting
The assertion was added incorrectly in converting the modify actions
into the format of low layer driver.
There is no mask specified in the rte_flow actions, and PMD driver
will give a mask of all 1s to the field to be modified. For each
field, the mask could not be zero. But for the whole header which
contains this field, the masks of other fields could be zero. The
assertion needs to be removed for debug mode.

Fixes: 72a944dba1 ("net/mlx5: fix header modify action validation")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
2020-05-05 15:54:27 +02:00
Dong Zhou
fa2d01c87d net/mlx5: support flow aging
Currently, there is no flow aging check and age-out event callback
mechanism for mlx5 driver, this patch implements it. It's included:
- Splitting the current counter container to aged or no-aged container
  since reducing memory consumption. Aged container will allocate extra
  memory to save the aging parameter from user configuration.
- Aging check and age-out event callback mechanism based on current
  counter. When a flow be checked aged-out, RTE_ETH_EVENT_FLOW_AGED
  event will be triggered to applications.
- Implement the new API: rte_flow_get_aged_flows, applications can use
  this API to get aged flows.

Signed-off-by: Dong Zhou <dongz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Dong Zhou
8d93c830e4 net/mlx5: modify ext-counter memory allocation
Currently, the counter pool needs 512 ext-counter memory for no batch
counters, it's allocated separately by once, behind the 512
basic-counter memory. This is not easy to get ext-counter pointer by
corresponding basic-counter pointer. This is also no easy for expanding
some other potential additional type of counter memory.

So, need allocate every one of ext-counter and basic-counter together,
as a single piece of memory. It's will be same for further additional
type of counter memory. In this case, one piece of memory contains all
type of memory for one counter, it's easy to get each type memory by
using offsetting.

Signed-off-by: Dong Zhou <dongz@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Xiaoyu Min
0afac6dcca net/mlx5: fix RSS enablement
PMD create some default control rules with RSS action
if it's not isolated mode.

However whether default control rules need to do RSS or not should be
controlled by device configuration, the mq_mode of rxmode configuration
in specific.

In another word, only when mq_mode is configured with ETH_MQ_RX_RSS_FLAG
set, then RSS is needed for default rules.

Fixes: c64ccc0eca ("mlx5: fix overwritten RSS configuration")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyu Min <jackmin@mellanox.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-05 15:54:27 +02:00
Kishore Padmanabha
8a32d5c492 net/bnxt: modify mark manager validity checks
The ULP mark manager originally assumed that zero was an invalid
mark and used it for invalidation and deletion.  The mark manager
now supports adding zero as a mark, flags for validity and type,
and adds explicit bounds checking instead of relying on mask.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-05 15:54:27 +02:00
Mike Baucom
17b6c8386d net/bnxt: fix mark handling
The current mark handling uses the meta data field of the rxcmp as the
first level check for determining gfid vs lfid.  When the meta data is
zero due to only the lowest 16bits of the gfid being set, the cfa code
is incorrectly interpreted as being an lfid.  Changing code to look at
meta fmt instead of the meta data directly for the determination.

Fixes: b87abb2e55 ("net/bnxt: support marking packet")

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2020-05-05 15:54:27 +02:00
Nithin Dabilpuram
542714cc4b net/octeontx2: update red algo for shaper dynamic update
Due to an errata red algo needs to be set to discard instead of stall
for 96XX C0 silicon for two rate shaping. This workaround is being
already handled for newly created hierarchy but not for dynamic
shaper update cases. This patch hence applies the workaround
even when for shaper dynamic update.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2020-05-05 15:54:26 +02:00
Amit Gupta
c600b523c0 net/octeontx2: fix bad L4 checksum detection
On detecting outer L4 checksum as bad, both outer and
inner checksums are marked as bad. No need to explicitly
check inner L4 checksum in this case.

Outer L4 UDP checksum error => PKT_RX_OUTER_L4_CKSUM_BAD
and PKT_RX_L4_CKSUM_BAD

Inner L4 UDP checksum error => PKT_RX_L4_CKSUM_BAD

Fixes: 41fe7a3a11 ("net/octeontx2: offload bad L2/L3/L4 UDP lengths detection")

Signed-off-by: Amit Gupta <agupta3@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2020-05-05 15:54:26 +02:00
Yunjian Wang
5ed5df8073 net/octeontx: fix dangling pointer on init failure
When octeontx_create() is cleaning up, it does not correctly set
the mac_addrs variable to NULL, which will lead to a double free.

Fixes: 9e399b88ce ("net/octeontx: fix memory leak of MAC address table")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Harman Kalra <hkalra@marvell.com>
2020-05-05 15:54:26 +02:00
Rasesh Mody
f97b56f9f1 net/qede: support FW version query
Add support for get firmware version operation.

Get and dump multi boot image (MBI) version as part of get
firmware version string along with Management firmware (MFW) version.
Use qede_fw_version_get() for PMD info logs.

Signed-off-by: Yash Sharma <ysharma@marvell.com>
Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-05 15:54:26 +02:00
Rasesh Mody
5810e43604 net/qede: support flow API flush
This patch adds support to flush the rte flows.

Signed-off-by: Rasesh Mody <rmody@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
2020-05-05 15:54:26 +02:00
Matan Azrad
11e2ed9e43 vdpa/mlx5: fix PCI address comparison
A regular memcmp function was used to compare between two objects of
type `struct rte_pci_addr`.

Due to the alignment rules of compiler structure builders, some memory
is not initiated in the structure even though all the fields were
initiated.

Therefore, the comparison may fail even though the PCI addresses are
identical and to cause false failure in probe.

Use the dedicated API to compare 2 PCI addresses.

Fixes: 75dd0ae917 ("vdpa/mlx5: disable RoCE")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
Tested-by: Noa Ezra <noae@mellanox.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Joyce Kong
3fc1d87c2a virtio: use one way barrier for split vring avail index
In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
and backend are assumed to be implemented in software, that is they can
run on identical CPUs in an SMP configuration.
Thus a weak form of memory barriers like rte_smp_r/wmb, other than
rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
and yields better performance.
For the above case, this patch helps yielding even better performance
by replacing the two-way barriers with C11 one-way barriers for avail
index in split ring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Joyce Kong
ea5207c158 virtio: use one way barrier for split vring used index
In case VIRTIO_F_ORDER_PLATFORM(36) is not negotiated, then the frontend
and backend are assumed to be implemented in software, that is they can
run on identical CPUs in an SMP configuration.
Thus a weak form of memory barriers like rte_smp_r/wmb, other than
rte_cio_r/wmb, is sufficient for this case(vq->hw->weak_barriers == 1)
and yields better performance.
For the above case, this patch helps yielding even better performance
by replacing the two-way barriers with C11 one-way barriers for used
index in split ring.

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
68ca93e31c net/hns3: fix return value when clearing statistics
Since the return value of the '.stats_reset' and '.xstats_reset'
callback function is int, when failing to issue command to firmware to
execute clear statistics, the relevant callback function should return
non-zero value.

Fixes: 8839c5e202 ("net/hns3: support device stats")
Cc: stable@dpdk.org

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
2de74dcfbd net/hns3: fix MSI-X interrupt during initialization
Currently, based on hns3 VF device error may occur during initialization.

The root cause as below:
When the following formula is executed during initialization, the
private variable named hw->tqps_num has not been obtained from PF driver
through mailbox, further causes failure when mapping interrupt and
queues.
  hw->num_msi = (num_msi > hw->tqps_num + 1) ? hw->tqps_num + 1 : num_msi;
We need to use hw->tqp_num after it is correctly assigned.

On the other hand, because the private variable named hw->num_msi, which
represents the number of MSI-x interrupt of hns3 PF/VF device, is used in
the '.get_reg' ops implementation function to dump all interrupt related
registers, it should be obtained from firmware directly and we'd better
not modify it in the driver.

Fixes: ef2e785c36 ("net/hns3: fix Tx interrupt when enabling Rx interrupt")
Fixes: 02a7b55657 ("net/hns3: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2020-05-05 15:54:26 +02:00
Min Hu (Connor)
99d673d5d3 net/hns3: fix VLAN PVID when configuring device
In current version, when upper level application calls the
rte_eth_dev_configure API function, if pvid config is not set of the
input parameter which struct type is rte_eth_conf, hns3 pmd driver also
sets the VLAN pvid related configuration to hardware, and this is not
reasonable. For example, As pvid is set to 100 by
rte_eth_dev_set_vlan_pvid, when pvid config is not set in rte_eth_conf,
rte_eth_dev_configure will tell driver to delete pvid 0, and that is
meaningless.

This patch fixes it to ensure that driver does not set VLAN pvid related
configuration to hardware when pvid config is not set in rte_eth_conf.

Fixes: 411d23b9ea ("net/hns3: support VLAN")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
837740cfa3 net/hns3: get PCI revision ID
The hns3 network engine is built-in multiple SoCs, such as kunpeng 920,
kunpeng 930, etc. The PCI revision id is 0x21 in kunpeng 920, and the PCI
revision id is 0x30 in kunpeng 930.

This patch gets PCI revision to identify different version of hardware
network engine.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-05 15:54:26 +02:00
Lijun Ou
8eed8acc81 net/hns3: add error code to some logs
Here adds some prints for return value when the relative function fails
and enter the exception branch.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-05 15:54:26 +02:00
Wei Hu (Xavier)
c4b7d6761d net/hns3: get Tx abnormal errors in xstats
When upper level application calls the rte_eth_tx_burst API function to
send multiple packets at a time with burst mode based on hns3 network
engine, there are some abnormal conditions that cause the driver to fail
to operate the hardware to send packets correctly.

This patch adds some statistic counts for the abnormal errors of Tx data
path to the extend device statistics. The upper level application can
get them by calling the rte_eth_xstats_get API function.

Note: When using burst mode to call the rte_eth_tx_burst API function to
send multiple packets at a time. When the first abnormal error is
detected, add one to the relevant error statistics item, and then exit
the loop of sending multiple packets of the function. That is to say,
even if there are multiple packets in which abnormal errors may be
detected in the burst, the relevant error statistics in the driver will
only be increased by one.

The detail description of the Tx abnormal errors statistic items as
below:
 - TX_OVER_LENGTH_PKT_CNT Total number of greater than
   HNS3_MAX_FRAME_LEN the driver supported.

 - TX_EXCEED_LIMITED_BD_PKT_CNT
     Total number of exceeding the hardware limited bd which process a
     packet needed bd numbers.

 - TX_EXCEED_LIMITED_BD_PKT_REASSEMBLE_FAIL_CNT
     Total number of exceeding the hardware limited bd fail which
     process a packet needed bd numbers and reassemble fail.

 - TX_UNSUPPORTED_TUNNEL_PKT_CNT
     Total number of unsupported tunnel packet. The unsupported tunnel
     type: vxlan_gpe, gtp, ipip and MPLSINUDP, MPLSINUDP is a packet
     with MPLS-in-UDP RFC 7510 header.

 - TX_QUEUE_FULL_CNT
     Total count which the available bd numbers in current bd queue is
     less than the bd numbers with the pkt process needed.

 - TX_SHORT_PKT_PAD_FAIL_CNT
     Total count which the packet length is less than minimum packet
     size HNS3_MIN_PKT_SIZE and fail to be appended with 0.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Hao Chen <chenhao164@huawei.com>
2020-05-05 15:54:26 +02:00
Jasvinder Singh
c1ea7a5f99 net/softnic: fix resource leak for pipeline
For sending request messages to data plane threads, the
caller invokes pipeline_msg_send_recv() function which never
returns null response. Thus, removed redundant check on
the returned response.

Coverity issue: 357676, 357680, 357681, 357682, 357690, 357693, 357711
Coverity issue: 357722, 357725, 357734, 357739, 357743, 357747, 357762
Coverity issue: 357766, 357787

Fixes: 6d4d054025 ("net/softnic: add command to read stats")
Fixes: 202905f3ee ("net/softnic: add command to create objects")
Fixes: ee19326a4b ("net/softnic: add command for pipeline table entries")
Fixes: 9bc0ce0ad1 ("net/softnic: add command for meter action")
Fixes: 2505030a83 ("net/softnic: add command for TTL action")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-05-05 15:54:26 +02:00
Jasvinder Singh
22335d4348 net/softnic: fix memory leak for thread
For sending request messages to data plane threads, the
caller invokes thread_msg_send_recv() function which never
returns null response. Thus, removed redundant check on
the returned response.

Coverity issue: 357717, 357772
Fixes: 70709c78fd ("net/softnic: add command to enable/disable pipeline")
Cc: stable@dpdk.org

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
2020-05-05 15:54:26 +02:00
Andrew Rybchenko
afff2aa3e3 net/sfc/base: fix build when EVB is enabled
Make local MCDI helper functions static.

Fixes: f0bda0cd68 ("net/sfc/base: add MCDI wrappers for vPort and vSwitch in EVB")
Fixes: ea94d14dbe ("net/sfc/base: provide APIs to configure and reset vPort")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-05 15:54:26 +02:00
Andrew Rybchenko
dd3d209cb1 net/sfc/base: use simpler EF10 family run-time checks
Fixes: 4625c4f527 ("net/sfc/base: factor out upstream port vAdaptor allocation")
Fixes: 4f12e20c85 ("net/sfc/base: introduce EVB module for SR-IOV")
Fixes: 18c8e84d77 ("net/sfc/base: support proxy auth operations for SR-IOV")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-05 15:54:26 +02:00
Andrew Rybchenko
f201b886b7 net/sfc/base: use simpler EF10 family conditional check
Fixes: 4f12e20c85 ("net/sfc/base: introduce EVB module for SR-IOV")
Fixes: 18c8e84d77 ("net/sfc/base: support proxy auth operations for SR-IOV")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-05 15:54:26 +02:00