net/ice/base: add RSS support for PPPoE and GTPU
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 29 Aug 2019 02:36:39 +0000 (10:36 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 7 Oct 2019 13:00:53 +0000 (15:00 +0200)
Added RSS support for PPPoE with inner TCP and UDP.
Added RSS support for GTPU with IPv4 and IPv6.

Signed-off-by: Zhirun Yan <zhirun.yan@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: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/base/ice_flow.c
drivers/net/ice/base/ice_flow.h

index a49196c..f71ac50 100644 (file)
@@ -167,7 +167,7 @@ static const u32 ice_ptypes_macvlan_il[] = {
 static const u32 ice_ptypes_ipv4_ofos[] = {
        0xFDC00000, 0xBFBF7F7E, 0x00EFDFDF, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
-       0x0003000F, 0x00000000, 0x00000000, 0x00000000,
+       0x0003000F, 0x000FC000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -179,7 +179,7 @@ static const u32 ice_ptypes_ipv4_ofos[] = {
 static const u32 ice_ptypes_ipv4_il[] = {
        0xE0000000, 0xB807700E, 0x8001DC03, 0xE01DC03B,
        0x0007700E, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x000FF800, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -191,7 +191,7 @@ static const u32 ice_ptypes_ipv4_il[] = {
 static const u32 ice_ptypes_ipv6_ofos[] = {
        0x00000000, 0x00000000, 0xF7000000, 0xFEFDFDFB,
        0x03BF7F7E, 0x00000000, 0x00000000, 0x00000000,
-       0x00080F00, 0x00000000, 0x00000000, 0x00000000,
+       0x00080F00, 0x03F00000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -203,7 +203,7 @@ static const u32 ice_ptypes_ipv6_ofos[] = {
 static const u32 ice_ptypes_ipv6_il[] = {
        0x00000000, 0x03B80770, 0x00EE01DC, 0x0EE00000,
        0x03B80770, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x7FE00000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -229,7 +229,7 @@ static const u32 ice_ptypes_arp_of[] = {
 static const u32 ice_ptypes_udp_il[] = {
        0x81000000, 0x20204040, 0x04081010, 0x80810102,
        0x00204040, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00410000, 0x10842000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -241,7 +241,7 @@ static const u32 ice_ptypes_udp_il[] = {
 static const u32 ice_ptypes_tcp_il[] = {
        0x04000000, 0x80810102, 0x10204040, 0x42040408,
        0x00810102, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00820000, 0x21084000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -277,7 +277,7 @@ static const u32 ice_ptypes_icmp_of[] = {
 static const u32 ice_ptypes_icmp_il[] = {
        0x00000000, 0x02040408, 0x40810102, 0x08101020,
        0x02040408, 0x00000000, 0x00000000, 0x00000000,
-       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x42108000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -345,6 +345,18 @@ static const u32 ice_ptypes_gtpu[] = {
        0x00000000, 0x00000000, 0x00000000, 0x00000000,
 };
 
+/* Packet types for pppoe */
+static const u32 ice_ptypes_pppoe[] = {
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x03FFF000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+       0x00000000, 0x00000000, 0x00000000, 0x00000000,
+};
+
 /* Manage parameters and info. used during the creation of a flow profile */
 struct ice_flow_prof_params {
        enum ice_block blk;
@@ -368,8 +380,7 @@ struct ice_flow_prof_params {
 #define ICE_FLOW_SEG_HDRS_L4_MASK      \
        (ICE_FLOW_SEG_HDR_ICMP | ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | \
         ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_GTPC | \
-        ICE_FLOW_SEG_HDR_GTPC_TEID | ICE_FLOW_SEG_HDR_GTPU_IP | \
-        ICE_FLOW_SEG_HDR_GTPU_UP | ICE_FLOW_SEG_HDR_GTPU_DWN)
+        ICE_FLOW_SEG_HDR_GTPC_TEID | ICE_FLOW_SEG_HDR_GTPU)
 
 /**
  * ice_flow_val_hdrs - validates packet segments for valid protocol headers
@@ -487,6 +498,12 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)
                                       ICE_FLOW_PTYPE_MAX);
                }
 
+               if (hdrs & ICE_FLOW_SEG_HDR_PPPOE) {
+                       src = (const ice_bitmap_t *)ice_ptypes_pppoe;
+                       ice_and_bitmap(params->ptypes, params->ptypes, src,
+                                      ICE_FLOW_PTYPE_MAX);
+               }
+
                if (hdrs & ICE_FLOW_SEG_HDR_IPV4) {
                        src = !i ? (const ice_bitmap_t *)ice_ptypes_ipv4_ofos :
                                (const ice_bitmap_t *)ice_ptypes_ipv4_il;
@@ -1670,7 +1687,8 @@ ice_flow_add_fld_raw(struct ice_flow_seg_info *seg, u16 off, u8 len,
 
 #define ICE_FLOW_RSS_SEG_HDR_L4_MASKS \
        (ICE_FLOW_SEG_HDR_TCP | ICE_FLOW_SEG_HDR_UDP | \
-        ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_GTPC_TEID)
+        ICE_FLOW_SEG_HDR_SCTP | ICE_FLOW_SEG_HDR_GTPC_TEID | \
+        ICE_FLOW_SEG_HDR_GTPU)
 
 
 #define ICE_FLOW_RSS_SEG_HDR_VAL_MASKS \
index eb8e1b7..0bb3efc 100644 (file)
 #define ICE_HASH_SCTP_IPV6     (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_SCTP_PORT)
 
 #define ICE_FLOW_HASH_GTP_TEID \
-       (ICE_FLOW_HASH_FLD(ICE_FLOW_FIELD_IDX_GTPC_TEID))
+       (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPC_TEID))
 
 #define ICE_FLOW_HASH_GTP_IPV4_TEID \
        (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_TEID)
 #define ICE_FLOW_HASH_GTP_IPV6_TEID \
        (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_TEID)
 
+#define ICE_FLOW_HASH_GTP_U_TEID \
+       (BIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID))
+
+#define ICE_FLOW_HASH_GTP_U_IPV4_TEID \
+       (ICE_FLOW_HASH_IPV4 | ICE_FLOW_HASH_GTP_U_TEID)
+#define ICE_FLOW_HASH_GTP_U_IPV6_TEID \
+       (ICE_FLOW_HASH_IPV6 | ICE_FLOW_HASH_GTP_U_TEID)
+
 #define ICE_FLOW_HASH_PPPOE_SESS_ID \
-       (ICE_FLOW_HASH_FLD(ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID))
+       (BIT_ULL(ICE_FLOW_FIELD_IDX_PPPOE_SESS_ID))
+
+#define ICE_FLOW_HASH_PPPOE_TCP_ID \
+       (ICE_FLOW_HASH_TCP_PORT | ICE_FLOW_HASH_PPPOE_SESS_ID)
+#define ICE_FLOW_HASH_PPPOE_UDP_ID \
+       (ICE_FLOW_HASH_UDP_PORT | ICE_FLOW_HASH_PPPOE_SESS_ID)
 
 /* Protocol header fields within a packet segment. A segment consists of one or
  * more protocol headers that make up a logical group of protocol headers. Each