NameDateSize

..14-Apr-20204 KiB

avf.apiH A D12-Dec-20192.1 KiB

avf.hH A D22-May-20207.6 KiB

avf_api.cH A D27-Sep-20192.8 KiB

avf_test.cH A D27-Sep-20193.7 KiB

cli.cH A D23-Jul-20195.9 KiB

CMakeLists.txtH A D27-Sep-2019799

device.cH A D27-May-202044.2 KiB

format.cH A D21-Aug-20194.5 KiB

input.cH A D25-Mar-202013.4 KiB

output.cH A D25-Feb-20208.9 KiB

plugin.cH A D03-May-20191.1 KiB

README.mdH A D14-Jun-20193.2 KiB

virtchnl.hH A D11-Jul-20198.5 KiB

README.md

1# Intel AVF device plugin for VPP    {#avf_plugin_doc}
2
3##Overview
4This plugins provides native device support for intel Adaptive Virtual
5Function (AVF). AVF is driver specification for current and future
6Intel Virtual Function devices. AVF defines communication channel between
7Physical Functions (PF) and VF.
8In essence, today this driver can be used only with 
9Intel XL710 / X710 / XXV710 adapters.
10
11##Prerequisites
12 * Driver requires newer i40e PF linux driver to be installed on the system,
13which supports virtualchnl interface. This code is tested with i40e driver
14version 2.4.6.
15
16* Driver requires MSI-X interrupt support, which is not supported by
17uio_pci_generic driver, so vfio-pci needs to be used. On systems without IOMMU
18vfio driver can still be used with recent kernels which support no-iommu mode.
19
20##Known issues
21This driver is still in experimental phase, however it shows very good 
22performance numbers.
23
24## Usage
25### System setup
26
271. load VFIO driver
28```
29sudo modprobe vfio-pci
30```
31
322. (systems without IOMMU only) enable unsafe NOIOMMU mode
33```
34echo Y | sudo tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode
35```
36
373. Create and bind SR-IOV virtual function(s)
38
39Following script creates VF, assigns MAC address and binds VF to vfio-pci
40```bash
41#!/bin/bash
42
43if [ $USER != "root" ] ; then
44	echo "Restarting script with sudo..."
45	sudo $0 ${*}
46	exit
47fi
48
49setup () {
50  cd /sys/bus/pci/devices/${1}
51  driver=$(basename $(readlink driver))
52  if [ "${driver}" != "i40e" ]; then
53    echo ${1} | tee driver/unbind
54    echo ${1} | tee /sys/bus/pci/drivers/i40e/bind
55  fi
56  ifname=$(basename net/*)
57  echo 0 | tee sriov_numvfs > /dev/null
58  echo 1 | tee sriov_numvfs > /dev/null
59  ip link set dev ${ifname} vf 0 mac ${2}
60  ip link show dev ${ifname}
61  vf=$(basename $(readlink virtfn0))
62  echo ${vf} | tee virtfn0/driver/unbind
63  echo vfio-pci | tee virtfn0/driver_override
64  echo ${vf} | sudo tee /sys/bus/pci/drivers/vfio-pci/bind
65  echo  | tee virtfn0/driver_override
66}
67
68# Setup one VF on PF 0000:3b:00.0 and assign MAC address
69setup 0000:3b:00.0 00:11:22:33:44:00
70# Setup one VF on PF 0000:3b:00.1 and assign MAC address
71setup 0000:3b:00.1 00:11:22:33:44:01
72```
73
74### Promisc mode
75In cases when interface is used in the L2 mode or promisc mode is needed for some other reason,
76trust needs to be set to "on" using the linux "ip link" utility.
77```
78ip link set dev <PF inteface name> vf <VF id> trust on
79```
80
81### L2 spoofing check
82By default Virtual Function is not allowed to send ethernet frames which
83have source MAC address different than address assigned to the VF.
84In some cases it is expected that VPP will send such frames (e.g. L2 bridging,
85bonding, l2 cross-connect) and in such cases spoof chack needs to be turned
86off by issuing following command:
87```
88ip link set dev <PF inteface name> vf <VF id> spoofchk off
89```
90
91### Interface Creation
92Interfaces can be dynamically created by using following CLI:
93```
94create interface avf 0000:3b:02.0
95set int state avf-0/3b/2/0 up
96```
97
98### Interface Deletion
99Interface can be deleted with following CLI:
100```
101delete interface avf <interface name>
102```
103
104### Interface Statistics
105Interface statistics can be displayed with `sh hardware-interface <if-name>`
106command.
107
108