1 .. SPDX-License-Identifier: BSD-3-Clause
2 Copyright(c) 2017 Cavium, Inc
4 LiquidIO VF Poll Mode Driver
5 ============================
7 The LiquidIO VF PMD library (librte_pmd_lio) provides poll mode driver support for
8 Cavium LiquidIO® II server adapter VFs. PF management and VF creation can be
9 done using kernel driver.
11 More information can be found at `Cavium Official Website
12 <http://cavium.com/LiquidIO_Adapters.html>`_.
14 Supported LiquidIO Adapters
15 -----------------------------
17 - LiquidIO II CN2350 210SV/225SV
18 - LiquidIO II CN2350 210SVPT
19 - LiquidIO II CN2360 210SV/225SV
20 - LiquidIO II CN2360 210SVPT
23 Pre-Installation Configuration
24 ------------------------------
26 The following options can be modified in the ``config`` file.
27 Please note that enabling debugging options may affect system performance.
29 - ``CONFIG_RTE_LIBRTE_LIO_PMD`` (default ``y``)
31 Toggle compilation of LiquidIO PMD.
33 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_DRIVER`` (default ``n``)
35 Toggle display of generic debugging messages.
37 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_INIT`` (default ``n``)
39 Toggle display of initialization related messages.
41 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_RX`` (default ``n``)
43 Toggle display of receive fast path run-time messages.
45 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_TX`` (default ``n``)
47 Toggle display of transmit fast path run-time messages.
49 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX`` (default ``n``)
51 Toggle display of mailbox messages.
53 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS`` (default ``n``)
55 Toggle display of register reads and writes.
58 SR-IOV: Prerequisites and Sample Application Notes
59 --------------------------------------------------
61 This section provides instructions to configure SR-IOV with Linux OS.
63 #. Verify SR-IOV and ARI capabilities are enabled on the adapter using ``lspci``:
65 .. code-block:: console
71 .. code-block:: console
74 Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI)
76 Capabilities: [178 v1] Single Root I/O Virtualization (SR-IOV)
78 Kernel driver in use: LiquidIO
80 #. Load the kernel module:
82 .. code-block:: console
86 #. Bring up the PF ports:
88 .. code-block:: console
93 #. Change PF MTU if required:
95 .. code-block:: console
97 ifconfig p4p1 mtu 9000
98 ifconfig p4p2 mtu 9000
100 #. Create VF device(s):
102 Echo number of VFs to be created into ``"sriov_numvfs"`` sysfs entry
105 .. code-block:: console
107 echo 1 > /sys/bus/pci/devices/0000:03:00.0/sriov_numvfs
108 echo 1 > /sys/bus/pci/devices/0000:03:00.1/sriov_numvfs
110 #. Assign VF MAC address:
112 Assign MAC address to the VF using iproute2 utility. The syntax is::
114 ip link set <PF iface> vf <VF id> mac <macaddr>
118 .. code-block:: console
120 ip link set p4p1 vf 0 mac F2:A8:1B:5E:B4:66
122 #. Assign VF(s) to VM.
124 The VF devices may be passed through to the guest VM using qemu or
125 virt-manager or virsh etc.
127 Example qemu guest launch command:
129 .. code-block:: console
131 ./qemu-system-x86_64 -name lio-vm -machine accel=kvm \
132 -cpu host -m 4096 -smp 4 \
133 -drive file=<disk_file>,if=none,id=disk1,format=<type> \
134 -device virtio-blk-pci,scsi=off,drive=disk1,id=virtio-disk1,bootindex=1 \
135 -device vfio-pci,host=03:00.3 -device vfio-pci,host=03:08.3
139 Refer to the document
140 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` to run
141 ``testpmd`` application.
145 Use ``igb_uio`` instead of ``vfio-pci`` in VM.
149 .. code-block:: console
152 EAL: PCI device 0000:03:00.3 on NUMA socket 0
153 EAL: probe driver: 177d:9712 net_liovf
154 EAL: using IOMMU type 1 (Type 1)
155 PMD: net_liovf[03:00.3]INFO: DEVICE : CN23XX VF
156 EAL: PCI device 0000:03:08.3 on NUMA socket 0
157 EAL: probe driver: 177d:9712 net_liovf
158 PMD: net_liovf[03:08.3]INFO: DEVICE : CN23XX VF
159 Interactive-mode selected
160 USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=171456, size=2176, socket=0
161 Configuring Port 0 (socket 0)
162 PMD: net_liovf[03:00.3]INFO: Starting port 0
163 Port 0: F2:A8:1B:5E:B4:66
164 Configuring Port 1 (socket 0)
165 PMD: net_liovf[03:08.3]INFO: Starting port 1
166 Port 1: 32:76:CC:EE:56:D7
167 Checking link statuses...
168 Port 0 Link Up - speed 10000 Mbps - full-duplex
169 Port 1 Link Up - speed 10000 Mbps - full-duplex
173 #. Enabling VF promiscuous mode
175 One VF per PF can be marked as trusted for promiscuous mode.
177 .. code-block:: console
179 ip link set dev <PF iface> vf <VF id> trust on
188 VF MTU is limited by PF MTU. Raise PF value before configuring VF for larger packet size.
193 Tx VLAN insertion is not supported and consequently VLAN offload feature is
199 Number of descriptors for Rx/Tx ring should be in the range 128 to 512.
204 LiquidIO adapters strip ethernet FCS of every packet coming to the host interface.