Commit Graph

1358 Commits

Author SHA1 Message Date
Vidya Sagar Velumuri
532963b807 crypto/cnxk: move IPsec SA creation to common
Move the IPsec SA creation to common.
The code can be used by fastpath also to create the SAs
Add changes to support new full context microcode

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-06-21 20:04:50 +02:00
Ankur Dwivedi
3aa16821ab common/cpt: fix build with GCC 12
The following warning is observed with GCC 12 compilation:

In function ‘fill_sg_comp_from_iov’,
    inlined from ‘cpt_zuc_snow3g_enc_prep’ at
        ../drivers/common/cpt/cpt_ucode.h:1672:9,
    inlined from ‘cpt_fc_enc_hmac_prep’ at
        ../drivers/common/cpt/cpt_ucode.h:2472:3,
    inlined from ‘fill_digest_params’ at
        ../drivers/common/cpt/cpt_ucode.h:3548:14,
    inlined from ‘otx_cpt_enq_single_sym’ at
        ../drivers/crypto/octeontx/otx_cryptodev_ops.c:541:9,
    inlined from ‘otx_cpt_enq_single_sym_sessless’ at
        ../drivers/crypto/octeontx/otx_cryptodev_ops.c:584:8,
    inlined from ‘otx_cpt_enq_single’ at
        ../drivers/crypto/octeontx/otx_cryptodev_ops.c:611:11,
    inlined from ‘otx_cpt_pkt_enqueue’ at
        ../drivers/crypto/octeontx/otx_cryptodev_ops.c:643:9,
    inlined from ‘otx_cpt_enqueue_sym’ at
        ../drivers/crypto/octeontx/otx_cryptodev_ops.c:668:9:
../drivers/common/cpt/cpt_ucode.h:415:36: warning: array subscript 0 is
outside array bounds of ‘buf_ptr_t[0]’ {aka ‘struct buf_ptr[]’}
[-Warray-bounds]
  415 |                         e_dma_addr = bufs[j].dma_addr;
      |                         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
../drivers/common/cpt/cpt_ucode.h:416:48: warning: array subscript 0 is
outside array bounds of ‘buf_ptr_t[0]’ {aka ‘struct buf_ptr[]’}
[-Warray-bounds]
  416 |                         e_len = (size > bufs[j].size) ?
      |                                         ~~~~~~~^~~~~

This patch resolves the warning.

Bugzilla ID: 861
Fixes: 9be415daf4 ("common/cpt: add common defines for microcode")
Fixes: b74652f3a9 ("common/cpt: add microcode interface for encryption")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Anoob Joseph <anoobj@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: David Marchand <david.marchand@redhat.com>
2022-06-21 20:04:49 +02:00
Ankur Dwivedi
5242d8dbbe common/cnxk: swap ZUC-256 key
The microcode expects zuc-256 key to be in reverse of what is
provided by dpdk test app. This patch swaps the zuc-256 key.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-21 20:04:49 +02:00
Tomasz Duszynski
2e8bd307fa common/cnxk: support switching CPRI/ETH back and forth
Add support for toggling modes between ETH and CPRI on
newer MACs (RPM).

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 09:02:14 +02:00
Tomasz Duszynski
bd2fd34ab8 common/cnxk: sync eth mode change command with firmware
Layout of eth mode change command defined by firmware has been changed
recently. So in order to retain compatibility between ROC and firmware
update existing codebase.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:20:58 +02:00
Tomasz Duszynski
3572f5a563 common/cnxk: remove unused constants
Some constants are redundant hence remove them.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:20:35 +02:00
Tomasz Duszynski
888123a685 raw/cnxk_bphy: support changing CPRI misc settings
Add support for changing miscellaneous CPRI settings.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:20:24 +02:00
Tomasz Duszynski
283c917519 raw/cnxk_bphy: support enabling Tx for CPRI SERDES
Add support for enabling or disablig TX for SERDES
configured in CPRI mode.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:20:09 +02:00
Tomasz Duszynski
7af3e7aaf9 raw/cnxk_bphy: support switching from eCPRI to CPRI
Add support for switching from ethernet (eCPRI) to CPRI mode.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:19:42 +02:00
Tomasz Duszynski
e267eef7cc common/cnxk: do not switch affinity back and forth
Switching affinity back and forth was used as a mean to pass CPU number
to IRQ registration routine which is an overkill.

Simplify current logic by extending IRQ registration routine parameter
list with a CPU which should run IRQ handler.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:18:57 +02:00
Tomasz Duszynski
81388ad14b common/cnxk: use wider mask to extract RPM ID
Some platforms have more RPMs available than the others. Take than
into account when retrieving id of a particular RPM.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:18:02 +02:00
Tomasz Duszynski
8d3ba6bf0a common/cnxk: update register access for CNF10xxN
Due to HW changes some fields which were used to enable
xmit were moved elsewhere. This patch takes care of this.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2022-06-22 08:17:41 +02:00
Tomasz Duszynski
b38db1bfb9 common/cnxk: allow building for generic arm64
Allow building generic arm64 target using config/arm/arm64_armv8_linux_*
config which works on both cn9k and cn10k by relaxing cache line size
requirements a bit.

While at it move cache line checks to common place.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-06-07 20:49:20 +02:00
Bruce Richardson
013b4c52c7 replace zero-length arrays with flexible ones
This patch replaces instances of zero-sized arrays i.e. those at the end
of structures with "[0]" with the more standard syntax of "[]".
Replacement was done using coccinelle script, with some revert and
cleanup of whitespace afterwards.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-06-07 16:44:21 +02:00
Suanming Mou
dfa2f53387 common/mlx5: remove unused lcore check
While non-lcore list operations were supported, non-lcore index will
be converted to MLX5_LIST_NLCORE. In that case, no need to check the
lcore index be -1 or not anymore.

This commit removes the unused lcore check in list.

Fixes: 7e1cf89271 ("common/mlx5: support list non-lcore operations")
Cc: stable@dpdk.org

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-06-05 17:04:43 +02:00
Junfeng Guo
bdd7558f5b common/iavf: support raw packet in protocol header
The patch extends existing virtchnl_proto_hdrs structure to allow VF
to pass a pair of buffers as packet data and mask that describe
a match pattern of a filter rule. Then the kernel PF driver is requested
to parse the pair of buffer and figure out low level hardware metadata
(ptype, profile, field vector.. ) to program the expected FDIR or RSS
rules.

Also update the proto_hdrs template init to align the virtchnl changes.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-24 04:53:37 +02:00
Ivan Malov
78b82063df common/sfc_efx/base: manage VNIC MAC address by MCDI handle
The board admin may need to assign a MAC address to a guest
VNIC identified by its MCDI handle. Provide an API for that.

In the case when a libefx-based driver is used at the guest,
it will need to check its MAC address using the symmetrical
API if the admin has tweaked it by means of its representor.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2022-05-31 18:50:00 +02:00
Ivan Malov
b85f50487e common/sfc_efx/base: convert EFX PCIe INTF to MCDI value
When the driver queries its PCIe interface type via MCDI,
the value from the response is translated to an EFX enum.

