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 E3FF745500; Wed, 26 Jun 2024 13:58:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D51E44335B; Wed, 26 Jun 2024 13:55:39 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 6314342E95 for ; Wed, 26 Jun 2024 13:43:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402235; x=1750938235; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n1NEF62JQxSKJonEba9g+vw5kqru94mhj/0bQ79gKBA=; b=Rhapi+GqumFGLpxSTX1PfUvNM6mQDZ/aLUKM4dY3sE8tZRYKOMq9hdnT 34et63r/pdlvtJHolLqMaDM9ZLdiqdHP5qyu8IgabBdkSRiSVkFmWKNry 64Dpht884CPl6BfiwaWtJ2+FPmFKPQ3AXYiATo11xqAuJx3Ff1HlHDQS0 RxFzSoJ78IXnsKhKjfvLhUlAFAmOTZ/JqJChCObXe1YMVBVNuiZZMZUeI 3A8Mwt8oYc3cNqaPG9L83rrZDn+vZ9cMZD+tEHCFrsqG0V648qAl+sILc n4E4zzhrDAavQBCxiRqvnQ9vOW52HKlkzNcGozB8/YO5XbCdmkb55tH33 g==; X-CSE-ConnectionGUID: BdlkVFIxSAqIwY8bPljTiQ== X-CSE-MsgGUID: G5H4AW3bRa+OmY+hiXIudQ== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979379" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979379" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:43:55 -0700 X-CSE-ConnectionGUID: EtFu8COjTZqh2aib6dhZLw== X-CSE-MsgGUID: T2dtlEqYQR2Y+MJheoKkFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873664" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:43:54 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Mateusz Pacuszka , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 032/103] net/ice/base: fix check for existing switch rule Date: Wed, 26 Jun 2024 12:41:20 +0100 Message-ID: <015a25cdc04292f64ffa5e19fe07ead282828712.1719401847.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 fa5bd94c58..f8d98d8a9e 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