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 47BD64404F; Wed, 12 Jun 2024 17:10:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2083E427B3; Wed, 12 Jun 2024 17:04:07 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 1D5B340E43 for ; Wed, 12 Jun 2024 17:04:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204645; x=1749740645; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=15qFUOAT4CLt2ZJWQ1whEBd5Px265j6W1haW5gteiU4=; b=b0GP5R/MwRAGyO82N42gdaQTun1TiyB3TCw8R69sa8tLP3OrzNQb5cVH WkxqKqnsEBfDmJvTFZSNV0BEETQFVTm+KVLssGb7wkG9H56xJTrepM+Sr CWZndoVHUV7cFJWQChccUDhqdbdeevhF/kZcOHYfYQAV/dfVRMBreioSi 2rR/6xwfL/xrPNOg/U1GirKPYc9oxWbs1EkmCGmzr2tphCGK8ySgT4SzV J6ezPUDcB0OyWdjg2QvJKe9pxuPiRFtKT3Lr1ZDBykEftrIKCDD6xVXcM Ne4CDfVIq2ywfA/Xp55p20rJZTHN0WT9KECjNywiLdp1ihv7cx3/BaHh5 Q==; X-CSE-ConnectionGUID: eaYD6OaKQ6ei87bwU6vMMg== X-CSE-MsgGUID: wQgsgThSQuW+8JHWvM3Vkg== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459307" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459307" 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:04:05 -0700 X-CSE-ConnectionGUID: QNT7eC4tRdWQd2Q7+jRT6w== X-CSE-MsgGUID: TWmI/Zp7RYGhfoANik5A9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925038" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:04:03 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Robert Malz Subject: [PATCH v2 029/148] net/ice/base: fix for applying multiple cloud filters Date: Wed, 12 Jun 2024 16:00:23 +0100 Message-ID: <6f451a25b2668cf7149108bf97860e951fdf7d5c.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 When applying UDP cloud filter with tunnel type different than VXLAN for each of the filter new recipe will be created instead of using already created one. This will quickly use all of the resources for specific recipe. Modified check to detect if recipe with similar tunnel type has been already created. Signed-off-by: Robert Malz Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_switch.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 1a851e4d0e..8f800e6fa2 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -2224,15 +2224,16 @@ static struct ice_prof_type_entry ice_prof_type_tbl[ICE_GTPU_PROFILE] = { */ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) { - u8 vxlan_profile[12] = {10, 11, 12, 16, 17, 18, 22, 23, 24, 25, 26, 27}; + u8 udp_tun_profile[12] = {10, 11, 12, 16, 17, 18, 22, 23, 24, 25, 26, + 27}; u8 gre_profile[12] = {13, 14, 15, 19, 20, 21, 28, 29, 30, 31, 32, 33}; u8 pppoe_profile[7] = {34, 35, 36, 37, 38, 39, 40}; u8 non_tun_profile[6] = {4, 5, 6, 7, 8, 9}; enum ice_sw_tunnel_type tun_type; u16 i, j, k, profile_num = 0; + bool udp_tun_valid = false; bool non_tun_valid = false; bool pppoe_valid = false; - bool vxlan_valid = false; bool gre_valid = false; bool gtp_valid = false; bool flag_valid = false; @@ -2249,8 +2250,8 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) } for (i = 0; i < 12; i++) { - if (vxlan_profile[i] == j) - vxlan_valid = true; + if (udp_tun_profile[i] == j) + udp_tun_valid = true; } for (i = 0; i < 7; i++) { @@ -2274,8 +2275,8 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) flag_valid = true; } - if (!non_tun_valid && vxlan_valid) - tun_type = ICE_SW_TUN_VXLAN; + if (!non_tun_valid && udp_tun_valid) + tun_type = ICE_SW_TUN_UDP; else if (!non_tun_valid && gre_valid) tun_type = ICE_SW_TUN_NVGRE; else if (!non_tun_valid && pppoe_valid) @@ -2283,9 +2284,9 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) else if (!non_tun_valid && gtp_valid) tun_type = ICE_SW_TUN_GTP; else if (non_tun_valid && - (vxlan_valid || gre_valid || gtp_valid || pppoe_valid)) + (udp_tun_valid || gre_valid || gtp_valid || pppoe_valid)) tun_type = ICE_SW_TUN_AND_NON_TUN; - else if (non_tun_valid && !vxlan_valid && !gre_valid && !gtp_valid && + else if (non_tun_valid && !udp_tun_valid && !gre_valid && !gtp_valid && !pppoe_valid) tun_type = ICE_NON_TUN; else @@ -7186,9 +7187,16 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts, /* If for "i"th recipe the found was never set to false * then it means we found our match */ - if (tun_type == recp[i].tun_type && found && - priority == recp[i].priority) - return i; /* Return the recipe ID */ + if (found && priority == recp[i].priority) { + if (tun_type == recp[i].tun_type || + (recp[i].tun_type == ICE_SW_TUN_UDP && + (tun_type == ICE_SW_TUN_VXLAN_GPE || + tun_type == ICE_SW_TUN_VXLAN || + tun_type == ICE_SW_TUN_GENEVE || + tun_type == ICE_SW_TUN_GENEVE_VLAN || + tun_type == ICE_SW_TUN_VXLAN_VLAN))) + return i; /* Return the recipe ID */ + } } } return ICE_MAX_NUM_RECIPES; -- 2.43.0