New upstream version 18.02
[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_DRIVER`` (default ``n``)
34
35   Toggle display of generic debugging messages.
36
37 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_INIT`` (default ``n``)
38
39   Toggle display of initialization related messages.
40
41 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_RX`` (default ``n``)
42
43   Toggle display of receive fast path run-time messages.
44
45 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_TX`` (default ``n``)
46
47   Toggle display of transmit fast path run-time messages.
48
49 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_MBOX`` (default ``n``)
50
51   Toggle display of mailbox messages.
52
53 - ``CONFIG_RTE_LIBRTE_LIO_DEBUG_REGS`` (default ``n``)
54
55   Toggle display of register reads and writes.
56
57
58 SR-IOV: Prerequisites and Sample Application Notes
59 --------------------------------------------------
60
61 This section provides instructions to configure SR-IOV with Linux OS.
62
63 #. Verify SR-IOV and ARI capabilities are enabled on the adapter using ``lspci``:
64
65    .. code-block:: console
66
67       lspci -s <slot> -vvv
68
69    Example output:
70
71    .. code-block:: console
72
73       [...]
74       Capabilities: [148 v1] Alternative Routing-ID Interpretation (ARI)
75       [...]
76       Capabilities: [178 v1] Single Root I/O Virtualization (SR-IOV)
77       [...]
78       Kernel driver in use: LiquidIO
79
80 #. Load the kernel module:
81
82    .. code-block:: console
83
84       modprobe liquidio
85
86 #. Bring up the PF ports:
87
88    .. code-block:: console
89
90       ifconfig p4p1 up
91       ifconfig p4p2 up
92
93 #. Change PF MTU if required:
94
95    .. code-block:: console
96
97       ifconfig p4p1 mtu 9000
98       ifconfig p4p2 mtu 9000
99
100 #. Create VF device(s):
101
102    Echo number of VFs to be created into ``"sriov_numvfs"`` sysfs entry
103    of the parent PF.
104
105    .. code-block:: console
106
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
109
110 #. Assign VF MAC address:
111
112    Assign MAC address to the VF using iproute2 utility. The syntax is::
113
114       ip link set <PF iface> vf <VF id> mac <macaddr>
115
116    Example output:
117
118    .. code-block:: console
119
120       ip link set p4p1 vf 0 mac F2:A8:1B:5E:B4:66
121
122 #. Assign VF(s) to VM.
123
124    The VF devices may be passed through to the guest VM using qemu or
125    virt-manager or virsh etc.
126
127    Example qemu guest launch command:
128
129    .. code-block:: console
130
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
136
137 #. Running testpmd
138
139    Refer to the document
140    :ref:`compiling and testing a PMD for a NIC <pmd_build_and_test>` to run
141    ``testpmd`` application.
142
143    .. note::
144
145       Use ``igb_uio`` instead of ``vfio-pci`` in VM.
146
147    Example output:
148
149    .. code-block:: console
150
151       [...]
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
170       Done
171       testpmd>
172
173 #. Enabling VF promiscuous mode
174
175    One VF per PF can be marked as trusted for promiscuous mode.
176
177    .. code-block:: console
178
179       ip link set dev <PF iface> vf <VF id> trust on
180
181
182 Limitations
183 -----------
184
185 VF MTU
186 ~~~~~~
187
188 VF MTU is limited by PF MTU. Raise PF value before configuring VF for larger packet size.
189
190 VLAN offload
191 ~~~~~~~~~~~~
192
193 Tx VLAN insertion is not supported and consequently VLAN offload feature is
194 marked partial.
195
196 Ring size
197 ~~~~~~~~~
198
199 Number of descriptors for Rx/Tx ring should be in the range 128 to 512.
200
201 CRC striping
202 ~~~~~~~~~~~~
203
204 LiquidIO adapters strip ethernet FCS of every packet coming to the host
205 interface. So, CRC will be stripped even when the ``rxmode.hw_strip_crc``
206 member is set to 0 in ``struct rte_eth_conf``.