Commit Graph

11465 Commits

Author SHA1 Message Date
Ophir Munk
79aa430721 common/mlx5: split common file under Linux directory
File mlx5_common.c includes both specific and non-specific Linux APIs.
Move the Linux specific APIS into a new file named linux/mlx5_common_os.c.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-03 17:19:26 +02:00
Ophir Munk
59513c3e13 common/mlx5: move netlink files under Linux directory
File mlx5_nl.c is using Netlink APIs which are Linux specifics.
Move it (including file mlx5_nl.h) to common/mlx5/linux directory.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-03 17:19:26 +02:00
Ophir Munk
72f7566056 common/mlx5: move glue files under Linux directory
The glue file mlx5_glue.c is based on Linux specifics APIs.
Move it (including file mlx5_glue.h) to common/mlx5/linux directory.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-03 17:19:26 +02:00
Ian Dolzhansky
6e8bdf7266 net/failsafe: fix RSS RETA size info
Failsafe driver has been indicating zero for RSS redirection table size
after device info reporting had been reworked. Report proper value.

Fixes: 4586be3743 ("net/failsafe: fix reported device info")
Cc: stable@dpdk.org

Signed-off-by: Ian Dolzhansky <ian.dolzhansky@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Gaetan Rivet <grive@u256.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2020-06-02 20:08:56 +02:00
Suanming Mou
33860cfab6 net/mlx5: fix interrupt installation timing
Currently, the DevX counter query works asynchronously with Devx
interrupt handler return the query result. When port closes, the
interrupt handler will be uninstalled and the Devx comp obj will
also be destroyed. Meanwhile the query is still not cancelled.

In this case, counter query may use the invalid Devx comp which
has been destroyed, and query failure with invalid FD will be
reported.

Adjust the shared interrupt install and uninstall timing to make
the counter asynchronous query stop before interrupt uninstall.

Fixes: f15db67df0 ("net/mlx5: accelerate DV flow counter query")
Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:24 +02:00
Suanming Mou
2786b7bf90 net/mlx5: fix secondary process resources release
When secondary process starts, it will allocate its own process private
data, and also does remap to UAR register of the Tx queue. Once the
secondary process exits, these resources should be released accordingly.
And the shared resources owned by primary should not be touched.

Currently, once one port in the secondary process spawn failed, all the
other spawned ports will also be released during process exits. However,
the mlx5_dev_close() function does not add the cases for secondary
process, it means call the mlx5_dev_close() function directly in
secondary process releases the resources it should not touch.

Add the case for secondary process release to its own resources in
mlx5_dev_close() function to help it quits gracefully.

Fixes: 942d13e6e7 ("net/mlx5: fix sharing context destroy order")
Fixes: 3a8207423a ("net/mlx5: close all ports on remove")
Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:24 +02:00
Michael Baum
01de93f245 net/mlx5: fix unreachable MPLS error path
The mlx5_flow_validate_item_mpls function checks MPLS item validation.
It first checks if the device supports MPLS, it is done using the ifdef
condition that if it fails to skip to endif and return the appropriate
error.

When MPLS is supported, the preprocessor will copy the body of the
function ending with return 0 followed by the lines that report MPLS
support.
In fact, these lines are unreachable because before them the function
returns 0 and in any case they are unnecessary.

Replace the endif by else and move endif to the end of the
function.

Fixes: 23c1d42c71 ("net/mlx5: split flow validation to dedicated function")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:24 +02:00
Michael Baum
c55ec83b58 net/mlx5: remove needless Tx queue initialization check
The mlx5_txq_obj_new function defines a pointer named txq_data and
assign value into it. After assigning, the code writer is sure that the
variable does not point to NULL and even express it using assertion.

During the function, the function does dereferencing to the pointer
several times and at no point change its value. However, at the end of
the function at the error label when it wants to free one of the fields
of the structure that txq_data points to, it checks again whether
txq_data is invalid.
This check is unnecessary since it knows for sure that txq_data is
valid.

