Commit Graph

31267 Commits

Author SHA1 Message Date
Nipun Gupta
88bde3f423 bus/fslmc: use DMB OSHST for synchronization before I/O
Outer Shareable Store (oshst) is sufficient for Data Memory
Barrier (dmb) when doing IO on the interface via QBMAN.

This will sync L3/DDR with the L1/L2 cached data.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-01-20 16:24:08 +01:00
Nipun Gupta
f48cd6c6cb bus/fslmc: update management complex FW to 10.29
update MC firmware library version to 10.29

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-01-20 16:24:08 +01:00
Rahul Lakkireddy
19cafed99a net/cxgbe: fix dangling pointer by mailbox access rework
Rework mailbox access serialization to dynamically allocate and
free mbox entry. Also remove unnecessary temp memory and macros.

Observed with: gcc-12.0 (GCC) 12.0.1 20220118 (experimental)

In file included from ../lib/eal/linux/include/rte_os.h:14,
                 from ../lib/eal/include/rte_common.h:28,
                 from ../lib/eal/include/rte_log.h:25,
                 from ../lib/ethdev/rte_ethdev.h:164,
                 from ../lib/ethdev/ethdev_driver.h:18,
                 from ../drivers/net/cxgbe/base/t4vf_hw.c:6:
In function ‘t4_os_atomic_add_tail’,
    inlined from ‘t4vf_wr_mbox_core’ at
	../drivers/net/cxgbe/base/t4vf_hw.c:115:2:
../drivers/net/cxgbe/base/adapter.h:742:9:
      warning: storing the address of local variable ‘entry’ in
      ‘((struct mbox_list *)adapter)[96].tqh_last’ [-Wdangling-pointer=]
  742 |         TAILQ_INSERT_TAIL(head, entry, next);
      |         ^~~~~~~~~~~~~~~~~
../drivers/net/cxgbe/base/t4vf_hw.c: In function ‘t4vf_wr_mbox_core’:
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘entry’ declared here
   86 |         struct mbox_entry entry;
      |                           ^~~~~
../drivers/net/cxgbe/base/t4vf_hw.c:86:27: note: ‘adapter’ declared here

Fixes: 3bd122eef2 ("cxgbe/base: add hardware API for Chelsio T5 series adapters")
Cc: stable@dpdk.org

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
2022-01-20 12:23:24 +01:00
Dmitry Kozlyuk
13b196425c app/testpmd: fix external buffer allocation
External pinned buffer memory (--mp-alloc=xbuf)
was allocated as multiple IOVA-contiguous memzones
of 2M size and 2M alignment.
Due to the malloc overhead and the alignment requirement,
each 2M memzone consumed 4M of hugepage memory:
2M of usable memory + X of malloc overhead + (2M-X) padding.
The allocation often failed with 2M hugepages and IOVA-as-PA
if a PA-contiguous span of 2 hugepages could not be found.
Also, with any hugepage size and IOVA mode
memory consumption was almost 2x of the usable amount.

Alignment requirement of 2M for external buffers is redundant.
It was an attempt to ensure IOVA-contiguity
by forcing memzones to start at hugepage boundaries,
while 2M size intended to leave no unused space on the page.
As shown above, this in fact caused excessive memory consumption
and decreased the chance of a successful allocation.
RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.

Remove the alignment requirement.
Reduce the memzone size by the malloc overhead size (4 cache lines),
so that memory consumption for each memzone is
(2M-X) of usable memory + X of malloc overhead = 2M.
This also means that whenever there are free 2M hugepages,
an IOVA-contiguous memzone can always be allocated.

Fixes: 72512e1897 ("app/testpmd: add mempool with external data buffers")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-01-18 14:22:15 +01:00
Sean Morrissey
f924a8d3bb app/testpmd: fix dereference before null check
Assign 'left' variable only after null check on 'size'
as function returns if 'size' is null.

Coverity issue: 374381
Fixes: 169a9fed1f ("app/testpmd: fix hex string parser support for flow API")
Cc: stable@dpdk.org

Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-18 14:02:48 +01:00
Yunjian Wang
cc5097b1e4 net/bonding: fix mode type mismatch
There were some type-mismatch issues in bonding and fix them:
- Use %u to fix argument type mismatch in RTE_BOND_LOG.
- The internals->mode is of type uint8_t. But the function
  parameter 'mode' is of type int. So change the mode type
  from int to uint8_t.

