Commit Graph

214 Commits

Author SHA1 Message Date
Rakesh Kudurumalla
f120772811 net/cnxk: fix extended statistics
This fix replaces the usage of roc_nix_num_xstats_get() which is compile
time RoC API with runtime RoC  roc_nix_xstats_names_get() API resolving
xstat count difference for cn9k and cn10k while displaying xstats
for ethdev ports

Fixes: 825bd1d9d8 ("common/cnxk: update extra stats for inline device")
Cc: stable@dpdk.org

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
2022-07-04 14:47:03 +02:00
Radha Mohan Chintakuntla
994b7ceb9b net/cnxk: add SDP VF device IDs
Add SDP VF device ID in the table for probe matching.

Signed-off-by: Radha Mohan Chintakuntla <radhac@marvell.com>
2022-06-20 19:23:46 +02:00
Nithin Dabilpuram
022f1c1a17 net/cnxk: resize CQ for Rx security for errata
Resize CQ for Rx security offload in case of HW errata.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-06-20 19:23:46 +02:00
Harman Kalra
6cef22dcfe net/cnxk: fix PFC class disabling
Disabling a specific PFC class on a SQ is resulting in disabling PFC
on the entire port.

Fixes: 9544713564 ("net/cnxk: support priority flow control")
Cc: stable@dpdk.org

Signed-off-by: Harman Kalra <hkalra@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-06-20 19:23:35 +02:00
Sunil Kumar Kori
14f7c27aeb net/cnxk: remove restriction on VF for PFC config
Currently PFC configuration is not allowed on VFs.
Patch enables PFC configuration on VFs

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
2022-06-20 19:15:41 +02:00
Satananda Burla
b50f4fbd26 net/cnxk: add SDP link status
Add SDP link status reporting

Signed-off-by: Satananda Burla <sburla@marvell.com>
2022-06-20 19:15:40 +02:00
Sunil Kumar Kori
174f2f3512 common/cnxk: add PFC support for VF
Current PFC implementation does not support VFs.
This patch enables PFC on VFs too.

Also fix the config of aura.bp to be based on number
of buffers(aura.limit) and corresponding shift
value(aura.shift).

Fixes: cb4bfd6e7b ("event/cnxk: support Rx adapter")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
2022-06-20 19:15:17 +02:00
Nithin Dabilpuram
75315881c2 common/cnxk: use computed value for WQE skip
Use computed value for WQE skip instead of a hard-coded value.
WQE skip needs to be number of 128B lines to accommodate rte_mbuf.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-06-20 19:15:15 +02:00
Harman Kalra
d41b53c5be common/cnxk: support CNF10KB SoC
Support for CNF10KB SoC by adding its PCI device ID.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
2022-06-17 14:18:33 +02:00
David Marchand
a31c9f970d net/cnxk: fix crash in IPsec telemetry
Calling this telemetry callback with no argument caused a crash.

Fixes: 41cc645c21 ("net/cnxk: add inline IPsec telemetry for CN9K")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
2022-06-13 14:08:44 +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
Chengwen Feng
67ead3fa8c net/cnxk: fix possible null dereference in telemetry
The return value of rte_tel_data_alloc() may be null pointer.
Add missing check vs null.

Fixes: 5ea354a1f2 ("net/cnxk: support telemetry")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-05-20 16:45:53 +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
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
14124e48a3 net/cnxk: fix hotplug detach for first device
Fix hotplug detach sequence to handle case where first PCI
device that is hosting NPA LF is being destroyed while in use.

Fixes: 5a4341c849 ("net/cnxk: add platform specific probe and remove")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:14 +02:00
Nithin Dabilpuram
e2819fea94 net/cnxk: fix multi-segment extraction in vwqe path
Fix multi-seg extraction in vwqe path to avoid updating mbuf[]
array until it is used via cq0 path.

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

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:13 +02:00
Nithin Dabilpuram
34b46320f4 net/cnxk: perform early MTU setup for event mode
Perform early MTU setup for event mode path in order
to update the Rx/Tx offload flags before Rx adapter setup
starts.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:12 +02:00
Nithin Dabilpuram
358d02d20a net/cnxk: support flow control for outbound inline
Add support for flow control in outbound inline path using
FC updates from CPT.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:11 +02:00
Akhil Goyal
d6e6bc5da4 net/cnxk: support security statistics
Enabled rte_security stats operation based on the configuration
of SA options set while creating session.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:10 +02:00
Akhil Goyal
a86e5f56a4 net/cnxk: add capabilities for IPsec options
Added supported capabilities for various IPsec SA options.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:10 +02:00
Akhil Goyal
3790ab9b7a net/cnxk: add capabilities for IPsec crypto algos
Added supported crypto algorithms for inline IPsec
offload.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:09 +02:00
Akhil Goyal
243e23bccc net/cnxk: update L3/L4 checksum offload in mbuf
When the packet is processed with inline IPsec offload,
the ol_flags were updated only with RTE_MBUF_F_RX_SEC_OFFLOAD.