Remove the aforementioned needless check.

Fixes: 6449068818 ("net/mlx5: add free on completion queue")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:24 +02:00
Michael Baum
50181d9965 net/mlx5: fix socket close
The mlx5_pmd_socket_handle function calls the accept function that
returns the socket descriptor into the conn_sock variable. The socket
descriptor value can be 0 (according to accept API) or positive and so
immediately after calling the function it checks whether conn_sock < 0.
Later in the function when other things fail it jumps to the error label
and release previously allocated resources (such as socket or file).

During the resource release, it checks whether the variable conn_sock
containing the socket descriptor is positive and if it is, it releases
it. However, in this check it misses the case where conn_sock == 0, in
this case the socket will not be released and there will be a Resource
leak.

Extend the close condition for 0 value too.

Fixes: e6cdc54cc0 ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:23 +02:00
Michael Baum
a943102fc6 net/mlx5: remove unnecessary init in socket creation
In the mlx5_pmd_socket_handle function it calls the recvmsg function
which returns the number of bytes read. The function assigns this return
value into a ret variable defined at the beginning of the function.
Similarly in the mlx5_pmd_socket_init function the it calls the socket
function which returns a file descriptor for the new socket. The
function also assigns this return value into a ret variable defined at
the beginning of the function.

In both functions they initialize the variable when defining it,
however, in both cases they do not use any ret variable before assigning
the return value from the function, so the initialization is
unnecessary.

Clean the aforementioned unnecessary initializations.

Fixes: e6cdc54cc0 ("net/mlx5: add socket server for external tools")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:23 +02:00
Michael Baum
ebed623f62 net/mlx5: fix hairpin Rx queue creation error path
The mlx5_rxq_obj_hairpin_new function defines a pointer named tmpl and
allocates memory for it using the rte_zmalloc_socket function.
Later, this function allocates memory to a variable inside tmpl using
the mlx5_devx_cmd_create_rq function.

In both cases, if the allocation fails, the code jumps to the error
label and frees allocated resources. However, in the first jump there
are still no resources to free and the jump only for the line return
NULL is unnecessary. Even worse, when it jumps to error label with
invalid tmpl it actually does dereference to a null pointer.
In contrast, the second jump needs to free the tmpl variable but the
function instead of freeing, tries to free the variable that it just
failed to allocate.
In addition, for another error, the function returns NULL without
freeing the tmpl variable before, causing a memory leak.

Delete the error label and replace each jump with local return NULL and
free tmpl variable if needed.

Fixes: e79c9be915 ("net/mlx5: support Rx hairpin queues")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:23 +02:00
Michael Baum
7e6eba619d net/mlx5: fix hairpin Tx queue creation error path
The mlx5_txq_obj_hairpin_new function defines a pointer named tmpl and
allocates memory for it using the rte_zmalloc_socket function.
Later, this function allocates memory to a variable inside tmpl using
the mlx5_devx_cmd_create_sq function.

In both cases, if the allocation fails, the code jumps to the error
label and frees allocated resources. However, in the first jump there
are still no resources to free and the jump only for the line return
NULL is unnecessary. Even worse, when it jumps to error label with
invalid tmpl it actually does dereference to a null pointer.
In contrast, the second jump needs to free the tmpl variable but the
function instead of freeing, tries to free the variable that it just
failed to allocate, and another variable that has never been allocated.
In addition, for another error, the function returns NULL without
freeing the tmpl variable before, causing a memory leak.

Delete the error label and replace each jump with local return NULL and
free tmpl variable if needed.

Fixes: ae18a1ae96 ("net/mlx5: support Tx hairpin queues")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-06-02 16:06:23 +02:00
Haiyue Wang
f1f8872a79 net/ice: fix PCI DSN to lowercase
The PCI DSN (device serial number) to format package file name should be
lowercase values.