When the driver passes this enum value back to any other
MCDI helper, the inverse translation has to be conducted.

Fixes: 1bf9ff57cc ("common/sfc_efx/base: allow getting VNIC MCDI client handles")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-05-31 18:50:00 +02:00
Arek Kusztal
db8d2a2c99 cryptodev: move RSA padding into separate struct
- move RSA padding into separate struct.
More padding members should be added into padding,
therefore having separate struct for padding parameters will
make this more readable.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-06-02 12:04:11 +02:00
Arek Kusztal
b558a67c32 crypto/qat: add secp384r1 curve
This commit adds secp384r1 (P-384) elliptic
curve to Intel QuickAssist Technology crypto PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-06-01 16:26:35 +02:00
Raja Zidane
f12c41bf40 crypto/mlx5: support plain text keys
Using crypto devs requires the user to log in and the supplied DEK to be
encrypted with a KEK (keys encryption key).
KEK is burned once on the nic, along with credentials for users,
and for a user to log in, he is needed to supply his creds wrapped with
the KEK.
A device comes out of the Mellanox factory with a pre-defined import
method for each algorithm. The defined method could be wrapped
mode, so the device can be used as described above, or
plaintext mode, without the need to log in and wrap supplied DEKs.

Support crypto operations with the plaintext import method.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-06-01 16:26:34 +02:00
Tomasz Duszynski
d1422d107d common/cnxk: support CNF950_A0
Add PCI IDs which match CNF95O_A0 SoC.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
2022-06-01 22:30:32 +02:00
Rahul Bhansali
dd462f68f0 common/cnxk: support CN103XX platform
Added support for CN103XX (cn10kb) platform.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-06-01 21:58:38 +02:00
Pavan Nikhilesh
be541d3758 common/cnxk: lock when accessing mbox of SSO
Since mailbox is now accessed from multiple threads, use lock to
synchronize access.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
2022-05-17 16:43:52 +02:00
Raja Zidane
18ca4a4ec7 net/mlx5: support ESP SPI match and RSS hash
In packets with ESP header, the inner IP will be encrypted, and
its fields cannot be used for RSS hashing. So, ESP packets
can be hashed only by the outer IP layer.
So, when using RSS on ESP packets, hashing may not be efficient,
because the fields used by the hash functions are only the outer IPs,
causing all traffic belonging to all tunnels between a given
pair of GWs to land on one core.
Adding the SPI hash field can extend the spreading of IPsec packets.

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-05-15 09:38:59 +02:00
Nithin Dabilpuram
3c100e0e6b common/cnxk: support per-port RQ in inline device
Add support for per port RQ in inline device thereby using
Aura/Pool attributes from that port specific first RQ.
When inline device is used with channel masking, it will
fallback to single RQ for all ethdev ports.

Also remove clamping up of CQ size for LBK ethdev when
inline inbound is enabled as now backpressure is supported
even on LBK ethdevs.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:15 +02:00
Nithin Dabilpuram
f0b9158c61 common/cnxk: use aggregate level RR priority from mbox
Use aggregate level Round Robin Priority from mbox response instead of
fixing it to single macro. This is useful when kernel AF driver
changes the constant.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:57 +02:00
Akhil Goyal
24d37e0761 common/cnxk: convert warning to debug print
Inbound SA SPI if not in min-max range specified in devargs,
was marked as a warning. But this is not converted to debug
print because if the entry is found to be duplicate in the mask,
it will give another error print. Hence, warning print is not needed
and is now converted to debug print.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:57 +02:00
Nithin Dabilpuram
f5a4327049 common/cnxk: fix soft expiry disable path
Fix issues in mode where soft expiry is disabled in ROC.
When soft expiry support is not enabled in inline device,
memory is not allocated for the ring base array and should
not be accessed.

Fixes: bea5d990a9 ("net/cnxk: support outbound soft expiry notification")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:56 +02:00
Rakesh Kudurumalla
b315581c66 common/cnxk: skip probing SoC environment for CN9K
SoC run platform file is not present in CN9k so probing
is done for CN10k devices

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:54 +02:00
Satha Rao
e746aec161 common/cnxk: fix SQ flush sequence
Fix SQ flush sequence to issue NIX RX SW Sync after SMQ flush.
This sync ensures that all the packets that were in-flight are
flushed out of memory.

This patch also fixes NULL return issues reported by
static analysis tool in Traffic Manager and sync's mailbox
to that of the kernel version.

Fixes: 05d727e8b1 ("common/cnxk: support NIX traffic management")
Fixes: 0b7e667ee3 ("common/cnxk: enable packet marking")
Cc: stable@dpdk.org

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:49 +02:00
Vidya Sagar Velumuri
064e790375 common/cnxk: support timestamp PKIND in CPT
Add new API to configure the SA table entries with new CPT PKIND
when timestamp is enabled.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:48 +02:00
Vidya Sagar Velumuri
76aa8098ff common/cnxk: add new PKIND for CPT when ts is enabled
With timestamp enabled, time stamp will be added to second pass packets
from CPT. NPC needs different configuration to parse second pass packets
with and without timestamp.
New PKIND is defined for CPT when time stamp is enabled on NIX.
CPT should use this PKIND for second pass packets when TS is enabled for
corresponding ethdev port.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:47 +02:00
Radha Mohan Chintakuntla
ff1400aa9d net/cnxk: add receive channel backpressure for SDP
The SDP interfaces also need to be configured for NIX receive channel
backpressure for packet receive.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:46 +02:00
Subrahmanyam Nilla
28b283fa7f common/cnxk: support multi channel for SDP send queues
Currently only base channel number is configured as default
channel for all the SDP send queues. Due to this, packets
sent on different SQ's are landing on the same output queue
on the host. Channel number in the send queue should be
configured according to the number of queues assigned to the
SDP PF or VF device.

Signed-off-by: Subrahmanyam Nilla <snilla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:45 +02:00
Satheesh Paul
a800675b06 net/cnxk: support IPv6 fragment flow pattern item
Support matching IPv6 fragment extension header
with RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT flow pattern item.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-09 14:36:43 +02:00
Vamsi Attunuru
b934e65b01 net/cnxk: enable 3DES-CBC capability
Enable 3DES-CBC capability of inline crypto device.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-07 13:07:51 +02:00
Kiran Kumar K
bbe8d1f198 common/cnxk: support parsing custom SA action
Adding ROC Flow changes to parse custom SA action for cnxk device.
When custom sa action is enabled, VTAG actions are not allowed.
And custom SA index will be calculated based on SA_HI and SA_LO
values. This allows the potential for a MCAM entry to match
many SAs, rather than only match a single SA.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-07 11:44:56 +02:00
Gowrishankar Muthukrishnan
e4a96623a4 common/cnxk: fix sizeof not portable
Fix sizeof not portable issue reported in coverity scan.

