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 65CF6454EF; Tue, 25 Jun 2024 13:18:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 83AEF427DA; Tue, 25 Jun 2024 13:16:09 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 3780542D72 for ; Tue, 25 Jun 2024 13:15:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314143; x=1750850143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WlONnZGuiKj2JvZzjTVkz2DARiStiIQKnKFCbI0G6A0=; b=CCOGRiuu6pvjX6qL8I5LQg8J3Vr6xG3mqLN7e5hK53Ye+W+Oxj2NH8fI YLBVyquWsOxO0iGTVwTMTTwR1K0ZkAEdrkYqptes0BNiSwnTJeSCQw/6g xbyFEXSsUTHRALzgP6J5bOtzsMO1wh7Mc3r3AW36HgMYYaN6iqZZBtule zG6oeW5pFYOuYSaVS+arbk/n+fjtQRaLUngSqpZOjPi+HscyVfoO++7Am eRYnA3NA0fp9Ul5zSwCcBDJAzpD32IzVpv7oyAw967q/uHJplGJooKdKU 7jXzyE+05zDuvrLwmFEAkLmGvA/Pqu8EfN4QKdIVTjMg0mie9AtLEay4B g==; X-CSE-ConnectionGUID: dWfRaZqXSd69BUH+Im5jHg== X-CSE-MsgGUID: OBI02K75T+GyaDcIKMgbBA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080125" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080125" 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:15:42 -0700 X-CSE-ConnectionGUID: wSSDWma+Q7icFfflY8qEoA== X-CSE-MsgGUID: ICJ9sAegRmCDjc8WRvTaIw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719046" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:15:42 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Robert Malz , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 026/129] net/ice/base: fix for applying multiple cloud filters Date: Tue, 25 Jun 2024 12:12:31 +0100 Message-ID: <0b99383e408bf5287c78a17f88726aff002ec643.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: 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 aa244809d8..7e6245bd51 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