From patchwork Sun Oct 25 00:29:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 82068 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A32ABA04B5; Sun, 25 Oct 2020 02:26:28 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 296481C01; Sun, 25 Oct 2020 02:26:05 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id D89671023 for ; Sun, 25 Oct 2020 02:26:01 +0200 (CEST) IronPort-SDR: 89VDungUKdHKVvP6a03NzwoXFN8IU6V5/98CM89rkvaxJmK9XG1j/qZLPnTiLAFgn64pIssca7 SNiY9IpVtiag== X-IronPort-AV: E=McAfee;i="6000,8403,9784"; a="167927025" X-IronPort-AV: E=Sophos;i="5.77,414,1596524400"; d="scan'208";a="167927025" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2020 17:25:59 -0700 IronPort-SDR: J/gKUSq6A/zS7KoTT35l5c4uwYl+gJ0njboFWsVthuQRO3vgVVEVfGAWvmlNfSDsHto7Nczn/f cjEqURx+MA9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,414,1596524400"; d="scan'208";a="359983996" Received: from dpdk51.sh.intel.com ([10.67.111.142]) by FMSMGA003.fm.intel.com with ESMTP; 24 Oct 2020 17:25:58 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: dev@dpdk.org, Qi Zhang , Zhirun Yan Date: Sun, 25 Oct 2020 08:29:33 +0800 Message-Id: <20201025002953.1680999-2-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20201025002953.1680999-1-qi.z.zhang@intel.com> References: <20201025002953.1680999-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 01/21] net/ice/base: add tunnel support for FDIR 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 struct to store outer part for tunnel rule. Add vxlan ptype in ipv4 mac bitmap. So when create a vxlan rule, the ptype group will be valid. Signed-off-by: Zhirun Yan Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_fdir.c | 8 ++++++++ drivers/net/ice/base/ice_fdir.h | 9 +++++++++ drivers/net/ice/base/ice_flow.c | 6 +++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c index aea388f2ab..aeff7af55d 100644 --- a/drivers/net/ice/base/ice_fdir.c +++ b/drivers/net/ice/base/ice_fdir.c @@ -1057,6 +1057,14 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input, loc[20] = ICE_FDIR_IPV4_PKT_FLAG_DF; break; case ICE_FLTR_PTYPE_NONF_IPV4_UDP: + ice_pkt_insert_mac_addr(pkt, input->ext_data_outer.dst_mac); + ice_pkt_insert_mac_addr(pkt + ETH_ALEN, + input->ext_data_outer.src_mac); + ice_pkt_insert_u32(pkt, ICE_IPV4_SRC_ADDR_OFFSET, + input->ip_outer.v4.dst_ip); + ice_pkt_insert_u32(pkt, ICE_IPV4_DST_ADDR_OFFSET, + input->ip_outer.v4.src_ip); + ice_pkt_insert_u8(pkt, ICE_IPV4_TOS_OFFSET, input->ip_outer.v4.tos); ice_pkt_insert_u32(loc, ICE_IPV4_DST_ADDR_OFFSET, input->ip.v4.src_ip); ice_pkt_insert_u16(loc, ICE_IPV4_UDP_DST_PORT_OFFSET, diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h index 7e00bb2730..d363de385d 100644 --- a/drivers/net/ice/base/ice_fdir.h +++ b/drivers/net/ice/base/ice_fdir.h @@ -181,6 +181,15 @@ struct ice_fdir_fltr { struct ice_fdir_v6 v6; } ip, mask; + /* for tunnel outer part */ + union { + struct ice_fdir_v4 v4; + struct ice_fdir_v6 v6; + } ip_outer, mask_outer; + + struct ice_fdir_extra ext_data_outer; + struct ice_fdir_extra ext_mask_outer; + struct ice_fdir_udp_gtp gtpu_data; struct ice_fdir_udp_gtp gtpu_mask; diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 80ac0b662e..601ca251d3 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -222,7 +222,7 @@ static const u32 ice_ptypes_macvlan_il[] = { * include IPV4 other PTYPEs */ static const u32 ice_ptypes_ipv4_ofos[] = { - 0x1DC00000, 0x04000800, 0x00000000, 0x00000000, + 0x1DC00000, 0x24000800, 0x00000000, 0x00000000, 0x00000000, 0x00000155, 0x00000000, 0x00000000, 0x00000000, 0x000FC000, 0x000002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -236,7 +236,7 @@ static const u32 ice_ptypes_ipv4_ofos[] = { * IPV4 other PTYPEs */ static const u32 ice_ptypes_ipv4_ofos_all[] = { - 0x1DC00000, 0x04000800, 0x00000000, 0x00000000, + 0x1DC00000, 0x24000800, 0x00000000, 0x00000000, 0x00000000, 0x00000155, 0x00000000, 0x00000000, 0x00000000, 0x000FC000, 0x83E0FAA0, 0x00000101, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -434,7 +434,7 @@ static const u32 ice_ptypes_gre_of[] = { /* Packet types for packets with an Innermost/Last MAC header */ static const u32 ice_ptypes_mac_il[] = { - 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,