]> git.ipfire.org Git - thirdparty/systemd.git/commit
network,udev: configure SR-IOV VF attribute one-by-one 37269/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Apr 2025 06:37:28 +0000 (15:37 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 30 Apr 2025 06:47:19 +0000 (15:47 +0900)
commit371005ac98902ae93ac0f7804b45a2f2f03b0aa9
treee145a07d107cb6632d62bb9be3692b1c85193737
parentc8b3f1d47d0d21a1f18667a781c6dc106d32025d
network,udev: configure SR-IOV VF attribute one-by-one

When a [SR-IOV] section has no setting, e.g.
```ini
[SR-IOV]
VirtualFunction=0
```
then the kernel previously replied -EINVAL, as we send a rtnl message
with an empty IFLA_VF_INFO container.
See See do_setvfinfo() in net/core/rtnetlink.c of the kernel.

When a [SR-IOV] section that has an unsupported settings by the
interface driver, then previously the kernel partially applied
settings and returned -EOPNOTSUPP. E.f.
```ini
[SR-IOV]
VirtualFunction=0
LinkState=auto
Trust=true
MACAddress=02:01:00:3e:61:34
```
and the interface does not support configuring the link state, then
the MAC address is assigned, but the trust is not applied:
```
enp3s0f0: Failed to configure SR-IOV virtual function 0, ignoring: Operation not supported
    vf 0     link/ether 02:01:00:3e:61:34 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
```

To fix such issues, this makes networkd/udevd send each attribute
for VF one-by-one.

Fixes #37257 and #37275.
src/network/networkd-queue.c
src/network/networkd-queue.h
src/network/networkd-sriov.c
src/shared/netif-sriov.c
src/shared/netif-sriov.h
src/udev/net/link-config.c