Coverity issue: 376538
Fixes: 7e9a94909e ("common/cnxk: realloc inline device XAQ AURA")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-05 10:10:17 +02:00
Gowrishankar Muthukrishnan
ea0d681efa common/cnxk: fix null pointer dereference
Fix null pointer dereference reported in coverity scan.

Coverity issue: 372065
Fixes: 665b6a7400 ("common/cnxk: add NPC helper API")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-05 10:10:17 +02:00
Satheesh Paul
6a65e22a4d common/cnxk: fix unaligned access to device memory
Use mbox_memcpy() instead of memcpy() to prevent unaligned access.

Fixes: 1f66919817 ("common/cnxk: improve MCAM entries management")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-03 10:02:00 +02:00
Rahul Bhansali
1f997c06c3 common/cnxk: add ROC errata list
Created roc_errata.h to list the errata handled in userspace drivers.
Added no_drop_re, cq_min_size_4k, no_fc_stype_ststp, no_drop_aging,
no_vwqe_flush_op etc erratas.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-02 20:31:15 +02:00
Volodymyr Fialko
7ae43d883d common/cnxk: add null check for inline device
Inline device could be null in cases when it was not bound or missing.
Added check to prevent null pointer access.

Fixes: fe5846bcc0 ("net/cnxk: add devargs for min-max SPI")
Cc: stable@dpdk.org

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2022-05-02 19:42:38 +02:00
Satheesh Paul
c6353c5754 common/cnxk: fix QinQ ROC item mismatch
ROC code is assuming presence of vlan extension headers in
case of QinQ, because of this, there is incompatibility
between the driver and ROC. Fixed this in ROC by treating
QINQ as multiple VLAN pattern items for DPDK (as opposed to
treating QINQ as separate pattern item).

Fixes: b8ac8b089c ("common/cnxk: support matching VLAN existence")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-25 07:08:21 +02:00
Satheesh Paul
fe8e6571d5 common/cnxk: correct ROC naming conventions
Corrected some names to follow ROC naming convention in ROC NPC code.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-25 07:07:25 +02:00
Satheesh Paul
4968b362b6 common/cnxk: support CPT second pass flow rules
Added support to create flow rules to match packets
from CPT's second pass packets. With this change, ingress
rules will be created with bits 10 and 11 of channel field
in the MCAM ignored by default. For rules specific to
second pass packets, the CPT channel bits will be set
in the MCAM.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-24 05:51:40 +02:00
Simei Su
90160401a2 common/iavf: support Rx timestamp in virtual channel
Add new ops and structures to support VF to support Rx timestamp
on flex descriptor.

"VIRTCHNL_OP_1588_PTP_GET_CAPS" ops is sent by the VF to request PTP
capabilities and responded by the PF with capabilities enabled for
that VF.

"VIRTCHNL_OP_1588_PTP_GET_TIME" ops is sent by the VF to request
the current time of the PHC. The PF will respond by reading the
device time and reporting it back to the VF.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:51:51 +02:00
Gagandeep Singh
c54fb3f7f7 common/dpaax: fix short MAC-I IV calculation for ZUC
Fixing the IV calculation for ZUC based short MAC-I
as per the HW security engine guidelines.

Fixes: 73a24060cd ("crypto/dpaa2_sec: add sample PDCP descriptor APIs")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-29 11:27:35 +02:00
Gagandeep Singh
882f253834 common/dpaax: remove obsolete code
Remove sec era 1 to 7 IPsec and caam operations code
as none of the NXP platform use it.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-29 11:27:35 +02:00
Anoob Joseph
ed96337581 common/cnxk: add timeout for ctx write operation
Add busy wait and polling for ctx write operation
rather than waiting with 1 ms delay.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-28 11:46:23 +02:00
Archana Muniganti
e85982ab32 crypto/cnxk: support AES-GMAC
Added lookaside IPsec AES-GMAC support in CNXK PMD.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-28 11:46:09 +02:00
Archana Muniganti
b4409f2b3f crypto/cnxk: support AH mode
Added IPsec AH mode support in CN9K and CN10K PMD

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-04-28 11:45:50 +02:00
Gagandeep Singh
13ce268103 common/dpaax: remove dead code
This patch remove structural and logical dead code from
caamflib.

Coverity issue: 375251, 375258, 375261, 375267, 375269
Coverity issue: 375285, 373161, 375249, 375257

Fixes: 6127fff842 ("common/dpaax: remove outdated caamflib code")
Fixes: 81eb760d22 ("common/dpaax/caamflib: remove some inline keys")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2022-04-28 08:54:50 +02:00
Adham Masarwah
cb91f12f4a net/mlx5: support MTU settings on Windows
Mlx5Devx library has new API's for setting and getting MTU.
Added new glue functions that wrap the new mlx5devx lib API's.
Implemented the os_ethdev callbacks to use the new glue
functions in Windows.

Signed-off-by: Adham Masarwah <adham@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-04-21 12:47:43 +02:00
Adham Masarwah
3014718fd2 net/mlx5: support promiscuous modes on Windows
Support of the set promiscuous modes by calling the new API
In Mlx5DevX Lib.
Added new glue API for Windows which will be used to communicate
with Windows driver to enable/disable PROMISC or ALLMC.

Signed-off-by: Adham Masarwah <adham@nvidia.com>
Tested-by: Idan Hackmon <idanhac@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-04-21 12:47:42 +02:00
Rongwei Liu
f956d3d4c3 net/mlx5: fix probing with secondary bonding member
Users can probe primary or secondary PCIe id when bonding is
configured.
1. -a 0a:00.0,representor=pf[0-1]vf[0-1], PMD probes 5 ports
totally: bonding device plus 4 representor ports.
2. -a 0a:00.1,representor=pf[0-1]vf[0-1], PMD only probes 2
representor ports.

Under the 2nd condition, bonding IB device doesn't have the same
PCIe id and PMD needs to check bonding relationship otherwise
probe failure.

Fixes: 6856efa54e ("net/mlx5: fix PF leak on PCI probing failure")
Cc: stable@dpdk.org

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-04-21 12:47:39 +02:00
Dmitry Kozlyuk
8113251862 common/mlx5: fix memory region range calculation
MR end for a mempool chunk may be calculated incorrectly.
For example, for chunk with addr=1.5M and len=1M with 2M page size
the range would be [0, 2M), while the proper result is [0, 4M).
Fix the calculation.

Fixes: 690b2a88c2 ("common/mlx5: add mempool registration facilities")
Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-04-21 12:47:37 +02:00
Wenjun Wu
b14e8a57b9 net/iavf: support quanta size configuration
This patch adds quanta size configuration support.
Quanta size should between 256 and 4096, and be a product of 64.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-04-22 14:05:29 +02:00
Wenjun Wu
5779a8894d net/iavf: support queue rate limit configuration
This patch adds queue rate limit configuration support.
Only max bandwidth is supported.

Signed-off-by: Ting Xu <ting.xu@intel.com>
Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-04-22 14:05:12 +02:00
Gregory Etelson
71adf25dbf net/mlx5: fix flex item availability
Flex item availability is restricted to BlueField-2 and BlueField-3
PF ports.

