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 923E6A057B; Mon, 30 Mar 2020 13:44:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 376061C10B; Mon, 30 Mar 2020 13:42:37 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 130381C0D0 for ; Mon, 30 Mar 2020 13:42:33 +0200 (CEST) IronPort-SDR: uHHS9SpgX93vIGOyyecizGmIBiSL3dUFKqAoCZOVi/BPQaAPgbumKB6NATJFQ2FpotbbzCnNx7 lc+MVIUoSNWA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 04:42:33 -0700 IronPort-SDR: rpQEHhC5pF+O3k0iqTbVD9h51z5JZZR2fYZZHOjBSW2t5lkod8iJyxnK9/nKPiIlucMovoz+q4 lypQiOeL83dA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,324,1580803200"; d="scan'208";a="449769910" Received: from dpdk51.sh.intel.com ([10.67.110.245]) by fmsmga006.fm.intel.com with ESMTP; 30 Mar 2020 04:42:32 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang , Wei Zhao , Paul M Stillwell Jr Date: Mon, 30 Mar 2020 19:45:35 +0800 Message-Id: <20200330114538.43275-14-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200330114538.43275-1-qi.z.zhang@intel.com> References: <20200330114538.43275-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH 13/16] net/ice/base: add support for PFCP and NAT-T of switch 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" This patch add support switch rule for PFCP and NAT-T packet base on profile rule, PFCP and NAT-T packet will not be matched on any packet fields, but instead matches the profile that the packet hits in the switch block. Signed-off-by: Wei Zhao Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_protocol_type.h | 5 +++++ drivers/net/ice/base/ice_switch.c | 20 ++++++++++++++++++++ drivers/net/ice/base/ice_switch.h | 5 +++++ 3 files changed, 30 insertions(+) diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index a63ef0c96..3588be0ca 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -64,6 +64,11 @@ enum ice_sw_tunnel_type { ICE_SW_TUN_PROFID_IPV6_ESP, ICE_SW_TUN_PROFID_IPV6_AH, ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3, + ICE_SW_TUN_PROFID_IPV6_NAT_T, + ICE_SW_TUN_PROFID_IPV4_PFCP_NODE, + ICE_SW_TUN_PROFID_IPV4_PFCP_SESSION, + ICE_SW_TUN_PROFID_IPV6_PFCP_NODE, + ICE_SW_TUN_PROFID_IPV6_PFCP_SESSION, ICE_ALL_TUNNELS /* All tunnel types including NVGRE */ }; diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index ff479cdd2..b5aa5abd9 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -5761,6 +5761,21 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, case ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3: ice_set_bit(ICE_PROFID_MAC_IPV6_L2TPV3, bm); return; + case ICE_SW_TUN_PROFID_IPV6_NAT_T: + ice_set_bit(ICE_PROFID_IPV6_NAT_T, bm); + return; + case ICE_SW_TUN_PROFID_IPV4_PFCP_NODE: + ice_set_bit(ICE_PROFID_IPV4_PFCP_NODE, bm); + return; + case ICE_SW_TUN_PROFID_IPV4_PFCP_SESSION: + ice_set_bit(ICE_PROFID_IPV4_PFCP_SESSION, bm); + return; + case ICE_SW_TUN_PROFID_IPV6_PFCP_NODE: + ice_set_bit(ICE_PROFID_IPV6_PFCP_NODE, bm); + return; + case ICE_SW_TUN_PROFID_IPV6_PFCP_SESSION: + ice_set_bit(ICE_PROFID_IPV6_PFCP_SESSION, bm); + return; case ICE_SW_TUN_AND_NON_TUN: default: prof_type = ICE_PROF_ALL; @@ -5783,6 +5798,11 @@ static bool ice_is_prof_rule(enum ice_sw_tunnel_type type) case ICE_SW_TUN_PROFID_IPV6_ESP: case ICE_SW_TUN_PROFID_IPV6_AH: case ICE_SW_TUN_PROFID_MAC_IPV6_L2TPV3: + case ICE_SW_TUN_PROFID_IPV6_NAT_T: + case ICE_SW_TUN_PROFID_IPV4_PFCP_NODE: + case ICE_SW_TUN_PROFID_IPV4_PFCP_SESSION: + case ICE_SW_TUN_PROFID_IPV6_PFCP_NODE: + case ICE_SW_TUN_PROFID_IPV6_PFCP_SESSION: return true; default: break; diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h index cf9f6fd73..f7ae5c741 100644 --- a/drivers/net/ice/base/ice_switch.h +++ b/drivers/net/ice/base/ice_switch.h @@ -18,7 +18,12 @@ /* Switch Profile IDs for Profile related switch rules */ #define ICE_PROFID_IPV6_ESP 72 #define ICE_PROFID_IPV6_AH 74 +#define ICE_PROFID_IPV6_NAT_T 76 #define ICE_PROFID_MAC_IPV6_L2TPV3 78 +#define ICE_PROFID_IPV4_PFCP_NODE 79 +#define ICE_PROFID_IPV4_PFCP_SESSION 80 +#define ICE_PROFID_IPV6_PFCP_NODE 81 +#define ICE_PROFID_IPV6_PFCP_SESSION 82 #define DUMMY_ETH_HDR_LEN 16 #define ICE_SW_RULE_RX_TX_ETH_HDR_SIZE \ -- 2.13.6