Commit Graph

15021 Commits

Author SHA1 Message Date
Fei Qin
b22af30045 net/nfp: fix return path in TSO processing
When enable TSO, nfp_net_nfdk_tx_tso() fills segment information in Tx
descriptor. However, the return path for TSO is lost and the LSO related
fields of Tx descriptor is filled with zeros which prevents packets from
being sent.

This patch fixes the return path in TSO processing function to make sure
TSO works fine.

Fixes: c73dced48c ("net/nfp: add NFDk Tx")
Cc: stable@dpdk.org

Signed-off-by: Fei Qin <fei.qin@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
2022-11-22 02:59:21 +01:00
Chaoyong He
7aa745d788 net/nfp: fix Rx descriptor DMA address for VNIC
When using flower firmware application, and the ctrl vNIC receiving a
packet that is larger than the mbuf size, the Rx function will break the
receive loop and sent a free list descriptor with random DMA address.

Fix this by moving the increment of the free list descriptor counter
to after the packet size have been checked and acted on.

Fixes: a36634e87e ("net/nfp: add flower ctrl VNIC Rx/Tx")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-11-18 15:00:01 +01:00
Chaoyong He
3fd6400393 net/nfp: fix Rx descriptor DMA address for PF
When using flower firmware application, and the PF receiving a packet
that is larger than the mbuf size, the Rx function will break the
receive loop and sent a free list descriptor with random DMA address.

Fix this by moving the increment of the free list descriptor counter
to after the packet size have been checked and acted on.

Fixes: cf559c2a1d ("net/nfp: add flower PF Rx/Tx")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-11-18 15:00:01 +01:00
Chaoyong He
0c48f5ad44 net/nfp: fix Rx descriptor DMA address
When receiving a packet that is larger than the mbuf size, the Rx
function will break the receive loop and sent a free list descriptor
with random DMA address.

Fix this by moving the increment of the free list descriptor counter
to after the packet size have been checked and acted on.

Fixes: bb340f56fc ("net/nfp: fix memory leak in Rx")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-11-18 15:00:01 +01:00
Chaoyong He
860d735d32 net/nfp: fix mask table free
The free process of mask table has problem, should use
'rte_hash_free()' rather than 'rte_free()'.

Fixes: ac09376096 ("net/nfp: add structures and functions for flow offload")

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
2022-11-18 13:40:24 +01:00
Dariusz Sosnowski
8e82ebe265 net/mlx5: document E-Switch limitations with HWS
This patch adds the following limitations to the mlx5 PMD guide:

- With HW Steering and E-Switch enabled, transfer proxy port must
  be started before any port representor.
- With HW Steering and E-Switch enabled, all representors
  must be stopped before transfer proxy port is stopped.

Documentation of mlx5 PMD's implementations of
rte_eth_dev_start() and rte_eth_dev_stop() is updated accordingly:

- rte_eth_dev_start() returns (-EAGAIN) when transfer proxy port
  cannot be started.
- rte_eth_dev_stop() returns (-EBUSY) when port representor
  cannot be stopped.

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-21 23:47:33 +01:00
Dariusz Sosnowski
f359b71525 net/mlx5: fix log level of transfer proxy stop failure
This patch increases log level for error reporting when stopping
the transfer proxy port failed. Stopping can fail with EBUSY when
related representor ports are still running.

Fixes: 483181f7b6 ("net/mlx5: support device control of representor matching")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-21 23:14:26 +01:00
Michael Baum
ef4ece4dbb net/mlx5: fix port closing
The shared IB device (sh) has per port data updated in port creation.
In port closing this port data is updated even when the SH still exist.

However, this updating is happened after SH has been released and for
last port it actually accesses to freed memory.

This patch updates the port data before SH releasing.

Fixes: 13c5c09390 ("net/mlx5: fix port event cleaning order")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-20 13:07:14 +01:00
Dariusz Sosnowski
7e59e875cb net/mlx5: fix modify field action validation
This patch removes the following checks from validation
of modify field action:

- rejection of ADD operation,
- offsets should be aligned to 4 bytes.

