New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network: Introduce SR-IOV #16219
network: Introduce SR-IOV #16219
Conversation
d85bf9b
to
f4cbeb6
Compare
This pull request introduces 1 alert when merging f4cbeb6 into a51a324 - view on LGTM.com new alerts:
|
6639924
to
36f6723
Compare
I will slightly update the commits and add tests for this. |
@ssahani Updated. PTAL. |
return func | ||
|
||
return f | ||
|
||
def expectedFailureIfCAKEIsNotAvailable(): | ||
def f(func): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
➜ ~ echo "99 2" > /sys/bus/netdevsim/new_device
➜ ~ ip link
9: eni99np1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:e7:ab:f4:5b:0d brd ff:ff:ff:ff:ff:ff
10: eni99np2: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 16:0a:ff:96:bf:77 brd ff:ff:ff:ff:ff:ff
➜ ~ udevadm info -w10s /sys/devices/netdevsim99/net/eni99np1
P: /devices/netdevsim99/net/eni99np1
L: 0
E: DEVPATH=/devices/netdevsim99/net/eni99np1
E: SUBSYSTEM=net
E: INTERFACE=eni99np1
E: IFINDEX=9
E: USEC_INITIALIZED=53327702503
E: ID_NET_NAMING_SCHEME=v245
E: ID_NET_NAME_PATH=eni99np1
E: ID_NET_DRIVER=netdevsim
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=eni99np1
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eni99np1 /sys/subsystem/net/devices/eni99np1
E: TAGS=:systemd:
➜ ~ echo "3" /sys/class/net/eni99np1/device/sriov_numvfs
3 /sys/class/net/eni99np1/device/sriov_numvfs
➜ ~ udevadm info -w10s /sys/devices/netdevsim99/net/eni99np1
P: /devices/netdevsim99/net/eni99np1
L: 0
E: DEVPATH=/devices/netdevsim99/net/eni99np1
E: SUBSYSTEM=net
E: INTERFACE=eni99np1
E: IFINDEX=9
E: USEC_INITIALIZED=53327702503
E: ID_NET_NAMING_SCHEME=v245
E: ID_NET_NAME_PATH=eni99np1
E: ID_NET_DRIVER=netdevsim
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=eni99np1
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/eni99np1 /sys/subsystem/net/devices/eni99np1
E: TAGS=:systemd:
➜ ~ ip -d link show eni99np1
9: eni99np1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:e7:ab:f4:5b:0d brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 portname p1 switchid efa555440bc0d5e49db2492abc36907aa49440e0256787a78ab0288dc8bb00
➜ ~
➜ ~ echo "3" > /sys/class/net/eni99np1/device/sriov_numvfs
➜ ~ ip -d link show eni99np1
9: eni99np1: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether f6:e7:ab:f4:5b:0d brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 portname p1 switchid efa555440bc0d5e49db2492abc36907aa49440e0256787a78ab0288dc8bb00
vf 0 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking off, link-state auto, trust off, query_rss off
vf 1 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking off, link-state auto, trust off, query_rss off
vf 2 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking off, link-state auto, trust off, query_rss off
I tested the same manually . It's ok
This looks good. thanks @yuwata . |
call('rmmod netdevsim', stderr=subprocess.STDOUT) | ||
rc = call('modprobe netdevsim', stderr=subprocess.STDOUT) | ||
if rc != 0: | ||
return unittest.expectedFailure(func) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes fedora does not support till now.
~ sus@esx-fedora
❯ sudo modprobe netdevsim
modprobe: FATAL: Module netdevsim not found in directory /lib/modules/5.8.0-0.rc1.20200617git69119673bd50.1.fc33.x86_64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kernel-modules-internal-5.6.19-300.fc32.x86_64 provides netdevsim.
@mrc0mmand Have you updated the Arch image for CentOS CIs? I have no idea about the CI failures. |
It seems some new parameters shows up in the route table. |
Nope, the image update is stuck on #16199. |
Yeah, |
More seriously, now |
|
Please retrigger 2/3 times . If this happens again they we figure must be because of this PR and we need to do some cleanup. |
It fails consistently with the exact same issue in both runs even after reschedule, whereas other (and more recent) PRs are fine. |
0e88799
to
0bacad6
Compare
Still I do not know why the |
SR-IOV provides the ability to partition a single physical PCI resource into virtual PCI functions which can then be injected in to a VM. In the case of network VFs, SR-IOV improves north-south n etwork performance (that is, traffic with endpoints outside the host machine) by allowing traffic to bypass the host machine’s network stack.
This also adjusts test_sysctl_disable_ipv6(), as rt_trap flag may be added to routes on some environments.
@keszybz Thank you for the review. Updated version is pushed. I hope all your points are addressed. PTAL. |
LGTM. |
How should I use it?
I created the relevant configuration file, but it doesn't seem to work. |
@daiaji Does the interface already has virtual functions? The
Note, recently I posted PR #21865 which adds the support of the same section into .link file, which creates relevant virtual function(s) on demand. If you'd like, please test the current git HEAD. |
@yuwata After compiling with this version of systemd, is there no need to manually use the sysfs user interface or add the kernel boot parameters to enable vf? |
I am not familiar with kernel boot params about SR-IOV. But, at least with the current git HEAD, it is not necessary to change sysfs attribute manually. One note, as you may know, to make SR-IOV setting work, the interface needs to support the functionality. |
The link file does not appear to create VF. |
Did you reboot the system or run |
@yuwata I rebooted the system, and I confirmed that this Intel I350-T4 supports SR-IOV. |
Thanks. Testing the feature is highly appreciated. I am waiting for your report in a new issue page. |
Until then, what logs do I need to provide? And how to access these logs. |
I noticed that your .link file shown in the above does not have number prefix. One of the matching .link file in the earliest in alphanumerical order is used, so, I guess still 99-default.link is applied to the interface. Please try to rename the file to e.g. 10-sr-iov.link.
Do you use systemd-udevd from the current git HEAD with .link files? If so, create the following rules:
Then,
and provide it. Also, please provide Thank you! |
OK, after changing the file name of the link file to 10-sr-iov.link, the VF is allocated normally. |
Yay! Nice!
That's expected. As the .link file does not contain any naming (and MAC address) related settings. Copy the following lines from the 99-default.link:
Set the link state to yes:
For details, please see section about [SR-IOV] section in systemd.network(5) or systemd.link(5). There exists multiple settings in the section. Note, if you want to online all VFs, then you need to specify multiple [SR-IOV] sections for each VF.
|
These configs worked for me. |
Yeah, that should also work. And from the logs in your recent issue about wait-online, it seems [SR-IOV] settings work fine for you. |
It seems to be more of a problem with the SR-IOV itself. I did not insert a network cable into the enp7s0f2 interface, so even if I use the VF as the network card of the VM, it seems that the network is still not available. The ActivationPolicy=always-up parameter doesn't seem to help me.😅 But actually because SR-IOV and MACVLAN have similar characteristics (poor compatibility with IEEE 802.11), I can't access my AP, I have given up using SR-IOV and MACVLAN to build my soft router. Will setting a VLAN help me? |
Hm, How about setting Unfortunately, I do not have any SR-IOV supporting real interfaces, but only dummy virtual interface... So, I have almost no way to debug the issue... |
If they do not work, how about to also set |
If you have any good way, then please let me know. Thank you for your help of testing the [SR-IOV] feature and investigating the root cause of the wait-online issue! |
LinkState=yes seems to cause enp7s0f2 to not work directly. |
closes #15629
cc @yuwata . I spent some time on SR-IOV. Here is the working version .