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_RX`` (default ``n``)
35 Toggle display of receive fast path run-time messages.
37 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_TX`` (default ``n``)
39 Toggle display of transmit fast path run-time messages.
41 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX`` (default ``n``)
43 Toggle display of mailbox messages.
45 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS`` (default ``n``)
47 Toggle display of register reads and writes.
50 SR-IOV: Prerequisites and Sample Application Notes
51 --------------------------------------------------
53 This section provides instructions to configure SR-IOV with Linux OS.
55 #. Verify SR-IOV and ARI capabilities are enabled on the adapter using ``lspci``:
57 .. code-block:: console
63 .. code-block:: console
66 Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI)
68 Capabilities: [178 v1] Single Root I/O Virtualization (SR-IOV)
70 Kernel driver in use: LiquidIO
72 #. Load the kernel module:
74 .. code-block:: console
78 #. Bring up the PF ports:
80 .. code-block:: console
85 #. Change PF MTU if required:
87 .. code-block:: console
89 ifconfig p4p1 mtu 9000
90 ifconfig p4p2 mtu 9000
92 #. Create VF device(s):
94 Echo number of VFs to be created into ``"sriov_numvfs"`` sysfs entry
97 .. code-block:: console
99 echo 1 > /sys/bus/pci/devices/0000:03:00.0/sriov_numvfs
100 echo 1 > /sys/bus/pci/devices/0000:03:00.1/sriov_numvfs
102 #. Assign VF MAC address:
104 Assign MAC address to the VF using iproute2 utility. The syntax is::
106 ip link set <PF iface> vf <VF id> mac <macaddr>
110 .. code-block:: console
112 ip link set p4p1 vf 0 mac F2:A8:1B:5E:B4:66
114 #. Assign VF(s) to VM.
116 The VF devices may be passed through to the guest VM using qemu or
117 virt-manager or virsh etc.
119 Example qemu guest launch command:
121 .. code-block:: console
123 ./qemu-system-x86_64 -name lio-vm -machine accel=kvm \
124 -cpu host -m 4096 -smp 4 \
125 -drive file=<disk_file>,if=none,id=disk1,format=<type> \
126 -device virtio-blk-pci,scsi=off,drive=disk1,id=virtio-disk1,bootindex=1 \
127 -device vfio-pci,host=03:00.3 -device vfio-pci,host=03:08.3
131 Refer to the document
132 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` to run
133 ``testpmd`` application.
137 Use ``igb_uio`` instead of ``vfio-pci`` in VM.
141 .. code-block:: console
144 EAL: PCI device 0000:03:00.3 on NUMA socket 0
145 EAL: probe driver: 177d:9712 net_liovf
146 EAL: using IOMMU type 1 (Type 1)
147 PMD: net_liovf[03:00.3]INFO: DEVICE : CN23XX VF
148 EAL: PCI device 0000:03:08.3 on NUMA socket 0
149 EAL: probe driver: 177d:9712 net_liovf
150 PMD: net_liovf[03:08.3]INFO: DEVICE : CN23XX VF
151 Interactive-mode selected
152 USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=171456, size=2176, socket=0
153 Configuring Port 0 (socket 0)
154 PMD: net_liovf[03:00.3]INFO: Starting port 0
155 Port 0: F2:A8:1B:5E:B4:66
156 Configuring Port 1 (socket 0)
157 PMD: net_liovf[03:08.3]INFO: Starting port 1
158 Port 1: 32:76:CC:EE:56:D7
159 Checking link statuses...
160 Port 0 Link Up - speed 10000 Mbps - full-duplex
161 Port 1 Link Up - speed 10000 Mbps - full-duplex
165 #. Enabling VF promiscuous mode
167 One VF per PF can be marked as trusted for promiscuous mode.
169 .. code-block:: console
171 ip link set dev <PF iface> vf <VF id> trust on
180 VF MTU is limited by PF MTU. Raise PF value before configuring VF for larger packet size.
185 Tx VLAN insertion is not supported and consequently VLAN offload feature is
191 Number of descriptors for Rx/Tx ring should be in the range 128 to 512.
196 LiquidIO adapters strip ethernet FCS of every packet coming to the host interface.