
Solarflare
Server
Adapter
User
Guide
SR
‐
IOV
Virtualization
Using
KVM
Issue
20
©
Solarflare
Communications
2017
344
•
Migration
is
not
supported
in
this
configuration
because
the
VM
has
knowledge
of
the
network
adapter
hardware
(VF)
present
in
the
server.
•
The
VF
is
visible
in
the
guest.
This
allows
applications
using
the
VF
interface
to
be
accelerated
using
OpenOnload
or
to
use
other
Solarflare
applications
such
as
SolarCapture.
•
The
Solarflare
net
driver
(sfc.ko)
needs
to
be
installed
in
the
guest.
KVM
Libvirt
network
hostdev
‐
Configuration
1
Create
the
VM
from
the
Linux
virt
‐
manager
GUI
interface
or
the
virsh
command
line
tool.
2
Install
Solarflare
network
driver
(sfc.ko)
in
the
guest
and
host.
3
Create
the
required
number
of
VFs:
#
sfboot
switch
‐
mode=sriov
vf
‐
count=4
A
cold
reboot
of
the
server
is
required
for
this
to
be
effective.
4
For
the
selected
PF
‐
configure
the
required
number
of
VFs
e.g:
#
echo
4
>
/sys/class/net/eth8/device/sriov_numvfs
5
VFs
will
now
be
visible
in
the
host
‐
use
ifconfig
and
the
lscpi
command
to
identify
the
Ethernet
interfaces
and
PCIe
addresses
(VFs
shown
below
in
bold
text):
#
lspci
‐
D
‐
d1924:
0000:03:00.0
Ethernet
controller:
Solarflare
Communications
SFC9120
(rev
01)
0000:03:00.1
Ethernet
controller:
Solarflare
Communications
SFC9120
(rev
01)
0000:03:00.2
Ethernet
controller:
Solarflare
Communications
Device
1903
(rev
01)
0000:03:00.3
Ethernet
controller:
Solarflare
Communications
Device
1903
(rev
01)
0000:03:00.4
Ethernet
controller:
Solarflare
Communications
Device
1903
(rev
01)
0000:03:00.5
Ethernet
controller:
Solarflare
Communications
Device
1903
(rev
01)
6
Using
the
PCIe
address,
unbind
the
VFs
to
be
passed
through
to
the
guest
from
the
host
sfc
driver
e.g.:
#
echo
0000:03:00.5
>
/sys/bus/pci/devices/0000\:03\:00.5/driver/unbind
7
Check
that
the
required
VF
interface
is
no
longer
visible
in
the
host
using
ifconfig
.
8
On
the
host,
stop
the
virtual
machine:
#
virsh
shutdown
<vmname>
9
On
the
host,
edit
the
virtual
machine
XML
file:
#
virsh
edit
<vmname>
10
For
each
VF
that
is
to
be
passed
to
the
guest,
add
the
following
<interface
type>
section
to
the
file
identifying
the
VF
PCIe
address
(use
lscpi
to
identify
PCIe
address):
<interface
type='hostdev'
managed='yes'>
<source>
<address
type='pci'
domain='0x0000'
bus='0x03'
slot='0x00'
function='0x5'/>
</source>
</interface>