Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2640948rbb; Wed, 28 Feb 2024 08:04:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXJPKH/S4ZAtABsDpPZI8dtwrqzaWv/tOnw2m1sZf8MEcEfdu9LPaV6wmzdgdaN+gPPphi9kJfFqZmjzdLN7f3go0WpDxmofUrl41xpbA== X-Google-Smtp-Source: AGHT+IE5RM7VBln0CVT9OlAZjQH992hbwlLGSBdrJ0hFxHwH+J3szq1CzjGjYjtJKTln53gKzOEO X-Received: by 2002:a05:622a:309:b0:42e:60c2:45de with SMTP id q9-20020a05622a030900b0042e60c245demr16433873qtw.66.1709136292829; Wed, 28 Feb 2024 08:04:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709136292; cv=pass; d=google.com; s=arc-20160816; b=xjVrOoCKJEUXCP0L0UV/dDxXKtbo2ia6/3LVhrGn3SYdVQGMZgWRdzyNzw+YnuGqZK 0g6/DA5VuSrAdua4Ig9w7ZzRwAg0qk7ZzVJn3597p4U3ELfFTaAmQVLiqmjKTCt1QPp9 HDJ7ZAFNVaPWPKkViogUoUt4rU4S+QEnuQPkxqA6zhg4NcVbWzrXxjsgW6Tif/DT76BF i59KuQpiga/ILvS/ThgY6CLlc9xUl2EWtDR/elzbBOdde3/3cGwlqUeiJ0hjG4YWYTMM 5do+lpzeB6+7HbDGqnfs3tdrMx/VGr7SR+IPYsP1YhL07POdLekXvXiEea88dnfAI7sK XdtQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7Pk5U//ZVPQPExQ9A4E0uQW+cR32sT/LD38cIH9X+2E=; fh=XF5dR1hZ6bmHhiCesO+5NPfXhTaDjas2E0STvyrxXLQ=; b=wG9p+PTkwngJUhJyz88kSbO6wv3/S0iuYassfKAjmRPUm7PxpmUkK7UeCSWLzz3DNA 36LlNyKzrCzoLcBewk1g1tQALNgCvX6IPZF4OQiHoY2bPqV7WfnawRD9ogqmSQIgCn4G Uprh6VfLedDC/5AJoebRFw6X1v5u2qlS2/H61TT8MI72vDXVyh3F1GyryE67HwVznEEf Q/rtKzRimLUdZHXd2CHhytaSi4O93IKj9Y2VhFavqgZa9my7AouGJFcJW8BZZ5BIkPVa jrcGe+0w3GW+ahEGTK4//iKtelMzykqYyZdJaGu40gA0ULs0EZHyUjCBmYDeJhZAlJ4d 8m3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fxX+Zwyf; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cj18-20020a05622a259200b0042eb314f92asi812506qtb.755.2024.02.28.08.04.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 08:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fxX+Zwyf; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-85317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85317-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 26BB11C22EA9 for ; Wed, 28 Feb 2024 16:04:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B10A15E5C7; Wed, 28 Feb 2024 16:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fxX+Zwyf" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 B121615DBC3; Wed, 28 Feb 2024 16:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709136257; cv=none; b=orJqVnYGu8oGDNOpry6zM0SRrqAAQ338XfqUOy4Yx2csSxGjGVlMk/zSNIFaQ712RCScIOJwmwP7TJHZxUc47CwKQZvQOQ9qhxRU8d36AZQVvAcWiVstRCRAo57Y1/WhYvcv3jfhHP/tqoyrljmVX5np+Zlju2Awf+nqVjcQ6jA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709136257; c=relaxed/simple; bh=R61ecFgc4lXqLojo0yvyMnIKMCsRpjfsVyCvjTYWt2U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SI1ilRpRKXeIxzibZGmMY9K8PGvCC0fuptl8TMfdlbulUp8acaRDHFlEUgBZzYZ8BkAYPjhDZOvPEJ0VFIq2+ySbGyzzRPpAjGqt3RYZkq9yOgmawdOZ30qPtw9gV1qzr73Ae0M7BRIoS9NXye3YwAj4Lm1GTiH2elNBTZ/Gr2c= 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=fxX+Zwyf; arc=none smtp.client-ip=198.175.65.17 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709136256; x=1740672256; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=R61ecFgc4lXqLojo0yvyMnIKMCsRpjfsVyCvjTYWt2U=; b=fxX+Zwyfc7JBscIKN4+Uy5jivXITpWq/e9bdT2lzxgNPEHfOsR3JPEf5 Qzibv3zVfz61XygTqr7wVCjOB1EeuhbJ/NAX/P1qJEiSKNg1tkFhVXFUm SCJCB4cDLhD76AfhayMlcnf93Nwauz5+gUoxUEECcLwGhuI5fyxw7RHyj XZrsnVIECA/6zOiJCIf4T/QAY7l2DDHiK4SkMofdJIHB1GpKo6bI8H6je txIqVNeGS00TX0KbTCLGKQdR3XV5MCHYwusTNbTl1O3zH/PUPYf8l4gie ueMSx9ao2SgiKPeSY7LdAmq1ZBCgL6bjAMHT+Shgf53vXtFroTj2zySjG A==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="3706596" X-IronPort-AV: E=Sophos;i="6.06,190,1705392000"; d="scan'208";a="3706596" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 08:04:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,190,1705392000"; d="scan'208";a="7527713" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by orviesa009.jf.intel.com with ESMTP; 28 Feb 2024 08:04:11 -0800 Received: from lincoln.igk.intel.com (lincoln.igk.intel.com [10.102.21.235]) by irvmail002.ir.intel.com (Postfix) with ESMTP id E397D36826; Wed, 28 Feb 2024 16:04:08 +0000 (GMT) From: Larysa Zaremba To: intel-wired-lan@lists.osuosl.org Cc: Larysa Zaremba , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Mateusz Pacuszka , Tony Nguyen , Lukasz Plachno , Jakub Buchocki , Pawel Kaminski , Przemek Kitszel , Michal Swiatkowski , Mateusz Polchlopek , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Pawel Chmielewski , Jesse Brandeburg Subject: [PATCH iwl-net 2/5] ice: Fix check for existing switch rule Date: Wed, 28 Feb 2024 16:59:46 +0100 Message-ID: <20240228155957.408036-3-larysa.zaremba@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240228155957.408036-1-larysa.zaremba@intel.com> References: <20240228155957.408036-1-larysa.zaremba@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 f84bab80ca42..bf2ab2b6ef68 100644 --- a/drivers/net/ethernet/intel/ice/ice_switch.c +++ b/drivers/net/ethernet/intel/ice/ice_switch.c @@ -3004,7 +3004,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; @@ -3052,7 +3052,7 @@ ice_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.43.0