net/ice/base: support PFCP and NAT-T of switch
authorQi Zhang <qi.z.zhang@intel.com>
Mon, 30 Mar 2020 11:45:35 +0000 (19:45 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:05 +0000 (13:57 +0200)
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 <wei.zhao1@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_protocol_type.h
drivers/net/ice/base/ice_switch.c
drivers/net/ice/base/ice_switch.h

index a63ef0c..3588be0 100644 (file)
@@ -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 */
 };
 
index ff479cd..b5aa5ab 100644 (file)
@@ -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;
index cf9f6fd..f7ae5c7 100644 (file)
 /* 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 \