Test SR-IOV port without real hardware with SR-IOV support

Registered by Alexey Perevalov

To test SR-IOV in the functional testing system it's prefer to use SR-IOV simulation or emulation.

Following sysfs attributes are necessary for sriovdp/kuryr-kubernetes(SR-IOV binding driver):
1. sriov_numvfs - both sriovdp and SR-IOV binding driver in kuryr require it to estimate number of available SR-IOV devices.
2. sriov_totalvfs - sriovdp just check this file, but doesn't use it. Kuryr-kubernetes doesn't use it. So it's minor requirement.
3. virtfn* - necessary to find proper device.

The VF device is also required, and we should be able to put it into network namespace.

Currently available 2 simulator in linux kernel:
1. dummy network driver
2. netdevsim network driver

But neither dummy nor netdevsim match requirement. Fake SR-IOV was added into dummy driver
https://patchwork.ozlabs.org/patch/693835/, but was moved to netdevsim
https://www.spinics.net/lists/netdev/msg469233.html in kernel v4.16.

netdevsim provides sriov_numvfs sysfs attribute file, but writing to that file doesn't lead to new VF device creation.
As a result no device which can be placed into network namespace.

Another approach is emulation:
Currently there is no such feature in QEMU. But it was a attempt to add it in the past.

https://lists.gnu.org/archive/html/qemu-devel/2017-10/msg02722.html
The reason why it wasn't merged - it's absence of real working NIC emulation devices in QEMU.

Summary:
Now it's not possible to get SR-IOV simulation or emulation out of box easily.

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
Alexey Perevalov
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Deferred
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.