Fixes: 2efb58cbab ("bond: new link bonding library")
Fixes: a45b288ef2 ("bond: support link status polling")
Fixes: 68451eb669 ("net/bonding: call through EAL on create/free")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2022-01-18 12:29:17 +01:00
Ciara Loftus
af8d89a0c6 net/af_xdp: fix build with -Wunused-function
The get_shared_umem function is only called when the kernel
flag XDP_UMEM_UNALIGNED_CHUNK_FLAG is defined. Move the
function implementation and associated helper so that it only
gets compiled when that flag is set.

Fixes: 74b46340e2 ("net/af_xdp: support shared UMEM")
Cc: stable@dpdk.org

Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-18 11:27:48 +01:00
Keith Wiles
3dcb88a0f1 net/tap: remove maintainer
I no longer have the bandwidth to support the TAP PMD, so I am
removing myself as the maintainer so as to not hold up commits.

Signed-off-by: Keith Wiles <keith.wiles@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-18 10:04:25 +01:00
Chandubabu Namburu
b0db927b5e net/axgbe: use PCI root complex device to distinguish device
"bus/pci: optimize bus scan" broke axgbe on V1000/R1000.
RV root complex pci device does not have any kernel driver assigned
so it is removed from pci scan list which is used in
"net/axgbe: add a HW quirk for register definitions".

Get root complex device id directly from pci sysfs instead of
pci scan list.

Fixes: 991e0b1dbc ("net/axgbe: add a HW quirk for register definitions")
Cc: stable@dpdk.org

Signed-off-by: Chandubabu Namburu <chandu@amd.com>
Acked-by: Selwin Sebastian <selwin.sebastian@amd.com>
2022-01-17 14:54:20 +01:00
Viacheslav Ovsiienko
9fac5ca8ed app/testpmd: fix Tx scheduling interval
The first "set txtimes" command parameter specifies the time
interval between scheduled send bursts for single queue. This
interval should be the same for all the forwarding ports.
It requires to maintain the timing related variables on per
queue basis instead of per core, as currently implemented.
This resulted in wrong burst intervals if two or more cores
were generating the scheduled traffic for two or more ports
in txonly mode.

This patch moves the timing variable to the fstream structure.
Only txonly forwarding mode with enabled send scheduling is
affected.

Fixes: 4940344dab ("app/testpmd: add Tx scheduling command")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2022-01-14 18:02:30 +01:00
Chengchang Tang
57b156540f net/bonding: fix offloading configuration
Currently, part offloadings of the bonding device will not take effect
by using dev_configure(). Because the related configuration will not be
delivered to the slave devices in this way.

The offloading capability of the bonding device is the intersection of
the capability of all slave devices. Based on this, the following
functions are added to the bonding driver:
1. If a Tx offloading is within the capability of the bonding device
   (i.e, all the slave devices support this Tx offloading), the enabling
   status of the offloading of all slave devices depends on the
   configuration of the bonding device.

2. For the Tx offloading that is not within the Tx offloading capability
   of the bonding device, the enabling status of the offloading on the
   slave devices is irrelevant to the bonding device configuration. And
   it depends on the original configuration of the slave devices.

Fixes: e8b3e1a9b1 ("net/bonding: switch to new offloading API")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-01-14 13:12:00 +01:00
Ferruh Yigit
b1cb30352d ethdev: mark old macros as deprecated
Old macros kept for backward compatibility, but this cause old macro
usage to sneak in silently.

Marking old macros as deprecated. Downside is this will cause some noise
for applications that are using old macros.

Fixes: 295968d174 ("ethdev: add namespace")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
2022-01-13 17:56:20 +01:00
Asaf Ravid
b922883be9 net/cnxk: fix promiscuous mode in multicast enable flow
When multicast promiscuous was being enabled it caused the unicast
promiscuous to be disabled. This fix resolves this by setting
NIX_RX_MODE_PROMISC when eth_dev->data->promiscuous is set, regardless.

Fixes: 325d79c00a ("net/cnxk: support all multicast")
Cc: stable@dpdk.org

Signed-off-by: Asaf Ravid <aravid@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-13 05:04:26 +01:00
Ajit Khaparde
f30622542c net/bnxt: check VF representor pointer before access
The PF or trusted VF Rx handler could invoke the VF representor's
Rx function without knowledge of the application cleaning up the
representor ports. Check if the vfr_bp pointer is valid before
accessing it.