The patch validates port type compliance before proceeding to
flex item creation.

Fixes: db25cadc08 ("net/mlx5: add flex item operations")
Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-03-07 11:43:12 +01:00
Vamsi Attunuru
694e29ea9b common/cnxk: fix build with custom maximum port config
Build fails with custom max eth ports configuration, like
-Dmax_ethports=1024.

Build error is:
../drivers/common/cnxk/roc_nix_inl_dev.c:794:2:
  note: in expansion of macro ‘PLT_STATIC_ASSERT’
 |  PLT_STATIC_ASSERT(sizeof(struct nix_inl_dev) <= ROC_NIX_INL_MEM_SZ);
 |  ^~~~~~~~~~~~~~~~~

Earlier soft expiry ring struct member was an array of pointers and it's
size is linked to number of RTE_MAX_ETHPORTS, and the whole struct size
is confined and protected by size assertion.
It resulted in build failure with -Dmax_ethports=1024 option and
assertion caught that failure.

Use dynamically allocated memory for storing soft expiry ring base
addresses which fixes the struct size against custom RTE_MAX_ETHPORTS
values and solves the static assertion failure.

Bugzilla ID: 940
Fixes: bea5d990a9 ("net/cnxk: support outbound soft expiry notification")
Cc: stable@dpdk.org

Reported-by: Wei Ling <weix.ling@intel.com>
Reported-by: Yu Jiang <yux.jiang@intel.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-03-03 06:59:25 +01:00
Harman Kalra
8f98e3ecc5 common/cnxk: fix mbuf data offset for VF
If PF has PTP enabled the data offset should be adjusted for VF to
skip extra 8 bytes of timestamp as the MAC inserts 8 bytes before
the ethernet header.

Fixes: c443e0d326 ("common/cnxk: support NIX PTP")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-03-03 18:35:40 +01:00
Nithin Dabilpuram
66d485fb50 common/cnxk: fix bitmap usage for TM
Revert change [1] to return error on case where no slab of free
resources is found. That error check break's a case where
there is a spare schedule queue to be reused that was just
allocated for sake of contiguous static TM nodes.

[1]
Fixes: 14f7e5d4bf ("common/cnxk: add missing checks of return values")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-03-03 18:28:16 +01:00
Michael Baum
2c75b9bcd5 common/mlx5: fix default devargs initialization
Device arguments list is provided along with its identifier as part of
EAL arguments.
The arguments specified in the list are taken from it, and the rest is
initialized to the default values.

When no list is provided at all, all arguments should have been
initialized to their default values. However, they are mistakenly
initialized to zero which may be a valid value for some.

This patch initializes the default values before checking whether
arguments have been specified.

Bugzilla ID: 945
Fixes: a729d2f093 ("common/mlx5: refactor devargs management")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-03-02 17:36:46 +01:00
Dmitry Kozlyuk
be66461cba common/mlx5: add Netlink event helpers
Introduce mlx5_nl_read_events() to read Netlink events
(technically, messages) from a socket that was configured
to listen for them via a new mlx5_nl_init() parameter.
Add mlx5_nl_parse_link_status_update() helper
to extract information from link-related events.
This patch is a shared base for later fixes.

Cc: stable@dpdk.org

Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-03-01 16:54:03 +01:00
Radu Nicolau
578da1bd20 net/iavf: support NAT-T / UDP encapsulation
Add support for NAT-T / UDP encapsulated ESP.
This fixes the inline crypto feature for iAVF which will not
function properly without setting the UDP encapsulation options.

Fixes: 6bc987ecb8 ("net/iavf: support IPsec inline crypto")
Cc: stable@dpdk.org

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
2022-03-01 20:27:31 +01:00
Arek Kusztal
8545c6d2e2 crypto/qat: fix smaller modulus cases for mod exp
This patch fixes not working cases when modulus is
smaller than other arguments.

Fixes: 3b78aa7b23 ("crypto/qat: refactor asymmetric crypto functions")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-03-04 11:20:36 +01:00
Raja Zidane
d2781de684 compress/mlx5: support out-of-space status
When trying to dequeue, an OP may fail due to insufficient
space for the OP output, the compressdev API defines out-of-space
for OP status. The driver can detect out-of-space errors and
report them to the user. Check if hw_error_syndrome specifies
out-of-space and set the OP status accordingly.
Also added an error message for a case of missing B-final flag.

Fixes: f8c97babc9 ("compress/mlx5: add data-path functions")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-03-04 10:41:20 +01:00
Stephen Hemminger
68eb9a1945 remove extra blank line at EOF
These source files all had unnecessary blank line at end of file.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-02-27 21:26:06 +01:00
Michael Baum
9d936f4f1a common/mlx5: support remote PD and CTX
Add option to probe common device using import CTX/PD functions instead
of create functions.
This option requires accepting the context FD and the PD handle as
devargs.

This sharing can be useful for applications that use PMD for only some
operations. For example, an app that generates queues itself and uses
PMD just to configure flow rules.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-25 17:33:31 +01:00
Michael Baum
0777921a61 common/mlx5: glue device and PD import
Add support for rdma-core API to import device.
The API gets ibv_context file descriptor and returns an ibv_context
pointer that is associated with the given file descriptor.
Add also support for rdma-core API to import PD.
The API gets ibv_context and PD handle and returns a protection domain
(PD) that is associated with the given handle in the given context.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-25 17:33:31 +01:00
Michael Baum
c2e3059a10 common/mlx5: consider local functions as internal
The functions which are not explicitly marked as internal
were exported because the local catch-all rule was missing in the
version script.
After adding the missing rule, all local functions are hidden.
The function mlx5_get_device_guid is used in another library,
so it needs to be exported (as internal).

Because the local functions were exported as non-internal
in DPDK 21.11, any change in these functions would break the ABI.
An ABI exception is added for this library, considering that all
functions are either local or internal.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-25 17:33:31 +01:00
Sean Zhang
5c4d491791 net/mlx5: support matching GRE optional fields
This patch adds matching on the optional fields (checksum/key/sequence)
of GRE header. The matching on checksum and sequence fields requests
support from rdma-core with the capability of misc5 and tunnel_header 0-3.

For patterns without checksum and sequence specified, keep using misc for
matching as before, but for patterns with checksum or sequence, validate
capability first and then use misc5 for the matching.

Signed-off-by: Sean Zhang <xiazhang@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-02-25 16:34:08 +01:00
Tomasz Duszynski
64e63c1929 common/cnxk: support CNF95xx B0 variant
Add CNF95xx B0 variant to the list of supported models.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-02-25 11:24:55 +01:00
Satha Rao
d120c08958 common/cnxk: check SQ node before setting BP config
Validate sq_node and parent before accessing their fields.
SQ was created without any associated TM node, this is valid negative
case, so return success while stopping TM without SQ node.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-25 08:47:53 +01:00
Satha Rao
0b7e667ee3 common/cnxk: enable packet marking
cnxk platforms supports packet marking when TM enabled with
valid shaper rates. VLAN DEI, IP ECN, or IP DSCP inside
packet will be updated based on mark flags selected.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-25 08:45:53 +01:00
Vidya Sagar Velumuri
582085ed2f common/cnxk: configure reassembly parameters
When reassembly is enabled by application, set corresponding
flags in SA during creation.

