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 5CEF1A0A02; Fri, 26 Mar 2021 03:49:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67BA6140E13; Fri, 26 Mar 2021 03:49:42 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 576EE140E08 for ; Fri, 26 Mar 2021 03:49:38 +0100 (CET) IronPort-SDR: /DFz0ZSiR+VKhWoceDuvmKAPVe8IFwscEcr189I9HOEq9ZNEvVz2BtWezLYpxafGlcvz+11KIv Tk50BCUwdnjA== X-IronPort-AV: E=McAfee;i="6000,8403,9934"; a="178615237" X-IronPort-AV: E=Sophos;i="5.81,279,1610438400"; d="scan'208";a="178615237" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2021 19:49:37 -0700 IronPort-SDR: 0KGTHHV+Mx53p7GyBUgw7ygaQf+XjXB/u6yubKTh5jV73eu4Kqx2n0h0NDQa1urdmbo+DDeml8 QCeAMttsQ7Nw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,279,1610438400"; d="scan'208";a="443117278" Received: from dpdk-junfengguo-v1.sh.intel.com ([10.67.119.125]) by fmsmga002.fm.intel.com with ESMTP; 25 Mar 2021 19:49:36 -0700 From: Junfeng Guo To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com Date: Fri, 26 Mar 2021 10:42:16 +0000 Message-Id: <20210326104217.3397745-3-junfeng.guo@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210326104217.3397745-1-junfeng.guo@intel.com> References: <20210222100908.4073232-2-junfeng.guo@intel.com> <20210326104217.3397745-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 2/3] net/iavf: support GTPU inner IPv6 for FDIR 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 GTPU_(EH)_IPV6 inner L3 and L4 fields matching for AVF FDIR. +------------------------------+---------------------------------+ | Pattern | Input Set | +------------------------------+---------------------------------+ | eth/ipv4/gtpu/ipv6 | inner: src/dst ip | | eth/ipv4/gtpu/ipv6/udp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/ipv6/tcp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/eh/ipv6 | inner: src/dst ip | | eth/ipv4/gtpu/eh/ipv6/udp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/eh/ipv6/tcp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/eh(0)/ipv6 | inner: src/dst ip | | eth/ipv4/gtpu/eh(0)/ipv6/udp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/eh(0)/ipv6/tcp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/eh(1)/ipv6 | inner: src/dst ip | | eth/ipv4/gtpu/eh(1)/ipv6/udp | inner: src/dst ip, src/dst port | | eth/ipv4/gtpu/eh(1)/ipv6/tcp | inner: src/dst ip, src/dst port | +------------------------------+---------------------------------+ Signed-off-by: Junfeng Guo --- drivers/net/iavf/iavf_fdir.c | 24 ++++++++++++++++++++++++ drivers/net/iavf/iavf_generic_flow.h | 10 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c index a15574c9ea..94ea2d959e 100644 --- a/drivers/net/iavf/iavf_fdir.c +++ b/drivers/net/iavf/iavf_fdir.c @@ -96,6 +96,19 @@ IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \ IAVF_INSET_GTPU_TEID) +#define IAVF_FDIR_INSET_GTPU_IPV6 (\ + IAVF_INSET_TUN_IPV6_SRC | IAVF_INSET_TUN_IPV6_DST | \ + IAVF_INSET_TUN_IPV6_NEXT_HDR | IAVF_INSET_TUN_IPV6_TC | \ + IAVF_INSET_TUN_IPV6_HOP_LIMIT) + +#define IAVF_FDIR_INSET_GTPU_IPV6_UDP (\ + IAVF_FDIR_INSET_GTPU_IPV6 | \ + IAVF_INSET_TUN_UDP_SRC_PORT | IAVF_INSET_TUN_UDP_DST_PORT) + +#define IAVF_FDIR_INSET_GTPU_IPV6_TCP (\ + IAVF_FDIR_INSET_GTPU_IPV6 | \ + IAVF_INSET_TUN_TCP_SRC_PORT | IAVF_INSET_TUN_TCP_DST_PORT) + #define IAVF_FDIR_INSET_IPV6_GTPU_EH (\ IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \ IAVF_INSET_GTPU_TEID | IAVF_INSET_GTPU_QFI) @@ -137,10 +150,16 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = { {iavf_pattern_eth_ipv4_gtpu_ipv4, IAVF_FDIR_INSET_GTPU_IPV4, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_ipv4_udp, IAVF_FDIR_INSET_GTPU_IPV4_UDP, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_ipv4_tcp, IAVF_FDIR_INSET_GTPU_IPV4_TCP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gtpu_ipv6, IAVF_FDIR_INSET_GTPU_IPV6, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gtpu_ipv6_udp, IAVF_FDIR_INSET_GTPU_IPV6_UDP, IAVF_INSET_NONE}, + {iavf_pattern_eth_ipv4_gtpu_ipv6_tcp, IAVF_FDIR_INSET_GTPU_IPV6_TCP, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_eh, IAVF_FDIR_INSET_IPV4_GTPU_EH, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_eh_ipv4, IAVF_FDIR_INSET_GTPU_IPV4, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp,IAVF_FDIR_INSET_GTPU_IPV4_UDP, IAVF_INSET_NONE}, {iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp,IAVF_FDIR_INSET_GTPU_IPV4_TCP, IAVF_INSET_NONE}, + {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_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}, @@ -727,6 +746,11 @@ iavf_fdir_parse_pattern(__rte_unused struct iavf_adapter *ad, VIRTCHNL_ADD_PROTO_HDR_FIELD_BIT(hdr, IPV6, DST); } + if (tun_inner) { + input_set &= ~IAVF_PROT_IPV6_OUTER; + input_set |= IAVF_PROT_IPV6_INNER; + } + rte_memcpy(hdr->buffer, &ipv6_spec->hdr, sizeof(ipv6_spec->hdr)); diff --git a/drivers/net/iavf/iavf_generic_flow.h b/drivers/net/iavf/iavf_generic_flow.h index f7bdd094e1..005eeb3553 100644 --- a/drivers/net/iavf/iavf_generic_flow.h +++ b/drivers/net/iavf/iavf_generic_flow.h @@ -105,6 +105,16 @@ (IAVF_PROT_IPV4_INNER | IAVF_IP_PROTO) #define IAVF_INSET_TUN_IPV4_TTL \ (IAVF_PROT_IPV4_INNER | IAVF_IP_TTL) +#define IAVF_INSET_TUN_IPV6_SRC \ + (IAVF_PROT_IPV6_INNER | IAVF_IP_SRC) +#define IAVF_INSET_TUN_IPV6_DST \ + (IAVF_PROT_IPV6_INNER | IAVF_IP_DST) +#define IAVF_INSET_TUN_IPV6_NEXT_HDR \ + (IAVF_PROT_IPV6_INNER | IAVF_IP_PROTO) +#define IAVF_INSET_TUN_IPV6_HOP_LIMIT \ + (IAVF_PROT_IPV6_INNER | IAVF_IP_TTL) +#define IAVF_INSET_TUN_IPV6_TC \ + (IAVF_PROT_IPV6_INNER | IAVF_IP_TOS) #define IAVF_INSET_TCP_SRC_PORT \ (IAVF_PROT_TCP_OUTER | IAVF_SPORT) -- 2.25.1