From 41763024c86f9544c1afa1e068c607df9691f7d0 Mon Sep 17 00:00:00 2001 From: Kiran Kumar K Date: Thu, 27 Aug 2020 17:10:41 +0530 Subject: [PATCH] net/octeontx2: move ESP parsing to LE layer Add support to parse NAT-T-ESP by moving the ESP parsing to LE. Signed-off-by: Kiran Kumar K Acked-by: Jerin Jacob --- drivers/common/octeontx2/hw/otx2_npc.h | 2 +- drivers/net/octeontx2/otx2_flow_parse.c | 10 +++++----- drivers/net/octeontx2/otx2_lookup.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/common/octeontx2/hw/otx2_npc.h b/drivers/common/octeontx2/hw/otx2_npc.h index efde1e214a..45e60dfd50 100644 --- a/drivers/common/octeontx2/hw/otx2_npc.h +++ b/drivers/common/octeontx2/hw/otx2_npc.h @@ -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, diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c index b7ff5fd032..476195d634 100644 --- a/drivers/net/octeontx2/otx2_flow_parse.c +++ b/drivers/net/octeontx2/otx2_flow_parse.c @@ -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; diff --git a/drivers/net/octeontx2/otx2_lookup.c b/drivers/net/octeontx2/otx2_lookup.c index 10944bc176..14ea1cf797 100644 --- a/drivers/net/octeontx2/otx2_lookup.c +++ b/drivers/net/octeontx2/otx2_lookup.c @@ -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; -- 2.20.1