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 22C3DA0C46; Thu, 10 Jun 2021 18:19:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9686D4067C; Thu, 10 Jun 2021 18:19:00 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 755F94003C for ; Thu, 10 Jun 2021 18:18:58 +0200 (CEST) IronPort-SDR: jqZGMHCX14aBxYE/MCW1aeOSKn354O6TJv0GImT/LqJqv6cIW6NjBZMC5awhu26zmyQruvCnZS UlVLrKpkloDQ== X-IronPort-AV: E=McAfee;i="6200,9189,10011"; a="202306824" X-IronPort-AV: E=Sophos;i="5.83,263,1616482800"; d="scan'208,217";a="202306824" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 09:18:57 -0700 IronPort-SDR: /GH0NVgJNa0ZtKK0yq+dUYAu94z/Yllurxc2PFTivt9lPemfaa1VGWEbsGvLZcOcxrIw22MX/p 2hKXoIHelOgw== X-IronPort-AV: E=Sophos;i="5.83,263,1616482800"; d="scan'208,217";a="419768024" Received: from amandee1-mobl.gar.corp.intel.com (HELO [10.215.198.81]) ([10.215.198.81]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2021 09:18:55 -0700 To: dev@dpdk.org References: <20210527074845.1263679> <20210602022442.264961-1-wenjun1.wu@intel.com> <20210602022442.264961-5-wenjun1.wu@intel.com> From: "Singh, Aman Deep" Message-ID: <32cf8656-4f0b-634a-61c5-1f02d2ae6381@intel.com> Date: Thu, 10 Jun 2021 21:48:41 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210602022442.264961-5-wenjun1.wu@intel.com> Content-Language: en-GB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] [PATCH v2 4/4] net/iavf: support AVF FDIR for GRE tunnel packet 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" On 6/2/2021 7:54 AM, Wenjun Wu wrote: > Support AVF FDIR for inner header of GRE tunnel packet. > > +------------------------------+---------------------------------------+ > | Pattern | Input Set | > +------------------------------+---------------------------------------+ > | eth/ipv4/gre/ipv4 | inner: src/dst ip, dscp | > | eth/ipv4/gre/ipv4/udp | inner: src/dst ip, dscp, src/dst port | > | eth/ipv4/gre/ipv4/tcp | inner: src/dst ip, dscp, src/dst port | > | eth/ipv4/gre/eh/ipv6 | inner: src/dst ip, tc | > | eth/ipv4/gre/eh/ipv6/udp | inner: src/dst ip, tc, src/dst port | > | eth/ipv4/gre/eh/ipv6/tcp | inner: src/dst ip, tc, src/dst port | > | eth/ipv6/gre/ipv4 | inner: src/dst ip, dscp | > | eth/ipv6/gre/ipv4/udp | inner: src/dst ip, dscp, src/dst port | > | eth/ipv6/gre/ipv4/tcp | inner: src/dst ip, dscp, src/dst port | > | eth/ipv6/gre/ipv6 | inner: src/dst ip, tc | > | eth/ipv6/gre/ipv6/udp | inner: src/dst ip, tc, src/dst port | > | eth/ipv6/gre/ipv6/tcp | inner: src/dst ip, tc, src/dst port | > +------------------------------+---------------------------------------+ > > Signed-off-by: Wenjun Wu > --- > drivers/net/iavf/iavf_fdir.c | 55 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c > index f238a83c84..c0b748caca 100644 > --- a/drivers/net/iavf/iavf_fdir.c > +++ b/drivers/net/iavf/iavf_fdir.c > @@ -139,6 +139,30 @@ > #define IAVF_FDIR_INSET_ECPRI (\ > IAVF_INSET_ECPRI) > > +#define IAVF_FDIR_INSET_GRE_IPV4 (\ > + IAVF_INSET_TUN_IPV4_SRC | IAVF_INSET_TUN_IPV4_DST | \ > + IAVF_INSET_TUN_IPV4_TOS | IAVF_INSET_TUN_IPV4_PROTO) > + > +#define IAVF_FDIR_INSET_GRE_IPV4_TCP (\ > + IAVF_FDIR_INSET_GRE_IPV4 | IAVF_INSET_TUN_TCP_SRC_PORT | \ > + IAVF_INSET_TUN_TCP_DST_PORT) > + > +#define IAVF_FDIR_INSET_GRE_IPV4_UDP (\ > + IAVF_FDIR_INSET_GRE_IPV4 | IAVF_INSET_TUN_UDP_SRC_PORT | \ > + IAVF_INSET_TUN_UDP_DST_PORT) > + > +#define IAVF_FDIR_INSET_GRE_IPV6 (\ > + IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST | \ > + IAVF_INSET_TUN_IPV6_TC | IAVF_INSET_TUN_IPV6_NEXT_HDR) > + > +#define IAVF_FDIR_INSET_GRE_IPV6_TCP (\ > + IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_TCP_SRC_PORT | \ > + IAVF_INSET_TUN_TCP_DST_PORT) > + > +#define IAVF_FDIR_INSET_GRE_IPV6_UDP (\ > + IAVF_FDIR_INSET_GRE_IPV6 | IAVF_INSET_TUN_UDP_SRC_PORT | \ > + IAVF_INSET_TUN_UDP_DST_PORT) > + > static struct iavf_pattern_match_item iavf_fdir_pattern[] = { > {iavf_pattern_ethertype, IAVF_FDIR_INSET_ETH, IAVF_INSET_NONE}, > {iavf_pattern_eth_ipv4, IAVF_FDIR_INSET_ETH_IPV4, IAVF_INSET_NONE}, > @@ -178,6 +202,18 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = { > {iavf_pattern_eth_ipv6_pfcp, IAVF_FDIR_INSET_PFCP, IAVF_INSET_NONE}, > {iavf_pattern_eth_ecpri, IAVF_FDIR_INSET_ECPRI, IAVF_INSET_NONE}, > {iavf_pattern_eth_ipv4_ecpri, IAVF_FDIR_INSET_ECPRI, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv4_gre_ipv4, IAVF_FDIR_INSET_GRE_IPV4, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv4_gre_ipv4_tcp, IAVF_FDIR_INSET_GRE_IPV4_TCP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv4_gre_ipv4_udp, IAVF_FDIR_INSET_GRE_IPV4_UDP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv4_gre_ipv6, IAVF_FDIR_INSET_GRE_IPV6, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv4_gre_ipv6_tcp, IAVF_FDIR_INSET_GRE_IPV6_TCP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv4_gre_ipv6_udp, IAVF_FDIR_INSET_GRE_IPV6_UDP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv6_gre_ipv4, IAVF_FDIR_INSET_GRE_IPV4, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv6_gre_ipv4_tcp, IAVF_FDIR_INSET_GRE_IPV4_TCP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv6_gre_ipv4_udp, IAVF_FDIR_INSET_GRE_IPV4_UDP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv6_gre_ipv6, IAVF_FDIR_INSET_GRE_IPV6, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv6_gre_ipv6_tcp, IAVF_FDIR_INSET_GRE_IPV6_TCP, IAVF_INSET_NONE}, > + {iavf_pattern_eth_ipv6_gre_ipv6_udp, IAVF_FDIR_INSET_GRE_IPV6_UDP, IAVF_INSET_NONE}, > }; > > static struct iavf_flow_parser iavf_fdir_parser; > @@ -596,6 +632,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, > const struct rte_flow_item_ah *ah_spec, *ah_mask; > const struct rte_flow_item_pfcp *pfcp_spec, *pfcp_mask; > const struct rte_flow_item_ecpri *ecpri_spec, *ecpri_mask; > + const struct rte_flow_item_gre *gre_spec, *gre_mask; > const struct rte_flow_item *item = pattern; > struct virtchnl_proto_hdr *hdr, *hdr1 = NULL; > struct rte_ecpri_common_hdr ecpri_common; > @@ -1195,6 +1232,24 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, > hdrs->count = ++layer; > break; > > + case RTE_FLOW_ITEM_TYPE_GRE: > + gre_spec = item->spec; > + gre_mask = item->mask; > + > + hdr = &hdrs->proto_hdr[layer]; > + > + VIRTCHNL_SET_PROTO_HDR_TYPE(hdr, GRE); > + > + if (gre_spec && gre_mask) { > + rte_memcpy(hdr->buffer, gre_spec, > + sizeof(*gre_spec)); > + } > + > + tun_inner = 1; > + > + hdrs->count = ++layer; > + break; > + > case RTE_FLOW_ITEM_TYPE_VOID: > break; > Support AVF FDIR for inner header of GRE tunnel packet. +------------------------------+---------------------------------------+ | Pattern | Input Set | +------------------------------+---------------------------------------+ | eth/ipv4/gre/ipv4 | inner: src/dst ip, dscp | | eth/ipv4/gre/ipv4/udp | inner: src/dst ip, dscp, src/dst port | | eth/ipv4/gre/ipv4/tcp | inner: src/dst ip, dscp, src/dst port | | eth/ipv4/gre/eh/ipv6 | inner: src/dst ip, tc | | eth/ipv4/gre/eh/ipv6/udp | inner: src/dst ip, tc, src/dst port | | eth/ipv4/gre/eh/ipv6/tcp | inner: src/dst ip, tc, src/dst port | | eth/ipv6/gre/ipv4 | inner: src/dst ip, dscp | | eth/ipv6/gre/ipv4/udp | inner: src/dst ip, dscp, src/dst port | | eth/ipv6/gre/ipv4/tcp | inner: src/dst ip, dscp, src/dst port | | eth/ipv6/gre/ipv6 | inner: src/dst ip, tc | | eth/ipv6/gre/ipv6/udp | inner: src/dst ip, tc, src/dst port | | eth/ipv6/gre/ipv6/tcp | inner: src/dst ip, tc, src/dst port | +------------------------------+---------------------------------------+ Signed-off-by: Wenjun Wu Acked-by: Aman Deep Singh >