New upstream version 18.11-rc1
[deb_dpdk.git] / doc / guides / nics / liquidio.rst
1 ..  SPDX-License-Identifier: BSD-3-Clause
2     Copyright(c) 2017 Cavium, Inc
3
4 LiquidIO VF Poll Mode Driver
5 ============================
6
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.
10
11 More information can be found at `Cavium Official Website
12 <http://cavium.com/LiquidIO_Adapters.html>`_.
13
14 Supported LiquidIO Adapters
15 -----------------------------
16
17 - LiquidIO II CN2350 210SV/225SV
18 - LiquidIO II CN2350 210SVPT
19 - LiquidIO II CN2360 210SV/225SV
20 - LiquidIO II CN2360 210SVPT
21
22
23 Pre-Installation Configuration
24 ------------------------------
25
26 The following options can be modified in the ``config`` file.
27 Please note that enabling debugging options may affect system performance.
28
29 - ``CONFIG_RTE_LIBRTE_LIO_PMD`` (default ``y``)
30
31   Toggle compilation of LiquidIO PMD.
32
33 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_RX`` (default ``n``)
34
35   Toggle display of receive fast path run-time messages.
36
37 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_TX`` (default ``n``)
38
39   Toggle display of transmit fast path run-time messages.
40
41 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX`` (default ``n``)
42
43   Toggle display of mailbox messages.
44
45 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS`` (default ``n``)
46
47   Toggle display of register reads and writes.
48
49
50 SR-IOV: Prerequisites and Sample Application Notes
51 --------------------------------------------------
52
53 This section provides instructions to configure SR-IOV with Linux OS.
54
55 #. Verify SR-IOV and ARI capabilities are enabled on the adapter using ``lspci``:
56
57    .. code-block:: console
58
59       lspci -s <slot> -vvv
60
61    Example output:
62
63    .. code-block:: console
64
65       [...]
66       Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI)
67       [...]
68       Capabilities: [178 v1] Single Root I/O Virtualization (SR-IOV)
69       [...]
70       Kernel driver in use: LiquidIO
71
72 #. Load the kernel module:
73
74    .. code-block:: console
75
76       modprobe liquidio
77
78 #. Bring up the PF ports:
79
80    .. code-block:: console
81
82       ifconfig p4p1 up
83       ifconfig p4p2 up
84
85 #. Change PF MTU if required:
86
87    .. code-block:: console
88
89       ifconfig p4p1 mtu 9000
90       ifconfig p4p2 mtu 9000
91
92 #. Create VF device(s):
93
94    Echo number of VFs to be created into ``"sriov_numvfs"`` sysfs entry
95    of the parent PF.
96
97    .. code-block:: console
98
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
101
102 #. Assign VF MAC address:
103
104    Assign MAC address to the VF using iproute2 utility. The syntax is::
105
106       ip link set <PF iface> vf <VF id> mac <macaddr>
107
108    Example output:
109
110    .. code-block:: console
111
112       ip link set p4p1 vf 0 mac F2:A8:1B:5E:B4:66
113
114 #. Assign VF(s) to VM.
115
116    The VF devices may be passed through to the guest VM using qemu or
117    virt-manager or virsh etc.
118
119    Example qemu guest launch command:
120
121    .. code-block:: console
122
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
128
129 #. Running testpmd
130
131    Refer to the document
132    :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` to run
133    ``testpmd`` application.
134
135    .. note::
136
137       Use ``igb_uio`` instead of ``vfio-pci`` in VM.
138
139    Example output:
140
141    .. code-block:: console
142
143       [...]
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
162       Done
163       testpmd>
164
165 #. Enabling VF promiscuous mode
166
167    One VF per PF can be marked as trusted for promiscuous mode.
168
169    .. code-block:: console
170
171       ip link set dev <PF iface> vf <VF id> trust on
172
173
174 Limitations
175 -----------
176
177 VF MTU
178 ~~~~~~
179
180 VF MTU is limited by PF MTU. Raise PF value before configuring VF for larger packet size.
181
182 VLAN offload
183 ~~~~~~~~~~~~
184
185 Tx VLAN insertion is not supported and consequently VLAN offload feature is
186 marked partial.
187
188 Ring size
189 ~~~~~~~~~
190
191 Number of descriptors for Rx/Tx ring should be in the range 128 to 512.
192
193 CRC striping
194 ~~~~~~~~~~~~
195
196 LiquidIO adapters strip ethernet FCS of every packet coming to the host interface.