These limitations were removed in
commit 0f4aa72b99 ("net/mlx5: support flow modify field with HWS"),
but non-HWS validation was not updated.

Notes about these limitations are removed from mlx5 PMD docs.
On top of that, the current offsetting behavior in modify field action
is clarified in the mlx5 docs.

Fixes: 0f4aa72b99 ("net/mlx5: support flow modify field with HWS")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-20 13:07:14 +01:00
Gregory Etelson
a23640047c net/mlx5: fix maximum LRO message size
The PMD analyzes each Rx queue maximal LRO size and selects one that
fits all queues to configure TIR LRO attribute.
TIR LRO attribute is number of 256 bytes chunks that match the
selected maximal LRO size.

PMD used `priv->max_lro_msg_size` for selected maximal LRO size and
number of TIR chunks.

Fixes: b9f1f4c239 ("net/mlx5: fix port initialization with small LRO")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-20 13:07:02 +01:00
Dariusz Sosnowski
28ffc4bbab net/mlx5: fix VLAN push action mask iteration
Before this patch, during translation of OF_PUSH_VLAN actions iterator
was moved forward to the position of OF_SET_VLAN_VID or
OF_SET_VLAN_PCP, but masks iterator was not updated.
As a result, the following actions were incorrectly translated,
because iterators were not aligned.

This patch fixes this behavior by properly adjusting masks iterator
alognside actions iterator.

Fixes: 773ca0e91b ("net/mlx5: support VLAN push/pop/modify with HWS")

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-20 10:04:42 +01:00
Suanming Mou
44864503a5 net/mlx5: fix GENEVE resource management
The item translation split causes GENEVE TLV option resource register
function flow_dev_geneve_tlv_option_resource_register() to be called
twice incorrectly both in spec and mask translation.

In SWS mode the refcnt will only be decreased by 1 in flow release.
The refcnt will never be 0 again, it causes the resource be leaked.
In HWS mode the resource is allocated as global, the refcnt should
not be increased after the resource be allocated. And the resource
should be released during PMD exists.

This commit fixes GENEVE resource management.

Fixes: 75a00812b1 ("net/mlx5: add hardware steering item translation")
Fixes: cd4ab74206 ("net/mlx5: split flow item matcher and value translation")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-17 15:47:55 +01:00
Michael Baum
c10643c4ab net/mlx5: fix error log in async flow destruction
The flow_hw_async_flow_destroy() function fills the error structure in
case of failure.

The error log reported by function is "fail to create rte flow" while
the correct failure is in destruction.

This patch changes the error log to report "fail to destroy rte flow".

Fixes: c40c061a02 ("net/mlx5: add basic flow queue operation")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-17 15:47:46 +01:00
Beilei Xing
8c6ef17e1f net/idpf: fix checks in multi-queue config and stop
There's core dump when launching l3fwd with 1 queue 1 core. It's
because NULL pointer is used if fail to configure device.
This patch removes incorrect check during device configuration,
and checks NULL pointer when executing VIRTCHNL2_OP_DEALLOC_VECTORS.

Fixes: 549343c25d ("net/idpf: support device initialization")
Fixes: 70675bcc3a ("net/idpf: support RSS")
Fixes: 37291a68fd ("net/idpf: support write back based on ITR expire")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-18 19:05:53 +01:00
Beilei Xing
10114eff6d net/idpf: add supported packet types
Failed to launch l3fwd, the log shows:
port 0 cannot parse packet type, please add --parse-ptype
This patch adds dev_supported_ptypes_get ops.

Fixes: 549343c25d ("net/idpf: support device initialization")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Reviewed-by: Jingjing Wu <jingjing.wu@intel.com>
2022-11-18 18:58:10 +01:00
Beilei Xing
477512896b net/idpf: fix port start
Port can't start successfully if stopping port and starting port
again.
This patch fixes port start by initialization.

