[PATCH net 0/2] Fix issues when PF sets MAC address for VF

Wei Fang posted 2 patches 3 weeks, 3 days ago
.../net/ethernet/freescale/enetc/enetc_pf.c   | 25 ++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
[PATCH net 0/2] Fix issues when PF sets MAC address for VF
Posted by Wei Fang 3 weeks, 3 days ago
The ENETC PF driver provides enetc_pf_set_vf_mac() to configure the MAC
address for the ENETC VF, but there are two issues when configuring the
MAC address of the VF through this interface. For specific issues, please
refer to the commit message of the following two patches. Therefore, this
patch set is used to fix these two issues.

Wei Fang (2):
  net: enetc: allocate vf_state during PF probes
  net: enetc: prevent PF from configuring MAC address for an enabled VF

 .../net/ethernet/freescale/enetc/enetc_pf.c   | 25 ++++++++++++-------
 1 file changed, 16 insertions(+), 9 deletions(-)

-- 
2.34.1
Re: [PATCH net 0/2] Fix issues when PF sets MAC address for VF
Posted by Jakub Kicinski 3 weeks ago
On Thu, 31 Oct 2024 14:02:45 +0800 Wei Fang wrote:
>   net: enetc: allocate vf_state during PF probes
>   net: enetc: prevent PF from configuring MAC address for an enabled VF

This combination of changes would imply that nobody sets the MAC
address on VFs via this driver, correct? Patch 1 fixes a crash
if address is set before VFs are enabled, patch 2 forces setting
the MAC before VFs are enabled (which would previously crash).
Which leads me to believe this will cause regressions to all users,
if such users exist.

The fact that the MAC address is not picked up by a running VM is
normal, I'd say even maybe expected. IIUC hypervisor will enable 
SRIOV at the start of day, then allocate, configure and assign VFs
to VMs. It will FLR the VF after configuration.

Your change will make it impossible to reconfigure VF with a MAC
of a new VM, if any other VF is in use.

Long story short, I don't believe the patch 2 is necessary at all,
maybe you can print a warning to the logs, if you really want.