But the hardware can also update the L3/L4 csum offload flags.
Hence, ol_flags are updated with RTE_MBUF_F_RX_IP_CKSUM_GOOD,
RTE_MBUF_F_RX_L4_CKSUM_GOOD, etc based on the microcode completion
codes.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:08 +02:00
Nithin Dabilpuram
c48b1488ac net/cnxk: optimize Rx fast path for security offload
Optimize Rx fast path for security packets by preprocessing
most of the operations such as sa pointer compute,
inner WQE pointer fetch and microcode completion translation
before the pkt is characterized as inbound inline pkt.

Preprocessed info will be discarded if packet is not
found to be security pkt. Also fix fetching of CQ word5
for vector mode. Get ucode completion code from CPT parse
header and RLEN from IP4v/IPv6 decrypted packet as it is
in same 64B cacheline as CPT parse header in most of
the cases. By this method, we avoid accessing an extra
cacheline

Fixes: c062f5726f ("net/cnxk: support IP reassembly")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:07 +02:00
Akhil Goyal
9aa9722963 net/cnxk: support decrement TTL for inline IPsec
Added support for decrementing TTL(IPv4)/hoplimit(IPv6)
while doing inline IPsec processing if the security session
SA options is enabled with dec_ttl.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:06 +02:00
Akhil Goyal
4f3c07b73b net/cnxk: reset offload flag if reassembly is disabled
The rx offload flag need to be reset if IP reassembly flag
is not set while calling reassembly_conf_set.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:05 +02:00
Akhil Goyal
76e0dd1131 net/cnxk: update environment variable for debug IV
Changed environment variable name for specifying
debug IV for unit testing of inline IPsec offload
with known test vectors.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:04 +02:00
Rakesh Kudurumalla
b106656542 net/cnxk: update inline device in ethdev telemetry
Inline PF_FUNC is updated in ethdev_tel_handle_info(),
when inline device is attached to any dpdk process

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:03 +02:00
Nithin Dabilpuram
2e668c547f net/cnxk: fix roundup size with transport mode
For transport mode, roundup needs to be based on L4 data
and shouldn't include L3 length.

By including L3 length, rlen that is calculated and put in
send hdr would cross the final length of the packet in some
scenarios where padding is necessary.

Also when outer and inner checksum offload flags are enabled,
get the l2_len and l3_len from il3ptr and il4ptr.

Fixes: 55bfac717c ("net/cnxk: support Tx security offload on cn10k")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:02 +02:00
Nithin Dabilpuram
1e1bfd078e net/cnxk: disable default inner checksum for outbound inline
Disable default inner L3/L4 checksum generation for outbound inline
path and enable based on SA options or RTE_MBUF flags as per
the spec. Though the checksum generation is not impacting much
performance, it is overwriting zero checksum for UDP packets
which is not always good.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:01 +02:00
Nithin Dabilpuram
39279dd904 net/cnxk: add barrier after meta batch free in scalar
Add barrier after meta batch free in scalar routine when
LMT lines are exactly full to make sure that next LMT line user
in Tx only starts writing the lines only when previous stoerl's
are complete.

Fixes: 4382a7ccf7 ("net/cnxk: support Rx security offload on cn10k")
Cc: stable@dpdk.org

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:27:00 +02:00
Nithin Dabilpuram
852cedbaf2 net/cnxk: update LBK ethdev link info
Update link info of LBK ethdev i.e AF's VF's as always up
and 100G. This is because there is no phy for the LBK interfaces
and driver won't get a link update notification for the same.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:59 +02:00
Nithin Dabilpuram
5875d2ca19 net/cnxk: support loopback mode on AF VF
Support internal loopback mode on AF VF's using ROC by setting
Tx channel same as Rx channel.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-10 16:26:58 +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
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
8efa348e81 net/cnxk: support custom SA index
Adding cnxk device driver support to configure custom SA index.
Custom SA index can be configured as part of the session create
as SPI, and later original SPI can be updated using session update.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-07 11:45:01 +02:00
Kiran Kumar K
7df4ead354 net/cnxk: support parsing custom SA action
Adding devargs support to parse custom SA action.
Devargs can be specified in the following way.
-a 0002:02:00.0,custom_sa_act=1

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-07 11:45:01 +02:00
Gowrishankar Muthukrishnan
332cae00ad net/cnxk: fix out of bounds accesses
Fix out of bounds access in cmd array which was reported in coverity
scan.

