net/ice/base: support flow director for GTPU with outer IPv6
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 11 Jun 2020 08:43:26 +0000 (16:43 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 30 Jun 2020 12:52:29 +0000 (14:52 +0200)
Add FDIR support for MAC_IPV6_GTPU type with outer IPv6 address, teid
and qfi fields matching.

Signed-off-by: Junfeng Guo <junfeng.guo@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_fdir.c
drivers/net/ice/base/ice_fdir.h
drivers/net/ice/base/ice_type.h

index ecdebd3..c5a2063 100644 (file)
@@ -102,6 +102,25 @@ static const u8 ice_fdir_ipv4_gtpu4_pkt[] = {
        0x00, 0x00,
 };
 
+static const u8 ice_fdir_ipv6_gtpu6_pkt[] = {
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x86, 0xdd, 0x60, 0x00,
+       0x00, 0x00, 0x00, 0x44, 0x11, 0x40, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x08, 0x68,
+       0x08, 0x68, 0x00, 0x44, 0x7f, 0xed, 0x34, 0xff,
+       0x00, 0x34, 0x12, 0x34, 0x56, 0x78, 0x00, 0x00,
+       0x00, 0x85, 0x02, 0x00, 0x33, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x3b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00,
+};
+
 static const u8 ice_fdir_ipv4_l2tpv3_pkt[] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00,
@@ -466,6 +485,13 @@ static const struct ice_fdir_base_pkt ice_fdir_pkt[] = {
                sizeof(ice_fdir_ipv4_gtpu4_pkt),
                ice_fdir_ipv4_gtpu4_pkt,
        },
+       {
+               ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER,
+               sizeof(ice_fdir_ipv6_gtpu6_pkt),
+               ice_fdir_ipv6_gtpu6_pkt,
+               sizeof(ice_fdir_ipv6_gtpu6_pkt),
+               ice_fdir_ipv6_gtpu6_pkt,
+       },
        {
                ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3,
                sizeof(ice_fdir_ipv4_l2tpv3_pkt), ice_fdir_ipv4_l2tpv3_pkt,
@@ -1035,6 +1061,16 @@ ice_fdir_get_gen_prgm_pkt(struct ice_hw *hw, struct ice_fdir_fltr *input,
                ice_pkt_insert_u6_qfi(loc, ICE_IPV4_GTPU_QFI_OFFSET,
                                      input->gtpu_data.qfi);
                break;
+       case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER:
+               ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_DST_ADDR_OFFSET,
+                                        input->ip.v6.src_ip);
+               ice_pkt_insert_ipv6_addr(loc, ICE_IPV6_SRC_ADDR_OFFSET,
+                                        input->ip.v6.dst_ip);
+               ice_pkt_insert_u32(loc, ICE_IPV6_GTPU_TEID_OFFSET,
+                                  input->gtpu_data.teid);
+               ice_pkt_insert_u6_qfi(loc, ICE_IPV6_GTPU_QFI_OFFSET,
+                                     input->gtpu_data.qfi);
+               break;
        case ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3:
                ice_pkt_insert_u32(loc, ICE_IPV4_L2TPV3_SESS_ID_OFFSET,
                                   input->l2tpv3_data.session_id);
index e4f7b13..1f31deb 100644 (file)
@@ -46,6 +46,8 @@
 #define ICE_IPV6_PROTO_OFFSET          20
 #define ICE_IPV4_GTPU_TEID_OFFSET      46
 #define ICE_IPV4_GTPU_QFI_OFFSET       56
+#define ICE_IPV6_GTPU_TEID_OFFSET      66
+#define ICE_IPV6_GTPU_QFI_OFFSET       76
 #define ICE_IPV4_L2TPV3_SESS_ID_OFFSET 34
 #define ICE_IPV6_L2TPV3_SESS_ID_OFFSET 54
 #define ICE_IPV4_ESP_SPI_OFFSET                34
index 41a1912..c13cd7b 100644 (file)
@@ -296,6 +296,7 @@ enum ice_fltr_ptype {
        ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP,
        ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP,
        ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER,
+       ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER,
        ICE_FLTR_PTYPE_NONF_IPV4_L2TPV3,
        ICE_FLTR_PTYPE_NONF_IPV6_L2TPV3,
        ICE_FLTR_PTYPE_NONF_IPV4_ESP,