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 595E3A0547; Fri, 28 May 2021 05:31:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B9EC4110F; Fri, 28 May 2021 05:31:51 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D4E5E40698 for ; Fri, 28 May 2021 05:31:49 +0200 (CEST) IronPort-SDR: ulGK5spLRC97VqsQDbPz6OF7mhoI/NsBlLOIfIx69gQWuMQ15N4OyWA+TuEu1NgHO4cwptRIet GVznBHhsvEBA== X-IronPort-AV: E=McAfee;i="6200,9189,9997"; a="288477064" X-IronPort-AV: E=Sophos;i="5.83,228,1616482800"; d="scan'208";a="288477064" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2021 20:31:47 -0700 IronPort-SDR: q7gUN3rlpdQ3UtAMqFO6EtW6hnFLVju1zUQLsYZ9GZgmMMZWVLxJRJ4rCRQ7IRzk02Un04SUuB 9bhNACHiJLwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,228,1616482800"; d="scan'208";a="443835549" Received: from dpdk-liulingy-1.sh.intel.com ([10.67.118.243]) by orsmga008.jf.intel.com with ESMTP; 27 May 2021 20:31:46 -0700 From: Lingyu Liu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Lingyu Liu Date: Fri, 28 May 2021 10:04:08 +0000 Message-Id: <20210528100409.580216-4-lingyu.liu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210528100409.580216-1-lingyu.liu@intel.com> References: <20210528100409.580216-1-lingyu.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v1 3/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" Support AVF FDIR for inner header of GTPoGRE tunnel packet. +-----------------------------------+-------------------------------+ | Pattern | Input Set | +-----------------------------------+-------------------------------+ |eth/ipv4/gre/ipv4/udp/gtpu/ipv4 |inner: src/dst ip | |eth/ipv4/gre/ipv4/udp/gtpu/ipv4/udp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv4/udp/gtpu/ipv4/tcp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv4/udp/gtpu/ipv6 |inner: src/dst ip | |eth/ipv4/gre/ipv4/udp/gtpu/ipv6/udp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv4/udp/gtpu/ipv6/tcp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv6/udp/gtpu/ipv4 |inner: src/dst ip | |eth/ipv4/gre/ipv6/udp/gtpu/ipv4/udp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv6/udp/gtpu/ipv4/tcp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv6/udp/gtpu/ipv6 |inner: src/dst ip | |eth/ipv4/gre/ipv6/udp/gtpu/ipv6/udp|inner: src/dst ip, src/dst port| |eth/ipv4/gre/ipv6/udp/gtpu/ipv6/tcp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv4/udp/gtpu/ipv4 |inner: src/dst ip | |eth/ipv6/gre/ipv4/udp/gtpu/ipv4/udp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv4/udp/gtpu/ipv4/tcp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv4/udp/gtpu/ipv6 |inner: src/dst ip | |eth/ipv6/gre/ipv4/udp/gtpu/ipv6/udp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv4/udp/gtpu/ipv6/tcp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv6/udp/gtpu/ipv4 |inner: src/dst ip | |eth/ipv6/gre/ipv6/udp/gtpu/ipv4/udp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv6/udp/gtpu/ipv4/tcp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv6/udp/gtpu/ipv6 |inner: src/dst ip | |eth/ipv6/gre/ipv6/udp/gtpu/ipv6/udp|inner: src/dst ip, src/dst port| |eth/ipv6/gre/ipv6/udp/gtpu/ipv6/tcp|inner: src/dst ip, src/dst port| +-----------------------------------+-------------------------------+ Signed-off-by: Lingyu Liu --- drivers/net/iavf/iavf_fdir.c | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c index f238a83c84..75f2d75143 100644 --- a/drivers/net/iavf/iavf_fdir.c +++ b/drivers/net/iavf/iavf_fdir.c @@ -164,6 +164,30 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = { {iavf_pattern_eth_ipv4_gtpu_eh_ipv6, IAVF_FDIR_INSET_GTPU_IPV6, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_eh_ipv6_udp, IAVF_FDIR_INSET_GTPU_IPV6_UDP, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_eh_ipv6_tcp, IAVF_FDIR_INSET_GTPU_IPV6_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv4_udp_gtpu_ipv4, IAVF_FDIR_INSET_GTPU_IPV4, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv4_udp_gtpu_ipv4_udp, IAVF_FDIR_INSET_GTPU_IPV4_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv4_udp_gtpu_ipv4_tcp, IAVF_FDIR_INSET_GTPU_IPV4_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv4_udp_gtpu_ipv6, IAVF_FDIR_INSET_GTPU_IPV6, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv4_udp_gtpu_ipv6_udp, IAVF_FDIR_INSET_GTPU_IPV6_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv4_udp_gtpu_ipv6_tcp, IAVF_FDIR_INSET_GTPU_IPV6_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv6_udp_gtpu_ipv4, IAVF_FDIR_INSET_GTPU_IPV4, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv6_udp_gtpu_ipv4_udp, IAVF_FDIR_INSET_GTPU_IPV4_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv6_udp_gtpu_ipv4_tcp, IAVF_FDIR_INSET_GTPU_IPV4_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv6_udp_gtpu_ipv6, IAVF_FDIR_INSET_GTPU_IPV6, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv6_udp_gtpu_ipv6_udp, IAVF_FDIR_INSET_GTPU_IPV6_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gre_ipv6_udp_gtpu_ipv6_tcp, IAVF_FDIR_INSET_GTPU_IPV6_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv4_udp_gtpu_ipv4, IAVF_FDIR_INSET_GTPU_IPV4, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv4_udp_gtpu_ipv4_udp, IAVF_FDIR_INSET_GTPU_IPV4_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv4_udp_gtpu_ipv4_tcp, IAVF_FDIR_INSET_GTPU_IPV4_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv4_udp_gtpu_ipv6, IAVF_FDIR_INSET_GTPU_IPV6, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv4_udp_gtpu_ipv6_udp, IAVF_FDIR_INSET_GTPU_IPV6_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv4_udp_gtpu_ipv6_tcp, IAVF_FDIR_INSET_GTPU_IPV6_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv6_udp_gtpu_ipv4, IAVF_FDIR_INSET_GTPU_IPV4, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv6_udp_gtpu_ipv4_udp, IAVF_FDIR_INSET_GTPU_IPV4_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv6_udp_gtpu_ipv4_tcp, IAVF_FDIR_INSET_GTPU_IPV4_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv6_udp_gtpu_ipv6, IAVF_FDIR_INSET_GTPU_IPV6, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv6_udp_gtpu_ipv6_udp, IAVF_FDIR_INSET_GTPU_IPV6_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv6_gre_ipv6_udp_gtpu_ipv6_tcp, IAVF_FDIR_INSET_GTPU_IPV6_TCP, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv6_gtpu, IAVF_FDIR_INSET_IPV6_GTPU, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv6_gtpu_eh, IAVF_FDIR_INSET_IPV6_GTPU_EH, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_l2tpv3, IAVF_FDIR_INSET_L2TPV3OIP, IAVF_INSET_NONE}, @@ -589,6 +613,7 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, const struct rte_flow_item_udp *udp_spec, *udp_mask; const struct rte_flow_item_tcp *tcp_spec, *tcp_mask; const struct rte_flow_item_sctp *sctp_spec, *sctp_mask; + const struct rte_flow_item_gre *gre_spec, *gre_mask; const struct rte_flow_item_gtp *gtp_spec, *gtp_mask; const struct rte_flow_item_gtp_psc *gtp_psc_spec, *gtp_psc_mask; const struct rte_flow_item_l2tpv3oip *l2tpv3oip_spec, *l2tpv3oip_mask; @@ -1026,6 +1051,23 @@ 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_GTPU: gtp_spec = item->spec; gtp_mask = item->mask; -- 2.25.1