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 251E1A0C3F; Thu, 15 Apr 2021 12:58:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7E601620FE; Thu, 15 Apr 2021 12:58:32 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 1AD7C1620FD for ; Thu, 15 Apr 2021 12:58:30 +0200 (CEST) IronPort-SDR: Qm5yq9qjefKJMzhb+9H/Jhcmr3o5avxUujmEXeZQli4gwPjPu2iCLm0EioMEIYZtG43p5TOc4v tQLroJYZ+R5g== X-IronPort-AV: E=McAfee;i="6200,9189,9954"; a="182329980" X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="182329980" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 03:58:29 -0700 IronPort-SDR: yz3WdhAZY6bGsoEFNxHIkI9H/7bhmao+dQ3hN+IRwWDfem56kG+PDT1YOQ7c0YjgqJ9yOsVn7O /DRFSPjJimCQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,223,1613462400"; d="scan'208";a="452868714" Received: from dpdk-yyzhang2.sh.intel.com ([10.67.117.129]) by fmsmga002.fm.intel.com with ESMTP; 15 Apr 2021 03:58:27 -0700 From: Yuying Zhang To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Yuying Zhang Date: Thu, 15 Apr 2021 10:47:50 +0000 Message-Id: <20210415104751.816581-1-yuying.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210318084824.165907-1-yuying.zhang@intel.com> References: <20210318084824.165907-1-yuying.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 1/2] net/ice/base: support GTPU for DCF switch filter 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 Sender: "dev" Enable GTPU filtering for DCF switch filter. Signed-off-by: Yuying Zhang --- drivers/net/ice/base/ice_protocol_type.h | 20 ++ drivers/net/ice/base/ice_switch.c | 263 ++++++++++++++++++++--- drivers/net/ice/base/ice_switch.h | 5 + 3 files changed, 260 insertions(+), 28 deletions(-) diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index 8c9d098e22..d1d266ffd2 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -76,6 +76,26 @@ enum ice_sw_tunnel_type { ICE_SW_TUN_GTP, ICE_SW_TUN_IPV4_GTPU_NO_PAY, ICE_SW_TUN_IPV6_GTPU_NO_PAY, + ICE_SW_TUN_IPV4_GTPU_EH_IPV4, + ICE_SW_TUN_IPV4_GTPU_IPV4_UDP, + ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP, + ICE_SW_TUN_IPV4_GTPU_IPV4_TCP, + ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP, + ICE_SW_TUN_IPV4_GTPU_EH_IPV6, + ICE_SW_TUN_IPV4_GTPU_IPV6_UDP, + ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP, + ICE_SW_TUN_IPV4_GTPU_IPV6_TCP, + ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP, + ICE_SW_TUN_IPV6_GTPU_EH_IPV4, + ICE_SW_TUN_IPV6_GTPU_IPV4_UDP, + ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP, + ICE_SW_TUN_IPV6_GTPU_IPV4_TCP, + ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP, + ICE_SW_TUN_IPV6_GTPU_EH_IPV6, + ICE_SW_TUN_IPV6_GTPU_IPV6_UDP, + ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP, + ICE_SW_TUN_IPV6_GTPU_IPV6_TCP, + ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP, ICE_SW_TUN_PPPOE, ICE_SW_TUN_PPPOE_PAY, ICE_SW_TUN_PPPOE_IPV4, diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 45f83cd10c..2a9bea4261 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -14,6 +14,7 @@ #define ICE_PPP_IPV6_PROTO_ID 0x0057 #define ICE_IPV6_ETHER_ID 0x86DD #define ICE_TCP_PROTO_ID 0x06 +#define ICE_GTPU_PROFILE 24 #define ICE_ETH_P_8021Q 0x8100 /* Dummy ethernet header needed in the ice_aqc_sw_rules_elem @@ -1123,6 +1124,7 @@ static const u8 dummy_udp_gtp_packet[] = { 0x02, 0x00, 0x00, 0x00, /* PDU Session extension header */ 0x00, 0x00, 0x00, 0x00, + }; static const struct ice_dummy_pkt_offsets dummy_ipv4_gtp_no_pay_packet_offsets[] = { @@ -1142,6 +1144,32 @@ struct ice_dummy_pkt_offsets dummy_ipv6_gtp_no_pay_packet_offsets[] = { { ICE_PROTOCOL_LAST, 0 }, }; +static const u8 dummy_ipv6_gtp_packet[] = { + 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x86, 0xdd, + + 0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 14 */ + 0x00, 0x6c, 0x11, 0x00, /* Next header UDP*/ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x08, 0x68, 0x08, 0x68, /* ICE_UDP_OF 54 */ + 0x00, 0x00, 0x00, 0x00, + + 0x30, 0x00, 0x00, 0x28, /* ICE_GTP 62 */ + 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, +}; + static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, @@ -1785,6 +1813,33 @@ static void ice_collect_result_idx(struct ice_aqc_recipe_data_elem *buf, ~ICE_AQ_RECIPE_RESULT_EN, recp->res_idxs); } +static struct ice_prof_type_entry ice_prof_type_tbl[ICE_GTPU_PROFILE] = { + { ICE_PROFID_IPV4_GTPU_IPV4_OTHER, ICE_SW_TUN_IPV4_GTPU_IPV4}, + { ICE_PROFID_IPV4_GTPU_IPV4_UDP, ICE_SW_TUN_IPV4_GTPU_IPV4_UDP}, + { ICE_PROFID_IPV4_GTPU_IPV4_TCP, ICE_SW_TUN_IPV4_GTPU_IPV4_TCP}, + { ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER, ICE_SW_TUN_IPV4_GTPU_EH_IPV4}, + { ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP}, + { ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP}, + { ICE_PROFID_IPV4_GTPU_IPV6_OTHER, ICE_SW_TUN_IPV4_GTPU_IPV6}, + { ICE_PROFID_IPV4_GTPU_IPV6_UDP, ICE_SW_TUN_IPV4_GTPU_IPV6_UDP}, + { ICE_PROFID_IPV4_GTPU_IPV6_TCP, ICE_SW_TUN_IPV4_GTPU_IPV6_TCP}, + { ICE_PROFID_IPV4_GTPU_EH_IPV6_OTHER, ICE_SW_TUN_IPV4_GTPU_EH_IPV6}, + { ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP}, + { ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP}, + { ICE_PROFID_IPV6_GTPU_IPV4_OTHER, ICE_SW_TUN_IPV6_GTPU_IPV4}, + { ICE_PROFID_IPV6_GTPU_IPV4_UDP, ICE_SW_TUN_IPV6_GTPU_IPV4_UDP}, + { ICE_PROFID_IPV6_GTPU_IPV4_TCP, ICE_SW_TUN_IPV6_GTPU_IPV4_TCP}, + { ICE_PROFID_IPV6_GTPU_EH_IPV4_OTHER, ICE_SW_TUN_IPV6_GTPU_EH_IPV4}, + { ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP}, + { ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP}, + { ICE_PROFID_IPV6_GTPU_IPV6_OTHER, ICE_SW_TUN_IPV6_GTPU_IPV6}, + { ICE_PROFID_IPV6_GTPU_IPV6_UDP, ICE_SW_TUN_IPV6_GTPU_IPV6_UDP}, + { ICE_PROFID_IPV6_GTPU_IPV6_TCP, ICE_SW_TUN_IPV6_GTPU_IPV6_TCP}, + { ICE_PROFID_IPV6_GTPU_EH_IPV6_OTHER, ICE_SW_TUN_IPV6_GTPU_EH_IPV6}, + { ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP}, + { ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP}, +}; + /** * ice_get_tun_type_for_recipe - get tunnel type for the recipe * @rid: recipe ID that we are populating @@ -1796,7 +1851,7 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) 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, profile_num = 0; + u16 i, j, k, profile_num = 0; bool non_tun_valid = false; bool pppoe_valid = false; bool vxlan_valid = false; @@ -1870,18 +1925,12 @@ static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid, bool vlan) } if (tun_type == ICE_SW_TUN_GTP) { - if (ice_is_bit_set(recipe_to_profile[rid], - ICE_PROFID_IPV4_GTPU_IPV4_OTHER)) - tun_type = ICE_SW_TUN_IPV4_GTPU_IPV4; - else if (ice_is_bit_set(recipe_to_profile[rid], - ICE_PROFID_IPV4_GTPU_IPV6_OTHER)) - tun_type = ICE_SW_TUN_IPV4_GTPU_IPV6; - else if (ice_is_bit_set(recipe_to_profile[rid], - ICE_PROFID_IPV6_GTPU_IPV4_OTHER)) - tun_type = ICE_SW_TUN_IPV6_GTPU_IPV4; - else if (ice_is_bit_set(recipe_to_profile[rid], - ICE_PROFID_IPV6_GTPU_IPV6_OTHER)) - tun_type = ICE_SW_TUN_IPV6_GTPU_IPV6; + for (k = 0; k < ARRAY_SIZE(ice_prof_type_tbl); k++) + if (ice_is_bit_set(recipe_to_profile[rid], + ice_prof_type_tbl[k].prof_id)) { + tun_type = ice_prof_type_tbl[k].type; + break; + } } if (profile_num == 1 && (flag_valid || non_tun_valid || pppoe_valid)) { @@ -6521,7 +6570,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = { { ICE_GENEVE, { 8, 10, 12, 14 } }, { ICE_VXLAN_GPE, { 8, 10, 12, 14 } }, { ICE_NVGRE, { 0, 2, 4, 6 } }, - { ICE_GTP, { 8, 10, 12, 14, 16, 18, 20 } }, + { ICE_GTP, { 8, 10, 12, 14, 16, 18, 20, 22 } }, { ICE_PPPOE, { 0, 2, 4, 6 } }, { ICE_PFCP, { 8, 10, 12, 14, 16, 18, 20, 22 } }, { ICE_L2TPV3, { 0, 2, 4, 6, 8, 10 } }, @@ -7461,38 +7510,100 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, case ICE_SW_IPV6_UDP: ice_set_bit(ICE_PROFID_IPV6_UDP, bm); return; + case ICE_SW_TUN_IPV4_GTPU_NO_PAY: + ice_set_bit(ICE_PROFID_IPV4_GTPU_TEID, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_NO_PAY: + ice_set_bit(ICE_PROFID_IPV6_GTPU_TEID, bm); + return; case ICE_SW_TUN_IPV4_GTPU_IPV4: - ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER, bm); ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_OTHER, bm); - ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, bm); ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_UDP, bm); - ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, bm); ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_TCP, bm); return; + case ICE_SW_TUN_IPV4_GTPU_IPV4_UDP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_UDP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_IPV4_TCP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV4_TCP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_EH_IPV4: + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_OTHER, bm); + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, bm); + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_UDP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV4_TCP, bm); + return; case ICE_SW_TUN_IPV6_GTPU_IPV4: - ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_OTHER, bm); ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_OTHER, bm); - ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, bm); ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_UDP, bm); - ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, bm); ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_TCP, bm); return; + case ICE_SW_TUN_IPV6_GTPU_IPV4_UDP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_UDP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_IPV4_TCP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV4_TCP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_EH_IPV4: + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_OTHER, bm); + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, bm); + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_UDP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV4_TCP, bm); + return; case ICE_SW_TUN_IPV4_GTPU_IPV6: - ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_OTHER, bm); ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_OTHER, bm); - ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, bm); ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_UDP, bm); - ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, bm); ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_TCP, bm); return; + case ICE_SW_TUN_IPV4_GTPU_IPV6_UDP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_UDP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_IPV6_TCP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_IPV6_TCP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_EH_IPV6: + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_OTHER, bm); + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, bm); + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_UDP, bm); + return; + case ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP: + ice_set_bit(ICE_PROFID_IPV4_GTPU_EH_IPV6_TCP, bm); + return; case ICE_SW_TUN_IPV6_GTPU_IPV6: - ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_OTHER, bm); ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_OTHER, bm); - ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, bm); ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_UDP, bm); - ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, bm); ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_TCP, bm); return; + case ICE_SW_TUN_IPV6_GTPU_IPV6_UDP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_UDP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_IPV6_TCP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_IPV6_TCP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_EH_IPV6: + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_OTHER, bm); + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, bm); + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_UDP, bm); + return; + case ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP: + ice_set_bit(ICE_PROFID_IPV6_GTPU_EH_IPV6_TCP, bm); + return; case ICE_SW_TUN_AND_NON_TUN: case ICE_SW_TUN_AND_NON_TUN_QINQ: default: @@ -7827,8 +7938,8 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, *offsets = dummy_ipv4_gtp_no_pay_packet_offsets; return; } else if (tun_type == ICE_SW_TUN_IPV6_GTPU_NO_PAY) { - *pkt = dummy_ipv6_gtpu_ipv6_packet; - *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet); + *pkt = dummy_ipv6_gtp_packet; + *pkt_len = sizeof(dummy_ipv6_gtp_packet); *offsets = dummy_ipv6_gtp_no_pay_packet_offsets; return; } @@ -7896,6 +8007,102 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, return; } + if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4 || + tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV4) { + *pkt = dummy_ipv4_gtpu_ipv4_packet; + *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet); + *offsets = dummy_ipv4_gtpu_ipv4_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4_UDP || + tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV4_UDP) { + *pkt = dummy_ipv4_gtpu_ipv4_udp_packet; + *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_udp_packet); + *offsets = dummy_ipv4_gtpu_ipv4_udp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4_TCP || + tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV4_TCP) { + *pkt = dummy_ipv4_gtpu_ipv4_tcp_packet; + *pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_tcp_packet); + *offsets = dummy_ipv4_gtpu_ipv4_tcp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6 || + tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV6) { + *pkt = dummy_ipv4_gtpu_ipv6_packet; + *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet); + *offsets = dummy_ipv4_gtpu_ipv6_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6_UDP || + tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV6_UDP) { + *pkt = dummy_ipv4_gtpu_ipv6_udp_packet; + *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_udp_packet); + *offsets = dummy_ipv4_gtpu_ipv6_udp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6_TCP || + tun_type == ICE_SW_TUN_IPV4_GTPU_EH_IPV6_TCP) { + *pkt = dummy_ipv4_gtpu_ipv6_tcp_packet; + *pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_tcp_packet); + *offsets = dummy_ipv4_gtpu_ipv6_tcp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4 || + tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV4) { + *pkt = dummy_ipv6_gtpu_ipv4_packet; + *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_packet); + *offsets = dummy_ipv6_gtpu_ipv4_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4_UDP || + tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV4_UDP) { + *pkt = dummy_ipv6_gtpu_ipv4_udp_packet; + *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_udp_packet); + *offsets = dummy_ipv6_gtpu_ipv4_udp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV4_TCP || + tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV4_TCP) { + *pkt = dummy_ipv6_gtpu_ipv4_tcp_packet; + *pkt_len = sizeof(dummy_ipv6_gtpu_ipv4_tcp_packet); + *offsets = dummy_ipv6_gtpu_ipv4_tcp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6 || + tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV6) { + *pkt = dummy_ipv6_gtpu_ipv6_packet; + *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_packet); + *offsets = dummy_ipv6_gtpu_ipv6_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6_UDP || + tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV6_UDP) { + *pkt = dummy_ipv6_gtpu_ipv6_udp_packet; + *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_udp_packet); + *offsets = dummy_ipv6_gtpu_ipv6_udp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_TUN_IPV6_GTPU_IPV6_TCP || + tun_type == ICE_SW_TUN_IPV6_GTPU_EH_IPV6_TCP) { + *pkt = dummy_ipv6_gtpu_ipv6_tcp_packet; + *pkt_len = sizeof(dummy_ipv6_gtpu_ipv6_tcp_packet); + *offsets = dummy_ipv6_gtpu_ipv6_tcp_packet_offsets; + return; + } + if (tun_type == ICE_SW_TUN_PPPOE && ipv6) { *pkt = dummy_pppoe_ipv6_packet; *pkt_len = sizeof(dummy_pppoe_ipv6_packet); diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h index 61be54f9c0..980bae5806 100644 --- a/drivers/net/ice/base/ice_switch.h +++ b/drivers/net/ice/base/ice_switch.h @@ -216,6 +216,11 @@ struct ice_adv_lkup_elem { union ice_prot_hdr m_u; /* Mask of header values to match */ }; +struct ice_prof_type_entry { + u16 prof_id; + enum ice_sw_tunnel_type type; +}; + struct ice_sw_act_ctrl { /* Source VSI for LOOKUP_TX or source port for LOOKUP_RX */ u16 src; -- 2.25.1