From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A343A04A3; Tue, 16 Jun 2020 11:37:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6E91B1BEE0; Tue, 16 Jun 2020 11:37:37 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 655E51B3BB for ; Mon, 15 Jun 2020 07:06:17 +0200 (CEST) IronPort-SDR: HKgCzmwLDbQbhvyr7vMKAMxGcNA4V/xKSJrXo4Txt6PGkvGnY3IBUJi+4CP23tzAqSAVP+fBtR H6vtPWZgkwJQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2020 22:06:17 -0700 IronPort-SDR: 0FE7gSiC8sIfPvP/61CATWk96mLGssnKSAdhCXIR3aZ2Fsdvb2l59sB4f0tukeNZJDYyWVV3cS wPVWbjhE7dmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,513,1583222400"; d="scan'208";a="276436051" Received: from dpdk-junfengguo-v3.sh.intel.com ([10.67.119.102]) by orsmga006.jf.intel.com with ESMTP; 14 Jun 2020 22:06:15 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, xiaolong.ye@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, jia.guo@intel.com, junfeng.guo@intel.com, simei.su@intel.com Date: Mon, 15 Jun 2020 13:04:40 +0800 Message-Id: <20200615050441.55224-2-junfeng.guo@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200615050441.55224-1-junfeng.guo@intel.com> References: <20200612081324.9370-1-junfeng.guo@intel.com> <20200615050441.55224-1-junfeng.guo@intel.com> X-Mailman-Approved-At: Tue, 16 Jun 2020 11:37:34 +0200 Subject: [dpdk-dev] [PATCH v2 1/2] net/ice: add FD support for GTPU with outer IP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Add FDir support for MAC_IPV6_GTPU type with outer IP address, teid and qfi fields matching. Note that outer IP matching fields here includes both SRC & DST of both IPv4 & IPv6. Signed-off-by: Junfeng Guo --- drivers/net/ice/ice_fdir_filter.c | 54 ++++++++++++++++++++++++++---- drivers/net/ice/ice_generic_flow.c | 31 ++++++++++++++--- drivers/net/ice/ice_generic_flow.h | 12 +++++-- 3 files changed, 84 insertions(+), 13 deletions(-) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index c3f23a019..4793b81c5 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -67,13 +67,20 @@ ICE_FDIR_INSET_VXLAN_IPV4 | \ ICE_INSET_TUN_SCTP_SRC_PORT | ICE_INSET_TUN_SCTP_DST_PORT) -#define ICE_FDIR_INSET_GTPU (\ +#define ICE_FDIR_INSET_IPV4_GTPU (\ ICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST | ICE_INSET_GTPU_TEID) -#define ICE_FDIR_INSET_GTPU_EH (\ +#define ICE_FDIR_INSET_IPV4_GTPU_EH (\ ICE_INSET_IPV4_SRC | ICE_INSET_IPV4_DST | \ ICE_INSET_GTPU_TEID | ICE_INSET_GTPU_QFI) +#define ICE_FDIR_INSET_IPV6_GTPU (\ + ICE_INSET_IPV6_SRC | ICE_INSET_IPV6_DST | ICE_INSET_GTPU_TEID) + +#define ICE_FDIR_INSET_IPV6_GTPU_EH (\ + ICE_INSET_IPV6_SRC | ICE_INSET_IPV6_DST | \ + ICE_INSET_GTPU_TEID | ICE_INSET_GTPU_QFI) + static struct ice_pattern_match_item ice_fdir_pattern_os[] = { {pattern_eth_ipv4, ICE_FDIR_INSET_ETH_IPV4, ICE_INSET_NONE}, {pattern_eth_ipv4_udp, ICE_FDIR_INSET_ETH_IPV4_UDP, ICE_INSET_NONE}, @@ -126,8 +133,11 @@ static struct ice_pattern_match_item ice_fdir_pattern_comms[] = { ICE_FDIR_INSET_VXLAN_IPV4_TCP, ICE_INSET_NONE}, {pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp, ICE_FDIR_INSET_VXLAN_IPV4_SCTP, ICE_INSET_NONE}, - {pattern_eth_ipv4_gtpu, ICE_FDIR_INSET_GTPU, ICE_INSET_NONE}, - {pattern_eth_ipv4_gtpu_eh, ICE_FDIR_INSET_GTPU_EH, ICE_INSET_NONE}, + + {pattern_eth_ipv4_gtpu, ICE_FDIR_INSET_IPV4_GTPU, ICE_INSET_NONE}, + {pattern_eth_ipv4_gtpu_eh, ICE_FDIR_INSET_IPV4_GTPU_EH, ICE_INSET_NONE}, + {pattern_eth_ipv6_gtpu, ICE_FDIR_INSET_IPV6_GTPU, ICE_INSET_NONE}, + {pattern_eth_ipv6_gtpu_eh, ICE_FDIR_INSET_IPV6_GTPU_EH, ICE_INSET_NONE}, }; static struct ice_flow_parser ice_fdir_parser_os; @@ -778,6 +788,21 @@ ice_fdir_cross_prof_conflict(struct ice_pf *pf, (pf, cflct_ptype, is_tunnel)) goto err; break; + /* IPv6 GTPU */ + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; + if (!ice_fdir_prof_resolve_conflict + (pf, cflct_ptype, is_tunnel)) + goto err; + break; /* IPv6 */ case ICE_FLTR_PTYPE_NONF_IPV6_UDP: case ICE_FLTR_PTYPE_NONF_IPV6_TCP: @@ -1008,6 +1033,19 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow, else PMD_DRV_LOG(ERR, "not supported tunnel type."); break; + case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER: + if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU) + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV6 | + ICE_FLOW_SEG_HDR_IPV_OTHER); + else if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU_EH) + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | + ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV6 | + ICE_FLOW_SEG_HDR_IPV_OTHER); + else + PMD_DRV_LOG(ERR, "not supported tunnel type."); + break; default: PMD_DRV_LOG(ERR, "not supported filter type."); break; @@ -1948,8 +1986,12 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, } if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU || - tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH) - flow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; + tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH) { + if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP) + flow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; + else + flow_type = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER; + } filter->tunnel_type = tunnel_type; filter->input.flow_type = flow_type; diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index ad103d0e8..abb5d22d1 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -1033,7 +1033,7 @@ enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[] = { RTE_FLOW_ITEM_TYPE_END, }; -/* GTPU */ +/* IPv4 GTPU (EH) */ enum rte_flow_item_type pattern_eth_ipv4_gtpu[] = { RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_IPV4, @@ -1041,22 +1041,43 @@ enum rte_flow_item_type pattern_eth_ipv4_gtpu[] = { RTE_FLOW_ITEM_TYPE_GTPU, RTE_FLOW_ITEM_TYPE_END, }; -enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = { +enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[] = { RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_IPV4, RTE_FLOW_ITEM_TYPE_UDP, RTE_FLOW_ITEM_TYPE_GTPU, - RTE_FLOW_ITEM_TYPE_IPV4, + RTE_FLOW_ITEM_TYPE_GTP_PSC, RTE_FLOW_ITEM_TYPE_END, }; -enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[] = { + +/* IPv6 GTPU (EH) */ +enum rte_flow_item_type pattern_eth_ipv6_gtpu[] = { RTE_FLOW_ITEM_TYPE_ETH, - RTE_FLOW_ITEM_TYPE_IPV4, + RTE_FLOW_ITEM_TYPE_IPV6, + RTE_FLOW_ITEM_TYPE_UDP, + RTE_FLOW_ITEM_TYPE_GTPU, + RTE_FLOW_ITEM_TYPE_END, +}; +enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_IPV6, RTE_FLOW_ITEM_TYPE_UDP, RTE_FLOW_ITEM_TYPE_GTPU, RTE_FLOW_ITEM_TYPE_GTP_PSC, RTE_FLOW_ITEM_TYPE_END, }; + +/* IPv4 GTPU IPv4 */ +enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[] = { + RTE_FLOW_ITEM_TYPE_ETH, + RTE_FLOW_ITEM_TYPE_IPV4, + RTE_FLOW_ITEM_TYPE_UDP, + RTE_FLOW_ITEM_TYPE_GTPU, + RTE_FLOW_ITEM_TYPE_IPV4, + RTE_FLOW_ITEM_TYPE_END, +}; + +/* IPv4 GTPU EH IPv4 */ enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[] = { RTE_FLOW_ITEM_TYPE_ETH, RTE_FLOW_ITEM_TYPE_IPV4, diff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h index 492a48cd9..3ce9a1f27 100644 --- a/drivers/net/ice/ice_generic_flow.h +++ b/drivers/net/ice/ice_generic_flow.h @@ -361,10 +361,18 @@ extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_udp[]; extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[]; extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[]; -/* GTPU */ +/* IPv4 GTPU (EH) */ extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[]; -extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[]; extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[]; + +/* IPv6 GTPU (EH) */ +extern enum rte_flow_item_type pattern_eth_ipv6_gtpu[]; +extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh[]; + +/* IPv4 GTPU IPv4 */ +extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[]; + +/* IPv4 GTPU EH IPv4 */ extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[]; extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[]; extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[]; -- 2.17.1