Commit Graph

135 Commits

Author SHA1 Message Date
Volodymyr Fialko
96798dcfc2 crypto/cnxk: support event vectorization
Add support for vector aggregation of crypto operations for cn10k.
Crypto operations will be grouped by sub event type, flow id, scheduler
type and queue id fields from  rte_event_crypto_metadata::response_info.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2022-10-02 20:33:25 +02:00
Volodymyr Fialko
c1749bc5ee eventdev: introduce event cryptodev vector type
Introduce ability to aggregate crypto operations processed by event
crypto adapter into single event containing rte_event_vector whose event
type is RTE_EVENT_TYPE_CRYPTODEV_VECTOR.

Application should set RTE_EVENT_CRYPTO_ADAPTER_EVENT_VECTOR in
rte_event_crypto_adapter_queue_conf::flag and provide vector configuration
with respect of rte_event_crypto_adapter_vector_limits, which could be
obtained by calling rte_event_crypto_adapter_vector_limits_get, to enable
vectorization.

The event crypto adapter would be responsible for vectorizing the crypto
operations based on provided response information in
rte_event_crypto_metadata::response_info.

Updated drivers and tests accordingly to new API.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-02 20:33:24 +02:00
Pavan Nikhilesh
edbb4c09c5 event/cnxk: fix missing xstats operations
Fix missing xstats ops registration when initializing event device.

Fixes: b5a52c9d97 ("event/cnxk: add event port and queue xstats")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-30 09:15:48 +02:00
Pavan Nikhilesh
2367e7e0cf event/cnxk: update event vector Tx routine
Update event vector transmit routine to honor elem_offset.
Use ``rte_event_vector::elem_offset`` to report partial
vector transmission to the application when there is not
enough space in the SQ.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-27 15:41:59 +02:00
Pavan Nikhilesh
a6d13f59e6 event/cnxk: disable timer resolution estimation
Disable timer resolution estimation, read TIM LF clock registers
to get the current running clock counter as estimating causes
time drift.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-27 12:56:38 +02:00
Pavan Nikhilesh
4b5ffa6a05 event/cnxk: set dequeue mode to prefetch with wait
Set default GetWork(dequeue) mode to prefetch with wait for
event.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-27 12:56:38 +02:00
Pavan Nikhilesh
e3c0049d16 event/cnxk: avoid reading non-cached registers
Avoid reading non-cached registers in fastpath.
PENDSTATE need not be read before tag flush in Tx enqueue
context as we have additional checks prior to check for
pending flushes.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-27 12:56:38 +02:00
Shijith Thotton
bd1cf51125 event/cnxk: remove option to limit XAQ
Removed support to limit XAQ from devargs. If XAQ is limited, new add
works could run out of XAQ entries and disable the queue.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
2022-09-27 12:55:39 +02:00
Volodymyr Fialko
661aeb251c crypto/cnxk: add burst enqueue for event mode
Added support for burst enqueue for cn10k event crypto adapter.
Instructions will be grouped based on the queue pair and sent in a burst.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-09-27 17:18:45 +02:00
Pavan Nikhilesh
3fe71706ab event/cnxk: fix stale data in workslot
Fix stale XAQ depth check pointers in workslot memory after
XAQ pool resize.

Fixes: bd64a963d2 ("event/cnxk: use common XAQ pool functions")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-27 05:22:51 +02:00
Shijith Thotton
2f279a1b6e eventdev: add weight and affinity attributes to queue conf
Added new fields to represent event queue weight and affinity in
rte_event_queue_conf structure. Internal op to get queue attribute is
removed as it is no longer needed. Updated driver to use the new field.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-09-26 15:34:57 +02:00
Rahul Bhansali
ffe6a6a109 event/cnxk: support reassembly functions
Add the support of reassembly functions callback
assignment to eventdev dequeue and dequeue_burst.

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

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
2022-09-26 15:33:47 +02:00
Pavan Nikhilesh
1c47a13510 event/cnxk: add preliminary Tx queue depth check
Add preliminary Tx queue depth check and return on failure.
Once the check passes, tx_adapter_enqueue() function becomes
a blocking call till it succeeds.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-26 15:33:47 +02:00
Shijith Thotton
8d5387a99a event/cnxk: move crypto adapter to respective file
Moved the common crypto adapter ops to file specific to eventdev
adapters.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
2022-09-26 15:33:44 +02:00
Vidya Sagar Velumuri
4440eb88dd net/cnxk: use full context IPsec structures
Use the Full context SA structures and command in IPsec fast path.
For inline outbound, populate CPT instruction as per full context.
Added new macros and functions with respect to full context.