Fixes: e9ff6df15b ("net/idpf: stop before closing device")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-17 13:27:27 +01:00
Olivier Matz
21e471abb5 net/ixgbevf: fix promiscuous and allmulti
The configuration of allmulti and promiscuous modes conflicts
together. For instance, if we enable promiscuous mode, then enable and
disable allmulti, then the promiscuous mode is wrongly disabled.

Fix this behavior by:
- doing nothing when we set/unset allmulti if promiscuous mode is on
- restorting the proper mode (none or allmulti) when we disable
  promiscuous mode

Fixes: 1f4564ed76 ("net/ixgbevf: enable promiscuous mode")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2022-11-17 13:23:30 +01:00
Zhichao Zeng
1408993082 net/iavf: support VXLAN-GPE tunnel offload
Add support for Vxlan-GPE tunnel packet checksum offloading by adding
the VXLAN_GPE flag during processing of Tx context descriptor.

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Tested-by: Ke Xu <ke1.xu@intel.com>
2022-11-17 13:04:42 +01:00
David Marchand
a63553111a net/ice: fix build with clang 15
This variable is not used.

Fixes: 0d8d7bd720 ("net/ice: support DDP dump switch rule binary")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2022-11-21 11:19:21 +01:00
David Marchand
d9298902d8 net/dpaa2: fix build with clang 15
This variable is not used.

Fixes: 4690a6114f ("net/dpaa2: enable error queues optionally")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2022-11-21 11:19:16 +01:00
David Marchand
f25fa03ad1 net/atlantic: fix build with clang 15
This variable is not used.

Fixes: 2b1472d715 ("net/atlantic: implement Tx path")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
2022-11-21 11:19:14 +01:00
Luca Boccassi
bdab530919 drivers: fix typos found by Lintian
Signed-off-by: Luca Boccassi <bluca@debian.org>
2022-11-15 17:17:14 +01:00
Beilei Xing
e9ff6df15b net/idpf: stop before closing device
This patch stops device at the beginning of idpf_dev_close.

Fixes: 14aa6ed8f2 ("net/idpf: support device start and stop")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-15 15:05:24 +01:00
Stephen Hemminger
742d8aaa81 drivers/net: remove unnecessary null checks
The function rte_free() already handles NULL argument;
therefore the checks in this code are unnecessary.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-11-15 15:04:22 +01:00
David Marchand
1094dd940e cleanup compat header inclusions
With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including it where unneeded, while others rely on
implicit inclusion.

Fix unneeded inclusions:
$ git grep -l include..rte_compat.h |
  xargs grep -LE '__rte_(internal|experimental)' |
  xargs sed -i -e '/#include..rte_compat.h/d'

Fix missing inclusion, by inserting rte_compat.h before the first
inclusion of a DPDK header:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#include..\(rte_\|.*pmd.h.$\)/{
      s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
    }'

Fix missing inclusion, by inserting rte_compat.h after the last
inclusion of a non DPDK header:
$ for file in $(git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h); do
    tac $file > $file.$$
    sed -i -e \
      '0,/#include../{
        s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
      }' $file.$$
    tac $file.$$ > $file
    rm $file.$$
  done

Fix missing inclusion, by inserting rte_compat.h after the header guard:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#define/{
      s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
    }'

And finally, exclude rte_compat.h itself.
$ git checkout lib/eal/include/rte_compat.h

At the end of all this, we have a clean tree:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h
buildtools/check-symbols.sh
devtools/checkpatches.sh
doc/guides/contributing/abi_policy.rst
doc/guides/rel_notes/release_20_11.rst
lib/eal/include/rte_compat.h

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-11-15 08:39:14 +01:00
Pavan Nikhilesh
9b70a944b4 event/cnxk: fix mbuf offset calculation
Fix incorrect mbuf offset calculation when HEADROOM exceeds 128B
while processing event vectors.

Fixes: 7fbbc981d5 ("event/cnxk: support vectorized Rx event fast path")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-11-07 12:50:51 +01:00
Frank Du
63bd264485 net/ice: fix interrupt handler unregister
rte_intr_callback_unregister may fail when irq cb is in handling,
use sync version to make sure unregister successfully.