Fixes: d1c91179e9 ("net/ice: check DSN package file firstly")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-06-02 12:46:44 +02:00
Yunjian Wang
df2123474d net/bnxt: fix missed unlock
Coverity issue: 357741
Fixes: 02a95625fe ("net/bnxt: add flow stats in extended stats")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-28 17:57:07 +02:00
Mike Baucom
2e449a26e7 net/bnxt: fix mark action if rule is at index zero
In the ingress path, the cfa_code field in Rx completion identifies the
CFA action rule that was used for the incoming packet. It is possible
that the packet could hit the rule at index 0 in the table.
The mark action code was too restrictive by disallowing a cfa_code of
zero.
This code loosens the requirement and allows zero.

Fixes: b87abb2e55 ("net/bnxt: support marking packet")
Cc: stable@dpdk.org

Signed-off-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-28 17:57:07 +02:00
Jeff Guo
1051b8db94 net/iavf: fix flow uninit
When closing VF device, the process of shutdown adminq should be after
the process of uninit the flow, since the VF might still need to use the
adminq to uninit flow.

Fixes: 9e03acd726 ("net/iavf: fix flow access")
Fixes: ff2d0c345c ("net/iavf: support generic flow API")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
3c9be81be9 net/netvsc: do not spin forever waiting for reply
Because of bugs in driver or host a reply to a request might
never occur. Better to give an error than spin forever.

Fixes: 4e9c73e96e ("net/netvsc: add Hyper-V network device")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
501a7e5735 net/netvsc: process link change messages in alarm
The original code would deadlock itself if a link change event
happened with link state interrupt enabled. The problem is that
the link state changed message would be seen while reading
the host to guest ring (under lock) and then the driver would
send a query to the host to see the new link state. The response
would never be seen (stuck in a while loop) waiting for the
response.

The solution is to use the link change indication to trigger
a DPDK alarm. The alarm will happen in a different thread and
in that context it can send request for new link state and
also do interrupt callback. This is similar to how the bonding
driver is handling the same thing.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
a4f53bec7c net/netvsc: do not query VF link state
When the primary device link state is queried, there is no
need to query the VF state as well. The application only sees
the state of the synthetic device.

Fixes: dc7680e859 ("net/netvsc: support integrated VF")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
c6854a4126 net/netvsc: fix warning when VF is removed
The code to unset owner of VF device was changing port to invalid
value before calling unset.

Fixes: 4a9efcddad ("net/netvsc: fix VF support with secondary process")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
b757deb8e3 net/netvsc: change datapath logging
The PMD_TX_LOG and PMD_RX_LOG can hide errors since this
debug log is typically disabled. Change the code to use
PMD_DRV_LOG for errors.

Under load, the ring buffer to the host can fill.
Add some statistics to estimate the impact and see other errors.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
a41ef8eefe net/netvsc: implement descriptor status
These functions are useful for applications and debugging.
The netvsc PMD also transparently handles the rx/tx descriptor
functions for underlying VF device.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Stephen Hemminger
c7b82b14e3 net/netvsc: support per-queue info requests
There is not a lot of info here from this driver.
But worth supporting these additional info queries.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2020-05-28 17:57:07 +02:00
Ajit Khaparde
83b4bf39ec net/bnxt: fix crash during close
We are freeing flow_stats a little early. This results in a
segfault when the driver accesses the members during cleanup.
Move the call to bnxt_free_flow_stats_info() to prevent this.

Fixes: 02a95625fe ("net/bnxt: add flow stats in extended stats")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2020-05-28 17:57:07 +02:00
Rahul Gupta
bfc1d45875 net/bnxt: fix performance for Arm
Eliminate unnecessary rte_smp_wmb() before writing to request/completion
doorbells. Use rte_cio_wmb() memory barrier instead of rte_io_wmb()
before writing to tx/rx request queue doorbells and use
rte_compiler_barrier() before writing to tx/rx completion queue
doorbells.

