net/iavf: support flow director GTPU outer IPv4/IPv6
authorJunfeng Guo <junfeng.guo@intel.com>
Wed, 8 Jul 2020 04:26:13 +0000 (12:26 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Sat, 11 Jul 2020 04:18:52 +0000 (06:18 +0200)
Add FDir support for MAC_IPV4_GTPU and MAC_IPV6_GTPU type with outer
IPv4/IPv6 address, teid and qfi fields matching. Note that outer IPv4
and IPv6 matching fields here include both SRC & DST of both IPv4 &
IPv6.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_fdir.c
drivers/net/iavf/iavf_generic_flow.c
drivers/net/iavf/iavf_generic_flow.h

index 264c47d..f584e56 100644 (file)
        IAVF_INSET_IPV6_TC | IAVF_INSET_IPV6_HOP_LIMIT | \
        IAVF_INSET_SCTP_SRC_PORT | IAVF_INSET_SCTP_DST_PORT)
 
-#define IAVF_FDIR_INSET_GTPU (\
+#define IAVF_FDIR_INSET_IPV4_GTPU (\
        IAVF_INSET_IPV4_SRC | IAVF_INSET_IPV4_DST | \
        IAVF_INSET_GTPU_TEID)
 
-#define IAVF_FDIR_INSET_GTPU_EH (\
+#define IAVF_FDIR_INSET_IPV4_GTPU_EH (\
        IAVF_INSET_IPV4_SRC | IAVF_INSET_IPV4_DST | \
        IAVF_INSET_GTPU_TEID | IAVF_INSET_GTPU_QFI)
 
+#define IAVF_FDIR_INSET_IPV6_GTPU (\
+       IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \
+       IAVF_INSET_GTPU_TEID)
+
+#define IAVF_FDIR_INSET_IPV6_GTPU_EH (\
+       IAVF_INSET_IPV6_SRC | IAVF_INSET_IPV6_DST | \
+       IAVF_INSET_GTPU_TEID | IAVF_INSET_GTPU_QFI)
+
 #define IAVF_FDIR_INSET_L2TPV3OIP (\
        IAVF_L2TPV3OIP_SESSION_ID)
 
@@ -106,8 +114,10 @@ static struct iavf_pattern_match_item iavf_fdir_pattern[] = {
        {iavf_pattern_eth_ipv6_udp,             IAVF_FDIR_INSET_ETH_IPV6_UDP,           IAVF_INSET_NONE},
        {iavf_pattern_eth_ipv6_tcp,             IAVF_FDIR_INSET_ETH_IPV6_TCP,           IAVF_INSET_NONE},
        {iavf_pattern_eth_ipv6_sctp,            IAVF_FDIR_INSET_ETH_IPV6_SCTP,          IAVF_INSET_NONE},
-       {iavf_pattern_eth_ipv4_gtpu,            IAVF_FDIR_INSET_GTPU,                   IAVF_INSET_NONE},
-       {iavf_pattern_eth_ipv4_gtpu_eh,         IAVF_FDIR_INSET_GTPU_EH,                IAVF_INSET_NONE},
+       {iavf_pattern_eth_ipv4_gtpu,            IAVF_FDIR_INSET_IPV4_GTPU,              IAVF_INSET_NONE},
+       {iavf_pattern_eth_ipv4_gtpu_eh,         IAVF_FDIR_INSET_IPV4_GTPU_EH,           IAVF_INSET_NONE},
+       {iavf_pattern_eth_ipv6_gtpu,            IAVF_FDIR_INSET_IPV6_GTPU,              IAVF_INSET_NONE},
+       {iavf_pattern_eth_ipv6_gtpu_eh,         IAVF_FDIR_INSET_IPV6_GTPU_EH,           IAVF_INSET_NONE},
        {iavf_pattern_eth_ipv4_l2tpv3,          IAVF_FDIR_INSET_L2TPV3OIP,              IAVF_INSET_NONE},
        {iavf_pattern_eth_ipv6_l2tpv3,          IAVF_FDIR_INSET_L2TPV3OIP,              IAVF_INSET_NONE},
        {iavf_pattern_eth_ipv4_esp,             IAVF_FDIR_INSET_ESP,                    IAVF_INSET_NONE},
index b6c26c4..c6d48f0 100644 (file)
@@ -315,7 +315,7 @@ enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[] = {
        RTE_FLOW_ITEM_TYPE_END,
 };
 
-/* GTPU */
+/* IPV4 GTPU (EH) */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[] = {
        RTE_FLOW_ITEM_TYPE_ETH,
        RTE_FLOW_ITEM_TYPE_IPV4,
@@ -333,6 +333,25 @@ enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[] = {
        RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* IPV6 GTPU (EH) */
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[] = {
+       RTE_FLOW_ITEM_TYPE_ETH,
+       RTE_FLOW_ITEM_TYPE_IPV6,
+       RTE_FLOW_ITEM_TYPE_UDP,
+       RTE_FLOW_ITEM_TYPE_GTPU,
+       RTE_FLOW_ITEM_TYPE_END,
+};
+
+enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[] = {
+       RTE_FLOW_ITEM_TYPE_ETH,
+       RTE_FLOW_ITEM_TYPE_IPV6,
+       RTE_FLOW_ITEM_TYPE_UDP,
+       RTE_FLOW_ITEM_TYPE_GTPU,
+       RTE_FLOW_ITEM_TYPE_GTP_PSC,
+       RTE_FLOW_ITEM_TYPE_END,
+};
+
+/* IPV4 GTPU IPv4 */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4[] = {
        RTE_FLOW_ITEM_TYPE_ETH,
        RTE_FLOW_ITEM_TYPE_IPV4,
@@ -342,6 +361,7 @@ enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4[] = {
        RTE_FLOW_ITEM_TYPE_END,
 };
 
+/* IPV4 GTPU EH IPv4 */
 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4[] = {
        RTE_FLOW_ITEM_TYPE_ETH,
        RTE_FLOW_ITEM_TYPE_IPV4,
index 978d071..8a66875 100644 (file)
@@ -182,10 +182,18 @@ extern enum rte_flow_item_type iavf_pattern_eth_ipv6_icmp6[];
 extern enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[];
 extern enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[];
 
-/* GTPU */
+/* IPv4 GTPU (EH) */
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[];
-extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[];
+
+/* IPv6 GTPU (EH) */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[];
+extern enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[];
+
+/* IPv4 GTPU IPv4 */
+extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4[];
+
+/* IPv4 GTPU EH IPv4 */
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
 extern enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];