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_net_liquidio**) 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 SR-IOV: Prerequisites and Sample Application Notes
24 --------------------------------------------------
26 This section provides instructions to configure SR-IOV with Linux OS.
28 #. Verify SR-IOV and ARI capabilities are enabled on the adapter using ``lspci``:
30 .. code-block:: console
36 .. code-block:: console
39 Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI)
41 Capabilities: [178 v1] Single Root I/O Virtualization (SR-IOV)
43 Kernel driver in use: LiquidIO
45 #. Load the kernel module:
47 .. code-block:: console
51 #. Bring up the PF ports:
53 .. code-block:: console
58 #. Change PF MTU if required:
60 .. code-block:: console
62 ifconfig p4p1 mtu 9000
63 ifconfig p4p2 mtu 9000
65 #. Create VF device(s):
67 Echo number of VFs to be created into ``"sriov_numvfs"`` sysfs entry
70 .. code-block:: console
72 echo 1 > /sys/bus/pci/devices/0000:03:00.0/sriov_numvfs
73 echo 1 > /sys/bus/pci/devices/0000:03:00.1/sriov_numvfs
75 #. Assign VF MAC address:
77 Assign MAC address to the VF using iproute2 utility. The syntax is::
79 ip link set <PF iface> vf <VF id> mac <macaddr>
83 .. code-block:: console
85 ip link set p4p1 vf 0 mac F2:A8:1B:5E:B4:66
87 #. Assign VF(s) to VM.
89 The VF devices may be passed through to the guest VM using qemu or
90 virt-manager or virsh etc.
92 Example qemu guest launch command:
94 .. code-block:: console
96 ./qemu-system-x86_64 -name lio-vm -machine accel=kvm \
97 -cpu host -m 4096 -smp 4 \
98 -drive file=<disk_file>,if=none,id=disk1,format=<type> \
99 -device virtio-blk-pci,scsi=off,drive=disk1,id=virtio-disk1,bootindex=1 \
100 -device vfio-pci,host=03:00.3 -device vfio-pci,host=03:08.3
104 Refer to the document
105 :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` to run
106 ``testpmd`` application.
110 Use ``igb_uio`` instead of ``vfio-pci`` in VM.
114 .. code-block:: console
117 EAL: PCI device 0000:03:00.3 on NUMA socket 0
118 EAL: probe driver: 177d:9712 net_liovf
119 EAL: using IOMMU type 1 (Type 1)
120 PMD: net_liovf[03:00.3]INFO: DEVICE : CN23XX VF
121 EAL: PCI device 0000:03:08.3 on NUMA socket 0
122 EAL: probe driver: 177d:9712 net_liovf
123 PMD: net_liovf[03:08.3]INFO: DEVICE : CN23XX VF
124 Interactive-mode selected
125 USER1: create a new mbuf pool <mbuf_pool_socket_0>: n=171456, size=2176, socket=0
126 Configuring Port 0 (socket 0)
127 PMD: net_liovf[03:00.3]INFO: Starting port 0
128 Port 0: F2:A8:1B:5E:B4:66
129 Configuring Port 1 (socket 0)
130 PMD: net_liovf[03:08.3]INFO: Starting port 1
131 Port 1: 32:76:CC:EE:56:D7
132 Checking link statuses...
133 Port 0 Link Up - speed 10000 Mbps - full-duplex
134 Port 1 Link Up - speed 10000 Mbps - full-duplex
138 #. Enabling VF promiscuous mode
140 One VF per PF can be marked as trusted for promiscuous mode.
142 .. code-block:: console
144 ip link set dev <PF iface> vf <VF id> trust on
153 VF MTU is limited by PF MTU. Raise PF value before configuring VF for larger packet size.
158 Tx VLAN insertion is not supported and consequently VLAN offload feature is
164 Number of descriptors for Rx/Tx ring should be in the range 128 to 512.
169 LiquidIO adapters strip ethernet FCS of every packet coming to the host interface.