net/octeontx2: move ESP parsing to LE layer
authorKiran Kumar K <kirankumark@marvell.com>
Thu, 27 Aug 2020 11:40:41 +0000 (17:10 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:14 +0000 (19:19 +0200)
Add support to parse NAT-T-ESP by moving the ESP parsing
to LE.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/octeontx2/hw/otx2_npc.h
drivers/net/octeontx2/otx2_flow_parse.c
drivers/net/octeontx2/otx2_lookup.c

index efde1e2..45e60df 100644 (file)
@@ -225,7 +225,6 @@ enum npc_kpu_ld_ltype {
        NPC_LT_LD_SCTP,
        NPC_LT_LD_ICMP6,
        NPC_LT_LD_IGMP = 8,
-       NPC_LT_LD_ESP,
        NPC_LT_LD_AH,
        NPC_LT_LD_GRE,
        NPC_LT_LD_NVGRE,
@@ -237,6 +236,7 @@ enum npc_kpu_ld_ltype {
 enum npc_kpu_le_ltype {
        NPC_LT_LE_VXLAN = 1,
        NPC_LT_LE_GENEVE,
+       NPC_LT_LE_ESP,
        NPC_LT_LE_GTPU = 4,
        NPC_LT_LE_VXLANGPE,
        NPC_LT_LE_GTPC,
index b7ff5fd..476195d 100644 (file)
@@ -245,6 +245,11 @@ otx2_flow_parse_le(struct otx2_parse_state *pst)
                info.len = sizeof(struct rte_flow_item_vxlan);
                lt = NPC_LT_LE_VXLAN;
                break;
+       case RTE_FLOW_ITEM_TYPE_ESP:
+               lt = NPC_LT_LE_ESP;
+               info.def_mask = &rte_flow_item_esp_mask;
+               info.len = sizeof(struct rte_flow_item_esp);
+               break;
        case RTE_FLOW_ITEM_TYPE_GTPC:
                lflags = NPC_F_UDP_GTP_GTPC;
                info.def_mask = &rte_flow_item_gtp_mask;
@@ -441,11 +446,6 @@ otx2_flow_parse_ld(struct otx2_parse_state *pst)
                info.def_mask = &rte_flow_item_sctp_mask;
                info.len = sizeof(struct rte_flow_item_sctp);
                break;
-       case RTE_FLOW_ITEM_TYPE_ESP:
-               lt = NPC_LT_LD_ESP;
-               info.def_mask = &rte_flow_item_esp_mask;
-               info.len = sizeof(struct rte_flow_item_esp);
-               break;
        case RTE_FLOW_ITEM_TYPE_GRE:
                lt = NPC_LT_LD_GRE;
                info.def_mask = &rte_flow_item_gre_mask;
index 10944bc..14ea1cf 100644 (file)
@@ -169,15 +169,15 @@ nix_create_non_tunnel_ptype_array(uint16_t *ptype)
                case NPC_LT_LD_NVGRE:
                        val |= RTE_PTYPE_TUNNEL_NVGRE;
                        break;
-               case NPC_LT_LD_ESP:
-                       val |= RTE_PTYPE_TUNNEL_ESP;
-                       break;
                }
 
                switch (le) {
                case NPC_LT_LE_VXLAN:
                        val |= RTE_PTYPE_TUNNEL_VXLAN;
                        break;
+               case NPC_LT_LE_ESP:
+                       val |= RTE_PTYPE_TUNNEL_ESP;
+                       break;
                case NPC_LT_LE_VXLANGPE:
                        val |= RTE_PTYPE_TUNNEL_VXLAN_GPE;
                        break;