12da31591SAshwin Sekhar T K.. SPDX-License-Identifier: BSD-3-Clause 22da31591SAshwin Sekhar T K Copyright(C) 2021 Marvell. 32da31591SAshwin Sekhar T K 42da31591SAshwin Sekhar T Kcnxk NPA Mempool Driver 52da31591SAshwin Sekhar T K======================= 62da31591SAshwin Sekhar T K 72da31591SAshwin Sekhar T KThe cnxk NPA PMD (**librte_mempool_cnxk**) provides mempool driver support for 82da31591SAshwin Sekhar T Kthe integrated mempool device found in **Marvell OCTEON CN9K/CN10K** SoC family. 92da31591SAshwin Sekhar T K 102da31591SAshwin Sekhar T KMore information about cnxk SoC can be found at `Marvell Official Website 112da31591SAshwin Sekhar T K<https://www.marvell.com/embedded-processors/infrastructure-processors/>`_. 122da31591SAshwin Sekhar T K 132da31591SAshwin Sekhar T KFeatures 142da31591SAshwin Sekhar T K-------- 152da31591SAshwin Sekhar T K 162da31591SAshwin Sekhar T Kcnxk NPA PMD supports: 172da31591SAshwin Sekhar T K 182da31591SAshwin Sekhar T K- Up to 128 NPA LFs 192da31591SAshwin Sekhar T K- 1M Pools per LF 202da31591SAshwin Sekhar T K- HW mempool manager 212da31591SAshwin Sekhar T K- Ethdev Rx buffer allocation in HW to save CPU cycles in the Rx path. 222da31591SAshwin Sekhar T K- Ethdev Tx buffer recycling in HW to save CPU cycles in the Tx path. 232da31591SAshwin Sekhar T K 242655241aSAshwin Sekhar T KCN9k NPA supports: 252655241aSAshwin Sekhar T K 262655241aSAshwin Sekhar T K- Burst alloc of up to 32 pointers. 272655241aSAshwin Sekhar T K 28db2a347aSAshwin Sekhar T KCN10k NPA supports: 29db2a347aSAshwin Sekhar T K 30db2a347aSAshwin Sekhar T K- Batch dequeue of up to 512 pointers with single instruction. 31db2a347aSAshwin Sekhar T K- Batch enqueue of up to 15 pointers with single instruction. 32db2a347aSAshwin Sekhar T K 332da31591SAshwin Sekhar T KPrerequisites and Compilation procedure 342da31591SAshwin Sekhar T K--------------------------------------- 352da31591SAshwin Sekhar T K 362da31591SAshwin Sekhar T K See :doc:`../platform/cnxk` for setup information. 372da31591SAshwin Sekhar T K 382da31591SAshwin Sekhar T KPre-Installation Configuration 392da31591SAshwin Sekhar T K------------------------------ 402da31591SAshwin Sekhar T K 412da31591SAshwin Sekhar T K 420a50a5aaSAshwin Sekhar T KRuntime Config Options 430a50a5aaSAshwin Sekhar T K~~~~~~~~~~~~~~~~~~~~~~ 440a50a5aaSAshwin Sekhar T K 450a50a5aaSAshwin Sekhar T K- ``Maximum number of mempools per application`` (default ``128``) 460a50a5aaSAshwin Sekhar T K 470a50a5aaSAshwin Sekhar T K The maximum number of mempools per application needs to be configured on 480a50a5aaSAshwin Sekhar T K HW during mempool driver initialization. HW can support up to 1M mempools, 490a50a5aaSAshwin Sekhar T K Since each mempool costs set of HW resources, the ``max_pools`` ``devargs`` 500a50a5aaSAshwin Sekhar T K parameter is being introduced to configure the number of mempools required 510a50a5aaSAshwin Sekhar T K for the application. 520a50a5aaSAshwin Sekhar T K For example:: 530a50a5aaSAshwin Sekhar T K 540a50a5aaSAshwin Sekhar T K -a 0002:02:00.0,max_pools=512 550a50a5aaSAshwin Sekhar T K 560a50a5aaSAshwin Sekhar T K With the above configuration, the driver will set up only 512 mempools for 570a50a5aaSAshwin Sekhar T K the given application to save HW resources. 580a50a5aaSAshwin Sekhar T K 590a50a5aaSAshwin Sekhar T K.. note:: 600a50a5aaSAshwin Sekhar T K 610a50a5aaSAshwin Sekhar T K Since this configuration is per application, the end user needs to 620a50a5aaSAshwin Sekhar T K provide ``max_pools`` parameter to the first PCIe device probed by the given 630a50a5aaSAshwin Sekhar T K application. 640a50a5aaSAshwin Sekhar T K 652da31591SAshwin Sekhar T KDebugging Options 662da31591SAshwin Sekhar T K~~~~~~~~~~~~~~~~~ 672da31591SAshwin Sekhar T K 682da31591SAshwin Sekhar T K.. _table_cnxk_mempool_debug_options: 692da31591SAshwin Sekhar T K 702da31591SAshwin Sekhar T K.. table:: cnxk mempool debug options 712da31591SAshwin Sekhar T K 722da31591SAshwin Sekhar T K +---+------------+-------------------------------------------------------+ 732da31591SAshwin Sekhar T K | # | Component | EAL log command | 742da31591SAshwin Sekhar T K +===+============+=======================================================+ 75*455a771fSAnoob Joseph | 1 | NPA | --log-level='pmd\.common\.cnxk\.mempool,8' | 762da31591SAshwin Sekhar T K +---+------------+-------------------------------------------------------+ 772da31591SAshwin Sekhar T K 782da31591SAshwin Sekhar T KStandalone mempool device 792da31591SAshwin Sekhar T K~~~~~~~~~~~~~~~~~~~~~~~~~ 802da31591SAshwin Sekhar T K 812da31591SAshwin Sekhar T K The ``usertools/dpdk-devbind.py`` script shall enumerate all the mempool 822da31591SAshwin Sekhar T K devices available in the system. In order to avoid, the end user to bind the 832da31591SAshwin Sekhar T K mempool device prior to use ethdev and/or eventdev device, the respective 842da31591SAshwin Sekhar T K driver configures an NPA LF and attach to the first probed ethdev or eventdev 852da31591SAshwin Sekhar T K device. In case, if end user need to run mempool as a standalone device 862da31591SAshwin Sekhar T K (without ethdev or eventdev), end user needs to bind a mempool device using 872da31591SAshwin Sekhar T K ``usertools/dpdk-devbind.py`` 8889627db1SAshwin Sekhar T K 8989627db1SAshwin Sekhar T K Example command to run ``mempool_autotest`` test with standalone CN10K NPA device:: 9089627db1SAshwin Sekhar T K 9189627db1SAshwin Sekhar T K echo "mempool_autotest" | <build_dir>/app/test/dpdk-test -c 0xf0 --mbuf-pool-ops-name="cn10k_mempool_ops" 92