15feecc57SShahaf Shuler.. SPDX-License-Identifier: BSD-3-Clause 23b47f9acSAdrien Mazarguil Copyright 2012 6WIND S.A. 35feecc57SShahaf Shuler Copyright 2015 Mellanox Technologies, Ltd 4972e365bSThomas Monjalon 50f91f952SThomas MonjalonNVIDIA MLX4 Ethernet Driver 60f91f952SThomas Monjalon=========================== 70f91f952SThomas Monjalon 80f91f952SThomas Monjalon.. note:: 90f91f952SThomas Monjalon 100f91f952SThomas Monjalon NVIDIA acquired Mellanox Technologies in 2020. 110f91f952SThomas Monjalon The DPDK documentation and code might still include instances 120f91f952SThomas Monjalon of or references to Mellanox trademarks (like BlueField and ConnectX) 130f91f952SThomas Monjalon that are now NVIDIA trademarks. 14972e365bSThomas Monjalon 158809f78cSBruce RichardsonThe MLX4 poll mode driver library (**librte_net_mlx4**) implements support 160f91f952SThomas Monjalonfor **NVIDIA ConnectX-3** and **NVIDIA ConnectX-3 Pro** 10/40 Gbps adapters 1767d48c2cSOlga Shernas well as their virtual functions (VF) in SR-IOV context. 1893fa8c0eSAdrien Mazarguil 1993fa8c0eSAdrien MazarguilThere is also a `section dedicated to this poll mode driver 20ec490898SMichael Baum<https://developer.nvidia.com/networking/dpdk>`_. 21972e365bSThomas Monjalon 22972e365bSThomas Monjalon 23972e365bSThomas MonjalonImplementation details 24972e365bSThomas Monjalon---------------------- 25972e365bSThomas Monjalon 260f91f952SThomas MonjalonMost NVIDIA ConnectX-3 devices provide two ports but expose a single PCI 278809f78cSBruce Richardsonbus address, thus unlike most drivers, librte_net_mlx4 registers itself as a 28972e365bSThomas MonjalonPCI driver that allocates one Ethernet device per detected port. 29972e365bSThomas Monjalon 30db27370bSStephen HemmingerFor this reason, one cannot block (or allow) a single port without also 31db27370bSStephen Hemmingerblocking (or allowing) the others on the same device. 32972e365bSThomas Monjalon 33972e365bSThomas MonjalonBesides its dependency on libibverbs (that implies libmlx4 and associated 348809f78cSBruce Richardsonkernel support), librte_net_mlx4 relies heavily on system calls for control 35972e365bSThomas Monjalonoperations such as querying/updating the MTU and flow control parameters. 36972e365bSThomas Monjalon 37972e365bSThomas MonjalonFor security reasons and robustness, this driver only deals with virtual 38972e365bSThomas Monjalonmemory addresses. The way resources allocations are handled by the kernel 39972e365bSThomas Monjaloncombined with hardware specifications that allow it to handle virtual memory 40972e365bSThomas Monjalonaddresses directly ensure that DPDK applications cannot access random 41972e365bSThomas Monjalonphysical memory (or memory that does not belong to the current process). 42972e365bSThomas Monjalon 43972e365bSThomas MonjalonThis capability allows the PMD to coexist with kernel network interfaces 44972e365bSThomas Monjalonwhich remain functional, although they stop receiving unicast packets as 45972e365bSThomas Monjalonlong as they share the same MAC address. 46972e365bSThomas Monjalon 470e0fb943SThomas MonjalonThe :ref:`flow_isolated_mode` is supported. 480e0fb943SThomas Monjalon 498809f78cSBruce RichardsonCompiling librte_net_mlx4 causes DPDK to be linked against libibverbs. 50972e365bSThomas Monjalon 51972e365bSThomas MonjalonConfiguration 52972e365bSThomas Monjalon------------- 53972e365bSThomas Monjalon 54972e365bSThomas MonjalonCompilation options 55972e365bSThomas Monjalon~~~~~~~~~~~~~~~~~~~ 56972e365bSThomas Monjalon 5768d99d00SCiara PowerThe ibverbs libraries can be linked with this PMD in a number of ways, 5868d99d00SCiara Powerconfigured by the ``ibverbs_link`` build option: 5993fa8c0eSAdrien Mazarguil 6068d99d00SCiara Power- ``shared`` (default): the PMD depends on some .so files. 61972e365bSThomas Monjalon 6268d99d00SCiara Power- ``dlopen``: Split the dependencies glue in a separate library 6368d99d00SCiara Power loaded when needed by dlopen. 6468d99d00SCiara Power It make dependencies on libibverbs and libmlx4 optional, 6568d99d00SCiara Power and has no performance impact. 66972e365bSThomas Monjalon 6768d99d00SCiara Power- ``static``: Embed static flavor of the dependencies libibverbs and libmlx4 682c0dd7b6SThomas Monjalon in the PMD shared library or the executable static binary. 692c0dd7b6SThomas Monjalon 706affeabaSThomas Monjalon 71f6242d06SAdrien MazarguilEnvironment variables 72f6242d06SAdrien Mazarguil~~~~~~~~~~~~~~~~~~~~~ 73f6242d06SAdrien Mazarguil 74f6242d06SAdrien Mazarguil- ``MLX4_GLUE_PATH`` 75f6242d06SAdrien Mazarguil 76f6242d06SAdrien Mazarguil A list of directories in which to search for the rdma-core "glue" plug-in, 77f6242d06SAdrien Mazarguil separated by colons or semi-colons. 78f6242d06SAdrien Mazarguil 79f6242d06SAdrien Mazarguil 80972e365bSThomas MonjalonRun-time configuration 81972e365bSThomas Monjalon~~~~~~~~~~~~~~~~~~~~~~ 82972e365bSThomas Monjalon 838809f78cSBruce Richardson- librte_net_mlx4 brings kernel network interfaces up during initialization 84972e365bSThomas Monjalon because it is affected by their state. Forcing them down prevents packets 85972e365bSThomas Monjalon reception. 86972e365bSThomas Monjalon 87972e365bSThomas Monjalon- **ethtool** operations on related kernel interfaces also affect the PMD. 88972e365bSThomas Monjalon 89001a520eSGaetan Rivet- ``port`` parameter [int] 90001a520eSGaetan Rivet 91001a520eSGaetan Rivet This parameter provides a physical port to probe and can be specified multiple 92001a520eSGaetan Rivet times for additional ports. All ports are probed by default if left 93001a520eSGaetan Rivet unspecified. 94001a520eSGaetan Rivet 95f4efc0ebSYongseok Koh- ``mr_ext_memseg_en`` parameter [int] 96f4efc0ebSYongseok Koh 97f4efc0ebSYongseok Koh A nonzero value enables extending memseg when registering DMA memory. If 98f4efc0ebSYongseok Koh enabled, the number of entries in MR (Memory Region) lookup table on datapath 99f4efc0ebSYongseok Koh is minimized and it benefits performance. On the other hand, it worsens memory 100f4efc0ebSYongseok Koh utilization because registered memory is pinned by kernel driver. Even if a 101f4efc0ebSYongseok Koh page in the extended chunk is freed, that doesn't become reusable until the 102f4efc0ebSYongseok Koh entire memory is freed. 103f4efc0ebSYongseok Koh 104f4efc0ebSYongseok Koh Enabled by default. 105f4efc0ebSYongseok Koh 10693fa8c0eSAdrien MazarguilKernel module parameters 10793fa8c0eSAdrien Mazarguil~~~~~~~~~~~~~~~~~~~~~~~~ 10893fa8c0eSAdrien Mazarguil 10993fa8c0eSAdrien MazarguilThe **mlx4_core** kernel module has several parameters that affect the 1108809f78cSBruce Richardsonbehavior and/or the performance of librte_net_mlx4. Some of them are described 11193fa8c0eSAdrien Mazarguilbelow. 11293fa8c0eSAdrien Mazarguil 11393fa8c0eSAdrien Mazarguil- **num_vfs** (integer or triplet, optionally prefixed by device address 11493fa8c0eSAdrien Mazarguil strings) 11593fa8c0eSAdrien Mazarguil 11693fa8c0eSAdrien Mazarguil Create the given number of VFs on the specified devices. 11793fa8c0eSAdrien Mazarguil 11893fa8c0eSAdrien Mazarguil- **log_num_mgm_entry_size** (integer) 11993fa8c0eSAdrien Mazarguil 12093fa8c0eSAdrien Mazarguil Device-managed flow steering (DMFS) is required by DPDK applications. It is 12193fa8c0eSAdrien Mazarguil enabled by using a negative value, the last four bits of which have a 12293fa8c0eSAdrien Mazarguil special meaning. 12393fa8c0eSAdrien Mazarguil 12493fa8c0eSAdrien Mazarguil - **-1**: force device-managed flow steering (DMFS). 12593fa8c0eSAdrien Mazarguil - **-7**: configure optimized steering mode to improve performance with the 12671d6dac9SAdrien Mazarguil following limitation: VLAN filtering is not supported with this mode. 12771d6dac9SAdrien Mazarguil This is the recommended mode in case VLAN filter is not needed. 12893fa8c0eSAdrien Mazarguil 129ce07b151SOphir MunkLimitations 130ce07b151SOphir Munk----------- 131ce07b151SOphir Munk 1320203d33aSYongseok Koh- For secondary process: 1330203d33aSYongseok Koh 1340203d33aSYongseok Koh - Forked secondary process not supported. 1350203d33aSYongseok Koh - External memory unregistered in EAL memseg list cannot be used for DMA 1360203d33aSYongseok Koh unless such memory has been registered by ``mlx4_mr_update_ext_mp()`` in 1370203d33aSYongseok Koh primary process and remapped to the same virtual address in secondary 1380203d33aSYongseok Koh process. If the external memory is registered by primary process but has 1390203d33aSYongseok Koh different virtual address in secondary process, unexpected error may happen. 1400203d33aSYongseok Koh 141ce07b151SOphir Munk- CRC stripping is supported by default and always reported as "true". 142ce07b151SOphir Munk The ability to enable/disable CRC stripping requires OFED version 143ce07b151SOphir Munk 4.3-1.5.0.0 and above or rdma-core version v18 and above. 144ce07b151SOphir Munk 145ba576975SMoti Haimovsky- TSO (Transmit Segmentation Offload) is supported in OFED version 146ba576975SMoti Haimovsky 4.4 and above. 147ba576975SMoti Haimovsky 148*f4ccdfadSRaslan Darawsheh- RSS only works on power-of-two number of queues. 149*f4ccdfadSRaslan Darawsheh 150*f4ccdfadSRaslan Darawsheh- It is possible to open non-power-of-two queues, 151*f4ccdfadSRaslan Darawsheh but the PMD will round down to the highest power-of-two queues by default for RSS. 152*f4ccdfadSRaslan Darawsheh Other queues can be utilized through flow API. 153*f4ccdfadSRaslan Darawsheh Example:: 154*f4ccdfadSRaslan Darawsheh 155*f4ccdfadSRaslan Darawsheh ./dpdk-testpmd -a 08:00.0 -- -i --rxq 12 --txq 12 --rss-ip 156*f4ccdfadSRaslan Darawsheh 157*f4ccdfadSRaslan Darawsheh The first 8 queues will be used by default for RSS over IP. 158*f4ccdfadSRaslan Darawsheh The rest of the queues can be utilized with flow API like the following:: 159*f4ccdfadSRaslan Darawsheh 160*f4ccdfadSRaslan Darawsheh flow create 0 ingress pattern eth / ipv4 / tcp / end actions rss queues 8 9 10 11 end / end 161*f4ccdfadSRaslan Darawsheh 162*f4ccdfadSRaslan Darawsheh 163972e365bSThomas MonjalonPrerequisites 164972e365bSThomas Monjalon------------- 165972e365bSThomas Monjalon 166972e365bSThomas MonjalonThis driver relies on external libraries and kernel drivers for resources 167972e365bSThomas Monjalonallocations and initialization. The following dependencies are not part of 168972e365bSThomas MonjalonDPDK and must be installed separately: 169972e365bSThomas Monjalon 1708cfe3aafSMoti Haimovsky- **libibverbs** (provided by rdma-core package) 171972e365bSThomas Monjalon 1728809f78cSBruce Richardson User space verbs framework used by librte_net_mlx4. This library provides 173972e365bSThomas Monjalon a generic interface between the kernel and low-level user space drivers 174972e365bSThomas Monjalon such as libmlx4. 175972e365bSThomas Monjalon 176972e365bSThomas Monjalon It allows slow and privileged operations (context initialization, hardware 177972e365bSThomas Monjalon resources allocations) to be managed by the kernel and fast operations to 178972e365bSThomas Monjalon never leave user space. 179972e365bSThomas Monjalon 1808cfe3aafSMoti Haimovsky- **libmlx4** (provided by rdma-core package) 181972e365bSThomas Monjalon 1820f91f952SThomas Monjalon Low-level user space driver library for NVIDIA ConnectX-3 devices, 183972e365bSThomas Monjalon it is automatically loaded by libibverbs. 184972e365bSThomas Monjalon 185972e365bSThomas Monjalon This library basically implements send/receive calls to the hardware 186972e365bSThomas Monjalon queues. 187972e365bSThomas Monjalon 1888cfe3aafSMoti Haimovsky- **Kernel modules** 189972e365bSThomas Monjalon 190972e365bSThomas Monjalon They provide the kernel-side verbs API and low level device drivers that 191972e365bSThomas Monjalon manage actual hardware initialization and resources sharing with user 192972e365bSThomas Monjalon space processes. 193972e365bSThomas Monjalon 194972e365bSThomas Monjalon Unlike most other PMDs, these modules must remain loaded and bound to 195972e365bSThomas Monjalon their devices: 196972e365bSThomas Monjalon 1970f91f952SThomas Monjalon - mlx4_core: hardware driver managing NVIDIA ConnectX-3 devices. 198972e365bSThomas Monjalon - mlx4_en: Ethernet device driver that provides kernel network interfaces. 1997be78d02SJosh Soref - mlx4_ib: InfiniBand device driver. 200972e365bSThomas Monjalon - ib_uverbs: user space driver for verbs (entry point for libibverbs). 201972e365bSThomas Monjalon 20293fa8c0eSAdrien Mazarguil- **Firmware update** 20393fa8c0eSAdrien Mazarguil 2040f91f952SThomas Monjalon NVIDIA MLNX_OFED releases include firmware updates for ConnectX-3 adapters. 20593fa8c0eSAdrien Mazarguil 20693fa8c0eSAdrien Mazarguil Because each release provides new features, these updates must be applied to 20793fa8c0eSAdrien Mazarguil match the kernel modules and libraries they come with. 20893fa8c0eSAdrien Mazarguil 20993fa8c0eSAdrien Mazarguil.. note:: 21093fa8c0eSAdrien Mazarguil 21193fa8c0eSAdrien Mazarguil Both libraries are BSD and GPL licensed. Linux kernel modules are GPL 21293fa8c0eSAdrien Mazarguil licensed. 21393fa8c0eSAdrien Mazarguil 2148cfe3aafSMoti HaimovskyDepending on system constraints and user preferences either RDMA core library 2150f91f952SThomas Monjalonwith a recent enough Linux kernel release (recommended) or NVIDIA MLNX_OFED, 2168cfe3aafSMoti Haimovskywhich provides compatibility with older releases. 21793fa8c0eSAdrien Mazarguil 2188cfe3aafSMoti HaimovskyCurrent RDMA core package and Linux kernel (recommended) 2198cfe3aafSMoti Haimovsky~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22093fa8c0eSAdrien Mazarguil 2218cfe3aafSMoti Haimovsky- Minimal Linux kernel version: 4.14. 2228cfe3aafSMoti Haimovsky- Minimal RDMA core version: v15 (see `RDMA core installation documentation`_). 22393fa8c0eSAdrien Mazarguil 2242c0dd7b6SThomas Monjalon- Starting with rdma-core v21, static libraries can be built:: 2252c0dd7b6SThomas Monjalon 2262c0dd7b6SThomas Monjalon cd build 2275d267b5aSThomas Monjalon CFLAGS=-fPIC cmake -DENABLE_STATIC=1 -DNO_PYVERBS=1 -DNO_MAN_PAGES=1 -GNinja .. 2282c0dd7b6SThomas Monjalon ninja 2295d267b5aSThomas Monjalon ninja install 2302c0dd7b6SThomas Monjalon 2318cfe3aafSMoti Haimovsky.. _`RDMA core installation documentation`: https://raw.githubusercontent.com/linux-rdma/rdma-core/master/README.md 232972e365bSThomas Monjalon 2330f91f952SThomas Monjalon.. _OFED_as_a_fallback: 2348cfe3aafSMoti Haimovsky 2350f91f952SThomas MonjalonNVIDIA MLNX_OFED as a fallback 2360f91f952SThomas Monjalon~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2378cfe3aafSMoti Haimovsky 2380f91f952SThomas Monjalon- `NVIDIA MLNX_OFED`_ version: **4.4, 4.5, 4.6**. 2398cfe3aafSMoti Haimovsky- firmware version: **2.42.5000** and above. 2408cfe3aafSMoti Haimovsky 2410f91f952SThomas Monjalon.. _`NVIDIA MLNX_OFED`: https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/ 242972e365bSThomas Monjalon 243972e365bSThomas Monjalon.. note:: 244972e365bSThomas Monjalon 2450f91f952SThomas Monjalon Several versions of NVIDIA MLNX_OFED are available. Installing the version 24693fa8c0eSAdrien Mazarguil this DPDK release was developed and tested against is strongly 24793fa8c0eSAdrien Mazarguil recommended. Please check the `prerequisites`_. 24893fa8c0eSAdrien Mazarguil 2490f91f952SThomas MonjalonInstalling NVIDIA MLNX_OFED 2500f91f952SThomas Monjalon^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2513730c188SNelio Laranjeiro 252443b949eSDavid Marchand#. Download latest NVIDIA MLNX_OFED. 2535747882cSShahaf Shuler 254443b949eSDavid Marchand#. Install the required libraries and kernel modules either by installing 2550f91f952SThomas Monjalon only the required set, or by installing the entire NVIDIA MLNX_OFED: 2565747882cSShahaf Shuler 257499b461fSThomas Monjalon For bare metal use:: 2585747882cSShahaf Shuler 2598cfe3aafSMoti Haimovsky ./mlnxofedinstall --dpdk --upstream-libs 2605747882cSShahaf Shuler 261499b461fSThomas Monjalon For SR-IOV hypervisors use:: 2625747882cSShahaf Shuler 2638cfe3aafSMoti Haimovsky ./mlnxofedinstall --dpdk --upstream-libs --enable-sriov --hypervisor 2645747882cSShahaf Shuler 265499b461fSThomas Monjalon For SR-IOV virtual machine use:: 2665747882cSShahaf Shuler 2678cfe3aafSMoti Haimovsky ./mlnxofedinstall --dpdk --upstream-libs --guest 2685747882cSShahaf Shuler 269443b949eSDavid Marchand#. Verify the firmware is the correct one:: 2705747882cSShahaf Shuler 2715747882cSShahaf Shuler ibv_devinfo 2725747882cSShahaf Shuler 273443b949eSDavid Marchand#. Set all ports links to Ethernet, follow instructions on the screen:: 2745747882cSShahaf Shuler 2755747882cSShahaf Shuler connectx_port_config 2765747882cSShahaf Shuler 277443b949eSDavid Marchand#. Continue with :ref:`section 2 of the Quick Start Guide <QSG_2>`. 2788cfe3aafSMoti Haimovsky 2798cfe3aafSMoti Haimovsky.. _qsg: 2808cfe3aafSMoti Haimovsky 2818cfe3aafSMoti HaimovskyQuick Start Guide 2828cfe3aafSMoti Haimovsky----------------- 2838cfe3aafSMoti Haimovsky 284443b949eSDavid Marchand#. Set all ports links to Ethernet:: 2855747882cSShahaf Shuler 2865747882cSShahaf Shuler PCI=<NIC PCI address> 2875747882cSShahaf Shuler echo eth > "/sys/bus/pci/devices/$PCI/mlx4_port0" 2885747882cSShahaf Shuler echo eth > "/sys/bus/pci/devices/$PCI/mlx4_port1" 2895747882cSShahaf Shuler 2908cfe3aafSMoti Haimovsky .. note:: 2918cfe3aafSMoti Haimovsky 2920f91f952SThomas Monjalon If using NVIDIA MLNX_OFED one can permanently set the port link 2938cfe3aafSMoti Haimovsky to Ethernet using connectx_port_config tool provided by it. 2940f91f952SThomas Monjalon :ref:`OFED_as_a_fallback`: 2958cfe3aafSMoti Haimovsky 2968cfe3aafSMoti Haimovsky.. _QSG_2: 2978cfe3aafSMoti Haimovsky 298443b949eSDavid Marchand#. In case of bare metal or hypervisor, configure optimized steering mode 299499b461fSThomas Monjalon by adding the following line to ``/etc/modprobe.d/mlx4_core.conf``:: 3005747882cSShahaf Shuler 3015747882cSShahaf Shuler options mlx4_core log_num_mgm_entry_size=-7 3025747882cSShahaf Shuler 3035747882cSShahaf Shuler .. note:: 3045747882cSShahaf Shuler 3055747882cSShahaf Shuler If VLAN filtering is used, set log_num_mgm_entry_size=-1. 3065747882cSShahaf Shuler Performance degradation can occur on this case. 3075747882cSShahaf Shuler 308443b949eSDavid Marchand#. Restart the driver:: 3095747882cSShahaf Shuler 3105747882cSShahaf Shuler /etc/init.d/openibd restart 3115747882cSShahaf Shuler 312499b461fSThomas Monjalon or:: 3135747882cSShahaf Shuler 3145747882cSShahaf Shuler service openibd restart 3155747882cSShahaf Shuler 316443b949eSDavid Marchand#. Install DPDK and you are ready to go. 3172e978b26SThomas Monjalon See :doc:`compilation instructions <../linux_gsg/build_dpdk>`. 3185747882cSShahaf Shuler 3195747882cSShahaf ShulerPerformance tuning 3205747882cSShahaf Shuler------------------ 3215747882cSShahaf Shuler 322443b949eSDavid Marchand#. Verify the optimized steering mode is configured:: 3235747882cSShahaf Shuler 3245747882cSShahaf Shuler cat /sys/module/mlx4_core/parameters/log_num_mgm_entry_size 3255747882cSShahaf Shuler 326443b949eSDavid Marchand#. Use the CPU near local NUMA node to which the PCIe adapter is connected, 3275747882cSShahaf Shuler for better performance. For VMs, verify that the right CPU 328499b461fSThomas Monjalon and NUMA node are pinned according to the above. Run:: 3295747882cSShahaf Shuler 3304821fa10SThomas Monjalon lstopo-no-graphics --merge 3315747882cSShahaf Shuler 3325747882cSShahaf Shuler to identify the NUMA node to which the PCIe adapter is connected. 3335747882cSShahaf Shuler 334443b949eSDavid Marchand#. If more than one adapter is used, and root complex capabilities allow 3355747882cSShahaf Shuler to put both adapters on the same NUMA node without PCI bandwidth degradation, 3365747882cSShahaf Shuler it is recommended to locate both adapters on the same NUMA node. 3375747882cSShahaf Shuler This in order to forward packets from one to the other without 3385747882cSShahaf Shuler NUMA performance penalty. 3395747882cSShahaf Shuler 340443b949eSDavid Marchand#. Disable pause frames:: 3415747882cSShahaf Shuler 3425747882cSShahaf Shuler ethtool -A <netdev> rx off tx off 3435747882cSShahaf Shuler 344443b949eSDavid Marchand#. Verify IO non-posted prefetch is disabled by default. This can be checked 3455747882cSShahaf Shuler via the BIOS configuration. Please contact you server provider for more 3465747882cSShahaf Shuler information about the settings. 3475747882cSShahaf Shuler 3485747882cSShahaf Shuler .. note:: 3495747882cSShahaf Shuler 3505747882cSShahaf Shuler On some machines, depends on the machine integrator, it is beneficial 3515747882cSShahaf Shuler to set the PCI max read request parameter to 1K. This can be 3525747882cSShahaf Shuler done in the following way: 3535747882cSShahaf Shuler 354499b461fSThomas Monjalon To query the read request size use:: 3555747882cSShahaf Shuler 3565747882cSShahaf Shuler setpci -s <NIC PCI address> 68.w 3575747882cSShahaf Shuler 358499b461fSThomas Monjalon If the output is different than 3XXX, set it by:: 3595747882cSShahaf Shuler 3605747882cSShahaf Shuler setpci -s <NIC PCI address> 68.w=3XXX 3615747882cSShahaf Shuler 3625747882cSShahaf Shuler The XXX can be different on different systems. Make sure to configure 3635747882cSShahaf Shuler according to the setpci output. 3645747882cSShahaf Shuler 365443b949eSDavid Marchand#. To minimize overhead of searching Memory Regions: 3669797bfccSYongseok Koh 3679797bfccSYongseok Koh - '--socket-mem' is recommended to pin memory by predictable amount. 3689797bfccSYongseok Koh - Configure per-lcore cache when creating Mempools for packet buffer. 3699797bfccSYongseok Koh - Refrain from dynamically allocating/freeing memory in run-time. 3709797bfccSYongseok Koh 371972e365bSThomas MonjalonUsage example 372972e365bSThomas Monjalon------------- 373972e365bSThomas Monjalon 3740f91f952SThomas MonjalonThis section demonstrates how to launch **testpmd** with NVIDIA ConnectX-3 3758809f78cSBruce Richardsondevices managed by librte_net_mlx4. 376972e365bSThomas Monjalon 377499b461fSThomas Monjalon#. Load the kernel modules:: 378972e365bSThomas Monjalon 379972e365bSThomas Monjalon modprobe -a ib_uverbs mlx4_en mlx4_core mlx4_ib 380972e365bSThomas Monjalon 38167d48c2cSOlga Shern Alternatively if MLNX_OFED is fully installed, the following script can 382499b461fSThomas Monjalon be run:: 38354f5a7a2SOlga Shern 38454f5a7a2SOlga Shern /etc/init.d/openibd restart 38554f5a7a2SOlga Shern 386972e365bSThomas Monjalon .. note:: 387972e365bSThomas Monjalon 388972e365bSThomas Monjalon User space I/O kernel modules (uio and igb_uio) are not used and do 389972e365bSThomas Monjalon not have to be loaded. 390972e365bSThomas Monjalon 391972e365bSThomas Monjalon#. Make sure Ethernet interfaces are in working order and linked to kernel 392499b461fSThomas Monjalon verbs. Related sysfs entries should be present:: 393972e365bSThomas Monjalon 394972e365bSThomas Monjalon ls -d /sys/class/net/*/device/infiniband_verbs/uverbs* | cut -d / -f 5 395972e365bSThomas Monjalon 396499b461fSThomas Monjalon Example output:: 397972e365bSThomas Monjalon 398972e365bSThomas Monjalon eth2 399972e365bSThomas Monjalon eth3 400972e365bSThomas Monjalon eth4 401972e365bSThomas Monjalon eth5 402972e365bSThomas Monjalon 403db27370bSStephen Hemminger#. Optionally, retrieve their PCI bus addresses to be used with the allow argument:: 404972e365bSThomas Monjalon 405972e365bSThomas Monjalon { 406972e365bSThomas Monjalon for intf in eth2 eth3 eth4 eth5; 407972e365bSThomas Monjalon do 408972e365bSThomas Monjalon (cd "/sys/class/net/${intf}/device/" && pwd -P); 409972e365bSThomas Monjalon done; 410972e365bSThomas Monjalon } | 411db27370bSStephen Hemminger sed -n 's,.*/\(.*\),-a \1,p' 412972e365bSThomas Monjalon 413499b461fSThomas Monjalon Example output:: 414972e365bSThomas Monjalon 415db27370bSStephen Hemminger -a 0000:83:00.0 416db27370bSStephen Hemminger -a 0000:83:00.0 417db27370bSStephen Hemminger -a 0000:84:00.0 418db27370bSStephen Hemminger -a 0000:84:00.0 419972e365bSThomas Monjalon 420972e365bSThomas Monjalon .. note:: 421972e365bSThomas Monjalon 4220f91f952SThomas Monjalon There are only two distinct PCI bus addresses because the NVIDIA 423972e365bSThomas Monjalon ConnectX-3 adapters installed on this system are dual port. 424972e365bSThomas Monjalon 425499b461fSThomas Monjalon#. Request huge pages:: 426972e365bSThomas Monjalon 427de34aaa9SThomas Monjalon dpdk-hugepages.py --setup 2G 428972e365bSThomas Monjalon 429499b461fSThomas Monjalon#. Start testpmd with basic parameters:: 430972e365bSThomas Monjalon 431e3f15be4SSarosh Arif dpdk-testpmd -l 8-15 -n 4 -a 0000:83:00.0 -a 0000:84:00.0 -- --rxq=2 --txq=2 -i 432972e365bSThomas Monjalon 433499b461fSThomas Monjalon Example output:: 434972e365bSThomas Monjalon 435972e365bSThomas Monjalon [...] 436972e365bSThomas Monjalon EAL: PCI device 0000:83:00.0 on NUMA socket 1 4378809f78cSBruce Richardson EAL: probe driver: 15b3:1007 librte_net_mlx4 4388809f78cSBruce Richardson PMD: librte_net_mlx4: PCI information matches, using device "mlx4_0" (VF: false) 4398809f78cSBruce Richardson PMD: librte_net_mlx4: 2 port(s) detected 4408809f78cSBruce Richardson PMD: librte_net_mlx4: port 1 MAC address is 00:02:c9:b5:b7:50 4418809f78cSBruce Richardson PMD: librte_net_mlx4: port 2 MAC address is 00:02:c9:b5:b7:51 442972e365bSThomas Monjalon EAL: PCI device 0000:84:00.0 on NUMA socket 1 4438809f78cSBruce Richardson EAL: probe driver: 15b3:1007 librte_net_mlx4 4448809f78cSBruce Richardson PMD: librte_net_mlx4: PCI information matches, using device "mlx4_1" (VF: false) 4458809f78cSBruce Richardson PMD: librte_net_mlx4: 2 port(s) detected 4468809f78cSBruce Richardson PMD: librte_net_mlx4: port 1 MAC address is 00:02:c9:b5:ba:b0 4478809f78cSBruce Richardson PMD: librte_net_mlx4: port 2 MAC address is 00:02:c9:b5:ba:b1 448972e365bSThomas Monjalon Interactive-mode selected 449972e365bSThomas Monjalon Configuring Port 0 (socket 0) 4508809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867d60: TX queues number update: 0 -> 2 4518809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867d60: RX queues number update: 0 -> 2 452972e365bSThomas Monjalon Port 0: 00:02:C9:B5:B7:50 453972e365bSThomas Monjalon Configuring Port 1 (socket 0) 4548809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867da0: TX queues number update: 0 -> 2 4558809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867da0: RX queues number update: 0 -> 2 456972e365bSThomas Monjalon Port 1: 00:02:C9:B5:B7:51 457972e365bSThomas Monjalon Configuring Port 2 (socket 0) 4588809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867de0: TX queues number update: 0 -> 2 4598809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867de0: RX queues number update: 0 -> 2 460972e365bSThomas Monjalon Port 2: 00:02:C9:B5:BA:B0 461972e365bSThomas Monjalon Configuring Port 3 (socket 0) 4628809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867e20: TX queues number update: 0 -> 2 4638809f78cSBruce Richardson PMD: librte_net_mlx4: 0x867e20: RX queues number update: 0 -> 2 464972e365bSThomas Monjalon Port 3: 00:02:C9:B5:BA:B1 465972e365bSThomas Monjalon Checking link statuses... 466972e365bSThomas Monjalon Port 0 Link Up - speed 10000 Mbps - full-duplex 467972e365bSThomas Monjalon Port 1 Link Up - speed 40000 Mbps - full-duplex 468972e365bSThomas Monjalon Port 2 Link Up - speed 10000 Mbps - full-duplex 469972e365bSThomas Monjalon Port 3 Link Up - speed 40000 Mbps - full-duplex 470972e365bSThomas Monjalon Done 471972e365bSThomas Monjalon testpmd> 472