Fixes: cf911d90e3 ("net/ice: support link update")
Cc: stable@dpdk.org

Signed-off-by: Frank Du <frank.du@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-14 19:29:02 +01:00
Yiding Zhou
d048a0aaae net/iavf: revert VLAN insertion fix
The vector Tx path does not support VLAN insertion via the L2TAG2 field,
but the scalar path supports. The earlier commit was to force to select
scalar path as soon as kernel driver requests to use L2TAG2. That logic is
incorrect. Because other case like VLAN offloading not required but scalar
path selected would have a significant performance drop.

Therefore the following commit was reverted accordingly.

commit 0d58caa7d6 ("net/iavf: fix VLAN insertion")

After reverting this commit, the AVX512 Tx path would insert the VLAN tag
into the wrong location(inner of QinQ) when the kernel driver requested
L2TAG2. This is inconsistent with the behavior of PF(outer of QinQ).

It is currently known that ice kernel drivers newer than 1.8.9 will request
the use of L2TAG2. User can set parameter '--force-max-simd-bitwidth' to
64/128/256 to avoid this issue.

Fixes: 0d58caa7d6 ("net/iavf: fix VLAN insertion")
Cc: stable@dpdk.org

Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-14 10:01:42 +01:00
Mingjin Ye
688cb2f2c6 net/ice: fix scalar Tx path segment
The scalar Tx path would send empty buffer that causes the Tx queue to
overflow.

This patch adds the last buffer length judgment in tx_prepare to fix this
issue, rte_errno will be set to EINVAL and returned if the last buffer is
empty.

Fixes: 17c7d0f9d6 ("net/ice: support basic Rx/Tx")
Fixes: ccf33dccf7 ("net/ice: check illegal packet sizes")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-11 18:17:06 +01:00
Kaiwen Deng
51097d9d77 net/ixgbe: fix drop queue index
The drop queue index was not set when adding internal Flow
Director Configuration copy in ixgbe device private data.
Therefore dropped packets would be received by queue 0
which is set to drop queue.

This commit sets drop queue index as IXGBE_FDIR_DROP_QUEUE
to fix this issue.

Fixes: 5007ac1318 ("ethdev: remove deprecated Flow Director configuration")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-11 18:06:10 +01:00
Mingjin Ye
90ba444205 net/ice: fix scalar Rx path segment
CRC is stripped by the hardware in the scattered Rx path. The last buffer
is invalid if it's packet length is zero.

This patch adds a judgment for the last buffer length to fix this issue,
it would free the mbuf associated to the last one if the last buffer is
empty.

