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 C0A021FF61E; Mon, 2 Jun 2025 15:16:44 +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=1748877404; cv=none; b=PytVyjvjaL556CUEC11dKOMxS7JewxOPDfveMBe6/SF+IKSrzOvsr/OHkvkvbCJmRj9hZY4TQEc2xjpoxyAgABXlDGKwwzbtI35YTxOTJaBpiwCyPkVWjVwpLAn23sxdcfaNhWnvPPlvSOiMuXpfwC8W5X87Xw4U/iFedATscm0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748877404; c=relaxed/simple; bh=+Glog9QEBD0L2WGq2KM8UJ0WGPttVdM0myDlFd6E88A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b2ifPh8e+OojW4PftFt0fo8EzCE55mt7MomlM7GQYEwaEJgmCJaOITXI+9gPtFhMurqgbTt/kFX5JBMFewN8mTecaCqn0GVhGlozGfJQhI3tmQISxT4K5gIoWXI5MwLhqgg6gCcE73frwS8vJCAt2EeEOi7bERkWgOmWQKkH3Fo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JSDyxQcK; 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="JSDyxQcK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3182DC4CEEB; Mon, 2 Jun 2025 15:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748877404; bh=+Glog9QEBD0L2WGq2KM8UJ0WGPttVdM0myDlFd6E88A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JSDyxQcKXz/AmKmsiJElxVF01qjjqIQCXJ7zqU0yIT4YhvDgg0lVIAjvfpEBTSSj1 qJ69dCjlKHvLb/43kVEnxyQgRzcxyQ6SN40iAegPh0tT3G2qJfSVYB93T5bO0SwpXV TiEnMESC0Nul4TqcMuoDmxjOMOZ2ybKtzt/HSWa4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jacob Keller , Michal Swiatkowski , Simon Horman , Sujai Buvaneswaran , Tony Nguyen , Sasha Levin Subject: [PATCH 6.1 240/325] ice: fix vf->num_mac count with port representors Date: Mon, 2 Jun 2025 15:48:36 +0200 Message-ID: <20250602134329.541343534@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134319.723650984@linuxfoundation.org> References: <20250602134319.723650984@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jacob Keller [ Upstream commit bbd95160a03dbfcd01a541f25c27ddb730dfbbd5 ] The ice_vc_repr_add_mac() function indicates that it does not store the MAC address filters in the firmware. However, it still increments vf->num_mac. This is incorrect, as vf->num_mac should represent the number of MAC filters currently programmed to firmware. Indeed, we only perform this increment if the requested filter is a unicast address that doesn't match the existing vf->hw_lan_addr. In addition, ice_vc_repr_del_mac() does not decrement the vf->num_mac counter. This results in the counter becoming out of sync with the actual count. As it turns out, vf->num_mac is currently only used in legacy made without port representors. The single place where the value is checked is for enforcing a filter limit on untrusted VFs. Upcoming patches to support VF Live Migration will use this value when determining the size of the TLV for MAC address filters. Fix the representor mode function to stop incrementing the counter incorrectly. Fixes: ac19e03ef780 ("ice: allow process VF opcodes in different ways") Signed-off-by: Jacob Keller Reviewed-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Sujai Buvaneswaran Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index 42d8e5e771b7e..fa9d928081d63 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -3551,7 +3551,6 @@ static int ice_vc_repr_add_mac(struct ice_vf *vf, u8 *msg) } ice_vfhw_mac_add(vf, &al->list[i]); - vf->num_mac++; break; } -- 2.39.5