From patchwork Sat Feb 8 13:22:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larysa Zaremba X-Patchwork-Id: 13966386 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 44D36248164; Sat, 8 Feb 2025 13:38:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739021891; cv=none; b=VN5Yr+KRa8PhRz2t7bHcLFkfsZHen+LRanzd1fZmDonh+3pTBNJKS6cyC2FaZ6WUdXa6aQj/F5BRoN1ciA4stXmazVYxP1iIejBgrV1Z7LhAnZnTiNgFAvPN3x1K1U4W0e+3LTv3YCww9umZzG2MmsC9v6OkMnlqq7IjsTX0es0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739021891; c=relaxed/simple; bh=M2eCGgxLh5c6cE335IWn+xf91G0/3FE3wsl1N+36ZVc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XxfNNYhXWvGdGCp5KsKGBl1eM8GcRcEXtKIX16J/ykFAZ/yjLAD+w1V6eKkLqBd50w8iM4P1JAN+s1pbfpdeze4GlzbmwA1ULI/udCbGBs4Goz/IENK9sf6XdQbmCzbgmfHhNpRLqHLkcTpTiGqxDMP9V3dhQ7IEfSO7bFngVDU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=La/1Mf23; arc=none smtp.client-ip=192.198.163.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="La/1Mf23" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1739021890; x=1770557890; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=M2eCGgxLh5c6cE335IWn+xf91G0/3FE3wsl1N+36ZVc=; b=La/1Mf23bT9LczvNhBLnph6iO3f2lBacGktn0PEcexRigHmJvv2AC39U 9ZJeqlZ0WMGXDzx6KdsFxABgWcGD5xQP900JOyPHrKdzK5JmrSjE/MViD V49l1oBnfUQieGxSK/2/X0rkXXRqWfrIGaWTWsfhUpkam2I2v/hCRlGAj bnaKA47JlzstQsTmkYRgLVwS+058DQxF88PsG9IaqB4DpQ85DVdv2lGjU DiK951RlR8y2S8Zm/ckmhY02XdTxtF0hXCV5l4/hCud58tZihjfMaq0WI 6+CqAYw92nAFP7y1xFH3l1/ewdjCGV1JmRKaO8+c65fubFCIZtq0qSpOm w==; X-CSE-ConnectionGUID: rNRlInWSRUeCcWKadrai6Q== X-CSE-MsgGUID: z7zzU5fPSn6yLcqCpGdCWg== X-IronPort-AV: E=McAfee;i="6700,10204,11314"; a="51084806" X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; d="scan'208";a="51084806" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2025 05:38:10 -0800 X-CSE-ConnectionGUID: j7tzURVfR4ev1ymBxFxPQQ== X-CSE-MsgGUID: bXhNBMywSK2m02htQTyNNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="116980863" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa005.jf.intel.com with ESMTP; 08 Feb 2025 05:38:06 -0800 Received: from lincoln.igk.intel.com (lincoln.igk.intel.com [10.102.21.235]) by irvmail002.ir.intel.com (Postfix) with ESMTP id 69AD332C91; Sat, 8 Feb 2025 13:38:05 +0000 (GMT) From: Larysa Zaremba To: Tony Nguyen , intel-wired-lan@lists.osuosl.org Cc: Larysa Zaremba , Przemek Kitszel , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michal Swiatkowski , Mateusz Pacuszka Subject: [PATCH iwl-next v3 1/6] ice: fix check for existing switch rule Date: Sat, 8 Feb 2025 14:22:42 +0100 Message-ID: <20250208132251.1989365-2-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250208132251.1989365-1-larysa.zaremba@intel.com> References: <20250208132251.1989365-1-larysa.zaremba@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Mateusz Pacuszka 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 --- 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 4a91e0aaf0a5..9d9a7edd3618 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; @@ -5978,7 +5978,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