From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 00FCC454EF; Tue, 25 Jun 2024 13:21:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A26942F2D; Tue, 25 Jun 2024 13:17:57 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id AF14A427DE for ; Tue, 25 Jun 2024 13:16:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314213; x=1750850213; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8LeCNUGesRy5kAW/61FIyr9j0anj5t+A3+nRaCmWMcQ=; b=Pr94GDx9PtDy4feCYU77FMf/8v3mriGeyNGNHD25ACNvi0rHA4ZpLP1x JDP9ChlkVzvgkIaTyf6qan2VSL49OxyJWQT2FlF+RcRdKIwGlkRYpcJ/U OwTJXfuYLWc02r586U8Z/P4CXpfQv3Kk+NvWu/TKiog1yfGHd0yu5lcI/ cgsVBn8MDkLuZKOtQa+F5yR4pmlMvb9jUgTJMc9mlValHJVT3QD9i/XPg 7CtJpFyVwMAKAg4SG8Roupz3YmU29wIkiAsiyWY2RWN8nlxrlxx/7pFNr p7nW/iC75smEyFcg0oMKF2T3Da+q5VQNaW9Rhm1lZby8wA/mIr3mqVnnF A==; X-CSE-ConnectionGUID: JSo7HcGTR8SZB4BgOpoGag== X-CSE-MsgGUID: dAixouSHRPu0VwEjG4ojAQ== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080249" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080249" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:16:25 -0700 X-CSE-ConnectionGUID: Cf8D6m6MTbiuV52kcQJKDA== X-CSE-MsgGUID: C9Cp9PufR+iqv83AlUgvgw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719216" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:16:25 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Mateusz Pacuszka , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 052/129] net/ice/base: fix check for existing switch rule Date: Tue, 25 Jun 2024 12:12:57 +0100 Message-ID: <570a68df46f01abd9347e1aa5b1b911c5069dcfe.1719313663.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.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 Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 2b4be6d115..57bdad5e56 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -4624,7 +4624,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 ICE_ERR_ALREADY_EXISTS; vsi_handle_arr[0] = cur_fltr->vsi_handle; @@ -4672,7 +4672,7 @@ ice_add_update_vsi_list(struct ice_hw *hw, /* A rule already exists with the new VSI being added */ if (ice_is_bit_set(m_entry->vsi_list_info->vsi_map, vsi_handle)) - return 0; + return ICE_ERR_ALREADY_EXISTS; /* Update the previously created VSI list set with * the new VSI ID passed in -- 2.43.0