Populate WQE ptr in CPT instruction with proper offset from mbuf.
Also add option to override outbound inline SA IV for debug
Update mbuf length based on IP version in Rx post process purposes
via environment variable.

User can set env variable as:
export ETH_SEC_IV_OVR="0x0, 0x0,..."

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:13 +02:00
Nithin Dabilpuram
780b9c8924 net/cnxk: support zero AURA for inline meta
Add support for zero aura for inline meta packets and register
callback to ROC to create meta pool via mempool. Also
add devargs to override meta buffer count and size.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:44:10 +02:00
Pavan Nikhilesh
1134d75881 cnxk/net: add FC check in vector event Tx path
Add FC check in vector event Tx path, the check needs to be
performed after head wait right before LMTST is issued.
Since, SQB pool FC updates are delayed w.r.t the actual
utilization of pool add sufficient slack to avoid overflow.

Added a new device argument to override the default SQB slack
configured, can be used as follows:

    -a 0002:02:00.0,sqb_slack=32

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-09-22 10:43:54 +02:00
Pavan Nikhilesh
f1cdb3c5b6 net/cnxk: enable PTP for event Rx adapter
Add support to enable PTP per ethernet device when that
specific ethernet device is connected to event device via
Rx adapter.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
2022-09-22 10:43:53 +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
Volodymyr Fialko
7e9a9600de event/cnxk: initialize work slot read cache
Initialize gw_rdata with tag type EMPTY. Leaving tag type as
zero(ATOMIC) may cause some unnecessary head wait, if cache will be used
before the first update in dequeue/get_work functions.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2022-06-20 21:00:40 +02:00
Volodymyr Fialko
6a24c7c4bc event/cnxk: add Tx adapter freeing
Tx adapter allocate data during eth_tx_adapter_queue_add() call and
it's only cleaned but not freed during eth_tx_adapter_queue_del().
Implemented eth_tx_adapter_free() callback to free adapter data.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2022-06-13 08:00:09 +02:00
Pavan Nikhilesh
7344c7db5d event/cnxk: fix Tx adapter enqueue return for CN10K
The `rte_event_eth_tx_adapter_enqueue()` function expects driver layer
to return the total number of events successfully transmitted.
Fix cn10k driver returning the number of packets transmitted in a
event vector instead of number of events.

Fixes: 761a321acf ("event/cnxk: support vectorized Tx event fast path")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-06-13 07:58:21 +02:00
Shijith Thotton
448e2400fa event/cnxk: fix QoS parameter handling
Fixed QoS parameters getting over written and IAQ/TAQ threshold
calculation.

Fixes: 910da32c53 ("event/cnxk: add device start")
Cc: stable@dpdk.org

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
2022-06-13 07:58:17 +02:00
Anoob Joseph
53668249c5 crypto/cnxk: add CPT hardware flow control checks
Add hardware supported flow control checks before enqueueing to CPT.
Since both poll mode and event mode can be used at the same time, add
hardware flow control checks to make sure s/w doesn't over submit to
hardware queues. For cn9k, queue depth usage is not high and so FC check
is omitted for poll mode.

To allow for more accurate updates, flow control hardware setting is
updated to give an update per 32 packets. In case of crypto adapter,
multiple cores can enqueue to the same CPT LF at the same time. To
allow such a case, flow control threshold is updated when the adapter
is configured.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-06-21 20:04:50 +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
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
Shijith Thotton
68c050954f event/cnxk: flush event queues over multiple pass
If an event queue flush does not complete after a fixed number of tries,
remaining queues are flushed before retrying the one with incomplete
flush.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
2022-05-17 16:43:57 +02:00
Shijith Thotton
7da7925f99 event/cnxk: support setting queue attributes at runtime
Added API to set queue attributes at runtime and API to get weight and
affinity.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:43:55 +02:00
Pavan Nikhilesh
e8594de273 event/cnxk: implement event port quiesce function
Implement event port quiesce function to clean up any lcore
resources used.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-05-17 16:43:36 +02:00
Pavan Nikhilesh
c0a9774f03 event/cnxk: move post-processing to separate function
Move event post-processing to a separate function.
Do complete event post-processing in tear-down functions to prevent
incorrect memory free.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-05-17 16:43:01 +02:00
Pavan Nikhilesh
c8b1008d33 event/cnxk: add checks in release operation
Add additional checks while performing RTE_EVENT_OP_RELEASE to
ensure that there are no pending SWTAGs and FLUSHEs in flight.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-05-17 16:42:57 +02:00
Gowrishankar Muthukrishnan
2f5b0c4862 event/cnxk: fix out of bounds access in test
Fix out of bounds array access reported in coverity scan.