Fixes: 6dc83230b4 ("net/bnxt: support port representor data path")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 03:07:41 +01:00
Kalesh AP
c05c22f9b8 net/bnxt: fix xstats query
Fix incorrect memset in bnxt_dev_xstats_get_op.
In bnxt_dev_xstats_get_op(), the PMD is not zeroing the whole
buffer supplied by the application. This can end up passing
junk statistics values to the application when the FW does not
support extended stats on a function.
Fixed to call memset() with correct size.

Fixes: f55e12f334 ("net/bnxt: support extended port counters")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 03:07:26 +01:00
Ajit Khaparde
79fc1c531e net/bnxt: fix crash by validating pointer
Validate the pointers in rxq before accessing them.
Otherwise it can cause a segfault.

Fixes: 657c2a7f1d ("net/bnxt: create aggregation rings when needed")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 03:00:12 +01:00
Ajit Khaparde
2ca0727917 net/bnxt: fix PAM4 mask setting
Set the PAM4 mask setting only when PAM4 signaling is enabled.
Setting it otherwise seems to result in link negotiation.
Also auto_pam4_link_speeds has been renamed to
auto_pam4_link_speed_mask to reflect its real usage.

Fixes: c23f9ded03 ("net/bnxt: support 200G PAM4 link")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:59:58 +01:00
Ajit Khaparde
54c6aad567 net/bnxt: fix ring teardown
Check for valid bit while scanning for hwrm_done completion
during ring teardown. Not checking the valid bit could cause a
ring overflow when we ring the doorbell.

Fixes: 4fb6ab3f86 ("net/bnxt: check flush status during ring free")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2022-01-12 02:59:42 +01:00
Kalesh AP
6c63f3495e net/bnxt: fix handling of VF configuration change
When there is a change in the default VLAN of the VF,
FW sends the VF_CFG_CHANGE async event to the driver.
Upon receiving this async event, driver currently only queries
the FW using HWRM_FUNC_QCFG. But this is not enough.

Driver has to clean up the existing filter and recreate filters
so the FW can apply the default VLAN to the filter.

Fixes: 12213821a8 ("net/bnxt: register for more async events")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:59:22 +01:00
Somnath Kotur
e21aca08f4 net/bnxt: refactor datapath stop for reuse
Refactor bnxt_stop_rxtx() for reuse.
By accepting rte_eth_dev as input, bnxt_stop_rxtx() can be used
in multiple scenarios such as representor devices.

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
2022-01-12 02:59:05 +01:00
Kalesh AP
bc9b2c20d2 net/bnxt: get maximum supported multicast filters count
The HWRM_FUNC_QCAPS response indicates the maximum number
of multicast filters that can be supported by this function
on the RX side.

Fixed to use this value instead of the hard coded value 16.

Fixes: d69851df12 ("net/bnxt: support multicast filter and set MAC addr")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:58:10 +01:00
Kalesh AP
59119d4952 net/bnxt: fix flow create when RSS is disabled
This patch reverts the commit "5d47d06b2c83".
Revert this commit as it caused a regression on legacy chips.
On newer chips we use TruFlow based flow creation instead of
HWRM based flow creation.

Fixes: 5d47d06b2c ("net/bnxt: modify VNIC accounting")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:57:55 +01:00
Kalesh AP
8a553bdf26 net/bnxt: add null check for mark table
During the port start, driver ignores mark table allocation failure.
This could cause a segfault due to NULL pointer dereference in
bnxt_set_mark_in_mbuf(). Fix this by checking the pointer validity
before accessing it.

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

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:57:31 +01:00
Kalesh AP
caf6c007da net/bnxt: improve recovery related log messages
Make these messages more specific.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:56:30 +01:00
Kalesh AP
de3fef20b9 net/bnxt: set fast-path pointers only if recovery succeeds
During reset recovery, fixed to set the fast-path pointers
only if recovery succeeds.

Fixes: 720b55ad27 ("net/bnxt: fix crash caused by error recovery")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:52:48 +01:00
Kalesh AP
604a6be6b6 net/bnxt: cap maximum number of unicast MAC addresses
The Maximum number of receive mac addr is hard coded to 128
in the ethdev library(RTE_ETH_NUM_RECEIVE_MAC_ADDR).
But the bnxt devices support more than 128 unicast MAC filters
which could result in a segfault while user tries to add more
than 128 unicast MAC addresses to the port.

