From dec3031f7c6d3208133b584b4ee4b6dec0a91799 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Mon, 30 Mar 2020 19:45:35 +0800 Subject: [PATCH] net/ice/base: support PFCP and NAT-T of switch 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 Acked-by: Qiming Yang --- 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 a63ef0c96c..3588be0ca3 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 ff479cdd24..b5aa5abd9f 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 cf9f6fd73b..f7ae5c741f 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.20.1