Provide ROC API to configure reassembly unit with active and
zombie limits and step size.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 21:31:53 +01:00
Vamsi Attunuru
bea5d990a9 net/cnxk: support outbound soft expiry notification
Add support for soft expiry notification mechanism in outbound
path by creating required number of ring buffers and a common poll
thread which polls for soft expiry events enqueued by microcode.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 21:31:28 +01:00
Tomasz Duszynski
040f0bda7c common/cnxk: extend log on model mismatch
Model is uniquely identified by 4 numbers. Print them all in case
model being populated is not on a list of known models. This makes
debugging a bit easier.

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 21:30:02 +01:00
Rahul Bhansali
8fbad405c2 common/cnxk: add CN10K specific xstats
Add cn10k specific Rx xstats of bandwidth profile,
CPT and IPsec counters.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 05:17:33 +01:00
Viacheslav Ovsiienko
7dac7abe0a common/mlx5: check send on time capability
The patch provides check for send scheduling on time hardware capability.
With this capability enabled hardware is able to handle Wait WQEs
with directly specified timestamp values. No Clock Queue is needed
anymore to handle send scheduling.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-02-24 13:46:52 +01:00
Nithin Dabilpuram
fe5846bcc0 net/cnxk: add devargs for min-max SPI
Add support for inline inbound SPI range via devargs
instead of just max SPI value and range being 0..max.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:38:20 +01:00
Nithin Dabilpuram
82529cff18 net/cnxk: fix inline device RQ tag mask
Fix inline device RQ  tagmask to get packets with receive errors
as type ETHDEV packets to callback handler so that packet buffers
can get freed. Currently only IPsec denied packets get the right
tag mask.

Fixes: ee48f711f3 ("common/cnxk: support NIX inline inbound and outbound setup")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:36:45 +01:00
Satha Rao
90b361368c common/cnxk: remove tracking of mark actions
Removed roc NPC APIs which tracks addition and deletion of
mark actions. It was earlier needed to track number of mark
actions added as part of flow rules. If mark actions count
is > 0, then the function pointer for Rx would get updated
to even read mark value from CQE/WQE and populate in mbuf.
Now the same switch is done based on new Rx meta data negotiate
ethdev API.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:36:38 +01:00
Nithin Dabilpuram
a9207715c1 common/cnxk: allow force use of SSO device for outb inline
Allow force use of SSO device even when inline dev is available
so that in case driver needs events directly delivered to
event device.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:35:58 +01:00
Nithin Dabilpuram
f598200aca common/cnxk: use SSO time counter threshold for IRQ
Enable time counter based threshold for raising SSO
EXE_INT instead of IAQ threshold. Time counter based
threshold helps getting periodic interrupts and process
pkts in burst instead of getting HW to raise an interrupt
for every new work.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:35:48 +01:00
Nithin Dabilpuram
c8c967e117 common/cnxk: support enabling AURA tail drop for RQ
Add support to enable AURA tail drop via RQ specifically
for inline device RQ's pkt pool. This is better than RQ
RED drop as it can be applied to all RQ's that are not
having security enabled but using same packet pool.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:35:38 +01:00
Vidya Sagar Velumuri
350b7a536a common/cnxk: enable L3 header write back in SA
Enable the field in SA to write back L2, L3 headers in case
of errors during inline processing.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:35:04 +01:00
Vidya Sagar Velumuri
5ece02e736 common/cnxk: use common SA init API for default options
Use common SA init API before doing initialization based on
params. This is better so that all HW specific default values
are at single place for lookaside and inline.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:34:54 +01:00
Vidya Sagar Velumuri
4af4e36a93 common/cnxk: support inline device API without ROC NIX
Update the inline device functions to work when roc_nix is NULL.
This is required, as IPsec driver have to use these APIs to work
with inline IPsec device, but the IPsec driver might not have roc_nix
information.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:34:44 +01:00
Satha Rao
02bf1662ef common/cnxk: adjust shaper rates to lower boundaries
Provide a method to get floor values for a requested shaper rate,
which can assure packets should never be transmitted at a rate higher
than configured.

Keep the old API to get HW suggested values.
And introduce new parameter to select appropriate API.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:34:34 +01:00
Nithin Dabilpuram
7e9a94909e common/cnxk: realloc inline device XAQ AURA
Add support to realloc inline device XAQ AURA with more
buffers of new packet pool AURA.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:34:24 +01:00
Satha Rao
650101241b common/cnxk: increase SMQ resource count
CN10K supports up to 832 resources at SMQ level, so increase
bitmap count to 1024.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:34:10 +01:00
Sunil Kumar Kori
20d02329cd common/cnxk: support priority flow control
CNXK platforms support priority flow control(802.1qbb) to pause
respective traffic per class on that link.

Adds RoC interface to configure priority flow control on MAC
block i.e. CGX on cn9k and RPM on cn10k.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:34:04 +01:00
Michael Baum
a6b9d5a538 common/mlx5: update doorbell mapping parameter name
The "tx_db_nc" devarg forces doorbell register mapping to non-cached
region eliminating the extra write memory barrier. This argument was
used in creating the UAR for Tx and thus affected its performance.

Recently [1] its use has been extended to all UAR creation in all mlx5
drivers, and now its name is no longer so accurate.

This patch changes its name to "sq_db_nc" to suit any send queue that
uses it. The old name will still work for backward compatibility.

[1] commit 5dfa003db5 ("common/mlx5: fix post doorbell barrier")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Reviewed-by: Raslan Darawsheh <rasland@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-02-23 15:57:43 +01:00
Shun Hao
38eb5c9f35 net/mlx5: fix E-Switch manager vport ID
One of the E-Switch vports plays the special role - it is assigned as
"E-Switch manager" and has some special exclusive rights and duties - it
maintains all the representors, manages FDB domain flows, etc. By
default, the E-Switch vport index was supposed to be zero on standalone
NICs (regular ConnectX) and 0xFFFE SmartNIC (BlueField), but that was
not always correct - this index can be assigned with any value by
kernel/hypervisor.

Currently the E-Switch manager vport id is supposed to be default - 0
for standalone NICs, and 0xFFFE for the SmartNICs, and is deduced from
the device PCI id.

To handle this and do not suggest any default values, can use DevX API
to query E-Switch manager vport ID directly from the firmware during
initialization, and use that value by default. If the new method is not
provided (legacy firmware), fallback to use the PCI id approach.

Fixes: a564038699 ("net/mlx5: support E-Switch manager egress traffic match")
Cc: stable@dpdk.org

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-02-23 15:57:39 +01:00
Yajun Wu
05b54bf089 common/mlx5: fix queue pair ack timeout configuration
VDPA driver creates two QPs(1 queue pair include 1 send queue
and 1 receive queue) per virtio queue to get traffic events
from NIC to SW.
Two QPs(called FW QP and SW QP) are created as loopback QP
and FW QP'SQ is connected to SW QP'RQ internally.