Fixes: a2033fda22 ("net/bnxt: fix number of MAC addresses for VMDq")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:50:16 +01:00
Kalesh AP
8717548934 net/bnxt: fix restoring VLAN filtering after recovery
During port start, driver calls bnxt_vlan_offload_set_op()
to program VLAN Filter/VLAN Strip setting to the HW. This
in turns add the vlan filters.

This results in a failure when bnxt_restore_filters() invokes
bnxt_restore_vlan_filters() during the recovery as the vlans are
already programmed.

Fix to ignore the error(-EEXIST).

Fixes: 151c8240ac ("net/bnxt: restore VLAN filters during reset recovery")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:48:54 +01:00
Kalesh AP
9b4353bec3 net/bnxt: restore RSS configuration after reset recovery
During reset recovery, driver is not restoring the VNIC rss hash key.
It's generating a new random hash key which results in unexpected
RSS behavior after recovery. Fixed this by storing the VNIC RSS
configuration to a local struct and then applying the cached value
during the recovery.

Fixes: df6cd7c1f7 ("net/bnxt: handle reset notify async event from FW")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:48:14 +01:00
Kalesh AP
3e6fae2b65 net/bnxt: fix queue stop operation
When there are no active Rx queues(i.e when all queues have been
stopped), clear the RSS redirection table of the VNIC on Thor.

Fixes: 9b63c6fd70 ("net/bnxt: support Rx/Tx queue start/stop")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
2022-01-12 02:47:49 +01:00
Kalesh AP
04689bdb65 net/bnxt: fix multicast MAC restore during reset recovery
During reset recovery, driver is not restoring the multicast
mac addresses. Added code to restore them during reset recovery.

Fixes: b02f1573cd ("net/bnxt: restore MAC filters during reset recovery")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:40:01 +01:00
Kalesh AP
4dc9409e01 net/bnxt: fix multicast address set
Fix bnxt_dev_set_mc_addr_list_op.
Fix to cache the multicast mac addresses added to the port
to the driver private structure memory. Use this cached mc list
to program the FW.

This fixes an issue where multicast packets reception is
successful only if the multicast mac address of the packets
is the first one in the multicast address list of the port.

This is in preparation for another fix in the series.

Fixes: d69851df12 ("net/bnxt: support multicast filter and set MAC addr")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
2022-01-12 02:39:32 +01:00
Lance Richardson
8dcee14fbf net/bnxt: fix xstats names query overrun
When the xstats_names parameter to rte_eth_xstats_get_names()
is non-NULL and the size parameter is less than the required
number of entries, the driver must return the required size
without modifying (and over-running) the caller's xstats_names
array.

Update bnxt_dev_xstats_get_names_op() in accordance with this
requirement.

Fixes: bfb9c2260b ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2022-01-12 02:11:09 +01:00
Dmitry Kozlyuk
637582afcc net/mlx5: relax headroom assertion
A debug assertion in Single-Packet Receive Queue (SPRQ) mode
required all Rx mbufs to have a 128 byte headroom,
based on the assumption that rte_pktmbuf_init() sets it.
However, rte_pktmbuf_init() may set a smaller headroom
if the dataroom is insufficient, e.g. this is a natural case
for split buffer segments. The headroom can also be larger.
Only check the headroom size when vectored Rx routines
are used because they rely on it. Relax the assertion
to require sufficient headroom size, not an exact one.

Fixes: a0a45e8af7 ("net/mlx5: configure Rx queue for buffer split")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-01-09 13:06:38 +01:00
Dmitry Kozlyuk
be8cda4932 net/mlx5: fix GCC uninitialized variable warning
When building with -Db_sanitize=thread, GCC gives a warning:

drivers/net/mlx5/mlx5_flow_meter.c: In function ‘mlx5_flow_meter_create’:
drivers/net/mlx5/mlx5_flow_meter.c:1170:33: warning: ‘legacy_fm’ may be
    used uninitialized in this function [-Wmaybe-uninitialized]

This is a false-positive: legacy_fm is initialized and used
if and only if priv->sh->meter_aso_en is false.
Work around this by initializing legacy_fm to NULL.
Add an assertion before legacy_fm use in case the logic changes.

Fixes: 4443201863 ("net/mlx5: support meter creation with policy")
Cc: stable@dpdk.org

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-01-06 10:09:00 +01:00
Tal Shnaiderman
e50fe91ae3 net/mlx5: support imissed counter on Windows
Add support for the imissed counter using the DevX API on Windows.

imissed is queried by creating a queue counter for the port, attaching
it to all created RQs and querying the "out_of_buffer" field.

