SR-IOV VFs don't go down when the PF goes down

kayson

Member
Feb 13, 2024
44
7
13
I'm running PVE 9.1 with the latest 6.17 kernel package as well as the newest out of tree drivers for my NIC (Intel X710-DA2). SR-IOV is set up and working and I have several VFs on each PF. The problem I'm running into is that if a PF goes down whether logically or physically (aka cable is pulled), the VFs are still marked UP. This means any VM with a NIC thinks it's NIC is up even though it really isn't, making failover, handling, etc, a pain. Certainly there are a number of ways to hack around this, including other methods of monitoring, but I'm curious if this is a common issue (or PVE-related, though I doubt it) and how people address it.

Thanks!!
 
erm theres a command in the intel documentation which goes over this

https://github.com/intel/ethernet-linux-i40e

Enabling a VF link if the port is disconnected
----------------------------------------------

If the physical function (PF) link is down, you can force link up
(from the host PF) on any virtual functions (VF) bound to the PF. Note
that this requires kernel support (Red Hat kernel 3.10.0-327 or newer,
upstream kernel 3.11.0 or newer) and associated iproute2 user space
support.

For example, to force link up on VF 0 bound to PF eth0:

ip link set eth0 vf 0 state enable

Note:

If the command does not work, it may not be supported by your
system.
 
erm theres a command in the intel documentation which goes over this

https://github.com/intel/ethernet-linux-i40e

Enabling a VF link if the port is disconnected
----------------------------------------------

If the physical function (PF) link is down, you can force link up
(from the host PF) on any virtual functions (VF) bound to the PF. Note
that this requires kernel support (Red Hat kernel 3.10.0-327 or newer,
upstream kernel 3.11.0 or newer) and associated iproute2 user space
support.

For example, to force link up on VF 0 bound to PF eth0:

ip link set eth0 vf 0 state enable

Note:

If the command does not work, it may not be supported by your
system.
I saw that but it doesn't address my problem. The issue is that my VF links are always up even when the PF link goes down. I want VFs to go down when their parent PF goes down. I could do it manually with a monitoring script or something but that's fragile.
 
erm theres a command in the intel documentation which goes over this

https://github.com/intel/ethernet-linux-i40e

Enabling a VF link if the port is disconnected
----------------------------------------------

If the physical function (PF) link is down, you can force link up
(from the host PF) on any virtual functions (VF) bound to the PF. Note
that this requires kernel support (Red Hat kernel 3.10.0-327 or newer,
upstream kernel 3.11.0 or newer) and associated iproute2 user space
support.

For example, to force link up on VF 0 bound to PF eth0:

ip link set eth0 vf 0 state enable

Note:

If the command does not work, it may not be supported by your
system.
I saw that but it doesn't address my problem. The issue is that my VF links are always up even when the PF link goes down. I want VFs to go down when their parent PF goes down. I could do it manually with a monitoring script or something but that's fragile.