Fixes: 4af9d0c729 ("net/bnxt: cleanup NQ doorbell")
Fixes: f8168ca0e6 ("net/bnxt: support thor controller")
Cc: stable@dpdk.org

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2020-05-28 17:57:07 +02:00
Kalesh AP
0466d286cd net/bnxt: fix setting link speed
bnxt PMD uses the macro BNXT_SUPPORTED_SPEEDS to validate
the user requested speed. But this has all the speed values
supported by the PMD and is not chip specific.

The check against this macro returns success when the user
tries set the speed to 100G on a port even if the chip does
not support 100G speed.

Fixed it to use bnxt_get_speed_capabilities() to check the
supported speeds by the chip.

Fixes: 1d0704f4d7 ("net/bnxt: add device configure operation")
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-28 17:57:07 +02:00
Lijun Ou
40783b1280 net/hns3: fix key length when configuring RSS
When users set the length of RSS hash key greater than the supported
length by hardware, the driver should intercept and can not configure
the wrong key into the hardware.

Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-28 17:57:07 +02:00
Lijun Ou
fdae939696 net/hns3: add RSS hash offload to Rx configuration
Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf:#️⃣:rss`. The hns3 PMD driver
already can notify the validity of `rte_mbuf:#️⃣rss` to the
application by enabling `PKT_RX_RSS_HASH` flag in `rte_mbuf::ol_flags`.

Fixes: 19a3ca4c99 ("net/hns3: add start/stop and configure operations")
Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-28 17:57:07 +02:00
Wei Hu (Xavier)
16c374402f net/hns3: fix Tx less than 60 bytes
Currently, when running testpmd application based on hns3 network engine
with csum fwd mode by "set fwd csum" command in the prompt line, sending
42 consecutive bytes of ARP packets to network port with packets
generator. But in fact hardware can't send the ARP packets and the
related logs as below:
"Preparing packet burst to failed: Invalid argument"

The hardware doesn't support transmit packets less than 60 bytes, and in
the '.tx_pkt_burst' ops implementation function named hns3_xmit_pkts
appending operation has been added for less than 60 bytes packets. So
the interception needs to be removed in the '.tx_pkt_prepare' ops
implementation function named hns3_prep_pkts.

Fixes: de620754a1 ("net/hns3: fix sending packets less than 60 bytes")
Fixes: bba6366983 ("net/hns3: support Rx/Tx and related operations")
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: Chengchang Tang <tangchengchang@huawei.com>
2020-05-28 17:57:07 +02:00
Chengchang Tang
3f28ec4a88 net/hns3: clear promiscuous on PF uninit
Currently, promiscuous mode configuration are not cleared during
uninstallation based on hns3 PF device. The residual entries may cause
unnecessary bandwidth usage.

So, we need clear the PF's promisc mode status during the uninit.

Fixes: a45fd0aa0e ("net/hns3: fix Rx queue search with broadcast packet")
Fixes: d51867db65 ("net/hns3: add initialization")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-28 17:57:07 +02:00
Chengchang Tang
e7eb703f8b net/hns3: replace special vport ids with macros
In hns3 PMD driver, the vport id 0 denote PF, and the vport id 1 denote
the first VF device of the port.

This patch adds two macros named HNS3_PF_FUNC_ID and
HNS3_1ST_VF_FUNC_ID, and replaces this two numbers to improve code
readability.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
2020-05-28 17:57:07 +02:00
Jeff Guo
c9da9d4183 net/iavf: fix RSS protocol field selector
When VFs configure the rss rule by virtchnl, it need to set bit mask
into the field selector for the protocol, then PF got the configure
massage and parse the field selector to the corresponding protocol
field.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhiwei He <zhiwei.he@intel.com>
2020-05-28 17:57:07 +02:00
Wei Zhao
59d3870c7f net/ice: fix switch action number check
The action number for switch filter should be 1, any
other such as 0 or more than 1 is invalid.

Fixes: 3428c6b6ec ("net/ice: add action number check for switch")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-28 17:57:07 +02:00
Guinan Sun
dd8384a4f5 net/ixgbe: check driver type in MACsec API
The driver type need to be checked in private API.