If the counter cannot be created, imissed will always report 0.

Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-01-06 10:07:59 +01:00
Gregory Etelson
985b479267 net/mlx5: fix GRE protocol type translation for Verbs
When application creates several flows to match on GRE tunnel without
explicitly specifying GRE protocol type value in flow rules, PMD will
translate that to zero mask.
RDMA-CORE cannot distinguish between different inner flow types and
produces identical matchers for each zero mask.

The patch extracts inner header type from flow rule and forces it in
GRE protocol type, if application did not specify any.

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

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-01-06 10:07:49 +01:00
Gregory Etelson
f3f1f576f4 net/mlx5: fix RSS expansion with explicit next protocol
The PMD RSS expansion scheme by default compiles flow rules for all
flow item types that may branch out from a stub supplied
by application.
For example,
ETH can lead to VLAN, IPv4 or IPv6.
IPv4 can lead to UDP, TCP, IPv4 or IPv6.

If application explicitly specified next protocol type, expansion must
use that option only and not create flows with other protocol types.

The PMD ignored explicit next protocol values in GRE and VXLAN-GPE.

The patch updates RSS expansion for GRE and VXLAN-GPE with explicit
next protocol settings.

Fixes: c7870bfe09 ("ethdev: move RSS expansion code to mlx5 driver")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-01-06 10:07:41 +01:00
Lior Margalit
0c7606b75b net/mlx5: fix assertion on flags set in packet mbuf
Fixed the assertion on the flags set in pkt->ol_flags for vectorized
MPRQ.  With vectorized MPRQ the CQs are processed before copying the
MPRQ bufs so the valid assertion is that the expected flag is set and
not that the pkt->ol_flags equlas this flag alone.

Fixes: 0f20acbf5e ("net/mlx5: implement vectorized MPRQ burst")
Cc: stable@dpdk.org

Signed-off-by: Lior Margalit <lmargalit@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-01-06 10:07:30 +01:00
Michael Baum
a1d59091a6 common/mlx5: fix missing validation in devargs parsing
The rte_kvargs_parse function parses the arguments
"key=value,key=value,..." string and return an allocated structure that
contains a key/value list.
It enables also to send a key without value and updates the values in
the following ways:
 - "key=value,key,..." - value is updated as NULL.
 - "key=value,key=,..." - value is updated as "" (empty string).

Mlx5 PMDs use this function to parse, but they don't support key without
value. They send the value as an argument to strtol function.
When strtol gets NULL as a parameter it cause a crash, when it gets ""
(empty string) it returns 0.

Adds a check that will prevent an argument in these formats, and returns
an error for it.

Fixes: 8520992403 ("common/mlx5: share memory related devargs")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-12-22 09:56:12 +01:00
Michael Baum
147f6fb42b net/mlx5: fix memory socket selection in ASO management
In ASO objects creation (WQE, CQE and MR), socket number is given as
a parameter.

The selection was wrongly socket 0 hardcoded even if the user didn't
configure memory for this socket.

This patch replaces the selection to default socket (SOCKET_ID_ANY).

Fixes: f935ed4b64 ("net/mlx5: support flow hit action for aging")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-12-22 09:56:01 +01:00
Michael Baum
8928997a13 common/mlx5: fix error handling in multi-class probe
The common drivers_probe function calls in a loop to all probe functions
for classes requested by the user. After it manages to probe them all,
it updates this on the device in the "classes_loaded" field.

If one of them fails, all those probed to it are remove using the
drivers_remove function. However, this function only releases the
classes in the "classes_loaded" field on the given device and misses the
newly probed classes.

This patch removes the condition from the release function, and ensures
that the caller function sends a more accurate parameter.

Fixes: 8a41f4decc ("common/mlx5: introduce layer for multiple class drivers")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2021-12-22 09:55:47 +01:00
Bin Zheng
c59f93d9a1 net/ixgbe: add vector Rx parameter check
Under the circumstance that `rx_tail` wrap back to zero
and the advance speed of `rx_tail` is greater than `rxrearm_start`,
`rx_tail` will catch up with `rxrearm_start` and surpass it.
This may cause some mbufs be reused by application.

So we need to make some restrictions to ensure that
 `rx_tail` will not exceed `rxrearm_start`.

e.g.

