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 418AA4404F; Wed, 12 Jun 2024 17:14:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 567F042789; Wed, 12 Jun 2024 17:05:21 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 03D0F42E5F for ; Wed, 12 Jun 2024 17:05:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204712; x=1749740712; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=psSLmxs0g7A1JcMfyb85VcKa4sXRwt7XxycmGmEbjZw=; b=ioFtBsXI3BCwvU8jCgbUolNhSLzGCZVKNVkCdzpVCXLsGbMpgvRVymzL 2XtTzgqzhQyvg2MnAOJoieg42UW3qmKC/betb1Tyw556IOYKoiLKZ2Nda wd5PIqYhqCEkHoDtG/S0wJmNyBAI9KahvspRPGbs1ZiOdpBLq7bwL48In 3dKIqaxJhdoDejorQsrNhN5GrPKo2yVTwgU7rx56TS+RFzHMfeOQ605Me +anoaUb5gT9AQW975GcJkc09dYrYHC9ystiE2X7Ps+bRdli1JemJNqJK+ tBHTvtuZD2b6dve8qtWpNBoUv82u7FhXlm070bo3N5Y2okSg6EJvstldC w==; X-CSE-ConnectionGUID: e/thtkK4Q4u3XyO/ssVEWw== X-CSE-MsgGUID: Upzx8vDHRTSmlFyQLYwKzg== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459591" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459591" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:05:08 -0700 X-CSE-ConnectionGUID: Zat3+SeeQmepk0tsjMJCYQ== X-CSE-MsgGUID: a1dWez7pQsmCK1jzj88NsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925461" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:05:07 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Mateusz Pacuszka Subject: [PATCH v2 066/148] net/ice/base: fix check for existing switch rule Date: Wed, 12 Jun 2024 16:01:00 +0100 Message-ID: <7e792ef1ab7abed155c92c6e910420558ab7f94b.1718204528.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes 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 6d0dcf43c6..62f86aaf13 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -4813,7 +4813,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; @@ -4861,7 +4861,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