Fixes: 50556c8810 ("net/ixgbe: fix MACsec setting")
Cc: stable@dpdk.org

Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2020-05-22 18:02:52 +02:00
Wei Zhao
be4ef2e0d0 net/i40e: fix flow director enabling
When we flush flow FDIR, all queues are disabled for FDIR.
If FDIR rule is created again, then the flow list is empty,
as it is the first time to create rule after flush fdir filter,
so we need to enable FDIR for all queues.
And also, disable FDIR for queues should be done in function
i40e_flow_flush_fdir_filter().

Fixes: 1491f63c75 ("net/i40e: fix flush of flow director filter")
Fixes: 6ae9b2b5e8 ("net/i40e: cache flow director enable value in Rx queue")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
2020-05-22 17:10:15 +02:00
Jeff Guo
9e03acd726 net/iavf: fix flow access
Add invalid flow checking func in iavf generic flow to avoid the error
of "Cannot access memory at address 0xXXXXXX" occur.

When hash init, the default RSS rules would be added, while hash uninit,
the default RSS rules should be deleted. Add the missing part in the
hash uninit process.

Fixes: 5ea6142543 ("net/iavf: fix VF reset for RSS")
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>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2020-05-22 17:10:15 +02:00
Jeff Guo
c9047db4af net/ice: fix setting L2TAG
Base on HW, if a packet is split into multiple segments, the L2TAG
should only be valid on the last Rx descriptor. So fix it by setting
L2TAG into mbuf when processing the last split packet.

Fixes: c68a52b8b3 ("net/ice: support vector SSE in Rx")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-22 17:10:15 +02:00
Jeff Guo
2482a99f30 net/iavf: fix setting L2TAG
Base on HW, if a packet is split into multiple segments, the L2TAG
should only be valid on the last Rx descriptor. So fix it by setting
L2TAG into mbuf when processing the last split packet.

Fixes: 319c421f38 ("net/avf: enable SSE Rx Tx")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-22 17:10:15 +02:00
Jeff Guo
61b26a9c5a net/i40e: fix setting L2TAG
Base on HW, if a packet is split into multiple segments, the L2TAG
should only be valid on the last Rx descriptor. So fix it by setting
L2TAG into mbuf when processing the last split packet.

Fixes: ca74903b75 ("net/i40e: extract non-x86 specific code from vector driver")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2020-05-22 17:10:15 +02:00
Dekel Peled
b0447b5470 net/mlx5: revert DevX preference for Rx objects
Recent patch exposed a minor performance issue,
so it is reverted.

Fixes: d237d22fbe ("net/mlx5: prefer DevX API to create Rx objects")

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
2020-05-21 17:59:29 +02:00
Igor Romanov
977424c2cc net/sfc/base: fix manual filter delete in EF10
When user requests a filter deletion only filter with
manual priority must be deleted. When an automatic filter has
the same specification, it must be skipped.

Fixes: 585c22edb2 ("net/sfc/base: handle manual and auto filter clashes in EF10")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
2020-05-21 17:38:12 +02:00
Xiaoyun Wang
c6f9f0b7d4 net/hinic: fix TSO
When TSO MSS is smaller than 80, and the sum length of continuous
sge num is larger than a MSS, which may cause hardware failed,
so in this scenarios pmd driver should adjust the tso_segsz with
the same with the value of hardware supported.