RDH: 972 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 1004 RDT: 1023 rxrearm_nb: 991 rxrearm_start: 0 rx_tail: 991
RDH: 12 RDT: 31 rxrearm_nb: 991 rxrearm_start: 32 rx_tail: 1023
RDH: 31 RDT: 63 rxrearm_nb: 960 rxrearm_start: 64 rx_tail: 0
RDH: 95 RDT: 95 rxrearm_nb: 1016 rxrearm_start: 96 rx_tail: 88
RDH: 95 RDT: 127 rxrearm_nb: 991 rxrearm_start: 128 rx_tail: 95
...
RDH: 908 RDT: 927 rxrearm_nb: 991 rxrearm_start: 928 rx_tail: 895
RDH: 940 RDT: 959 rxrearm_nb: 991 rxrearm_start: 960 rx_tail: 927
RDH: 980 RDT: 991 rxrearm_nb: 991 rxrearm_start: 992 rx_tail: 959
RDH: 991 RDT: 991 rxrearm_nb: 1026 rxrearm_start: 992 rx_tail: 994

when `rx_tail` catches up with `rxrearm_start`,
2(994 - 992) mbufs be reused by application !

Bugzilla ID: 882
Fixes: 5a3cca3424 ("net/ixgbe: fix vector Rx")
Cc: stable@dpdk.org

Signed-off-by: Bin Zheng <zhengbin.89740@bytedance.com>
Acked-by: Leyi Rong <leyi.rong@intel.com>
Reviewed-by: Haiyue Wang <haiyue.wang@intel.com>
Reviewed-by: Liang Ma <liangma@liangbit.com>
2022-01-11 01:33:24 +01:00
Radu Nicolau
ff8b8bcd2e net/iavf: fix segmentation offload condition
Apply segmentation offload when requested for non tunneled
packets e.g. IPsec transport mode.

Fixes: 1e728b0112 ("net/iavf: rework Tx path")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2022-01-10 10:47:22 +01:00
Kevin Liu
58d212e3bc net/ice: fix Tx checksum offload
The tunnel packets is missing some information after Tx forwarding.

In ice_txd_enable_offload, when set tunnel packet Tx checksum
offload enable, td_offset should be set with outer l2/l3 len instead
of inner l2/l3 len.

In ice_txd_enable_checksum, td_offset should also be set with outer
l3 len.

This patch fix the bug that the checksum engine can forward Ipv4/Ipv6
tunnel packets.

Fixes: 28f9002ab6 ("net/ice: add Tx AVX512 offload path")
Fixes: 17c7d0f9d6 ("net/ice: support basic Rx/Tx")
Cc: stable@dpdk.org

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-01-10 10:38:05 +01:00
Dapeng Yu
285f63fc6b net/ice: track DCF state of PF
When VF is reset, PF will change DCF state from ON to other state, if
flow creation, destroy, or redirect command is sent to DCF at this
time, it will fail.

This patch tracks DCF state and returns try-again error to caller when
DCF state is not ON.

Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
2022-01-02 09:31:06 +01:00
Haiyue Wang
9b8b48f43b net/iavf: remove git residue symbol
This extra symbol '+' should be added when patch was reapplied, and the
compiler treats it as unsigned type, so the code still runs well.

Fixes: 8410842505 ("net/iavf: support asynchronous virtual channel message")
Cc: stable@dpdk.org

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
2022-01-02 09:27:40 +01:00
Qi Zhang
fd5ad5638e net/ice: fix Tx checksum offload capability
Add missing capability for outer UDP Tx checksum.
Also fixed the feature list in ice_dcf.ini

Fixes: bf89db4409 ("net/ice: complete device info get in DCF")
Cc: stable@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
2022-01-02 09:25:26 +01:00
Junfeng Guo
a631c98a96 net/ice: fix pattern check for flow director parser
FDIR rules with masks are not supported in current code. Thus add
pattern check for IPv4/UDP/TCP/SCTP addr/port to terminate the FDIR
programming stage.

Fixes: 1b71ed2cdd ("net/ice: refactor flow pattern parser")
Cc: stable@dpdk.org

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-01-02 09:21:38 +01:00
Satheesh Paul
18652b0f78 net/cnxk: add devargs for configuring SDP channel mask
This patch adds support to configure channel mask which will
be used by rte flow when adding flow rules on SDP interfaces.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-12-21 11:18:53 +01:00
Satheesh Paul
f137566333 common/cnxk: support setting channel mask for SDP interfaces
ROC changes to support setting channel mask for SDP interfaces.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2021-12-21 11:18:39 +01:00