When packet receive or send out, HW will send WQE by FW QP'SQ,
then SW will get CQE from the CQ of SW QP.

With large scale and heavy traffic, the SQ's request may fail
to get ACK from RQ HW, because HW is busy.
SQ will retry the request with qpc.retry_count times and each time
wait for 4.096 uS *2^(ack_timeout) for the response. If still can’t
get RQ’s HW response, SQ will go to an error state.

16 is experienced value. It should not be too high or too low.
Too high will make QP waits too long in case it’s packet drop.
Too low will cause QP to go to an error state(retry-exceeded) easily.

Fixes: 15c3807e86 ("common/mlx5: support DevX QP operations")
Cc: stable@dpdk.org

Signed-off-by: Yajun Wu <yajunw@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-23 15:57:30 +01:00
Michael Baum
a729d2f093 common/mlx5: refactor devargs management
Improve the devargs handling in two aspects:
 - Parse the devargs string only once.
 - Return error and report for unknown keys.

The common driver parses once the devargs string into a dictionary, then
provides it to all the drivers' probe. Each driver updates within it
which keys it has used, then common driver receives the updated
dictionary and reports about unknown devargs.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-21 11:36:56 +01:00
Michael Baum
c089eb9358 common/mlx5: check common devargs in probing again
MLX5 common driver supports probing again in two scenarios:
 - Add new driver under existing device. common probe function gets
   it in devargs, then calls the requested driver's probe function
   (regardless of the driver's own support in probing again) with the
   existing device as parameter.
 - Transfer the probing again support of the drivers themselves
   (currently only net). In this scenario, the existing device is sent
   as a parameter to the existing driver's probe too.

In both cases it gets a new set of arguments that do not necessarily
match the configured arguments in the existing device.
Some of the arguments belong to the configuration of the existing
device, so they can't be updated in the probing again. On the other
hand, there are arguments that belong to a specific driver or specific
port and might get a new value in the probing again.
The user might generate any argument he wants in probing again, but when
he generates arguments belonging to the common device configuration, it
does not affect.

This patch adds an explicit check for the devargs belonging to the
common device configuration. If there is no match to the existing
configuration, it returns an error.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-21 11:36:55 +01:00
Michael Baum
c4c3e8afef common/mlx5: share VF check function
The check if device is VF work for Linux as same as Windows.
This patch removes it to the function implemented in the folder shared
between the operating systems, removing the duplication.

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
2022-02-21 11:36:46 +01:00
Ivan Malov
a3b2ade480 common/sfc_efx/base: add missing handler for 1-byte fields
One may set RECIRC_ID in a MAE action rule specification.
This field is not a network one, and its handling goes
to the code snippet which does not recognise field
sizes other than 4 bytes. Add the missing handler.

Fixes: 3a73dcfdb2 ("common/sfc_efx/base: match on recirc ID in action rules")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-02-18 16:22:25 +01:00
Ivan Malov
b4dd34c7f7 common/sfc_efx/base: fix recirculation ID set in outer rules
Recirculation ID field of MAE outer rule insert MCDI is
part of the lookup control structure and it has non-zero
bit offset relative to the byte offset of the structure.

Fixes: 5cf153e79c ("common/sfc_efx/base: support recirculation ID in outer rules")
Cc: stable@dpdk.org

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-02-18 16:22:25 +01:00
Kiran Kumar K
fbc0fa7499 net/cnxk: keep flow rules across restart
Adding changes to enable keep flow rule device capability.
With this change, flow rules will be kept across device restart.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Reviewed-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2022-02-18 08:39:50 +01:00
Gowrishankar Muthukrishnan
244a996f01 common/cnxk: fix uninitialized pointer read
Fix uninitialized pointer read reported in coverity scan.

Coverity issue: 370214, 370217, 370219, 370220, 370221
Coverity issue: 370223, 370224, 370225, 372065
Fixes: c34ea71b87 ("common/cnxk: add NPC parsing API")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-18 05:20:47 +01:00
Gowrishankar Muthukrishnan
2447b0b669 common/cnxk fix unintended sign extension
This patch fixes unintended sign extensions reported in coverity
scan.

Coverity issue: 373258
Fixes: 8ca851cdc5 ("common/cnxk: support dual VLAN insert and strip actions")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-18 05:20:41 +01:00
Gowrishankar Muthukrishnan
14f7e5d4bf common/cnxk: add missing checks of return values
This patch fixes coverity issue by adding checks on return values.

Coverity issue: 373628, 374858, 370213, 370215
Fixes: af75aac789 ("common/cnxk: support telemetry for NIX")
Fixes: d61138d4f0 ("drivers: remove direct access to interrupt handle")
Fixes: fcdef46b66 ("common/cnxk: support NIX TM debug and misc utils")
Fixes: df405df95e ("common/cnxk: add NIX TM helper to alloc/free resource")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-18 05:09:16 +01:00
Ankur Dwivedi
8540d7dbfc common/cnxk: fix NPC key extraction validation
The x->len is passed as argument to npc_prep_mcam_ldata().
In the function, the len is used to reference elements of
int_info and int_info_mask array.
The arrays are of length NPC_MAX_EXTRACT_DATA_LEN.

Validating the x->len value so that it is not greater than
NPC_MAX_EXTRACT_DATA_LEN.

This patch also resolves warning observed with gcc 12 compiler.

log:
 ../drivers/common/cnxk/roc_npc_utils.c:13:26: warning: writing 16 bytes
 into a region of size 0 [-Wstringop-overflow=]
 ptr[idx] = data[len - 1 - idx];

 ../drivers/common/cnxk/roc_npc_utils.c:163:17: note: at offset 64 into
 destination object ‘int_info’ of size 64
 uint8_t int_info[NPC_MAX_EXTRACT_DATA_LEN];

Bugzilla ID: 854
Fixes: 665b6a7400 ("common/cnxk: add NPC helper API")
Cc: stable@dpdk.org

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-02-17 14:02:24 +01:00
Harman Kalra
f2566bfa80 common/cnxk: enable NIX Tx interrupts errata
An errata exists whereby NIX may incorrectly overwrite the value in
NIX_SQ_CTX_S[SQ_INT]. This may cause set interrupts to get cleared or
causing an QINT when no error is outstanding.
As a workaround, software should always read all SQ debug registers
and not just rely on NIX_SQINT_E bits set in NIX_SQ_CTX_S[SQ_INT].
Also for detecting SQB faults software must read SQ context and
check id next_sqb is NULL.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-17 10:26:30 +01:00
Satheesh Paul
0fb2b46be7 common/cnxk: fix base rule merge
Egress rules do not have a base steering rule and the
current base steering rule is applicable only for ingress
rules. Hence, when creating a flow rule, merge base steering
rule only for ingress rules.

Fixes: f9af908074 ("common/cnxk: add mcam utility API")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-02-17 09:12:08 +01:00
Satheesh Paul
542e27e99b common/cnxk: fix log level during MCAM allocation
Changed log level from info to debug for a couple of log
messages printed during MCAM allocation.

Fixes: 1f66919817 ("common/cnxk: improve MCAM entries management")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-02-17 08:21:25 +01:00
Satheesh Paul
40257b81b8 common/cnxk: fix flow deletion
When a flow is deleted, the counters are deleted without
being cleared first. This results in counter values being
retained and shown in flows created later. Hence, counter
is cleared before being deleted.

Updated driver to clear and delete counters upon flow deletion.

Fixes: a07f7ced43 ("common/cnxk: add NPC init and fini")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-02-17 07:33:16 +01:00
Satheesh Paul
9132292e99 common/cnxk: fix null access in IPv6 flow parsing
Added null check in IPv6 flow pattern parsing.

Fixes: 474e275b1b ("common/cnxk: support extensions attributes in IPv6 item")

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
2022-02-17 05:33:09 +01:00
Arek Kusztal
6c25a68adc crypto/qat: add ECPM algorithm
This patch adds Elliptic Curve Multiplication
algorithm to Intel QuickAssist Technology PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
2022-02-23 10:17:06 +01:00
Arek Kusztal
b5324d3854 crypto/qat: add ECDSA algorithm
This patch adds ECDSA algorithm to Intel
QuickAssist Technology PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
2022-02-23 10:16:53 +01:00
Arek Kusztal
3b78aa7b23 crypto/qat: refactor asymmetric crypto functions
This commit refactors asummetric crypto functions
in Intel QuickAssist Technology PMD.
Functions right now are shorter and far easier readable,
plus it facilitates addition of new algorithms.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
2022-02-23 10:02:36 +01:00
Kai Ji
85fec6fd96 crypto/qat: unify raw data path functions
This patch unifies QAT's raw dp api implementations
to the same enqueue/dequeue methods used in crypto operations.
The specific functions for different QAT generation are updated
respectively. The qat_sym_hw_dp.c is removed as no longer required.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-23 09:59:16 +01:00
Kai Ji
fb3b9f4922 crypto/qat: rework burst data path
This patch enable the op_build_request function in
qat_enqueue_op_burst, and the qat_dequeue_process_response
function in qat_dequeue_op_burst.
The op_build_request invoked in crypto build request op is based
on crypto operations setup'd during session init.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-23 09:59:16 +01:00
Kai Ji
2becec6bee crypto/qat: unify asymmetric functions
This patch removes qat_asym_pmd.c and integrates all the
functions into qat_asym.c. The unified/integrated asym crypto
pmd functions should make them easier to maintain.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-23 09:59:16 +01:00
Kai Ji
e0a6761022 crypto/qat: unify symmetric functions
This patch removes qat_sym_pmd.c and integrates all the functions into
qat_sym.c. The unified/integrated qat sym crypto pmd functions should
make them easier to maintain.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-23 09:59:16 +01:00
Kai Ji
a234330286 crypto/qat: rework asymmetric op build operation
This patch reworks the asymmetric crypto data path
implementation in QAT driver. The changes include asymmetric
crypto data path separation for QAT hardware generations, and
code optimisation of the device capabilities declaration.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-23 09:59:16 +01:00
Kai Ji
c3352e724d common/qat: define build request and dequeue operations
This patch introduce build request and dequeue op function
pointers to the qat queue pair implementation. The function
pointers are assigned during qat session generation based on input
crypto operation request.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-23 09:59:16 +01:00
Pavan Nikhilesh
1f5b3d55c0 event/cnxk: store and reuse workslot status
Store and reuse workslot status for TT, GRP and HEAD status
instead of reading from GWC as reading from GWC imposes
additional latency.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-14 16:23:33 +01:00
Gagandeep Singh
c6eb07e4ea common/dpaax: change PDCP SDAP job processing mode
For PDCP SDAP test cases, HW sec engine process the
jobs in WAIT mode.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2022-02-12 12:10:43 +01:00
Franck Lenormand
6127fff842 common/dpaax: remove outdated caamflib code
DPAA1 and DPAA2 platforms use SEC ERA 8 and 10 only.
Hence, code related to old SEC-ERA (1-7) is removed.

This patch removes code in SDAP and PDCP header related to these
ERA to simplify the codebase:
 - Simplify logic using RTA_SEC_ERA_<> macro
 - Remove era_2_sw_hfn_ovrd dedicated to RTA_SEC_ERA_2

Signed-off-by: Franck Lenormand <franck.lenormand@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
2022-02-12 12:08:46 +01:00
Anoob Joseph
a45f37334b crypto/cnxk: fix update of number of descriptors
Pending queue also need to be adjusted while updating the number of
descriptors.

Fixes: a455fd869c ("common/cnxk: align CPT queue depth to power of 2")
Cc: stable@dpdk.org

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:38 +01:00
Anoob Joseph
1a8cb9199b common/cnxk: add ROC cache line size constant
Add ROC cache line size constant.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:38 +01:00
Tejasree Kondoj
670af27b22 crypto/cnxk: support ESN and anti-replay
Added lookaside IPsec ESN and anti-replay support
through security session update.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:38 +01:00
Anoob Joseph
a4716f534e common/cnxk: add err ctl in SA
Add err ctl field in SA context.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-02-12 10:26:38 +01:00
Arek Kusztal
f4eac3a09c common/qat: enable GEN4 b devices
This commit enables CPM2.0b devices in Intel QuickAssist
Technology PMD.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
2022-02-12 10:26:38 +01:00
Pavan Nikhilesh
ae2c2cb606 net/cnxk: avoid command copy from Tx queue
Tx command is prepared based on offloads enabled and stored in
Tx queue structure at tx_queue_setup phase.
In fastpath the command is copied from Tx queue to LMT line for
all the packets.
Since, the command contents are mostly constants we can move the
command preparation to fastpath and avoid accessing Tx queue
memory.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-11 11:28:30 +01:00
Jie Wang
984b99d6fe common/iavf: add session ID fields for L2TPv2
Add virtchnl fields session ID of L2TPv2 for AVF HASH.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-02-11 10:37:56 +01:00
Stephen Hemminger
06c047b680 remove unnecessary null checks
Functions like free, rte_free, and rte_mempool_free
already handle NULL pointer so the checks here are not necessary.

Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2022-02-12 12:07:48 +01:00
Ivan Malov
bcdcec8cca common/sfc_efx/base: support even spread RSS mode
Riverhead boards support spreading traffic across the
specified number of queues without using indirections.
This mode is provided by a dedicated RSS context type.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-02-02 18:37:31 +01:00
Ivan Malov
e7ea5f304f common/sfc_efx/base: support selecting RSS table entry count
On Riverhead boards, the client can control how many entries
to have in the indirection table of an exclusive RSS context.

Provide the new parameter to clients and indicate its bounds.
Extend the API for writing the table to have the flexibility.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-02-02 18:37:31 +01:00
Ivan Malov
7a71c15dcc common/sfc_efx/base: refactor RSS table entry count name
In the existing code, "n" is hardly a clear name for that.
Use a clearer name to help future maintainers of the code.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-02-02 18:37:31 +01:00
Ivan Malov
777da15056 common/sfc_efx/base: query RSS queue span limit on Riverhead
On Riverhead boards, clients can query the limit on how many
queues an RSS context may address. Put the capability to use.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
2022-02-02 18:37:31 +01:00
Weiguo Li
3cacda8ff0 common/mlx5: remove useless C++ include guard
Remove the incomplete cplusplus guard in internal headers.

Fixes: 7525ebd8eb ("common/mlx5: add glue functions on Windows")

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
2022-02-08 17:10:54 +01:00
Bruce Richardson
ecb904cc45 build: fix warnings when running external commands
Meson 0.61.1 is giving warnings that the calls to run_command do not
always explicitly specify if the result is to be checked or not, i.e.
there is a missing "check" parameter. This is because the default
behaviour without the parameter is due to change in the future.

We can fix these warnings by explicitly adding into each call whether
the result should be checked by meson or not. This patch therefore
adds in "check: false" to each run_command call where the result is
being checked by the DPDK meson.build code afterwards, and adds in
"check: true" to any calls where the result is currently unchecked.

Bugzilla ID: 921
Cc: stable@dpdk.org

Reported-by: Jerin Jacob <jerinj@marvell.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
2022-02-02 15:44:12 +01:00
Bing Zhao
b4a4159d4e common/mlx5: fix probing failure code
While probing the device with unsupported class, the process should
fail because no appropriate driver was found. After traversing all
the drivers, an error value should be returned for the case.

In the previous implementation, zero value indicating probing success
was wrongly returned.

Fixes: ad435d3204 ("common/mlx5: add bus-agnostic layer")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-01-26 17:41:12 +01:00
Dmitry Kozlyuk
2eb92b0fbb common/mlx5: fix MR lookup for non-contiguous mempool
Memory region (MR) lookup by address inside mempool MRs
was not accounting for the upper bound of an MR.
For mempools covered by multiple MRs this could return
a wrong MR LKey, typically resulting in an unrecoverable
TxQ failure:

    mlx5_net: Cannot change Tx QP state to INIT Invalid argument

Corresponding message from /var/log/dpdk_mlx5_port_X_txq_Y_index_Z*:

    Unexpected CQE error syndrome 0x04 CQN = 128 SQN = 4848
        wqe_counter = 0 wq_ci = 9 cq_ci = 122

This is likely to happen with --legacy-mem and IOVA-as-PA,
because EAL intentionally maps pages at non-adjacent PA
to non-adjacent VA in this mode, and MLX5 PMD works with VA.

Fixes: 690b2a88c2 ("common/mlx5: add mempool registration facilities")
Cc: stable@dpdk.org

Reported-by: Wang Yunjian <wangyunjian@huawei.com>
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
2022-01-26 17:41:10 +01:00
Rahul Bhansali
bce33776a7 common/cnxk: update NIX and NPA dump functions
Updates nix_dump and npa_dump to use plt_dump function.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 14:17:31 +01:00
Weiguo Li
5c382298c1 common/cnxk: fix error checking
Fixes: 804c108b03 ("common/cnxk: set BPHY IRQ handler")
Cc: stable@dpdk.org

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 14:17:29 +01:00
Nithin Dabilpuram
07618e267b common/cnxk: set UDP ports for IPsec UDP encapsulation
Set UDP ports for IPsec UDP encapsulation feature in
outbound inline.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-01-23 08:43:07 +01:00
Nithin Dabilpuram
c295403a11 net/cnxk: improve inbound inline error handling for cn9k
Improve inbound inline error handling for CN9K in terms of
packet delivered to application for different kinds of errors.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-01-23 08:43:07 +01:00
Nithin Dabilpuram
a3b4864251 common/cnxk: fix uninitialized variables
Fix uninitialized variable issues reported by
klockwork(static analysis tool).

Fixes: ed135040f0 ("common/cnxk: add CPT LF configuration")
Fixes: 585bb3e538 ("common/cnxk: add VF support to base device class")
Fixes: 58debb813a ("common/cnxk: enable TM to listen on Rx pause frames")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 08:43:07 +01:00
Nithin Dabilpuram
da718c1919 common/cnxk: fix null pointer dereferences
Fix null pointer dereference issues reported by
klockwork(static analysis tool).

Fixes: c045d2e5cb ("common/cnxk: add CPT configuration")
Fixes: 585bb3e538 ("common/cnxk: add VF support to base device class")
Fixes: 665ff1ccc2 ("common/cnxk: add base device class")
Fixes: da57d4589a ("common/cnxk: support NIX flow control")
Fixes: 218d022e1f ("common/cnxk: support NIX stats")
Fixes: 4efa6e82fe ("common/cnxk: support NIX extended stats")
Fixes: 0885429c30 ("common/cnxk: add NIX TM hierarchy enable/disable")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 08:43:07 +01:00
Harman Kalra
89d3557c8d common/cnxk: always use single interrupt ID with NIX
An errata exists whereby, in certain cases NIX may use an
incorrect QINT_IDX for SQ interrupts. As a result, the
interrupt may not be delivered to software, or may not be
associated with the correct SQ.
When NIX uses an incorrect QINT_IDX :
1. NIX_LF_QINT(0..63)_CNT[COUNT] will be incremented for
incorrect QINT.
2. NIX_LF_QINT(0..63)_INT[INTR] will be set for incorrect
QINT.

Fixes: ae06070901 ("common/cnxk: add NIX Tx queue management API")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 08:43:07 +01:00
Harman Kalra
9b7198ea6d common/cnxk: reset stale values on error debug registers
LF's error debug registers like NIX_LF_SQ_OP_ERR_DBG,
NIX_LF_MNQ_ERR_DBG, NIX_LF_SEND_ERR_DBG captures debug
info for an error detected during LMT operation or meta
enqueue or after meta enqueue granted respectively. HW
sets a valid bit when info is captured and SW is expected
to clear this valid bit by writing 1, else these registers
will show stale values of first interrupt when occurred and
will never update with subsequent interrupts.

Fixes: f6d567b03d ("common/cnxk: support NIX IRQ")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 08:43:01 +01:00
Nithin Dabilpuram
83e275519c common/cnxk: fix byte order of frag sizes and infos
Change the byte order of frag sizes and infos to match HW
implementation.

Fixes: 64a73ebd87 ("common/cnxk: add CPT hardware definitions")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-01-23 08:19:20 +01:00
Gowrishankar Muthukrishnan
6a78d41e07 common/cnxk: use for loop in shaper profiles cleanup
In shaper profiles cleanup, Klockwork static analyzer tool reports
infinite loop although existing loop condition is alright.
False positive may be due to tqh_first not checked in loop,
hence switching to FOREACH_SAFE to make Klockwork happy.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-01-23 08:19:18 +01:00