Fixes: 076221c8fe ("net/hinic: add Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
2020-05-21 17:12:27 +02:00
Ankur Dwivedi
357439ad09 net/octeontx2: fix buffer size assignment
The elt_size field in mempool holds the size of one packet buffer.
It can be used to set the lpm_sizem1 field in rq context.

The lpb_sizem1 field in rq context is 12 bit, direct assignment
to it was causing overflow of value. Because of this errors
were observed while trying inline inbound with large packets.
This patch resolves the errors.

Fixes: 094fc8a3a1 ("net/octeontx2: add Rx queue setup and release")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2020-05-21 15:53:14 +02:00
Rahul Gupta
20cb28a0ec net/bnxt: fix Rx ring producer index
When a queue is started after deferred_start, then increment raw_prod
irrespective of new mbuf is allocated or old mbufs are used.

Fixes: d256c73c11 ("net/bnxt: fix memory leak during queue restart")
Cc: stable@dpdk.org

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
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-21 15:53:14 +02:00
Leyi Rong
514d1c989d net/iavf: fix flow director after queue reconfigured
FDIR ID parsing will not be handled correctly after queue reconfigured,
enable FDIR ID parsing per Q regardless of fdir_ref_cnt to fix it.

Fixes: f71dbf852d ("net/iavf: add flow director enabled switch value")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-21 15:53:14 +02:00
Qi Zhang
3ccf61bc1e net/ice/base: fix tunnel type match word handling
Use a common function when selecting the proper word and mask match for
a tunnel type when programming switch rules.

Store switch recipe field mask as little endian, which avoids needing to
convert back to big endian after reading recipe from FW.

Obtain word mask from FW recipe.

Fix word matching element and index pairing.

Fixes: fed0c5ca5f ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2020-05-21 15:53:14 +02:00
Thomas Monjalon
7f55a2053b net/mvpp2: fix build with gcc 10
GCC 10 is detecting the enum mismatch when assigning UDP variables
with MUSDK constants for TCP.

drivers/net/mvpp2/mrvl_flow.c:2521:47: error: implicit conversion
from 'enum mv_net_tcp_fields' to 'enum mv_net_udp_fields'
[-Werror=enum-conversion]

An assigned field is also fixed from "tcp" to "udp".

Fixes: 7235341d75 ("net/mrvl: support classifier")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Liron Himi <lironh@marvell.com>
Acked-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
2020-05-21 15:41:48 +02:00
Ferruh Yigit
0ff708ed6f bus/fslmc: drop inline from non-static functions
There is no point in having non-static (and non-extern) inline
functions.

Also this breaks the build for the ICC [1] because of the 'internal'
symbol check.

When function is 'inline' ICC is ignoring 'section' attribute and not
putting function to 'internal' section which breaks 'check-symbols.sh'
script with below error.

[1]
qbman_swp_dqrr_next is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of qbman_swp_dqrr_next
qbman_swp_enqueue_multiple is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of qbman_swp_enqueue_multiple
qbman_swp_enqueue_multiple_desc is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of qbman_swp_enqueue_multiple_desc
qbman_swp_enqueue_multiple_fd is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of qbman_swp_enqueue_multiple_fd
qbman_swp_pull is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of qbman_swp_pull
qbman_swp_release is not flagged as internal
but is listed in version map
Please add __rte_internal to the definition of qbman_swp_release

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2020-05-20 15:15:48 +02:00
Jeff Guo
5ea6142543 net/iavf: fix VF reset for RSS
Since there are some default rss configure in kernel PF/VF but not DPDK
IAVF, if these configurations be modified by VF and then VF reset, this
default rss configurations can not be reset to default by IAVF. So need
to add default rss set in IAVF hash initial process.

Fixes: 7be10c3004 ("net/iavf: add RSS configuration for VF")
Cc: stable@dpdk.org

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Tested-by: Zhiwei He <zhiwei.he@intel.com>
2020-05-19 17:12:17 +02:00
Qiming Yang
6cc330b709 net/i40e: fix queue related exception handling
There should have different behavior in queue start fail and stop fail
case.  When queue start fail, all the next actions should be terminated
and then started queues should be cleared. But for queue stop stage, one
queue stop fail should not end other queues stop. This patch fixed that
issue in PF and VF.

Fixes: b6583ee402 ("i40e: full VMDQ pools support")
Fixes: 3f6a696f10 ("i40evf: queue start and stop")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
2020-05-19 17:12:16 +02:00