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 E72D3222599; Mon, 23 Jun 2025 22:10:39 +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=1750716640; cv=none; b=dT0QZqqAs6VgHFmT581qAYrFuSSayhJAP3Y/RdvPQsWEbK4qicJJvySdE8tPDGt89sMpHWh1JLykMynOW+Wn6tGJ8NfteVFmCGGX0kyfke/ogBDJHfA63/2xoXrzMfkMtd+xs8smeQ5b4zZQQlboK7F8SyzXeFnIhtzPRZEO7I4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750716640; c=relaxed/simple; bh=BU7lsCfvhD+CU1qh0OGVLVG4UsSpZ1nYqxKdML7QMeg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LCuTCDMc/v0A+wi6KkhfO4zLoRbqfwmgdAzTCMeWJcVGLykJU10eP/hrCgvr3THGBPItEQsC4RGs7viep743mvGkI3P+svy1pr8MN0nQXhDPs619z2CRIx7nGwW95O5tPPMYDysShL4uabGOaz/yhdL/OryR46EQFc3M6FiRlmc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d8FRhi7t; 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="d8FRhi7t" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D9C3C4CEEA; Mon, 23 Jun 2025 22:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750716639; bh=BU7lsCfvhD+CU1qh0OGVLVG4UsSpZ1nYqxKdML7QMeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d8FRhi7tyued0Zu4JI/lZr1/MFzVRupT7BAI2ifsX37PJj9v1h1EtfrGqCPPDAQFb KarNBqtHtK3VCxatjCaOCmroui8vo0O2GUoUTsxMT44SCI8DwnQ6Z/zJayvj3q3afx KN11uJtAZF1FYdnkz4S9iak92FLCtM5gVD18wH74= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mateusz Pacuszka , Przemek Kitszel , Michal Swiatkowski , Larysa Zaremba , Simon Horman , Rafal Romanowski , Tony Nguyen , Sasha Levin Subject: [PATCH 6.12 271/414] ice: fix check for existing switch rule Date: Mon, 23 Jun 2025 15:06:48 +0200 Message-ID: <20250623130648.806414517@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130642.015559452@linuxfoundation.org> References: <20250623130642.015559452@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mateusz Pacuszka [ Upstream commit a808691df39b52cd9db861b118e88e18b63e2299 ] In case the rule already exists and another VSI wants to subscribe to it new VSI list is being created and both VSIs are moved to it. Currently, the check for already existing VSI with the same rule is done based on fdw_id.hw_vsi_id, which applies only to LOOKUP_RX flag. Change it to vsi_handle. This is software VSI ID, but it can be applied here, because vsi_map itself is also based on it. Additionally change return status in case the VSI already exists in the VSI map to "Already exists". Such case should be handled by the caller. Signed-off-by: Mateusz Pacuszka Reviewed-by: Przemek Kitszel Reviewed-by: Michal Swiatkowski Signed-off-by: Larysa Zaremba Reviewed-by: Simon Horman Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c index 0e740342e2947..c5430363e7081 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -3146,7 +3146,7 @@ ice_add_update_vsi_list(struct ice_hw *hw, u16 vsi_handle_arr[2]; /* A rule already exists with the new VSI being added */ - if (cur_fltr->fwd_id.hw_vsi_id == new_fltr->fwd_id.hw_vsi_id) + if (cur_fltr->vsi_handle == new_fltr->vsi_handle) return -EEXIST; vsi_handle_arr[0] = cur_fltr->vsi_handle; @@ -5977,7 +5977,7 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw, /* A rule already exists with the new VSI being added */ if (test_bit(vsi_handle, m_entry->vsi_list_info->vsi_map)) - return 0; + return -EEXIST; /* Update the previously created VSI list set with * the new VSI ID passed in -- 2.39.5