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 054A945500; Wed, 26 Jun 2024 13:55:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A0C243007; Wed, 26 Jun 2024 13:55:03 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 725A442E95 for ; Wed, 26 Jun 2024 13:43:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402190; x=1750938190; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KmdXyHRGJob9Gi6CNIEPWQhNFmb8WWbuj6WqFQgvHsM=; b=SrEiNwV6iMgQcVWxktH/Asotb7KXlDsmYIG9udLp3B2bfIxsGfQ5XtDi 4A0Ojsp/7+fWzr3ISf0OfSi6NJ+JICtRcc4G0ypZs+M+86iHKdyN6xdvB bBKLKIQXTVUWTa5dO3sQTCheG4jEyZYhT1f8Lon71HEFyHULLMBq4finY EiUx8NFDPeqaQPAeD3rPMRO/rc35gwInz7aEi9ZdDsDxvjV5mKyVJ3ncE hL2W2LaMfaWkuk54zDEEZi9d2eKRj+cfcGDB1MSnYM9DM/Bepe0RYNjrd BiPJJ/SoWZyklvP+vf/+ZgWEU3h/nALxJ/SFTzCF64sNMV4WtL+C6M7yZ g==; X-CSE-ConnectionGUID: C57hOuo2Tq26WvRrsrYgUg== X-CSE-MsgGUID: NOYYf12RQoyPYBZJn+MV2A== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979284" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979284" 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:10 -0700 X-CSE-ConnectionGUID: toG7S5CxRD2IXn/ZH2fuIQ== X-CSE-MsgGUID: K4bn5wTUTE6urkhDa+LGCQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873436" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:43:09 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Robert Malz , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 006/103] net/ice/base: fix for applying multiple cloud filters Date: Wed, 26 Jun 2024 12:40:54 +0100 Message-ID: <7c90c401de0e932102f31fbc5df97ec7f47f72f2.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: Robert Malz 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 e32786d59c..711a6cfbbe 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 @@ -7189,9 +7190,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