Fixes: 6eac0b7fde ("net/ice: support advance Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-11 14:06:54 +01:00
Steve Yang
b125c0e721 net/iavf: fix tainted scalar
tainted_data_downcast: Downcasting match_item->meta from void * to
struct virtchnl_proto_hdrs implies that the data that this pointer points
to is tainted.

var_assign_var: Assigning: proto_hdrs = match_item->meta.
Both are now tainted.

var_assign_var: Assigning: rss_meta->proto_hdrs = *proto_hdrs. Both are
now tainted.

Passing tainted expression "rss_meta->proto_hdrs.count" to
"iavf_refine_proto_hdrs", which uses it as a loop boundary.

Removed temporary variable 'proto_hdrs', and copied whole memory of
match_item meta with exact structure size to avoid data downcast.

Coverity issue: 381131
Fixes: 91f27b2e39 ("net/iavf: refactor RSS")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-10 19:13:21 +01:00
Jie Wang
719469f13b net/i40e: fix jumbo frame Rx with X722
For NIC I40E_10G-10G_BASE_T_X722, when the port is configured with
link speed, it cannot receive jumbo frame packets.

Because it set maximum frame size failed when starts the port that
the port link status is still down.

This patch fix the error that starts the port will force set maximum
frame size.

Fixes: 2184f7cdee ("net/i40e: fix max frame size config at port level")
Cc: stable@dpdk.org

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Tested-by: Dukai Yuan <dukaix.yuan@intel.com>
2022-11-10 18:57:43 +01:00
Beilei Xing
d9e46239ee net/idpf: fix memory leak in Tx queue release
This patch fixes memory leak during Tx split queue release.

Fixes: 19b58dba9d ("net/idpf: support queue release")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2022-11-09 16:34:43 +01:00
Beilei Xing
ef47d95e90 net/idpf: fix TSO
This patch fixes TSO by adding Tx checksum offload.

Fixes: ed5b21acc6 ("net/idpf: support Tx offloading")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
2022-11-09 16:33:27 +01:00
Mingjin Ye
b95179d139 net/i40e: fix pctype configuration for X722
To make X722's PCTYPE is compatible with X710, the PCTYPE in the
FD programming descriptor is translated into different types by using
GLQF_FD_PCTYPE table. But the types of 'UNICAST_IPV4_UDP'
and 'MULTICAST_IPV4_UDP' are only supported for X722, so that
the corresponding registers can not be configured after translation.

This patch removes the transition before the FD filter is programmed.

Fixes: ef4c16fd91 ("net/i40e: refactor RSS flow")
Cc: stable@dpdk.org

Signed-off-by: Mingjin Ye <mingjinx.ye@intel.com>
Tested-by: Lingli Chen <linglix.chen@intel.com>
2022-11-09 11:38:40 +01:00
Wenzhuo Lu
5cbfb386aa net/iavf: fix VLAN offload
HW VLAN offload cannot be enabled because the HW capability flags
are not set correctly.

Fixes: eff56a7b9f ("net/iavf: add offload path for Rx AVX512")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-09 11:10:59 +01:00
Yiding Zhou
43d30256b2 net/ice/base: fix duplicate flow rules
When a vsi that already exists in the created vsi_list subscribes to the
same filter again, the return value ICE_SUCCESS results in duplicate flow
rules to be stored, which will cause 'flush' and 'destroy' errors.

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

Signed-off-by: Yiding Zhou <yidingx.zhou@intel.com>
Tested-by: Ke Xu <ke1.xu@intel.com>
2022-11-09 11:10:59 +01:00
Steve Yang
0f044b6681 net/iavf: fix refine protocol header
Protocol header count should be changed when tunnel level is larger than 1.

Fixes: 0b241667cc ("net/iavf: fix tainted scalar")
Cc: stable@dpdk.org

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-11-09 11:10:59 +01:00
Zhichao Zeng
0c550022fb net/iavf: fix Tx descriptors for IPsec
This patch fixes the building of context and data descriptor
on the scalar path for IPSec.

Fixes: f7c8c36fde ("net/iavf: enable inner and outer Tx checksum offload")

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Tested-by: Ke Xu <ke1.xu@intel.com>
2022-11-09 11:10:59 +01:00
Beilei Xing
646c16a26e net/idpf: fix build on CentOS 7
There's build error with clang 3.4.2 in CentOS 7:

drivers/net/idpf/idpf_vchnl.c:141:13: error: comparison of constant
522 with expression of type 'enum virtchnl_ops' is always false
[-Werror,-Wtautological-constant-out-of-range-compare]

Fixes: 549343c25d ("net/idpf: support device initialization")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Tested-by: Ali Alnubani <alialnu@nvidia.com>
2022-11-09 11:10:59 +01:00
Shun Hao
e2b05b22ec net/mlx5: fix drop action validation
Currently there's limitation for Drop action that can only co-exist with
Count action.

Sample and Age actions are also able to exist with Drop within the same
flow, and this patch includes them in the Drop action validation.

Fixes: 70faf9ae0a ("net/mlx5: unify validation of drop action")
Cc: stable@dpdk.org

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:56 +01:00
Rongwei Liu
f64a79464c net/mlx5: fix marks on Rx packets
If HW Steering is enabled, Rx queues were configured to receive MARKs
when a table with MARK actions was created. After stopping the port,
Rx queue configuration is released, but during starting the port
the mark flag was not updated in the Rx queue configuration.

This patch introduces a reference count on the MARK action and it
increases/decreases per template_table create/destroy.

When the port is stopped, Rx queue configuration is not cleared if
reference count is not zero.

Fixes: 3a2f674b6a ("net/mlx5: add queue and RSS HW steering action")
Cc: stable@dpdk.org

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:56 +01:00
Michael Baum
13c5c09390 net/mlx5: fix port event cleaning order
The shared IB device (sh) has per port data with filed for interrupt
handler port_id. It used by shared interrupt handler to find the
corresponding rte_eth device by IB port index.
If value is equal or greater RTE_MAX_ETHPORTS it means there is no
subhandler installed for specified IB port index.

When a few ports are created under same sh, the sh is created with the
first port and the interrupt handler port_id is initialized to
RTE_MAX_ETHPORTS for each port.
In port creation, the interrupt handler port_id is updated with the
correct value. Since this updating, the mlx5_dev_interrupt_nl_cb
function uses this port and its priv structure.
However, when the ports are closed, this filed isn't updated and the
interrupt handler continue working until it is uninstalled in SH
destruction.
If mlx5_dev_interrupt_nl_cb is called between port closing and SH
destruction, it uses invalid port causing a crash.

This patch adds interrupt handler port_id updating to the close function
and add memory barrier to make sure it is done before priv reset.

Fixes: 655c3c26c1 ("net/mlx5: fix initial link status detection")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:56 +01:00
Gregory Etelson
b9f1f4c239 net/mlx5: fix port initialization with small LRO
If application provided maximal LRO size was less than expected PMD
minimum, the PMD either crashed with assert, if asserts were enabled,
or proceeded with port initialization to set port private maximal
LRO size below supported minimum.

The patch terminates port start if LRO size
does not match PMD requirements and TCP LRO offload was requested
at least for one Rx queue.

Fixes: 50c00baff7 ("net/mlx5: limit LRO size to maximum Rx packet")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:55 +01:00
Alexander Kozyrev
7869d60380 net/mlx5: fix indexed pool local cache crash
Local cache for an indexed pool is not initialized in the situation when
all the indices are allocated on one CPU core and freed on another one.
That leads to a crash once we try to check its reference counter.
Check that the local cache is initialized before accessing this counter.

Fixes: d15c0946be ("net/mlx5: add indexed pool local cache")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-10 18:15:55 +01:00
Erez Shitrit
73be9af44e net/mlx5/hws: fix disconnecting matcher
This patch fixes the matcher disconnection handling, by removing the RTC
references from flow table if the currently removed matcher was the last
one for the given table. As a result RTC in this matcher can be
correctly freed, since there are no dangling references to the RTC.

Fixes: c467608215 ("net/mlx5/hws: add matcher object")

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:55 +01:00
Erez Shitrit
0189565118 net/mlx5/hws: fix order of destroying default tables
This patch fixes the order dereferencing default FDB miss table and
destroying the flow table object. Flow table should be destroyed
before the dereference.

Fixes: 394cc7ba40 ("net/mlx5/hws: add table object")

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:54 +01:00
Viacheslav Ovsiienko
d4444de895 net/mlx5/hws: fix timestamp format on Tx queue creation
The NIC since 6DX supports multiple timestamp formats
in CQEs configured via firmware. If real time timestamp
format has been configured the correct attributes should
be specified on queue creation via DevX. These attributes
setting was missed on steering queue creation and hardware
steering initialization failed.

Fixes: 3eb748869d ("net/mlx5/hws: add send layer")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-11-10 18:15:54 +01:00
Shun Hao
afb98009a0 net/mlx5: fix assert when creating meter policy
When creating meter policy rules, it's possible to use flow items
translation to add src port match criteria. Currently the items
translation process needs to get thread workspace to store vport
metadata tag, but in policy creation, the thread workspace was not
initialized so it will cause assert failure.

This patch adds initialization of thread-local workspace when creating
meter policy rules to avoid that assert.

Fixes: e9de8f33ca ("net/mlx5: fix source port checking in sample flow rule")
CC: stable@dpdk.org

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-11-10 18:15:53 +01:00