From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 886D3230981; Wed, 30 Jul 2025 09:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753869149; cv=none; b=KER1Ilqs/5kMX2JGC3eXWDU4tzusXsD4RuN3fPazZhEMeet2PdiaRvrmbGPHX09fEyfnWhduPwcPjNk6xxbb0AJiOCTQZJvZXaalJBKe6hCMxByiwYSHdWKNHGKyuGEagsRkJeXkHcN9GOCDY5h+qTBZk+QvgNtpi9dclE//hXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753869149; c=relaxed/simple; bh=HNxEvs2Oyhs732qiGCxzP+oRhpeFC4TA8ucVqx7LlJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HX3ERV1sXpYKUohfqUX5qhD5STxaJnifFA5kuk3FK4LIM2WXUoXg4RpRwNU07rQ2N4MRghtuYowAgOp0YOi38cA96G8GvwV84TAmouo1mm4ikzl3e3Rvj6gjfvy1B8dd44V+ip6iUP4lPfT+5Rj2tSP6C9SvqgERTcg0kHDjBy0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vItj97vF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vItj97vF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05158C4CEF5; Wed, 30 Jul 2025 09:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753869149; bh=HNxEvs2Oyhs732qiGCxzP+oRhpeFC4TA8ucVqx7LlJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vItj97vFPU74lZbb7dAuLeC1ey0RUuflElzdyrQKMEGy9YeTCWROgUKNVFej9Q7vB Znbu4RNLN039pGmV3TTcez/LnmxunikxYQsnFW73y/VF8gsBD1aNJFB/EGJjDphKCm HRS2/VOnRtnkyi4ZWvPRP2Btd/6KfqzJJoA84DNA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jamie Bainbridge , Simon Horman , Rafal Romanowski , Tony Nguyen , Sasha Levin Subject: [PATCH 6.15 31/92] i40e: When removing VF MAC filters, only check PF-set MAC Date: Wed, 30 Jul 2025 11:35:39 +0200 Message-ID: <20250730093231.957662973@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250730093230.629234025@linuxfoundation.org> References: <20250730093230.629234025@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jamie Bainbridge [ Upstream commit 5a0df02999dbe838c3feed54b1d59e9445f68b89 ] When the PF is processing an Admin Queue message to delete a VF's MACs from the MAC filter, we currently check if the PF set the MAC and if the VF is trusted. This results in undesirable behaviour, 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. This results in the VF losing its PF-set MAC which should not happen. There is no need to check for trust at all, because an untrusted VF cannot change its own MAC. The only check needed is whether the PF set the MAC. If the PF set the MAC, then don't erase the MAC on link-down. Resolve this by changing the deletion check only for PF-set MAC. (the out-of-tree driver has also intentionally removed the check for VF trust here with OOT driver version 2.26.8, this changes the Linux kernel driver behaviour and comment to match the OOT driver behaviour) Fixes: ea2a1cfc3b201 ("i40e: Fix VF MAC filter removal") Signed-off-by: Jamie Bainbridge Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- 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 2dbe38eb94941..7ccfc1191ae56 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