intel-wired-lan.osuosl.org archive mirror
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net] i40e: Match VF MAC deletion behaviour with OOT driver
@ 2025-06-22 23:04 Jamie Bainbridge
  2025-06-23 16:20 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Jamie Bainbridge @ 2025-06-22 23:04 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Brett Creeley,
	Ivan Vecera, Michal Schmidt
  Cc: Jamie Bainbridge, intel-wired-lan, netdev, linux-kernel

When the PF is processing an AQ message to delete a VF's MACs from the
MAC filter, the Linux kernel driver checks if the PF set the MAC and if
the VF is trusted. However, the out-of-tree driver has intentionally
removed the check for VF trust with OOT driver version 2.26.8.

This results in an undesirable behaviour difference between the OOT
driver and the Linux driver, where if a trusted VF with a PF-set MAC
sets itself down (which sends an AQ message to delete the VF's MAC
filters) then the VF MAC is erased from the interface with the Linux
kernel driver but not with the OOT driver.

This results in the VF losing its PF-set MAC which should not happen.

Change the Linux kernel driver and comment to match the OOT behaviour.

Fixes: ea2a1cfc3b201 ("i40e: Fix VF MAC filter removal")
Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 88e6bef69342c2e65d8d5b2d7df5ac2cc32ee3d9..45ccbb1cdda0a33527852096ee9759fc19db3a5d 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -3137,10 +3137,10 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
 		const u8 *addr = al->list[i].addr;
 
 		/* Allow to delete VF primary MAC only if it was not set
-		 * administratively by PF or if VF is trusted.
+		 * administratively by PF.
 		 */
 		if (ether_addr_equal(addr, vf->default_lan_addr.addr)) {
-			if (i40e_can_vf_change_mac(vf))
+			if (!vf->pf_set_mac)
 				was_unimac_deleted = true;
 			else
 				continue;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Intel-wired-lan] [PATCH net] i40e: Match VF MAC deletion behaviour with OOT driver
  2025-06-22 23:04 [Intel-wired-lan] [PATCH net] i40e: Match VF MAC deletion behaviour with OOT driver Jamie Bainbridge
@ 2025-06-23 16:20 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2025-06-23 16:20 UTC (permalink / raw)
  To: Jamie Bainbridge
  Cc: Ivan Vecera, Brett Creeley, Przemek Kitszel, linux-kernel,
	Andrew Lunn, Eric Dumazet, netdev, Tony Nguyen, intel-wired-lan,
	Jakub Kicinski, Paolo Abeni, David S. Miller

On Mon, Jun 23, 2025 at 09:04:41AM +1000, Jamie Bainbridge wrote:
> When the PF is processing an AQ message to delete a VF's MACs from the
> MAC filter, the Linux kernel driver checks if the PF set the MAC and if
> the VF is trusted. However, the out-of-tree driver has intentionally
> removed the check for VF trust with OOT driver version 2.26.8.
> 
> This results in an undesirable behaviour difference between the OOT
> driver and the Linux driver, where if a trusted VF with a PF-set MAC
> sets itself down (which sends an AQ message to delete the VF's MAC
> filters) then the VF MAC is erased from the interface with the Linux
> kernel driver but not with the OOT driver.
> 
> This results in the VF losing its PF-set MAC which should not happen.
> 
> Change the Linux kernel driver and comment to match the OOT behaviour.
> 
> Fixes: ea2a1cfc3b201 ("i40e: Fix VF MAC filter removal")
> Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com>

Hi Jamie,

I hate to be a pain but I'm wondering if we could rephrase the subject
and patch description to emphasis that this is correcting undesirable
(incorrect?) behaviour. And as a footnote, that the new behaviour matches
the OOT driver.

Correctness is what matters most from an upstream PoV.

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-23 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-22 23:04 [Intel-wired-lan] [PATCH net] i40e: Match VF MAC deletion behaviour with OOT driver Jamie Bainbridge
2025-06-23 16:20 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).