18558dcaaSPavan Nikhilesh.. SPDX-License-Identifier: BSD-3-Clause 28558dcaaSPavan Nikhilesh Copyright(c) 2021 Marvell. 38558dcaaSPavan Nikhilesh 48558dcaaSPavan NikhileshMarvell cnxk SSO Eventdev Driver 58558dcaaSPavan Nikhilesh================================ 68558dcaaSPavan Nikhilesh 78558dcaaSPavan NikhileshThe SSO PMD (**librte_event_cnxk**) and provides poll mode 88558dcaaSPavan Nikhilesheventdev driver support for the inbuilt event device found in the 98558dcaaSPavan Nikhilesh**Marvell OCTEON cnxk** SoC family. 108558dcaaSPavan Nikhilesh 118558dcaaSPavan NikhileshMore information about OCTEON cnxk SoC can be found at `Marvell Official Website 128558dcaaSPavan Nikhilesh<https://www.marvell.com/embedded-processors/infrastructure-processors/>`_. 138558dcaaSPavan Nikhilesh 148558dcaaSPavan NikhileshSupported OCTEON cnxk SoCs 158558dcaaSPavan Nikhilesh-------------------------- 168558dcaaSPavan Nikhilesh 178558dcaaSPavan Nikhilesh- CN9XX 188558dcaaSPavan Nikhilesh- CN10XX 19*45ce5425SPavan Nikhilesh- CN20XX 208558dcaaSPavan Nikhilesh 218558dcaaSPavan NikhileshFeatures 228558dcaaSPavan Nikhilesh-------- 238558dcaaSPavan Nikhilesh 248558dcaaSPavan NikhileshFeatures of the OCTEON cnxk SSO PMD are: 258558dcaaSPavan Nikhilesh 268558dcaaSPavan Nikhilesh- 256 Event queues 278558dcaaSPavan Nikhilesh- 26 (dual) and 52 (single) Event ports on CN9XX 288558dcaaSPavan Nikhilesh- 52 Event ports on CN10XX 298558dcaaSPavan Nikhilesh- HW event scheduler 308558dcaaSPavan Nikhilesh- Supports 1M flows per event queue 318558dcaaSPavan Nikhilesh- Flow based event pipelining 328558dcaaSPavan Nikhilesh- Flow pinning support in flow based event pipelining 338558dcaaSPavan Nikhilesh- Queue based event pipelining 348558dcaaSPavan Nikhilesh- Supports ATOMIC, ORDERED, PARALLEL schedule types per flow 358558dcaaSPavan Nikhilesh- Event scheduling QoS based on event queue priority 368558dcaaSPavan Nikhilesh- Open system with configurable amount of outstanding events limited only by 378558dcaaSPavan Nikhilesh DRAM 388558dcaaSPavan Nikhilesh- HW accelerated dequeue timeout support to enable power management 393d9a7181SShijith Thotton- HW managed event timers support through TIM, with high precision and 40*45ce5425SPavan Nikhilesh time granularity of 2.5us on CN9K and 1us on CN10K/CN20K. 413d9a7181SShijith Thotton- Up to 256 TIM rings a.k.a event timer adapters. 423d9a7181SShijith Thotton- Up to 8 rings traversed in parallel. 43cb4bfd6eSPavan Nikhilesh- HW managed packets enqueued from ethdev to eventdev exposed through event eth 44cb4bfd6eSPavan Nikhilesh RX adapter. 45cb4bfd6eSPavan Nikhilesh- N:1 ethernet device Rx queue to Event queue mapping. 46295968d1SFerruh Yigit- Lockfree Tx from event eth Tx adapter using ``RTE_ETH_TX_OFFLOAD_MT_LOCKFREE`` 47cb4bfd6eSPavan Nikhilesh capability while maintaining receive packet order. 48cb4bfd6eSPavan Nikhilesh- Full Rx/Tx offload support defined through ethdev queue configuration. 49*45ce5425SPavan Nikhilesh- HW managed event vectorization on CN10K/CN20K for packets enqueued from ethdev 50*45ce5425SPavan Nikhilesh to eventdev configurable per each Rx queue in Rx adapter. 51cb4bfd6eSPavan Nikhilesh- Event vector transmission via Tx adapter. 52da693ffeSPavan Nikhilesh- Up to 2 event link profiles. 538558dcaaSPavan Nikhilesh 548558dcaaSPavan NikhileshPrerequisites and Compilation procedure 558558dcaaSPavan Nikhilesh--------------------------------------- 568558dcaaSPavan Nikhilesh 578558dcaaSPavan Nikhilesh See :doc:`../platform/cnxk` for setup information. 588558dcaaSPavan Nikhilesh 59e656d40fSShijith Thotton 60e656d40fSShijith ThottonRuntime Config Options 61e656d40fSShijith Thotton---------------------- 62e656d40fSShijith Thotton 63e656d40fSShijith Thotton- ``Maximum number of in-flight events`` (default ``8192``) 64e656d40fSShijith Thotton 65e656d40fSShijith Thotton In **Marvell OCTEON cnxk** the max number of in-flight events are only limited 66e656d40fSShijith Thotton by DRAM size, the ``xae_cnt`` devargs parameter is introduced to provide 67e656d40fSShijith Thotton upper limit for in-flight events. 68e656d40fSShijith Thotton 69e656d40fSShijith Thotton For example:: 70e656d40fSShijith Thotton 71e656d40fSShijith Thotton -a 0002:0e:00.0,xae_cnt=16384 72e656d40fSShijith Thotton 737ffa7379SPavan Nikhilesh- ``CN9K Getwork mode`` 747ffa7379SPavan Nikhilesh 757ffa7379SPavan Nikhilesh CN9K ``single_ws`` devargs parameter is introduced to select single workslot 767ffa7379SPavan Nikhilesh mode in SSO and disable the default dual workslot mode. 777ffa7379SPavan Nikhilesh 787ffa7379SPavan Nikhilesh For example:: 797ffa7379SPavan Nikhilesh 807ffa7379SPavan Nikhilesh -a 0002:0e:00.0,single_ws=1 817ffa7379SPavan Nikhilesh 8238c2e324SShijith Thotton- ``Event Group QoS support`` 8338c2e324SShijith Thotton 8438c2e324SShijith Thotton SSO GGRPs i.e. queue uses DRAM & SRAM buffers to hold in-flight 8538c2e324SShijith Thotton events. By default the buffers are assigned to the SSO GGRPs to 8638c2e324SShijith Thotton satisfy minimum HW requirements. SSO is free to assign the remaining 8738c2e324SShijith Thotton buffers to GGRPs based on a preconfigured threshold. 8838c2e324SShijith Thotton We can control the QoS of SSO GGRP by modifying the above mentioned 8938c2e324SShijith Thotton thresholds. GGRPs that have higher importance can be assigned higher 9038c2e324SShijith Thotton thresholds than the rest. The dictionary format is as follows 91bd1cf511SShijith Thotton [Qx-TAQ-IAQ][Qz-TAQ-IAQ] expressed in percentages, 0 represents default. 9238c2e324SShijith Thotton 9338c2e324SShijith Thotton For example:: 9438c2e324SShijith Thotton 95bd1cf511SShijith Thotton -a 0002:0e:00.0,qos=[1-50-50] 9638c2e324SShijith Thotton 97*45ce5425SPavan Nikhilesh- ``CN10K/CN20K WQE stashing support`` 9820345cbdSPavan Nikhilesh 99*45ce5425SPavan Nikhilesh CN10K/CN20K supports stashing the scheduled WQE carried by `rte_event` to the 10020345cbdSPavan Nikhilesh cores L2 Dcache. The number of cache lines to be stashed and the offset 10120345cbdSPavan Nikhilesh is configurable per HWGRP i.e. event queue. The dictionary format is as 10220345cbdSPavan Nikhilesh follows `[Qx|stash_offset|stash_length]` here the stash offset can be 10320345cbdSPavan Nikhilesh a negative integer. 10420345cbdSPavan Nikhilesh By default, stashing is enabled on queues which have been connected to 10520345cbdSPavan Nikhilesh Rx adapter. Both MBUF and NIX_RX_WQE_HDR + NIX_RX_PARSE_S are stashed. 10620345cbdSPavan Nikhilesh 10720345cbdSPavan Nikhilesh For example:: 10820345cbdSPavan Nikhilesh 10920345cbdSPavan Nikhilesh For stashing mbuf on queue 0 and mbuf + headroom on queue 1 11020345cbdSPavan Nikhilesh -a 0002:0e:00.0,stash="[0|-1|1][1|-1|2]" 11120345cbdSPavan Nikhilesh 112cb4bfd6eSPavan Nikhilesh- ``Force Rx Back pressure`` 113cb4bfd6eSPavan Nikhilesh 114cb4bfd6eSPavan Nikhilesh Force Rx back pressure when same mempool is used across ethernet device 115cb4bfd6eSPavan Nikhilesh connected to event device. 116cb4bfd6eSPavan Nikhilesh 117cb4bfd6eSPavan Nikhilesh For example:: 118cb4bfd6eSPavan Nikhilesh 119cb4bfd6eSPavan Nikhilesh -a 0002:0e:00.0,force_rx_bp=1 120cb4bfd6eSPavan Nikhilesh 1211b06a817SPavan Nikhilesh- ``TIM disable NPA`` 1221b06a817SPavan Nikhilesh 1231b06a817SPavan Nikhilesh By default chunks are allocated from NPA then TIM can automatically free 1241b06a817SPavan Nikhilesh them when traversing the list of chunks. The ``tim_disable_npa`` devargs 1251b06a817SPavan Nikhilesh parameter disables NPA and uses software mempool to manage chunks 1261b06a817SPavan Nikhilesh 1271b06a817SPavan Nikhilesh For example:: 1281b06a817SPavan Nikhilesh 1291b06a817SPavan Nikhilesh -a 0002:0e:00.0,tim_disable_npa=1 1301b06a817SPavan Nikhilesh 131a66fa856SShijith Thotton- ``TIM modify chunk slots`` 132a66fa856SShijith Thotton 133a66fa856SShijith Thotton The ``tim_chnk_slots`` devargs can be used to modify number of chunk slots. 134a66fa856SShijith Thotton Chunks are used to store event timers, a chunk can be visualised as an array 135a66fa856SShijith Thotton where the last element points to the next chunk and rest of them are used to 136a66fa856SShijith Thotton store events. TIM traverses the list of chunks and enqueues the event timers 137a66fa856SShijith Thotton to SSO. The default value is 255 and the max value is 4095. 138a66fa856SShijith Thotton 139a66fa856SShijith Thotton For example:: 140a66fa856SShijith Thotton 141a66fa856SShijith Thotton -a 0002:0e:00.0,tim_chnk_slots=1023 142a66fa856SShijith Thotton 143853623b9SShijith Thotton- ``TIM enable arm/cancel statistics`` 144853623b9SShijith Thotton 145853623b9SShijith Thotton The ``tim_stats_ena`` devargs can be used to enable arm and cancel stats of 146853623b9SShijith Thotton event timer adapter. 147853623b9SShijith Thotton 148853623b9SShijith Thotton For example:: 149853623b9SShijith Thotton 150853623b9SShijith Thotton -a 0002:0e:00.0,tim_stats_ena=1 151853623b9SShijith Thotton 152a66fa856SShijith Thotton- ``TIM limit max rings reserved`` 153a66fa856SShijith Thotton 154a66fa856SShijith Thotton The ``tim_rings_lmt`` devargs can be used to limit the max number of TIM 155a66fa856SShijith Thotton rings i.e. event timer adapter reserved on probe. Since, TIM rings are HW 156a66fa856SShijith Thotton resources we can avoid starving other applications by not grabbing all the 157a66fa856SShijith Thotton rings. 158a66fa856SShijith Thotton 159a66fa856SShijith Thotton For example:: 160a66fa856SShijith Thotton 161a66fa856SShijith Thotton -a 0002:0e:00.0,tim_rings_lmt=5 162a66fa856SShijith Thotton 1638a3d58c1SShijith Thotton- ``TIM ring control internal parameters`` 1648a3d58c1SShijith Thotton 1658a3d58c1SShijith Thotton When using multiple TIM rings the ``tim_ring_ctl`` devargs can be used to 1668a3d58c1SShijith Thotton control each TIM rings internal parameters uniquely. The following dict 1678a3d58c1SShijith Thotton format is expected [ring-chnk_slots-disable_npa-stats_ena]. 0 represents 1688a3d58c1SShijith Thotton default values. 1698a3d58c1SShijith Thotton 1708a3d58c1SShijith Thotton For Example:: 1718a3d58c1SShijith Thotton 1728a3d58c1SShijith Thotton -a 0002:0e:00.0,tim_ring_ctl=[2-1023-1-0] 1738a3d58c1SShijith Thotton 1748bdbae66SPavan Nikhilesh- ``TIM external clock frequency`` 1758bdbae66SPavan Nikhilesh 1768bdbae66SPavan Nikhilesh The ``tim_eclk_freq`` devagrs can be used to pass external clock frequencies 1778bdbae66SPavan Nikhilesh when external clock source is selected. 1788bdbae66SPavan Nikhilesh 1798bdbae66SPavan Nikhilesh External clock frequencies are mapped as follows:: 1808bdbae66SPavan Nikhilesh 1818bdbae66SPavan Nikhilesh RTE_EVENT_TIMER_ADAPTER_EXT_CLK0 = TIM_CLK_SRC_10NS, 1828bdbae66SPavan Nikhilesh RTE_EVENT_TIMER_ADAPTER_EXT_CLK1 = TIM_CLK_SRC_GPIO, 1838bdbae66SPavan Nikhilesh RTE_EVENT_TIMER_ADAPTER_EXT_CLK2 = TIM_CLK_SRC_PTP, 1848bdbae66SPavan Nikhilesh RTE_EVENT_TIMER_ADAPTER_EXT_CLK3 = TIM_CLK_SRC_SYNCE 1858bdbae66SPavan Nikhilesh 1868bdbae66SPavan Nikhilesh The order of frequencies supplied to device args should be GPIO-PTP-SYNCE. 1878bdbae66SPavan Nikhilesh 1888bdbae66SPavan Nikhilesh For Example:: 1898bdbae66SPavan Nikhilesh 1908bdbae66SPavan Nikhilesh -a 0002:0e:00.0,tim_eclk_freq=122880000-1000000000-0 1918bdbae66SPavan Nikhilesh 192*45ce5425SPavan NikhileshPower Saving on CN10K/CN20K 193*45ce5425SPavan Nikhilesh--------------------------- 194b8dbcbe8SPavan Nikhilesh 195b8dbcbe8SPavan NikhileshARM cores can additionally use WFE when polling for transactions on SSO bus 196b8dbcbe8SPavan Nikhileshto save power i.e., in the event dequeue call ARM core can enter WFE and exit 197b8dbcbe8SPavan Nikhileshwhen either work has been scheduled or dequeue timeout has reached. 198b8dbcbe8SPavan NikhileshThis feature can be selected by configuring meson with ``RTE_ARM_USE_WFE`` enabled. 199b8dbcbe8SPavan Nikhilesh 2008558dcaaSPavan NikhileshDebugging Options 2018558dcaaSPavan Nikhilesh----------------- 2028558dcaaSPavan Nikhilesh 2038558dcaaSPavan Nikhilesh.. _table_octeon_cnxk_event_debug_options: 2048558dcaaSPavan Nikhilesh 2058558dcaaSPavan Nikhilesh.. table:: OCTEON cnxk event device debug options 2068558dcaaSPavan Nikhilesh 2078558dcaaSPavan Nikhilesh +---+------------+-------------------------------------------------------+ 2088558dcaaSPavan Nikhilesh | # | Component | EAL log command | 2098558dcaaSPavan Nikhilesh +===+============+=======================================================+ 210455a771fSAnoob Joseph | 1 | SSO | --log-level='pmd\.common\.cnxk\.event,8' | 2118558dcaaSPavan Nikhilesh +---+------------+-------------------------------------------------------+ 212455a771fSAnoob Joseph | 2 | TIM | --log-level='pmd\.common\.cnxk\.timer,8' | 2133d9a7181SShijith Thotton +---+------------+-------------------------------------------------------+ 214cb4bfd6eSPavan Nikhilesh 215cb4bfd6eSPavan NikhileshLimitations 216cb4bfd6eSPavan Nikhilesh----------- 217cb4bfd6eSPavan Nikhilesh 218cb4bfd6eSPavan NikhileshRx adapter support 219cb4bfd6eSPavan Nikhilesh~~~~~~~~~~~~~~~~~~ 220cb4bfd6eSPavan Nikhilesh 221cb4bfd6eSPavan NikhileshUsing the same mempool for all the ethernet device ports connected to 222cb4bfd6eSPavan Nikhileshevent device would cause back pressure to be asserted only on the first 223cb4bfd6eSPavan Nikhileshethernet device. 224cb4bfd6eSPavan NikhileshBack pressure is automatically disabled when using same mempool for all the 225cb4bfd6eSPavan Nikhileshethernet devices connected to event device to override this applications can 226cb4bfd6eSPavan Nikhileshuse `force_rx_bp=1` device arguments. 227cb4bfd6eSPavan NikhileshUsing unique mempool per each ethernet device is recommended when they are 228cb4bfd6eSPavan Nikhileshconnected to event device. 2291693345bSAmit Prakash Shukla 2301693345bSAmit Prakash ShuklaDMA adapter new mode support 2311693345bSAmit Prakash Shukla~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2321693345bSAmit Prakash Shukla 2331693345bSAmit Prakash ShuklaDMA driver does not support DMA adapter configured in new mode. 234