Coverity issue: 375245, 375246, 375260, 375263, 375264, 375271
Coverity issue: 375278, 375279, 375273, 375274, 375275, 375276
Coverity issue: 375280, 375281, 375283, 375286
Fixes: c5b97e9883 ("net/cnxk: add cn10k template Tx functions to build")
Fixes: dd8c20eee4 ("net/cnxk: add cn9k template Tx functions to build")
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
938ba5f9b9 net/cnxk: fix uninitialized variables
Fix uninitialized scalar variable reported in coverity scan.

Coverity issue: 371876, 371877
Coverity issue: 371872, 371880
Fixes: 39dc567c19 ("net/cnxk: add Tx burst for CN9K")
Fixes: 19f3af2371 ("net/cnxk: add Tx burst for CN10K")
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
c8647cd7f3 net/cnxk: add message on flow parsing failure
Set the error message with rte_flow_error_set() API
when flow parsing fails.

Fixes: 8c009b4505 ("net/cnxk: support flow API")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-05-03 08:08:35 +02:00
Rahul Bhansali
5a75f63818 net/cnxk: use ROC errata API
Used errata APIs roc_errata_nix_has_no_drop_re() and
roc_errata_nix_has_cq_min_size_4k() instead of direct
ROC model check.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-02 20:31:30 +02:00
Sunil Kumar Kori
d49bdfcf0d net/cnxk: fix crash during hotplug detach operation
hot_plug application does not perform any port setup
configuration via rte_eth_dev_configure() API. All the probed
Ethernet ports do not contain any Rx and Tx queues.

While detaching a device via rte_eal_hotplug_remove(), CNXK
driver expects Rx and Tx queues structures populated during
reset of PFC. So application gets crashed as data->rx_queues
and data->tx_queues are NULL.

Fixes: 9544713564 ("net/cnxk: support priority flow control")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-02 19:42:38 +02:00
Satheesh Paul
75902770ae net/cnxk: support mark pattern item type
Added support for RTE_FLOW_ITEM_TYPE_MARK. This item type
can be used to create ingress flow rules to match packets
from CPT's second pass packets.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-24 05:52:58 +02:00
Rakesh Kudurumalla
68f8a52a6b net/cnxk: fix build with optimization
Fix the following build error seen with --optimization=1 and
GCC 10.3.0.

drivers/net/cnxk/cnxk_ethdev_mtr.c: In function
‘cnxk_nix_mtr_policy_validate’:
lib/ethdev/rte_mtr_driver.h:188:10: error: ‘str’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]

drivers/net/cnxk/cn10k_rx.h:149:2 error: ‘frag_ptr’ may be
used uninitialized in this function

Bugzilla ID: 939
Fixes: b526599020 ("net/cnxk: fix build with GCC 12")
Cc: stable@dpdk.org

Reported-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Tested-by: Daxue Gao <daxuex.gao@intel.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-03-10 09:48:11 +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
Vamsi Attunuru
9d127f4404 net/cnxk: make inline inbound device usage as default
Currently inline inbound device usage is not default for eventdev,
patch renames force_inl_dev dev arg to no_inl_dev and enables inline
inbound device by default.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-25 09:20:35 +01:00
Satha Rao
50e2c7fdc1 net/cnxk: enable packet marking callbacks
cnxk platform supports red/yellow packet marking based on TM
configuration. This patch set hooks to enable/disable packet
marking for VLAN DEI, IP DSCP and IP ECN. Marking enabled only
in scalar mode.

Signed-off-by: Satha Rao <skoteshwar@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-25 08:47:53 +01:00
Vidya Sagar Velumuri
c062f5726f net/cnxk: support IP reassembly
Added capability and support for inline inbound IP reassembly
in cnxk driver. The IP reassembly offload is supported only
when the inline IPSec security offload is enabled.

In case of IP reassembly incomplete, the mbufs are attached
in the mbuf dynamic field and a dynamic flag is set accordingly.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 21:33:33 +01:00
Pavan Nikhilesh
592642c494 net/cnxk: align prefetches to CN10K cache model
Align prefetches for CN10K cache model for vWQE in Rx and Tx.
Move mbuf->next NULL assignment to Tx path and enabled it only
when multi segments offload is enabled to reduce L1 pressure.
Add macros to detect corrupted mbuf->next values when
MEMPOOL_DEBUG is set.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 21:31:48 +01:00