[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB8510E1F902CE9F68676D7E6F88512@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Mon, 4 Nov 2024 02:41:18 +0000
From: Wei Fang <wei.fang@....com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
<edumazet@...gle.com>, "pabeni@...hat.com" <pabeni@...hat.com>,
"andrew+netdev@...n.ch" <andrew+netdev@...n.ch>, Claudiu Manoil
<claudiu.manoil@....com>, Vladimir Oltean <vladimir.oltean@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: RE: [PATCH net 0/2] Fix issues when PF sets MAC address for VF
> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: 2024年11月4日 4:51
> To: Wei Fang <wei.fang@....com>
> Cc: davem@...emloft.net; edumazet@...gle.com; pabeni@...hat.com;
> andrew+netdev@...n.ch; Claudiu Manoil <claudiu.manoil@....com>;
> Vladimir Oltean <vladimir.oltean@....com>; netdev@...r.kernel.org;
> linux-kernel@...r.kernel.org; imx@...ts.linux.dev
> Subject: Re: [PATCH net 0/2] Fix issues when PF sets MAC address for VF
>
> 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.
To be honest, I don't know much about the LS1028A platform. Apparently,
Before this patch, users could only modify the MAC address of VF through
the PF driver after the VF is enabled. However, the VF driver only obtains
the MAC address from the register and set it into net_device during probe.
Since VF has been enabled, the VF driver has already completed the probe.
Therefore, if users want to the VF network to work properly, they need to
re-probe the VF driver. If users do disable/enable SRIOV or unbind/bind
VF driver to re-probe the VF driver, such as you mentioned below, assign
the VF to a VM, patch 2 will indeed cause a regression issue.
>
> 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.
I think your concern is reasonable, the best way is that we add the
PSI-to-VSI messaging in the future, so that is wont cause regression
issue. Thanks.
Powered by blists - more mailing lists