Commit Graph

11340 Commits

Author SHA1 Message Date
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