Coverity issue: 375817
Fixes: 2351506401 ("event/cnxk: add SSO selftest and dump")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:42:44 +02:00
Volodymyr Fialko
80bb303d3b event/cnxk: fix base pointer for SSO head wait
Function roc_sso_hws_head_wait() expects a base as input pointer, and it
will itself get tag_op from the base. By passing tag_op instead of base
pointer to this function will add SSOW_LF_GWS_TAG register offset twice,
which will lead to accessing wrong register.

Fixes: 1f5b3d55c0 ("event/cnxk: store and reuse workslot status")
Cc: stable@dpdk.org

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-17 16:42:27 +02:00
Pavan Nikhilesh
fc39f62560 event/cnxk: fix Rx adapter config check
The rx_queue_flags should be checked against
RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID flag.

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

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-03-03 07:48:09 +01:00
Pavan Nikhilesh
b4766203dd event/cnxk: fix sub-event clearing mask length
Fix incorrect mask used when clearing subevent type masking out
useful data.

Fixes: e239e0d3fa ("event/cnxk: add SSO HW device operations")
Cc: stable@dpdk.org

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-03-03 07:47:47 +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
Rakesh Kudurumalla
68c48ab318 net/cnxk: add SoC specific PTP timestamp read
Timestamp resolution for an incoming and outgoing packets
is different for CN10k and CN9K. Added SoC specific
callback to retrieve timestamp in correct format
when read by application.

Signed-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-24 11:04:49 +01:00
Nithin Dabilpuram
7a709964d9 net/cnxk: use NPA batch burst free for meta buffers
Currently meta buffers are freed in bursts of one LMT line
i.e 15 pointers. Instead free them in bursts of 16 LMTlines
which is 240 ptrs for better perf.

Also mark mempool objects as get and put in missing places.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-23 17:37:44 +01:00
Rahul Bhansali
4e00823dcc net/cnxk: fix mbuf data length
If multi-segment is enabled and single segment/packet
is received, then mbuf data_len is not updated in
cn9k_nix_cqe_to_mbuf() function.
Also, in case of timestamp is enabled, mbuf data_len
and pkt_len will be updated for all packets including
multi segmented packets.

Fixes: 7c6bee3406 ("net/cnxk: enable PTP processing in vector Rx")
Cc: stable@dpdk.org

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-02-16 14:36:00 +01:00
Pavan Nikhilesh
99f7941037 event/cnxk: update SQB FC check for Tx adapter
Update SQB limit to include CPT queue size when Security
offload is enabled.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-02-22 10:50:54 +01:00
Pavan Nikhilesh
542328206c event/cnxk: remove deschedule usage in CN9K
Using deschedule cmd might incorrectly ignore updates
to WQE, GGRP on CN9K.
Use addwork to pipeline work instead.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
2022-02-22 10:50:54 +01:00
Gowrishankar Muthukrishnan
de3f033e54 event/cnxk: fix uninitialized local variables
Fix uninitialized local variable as reported in coverity scan.

Coverity issue: 370578, 370579, 370587
Fixes: 300b796262 ("event/cnxk: add timer arm routine")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
2022-02-22 10:50:54 +01:00
Gowrishankar Muthukrishnan
315d14d705 event/cnxk: fix memory leaks
Fix memory leaks reported by coverity scan in
cnxk_tim_parse_clk_list()  and cnxk_tim_parse_ring_ctl_list()
functions on not freeing strduped memory.

Coverity issue: 374990 374991
Fixes: 8a3d58c189 ("event/cnxk: add option to control timer adapters")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
2022-02-22 10:49:48 +01:00
Gowrishankar Muthukrishnan
894851527e event/cnxk: fix variables casting
Fix incompatible casting on variables reported by coverity scan.

Coverity issue: 370582 370584
Fixes: 6223ede203 ("event/cnxk: add event port link and unlink")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
2022-02-22 10:45:33 +01:00