[systemd-devel] persisting sriov_numvfs

Martin Polednik mpolednik at redhat.com
Fri Jan 23 05:51:34 PST 2015

----- Original Message -----
> From: "Lennart Poettering" <lennart at poettering.net>
> To: "Dan Kenigsberg" <danken at redhat.com>
> Cc: systemd-devel at lists.freedesktop.org, mpoledni at redhat.com, ibarkan at redhat.com
> Sent: Friday, January 23, 2015 3:49:59 AM
> Subject: Re: [systemd-devel] persisting sriov_numvfs
> On Mon, 19.01.15 14:18, Dan Kenigsberg (danken at redhat.com) wrote:
> > Hello, list.
> > 
> > I'm an http://oVirt.org developer, and we plan to (finally) support
> > SR-IOV cards natively. Working on this feature, we've noticed that
> > something is missing in the platform OS.
> > 
> > If I maintain a host with sr-iov cards, I'd like to use the new kernel
> > method of defining how many virtual functions (VFs) are to be exposed by
> > each physical function:
> Quite frankly, I cannot make sense of these sentences. I have no clue
> what a "SR-IOV", "virtual function", "physical function" is supposed
> to be.
> Please explain what this all is, before we can think of adding any
> friendlier config option to udev/networkd/systemd for this.


I'm oVirt developer responsible for VFIO/SR-IOV passthrough on the host

SR-IOV is a specification from PCI SIG, where single hardware device
(we're using NICs for example) can actually act as a multiple devices.
This device is then considered PF (physical function) and spawned devices
are so called VFs (virtual functions). This functionality allows system
administrators to assign these devices to virtual machines to get near
bare metal performance of the device and possibly share it amongst multiple

Spawning of the VFs was previously done via device driver, using max_vfs
attribute. This means that if you wanted to persist these VFs, you had to
add this to modules-load.d. Since some of the device driver creators used
different names, spawning of VFs was moved to sysfs and can be operated via
echo ${number} > /sys/bus/pci/devices/${device_name}/sriov_numvfs where
${number} <= /sys/bus/pci/devices/${device_name}/sriov_totalvfs and if 
changing the number of VFs from nonzero value, it first needs to be set to 0.

We've encountered the need to persist this configuration and load it before
network scripts (and possibly in future other scripts) so that the hardware
can be referenced in those scripts. There is currently no such option. We
are seeking help in creating a standardized way of handling this persistence.

> Lennart
> --
> Lennart Poettering, Red Hat

More information about the systemd-devel mailing list