net/octeontx2: move ESP parsing to LE layer

Message ID 20200827114042.475771-1-kirankumark@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series net/octeontx2: move ESP parsing to LE layer |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed
ci/iol-testing fail Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Kiran Kumar Kokkilagadda Aug. 27, 2020, 11:40 a.m. UTC
  From: Kiran Kumar K <kirankumark@marvell.com>

Add support to parse NAT-T-ESP by moving the ESP parsing
to LE.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
 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(-)
  

Comments

Jerin Jacob Sept. 29, 2020, 5:56 p.m. UTC | #1
On Thu, Aug 27, 2020 at 5:11 PM <kirankumark@marvell.com> wrote:
>
> From: Kiran Kumar K <kirankumark@marvell.com>
>
> 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>
Applied to dpdk-next-net-mrvl/main. Thanks



> ---
>  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 efde1e214..45e60dfd5 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 2d9a5857c..e918574df 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 10944bc17..14ea1cf79 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.25.1
>
  

Patch

diff --git a/drivers/common/octeontx2/hw/otx2_npc.h b/drivers/common/octeontx2/hw/otx2_npc.h
index efde1e214..45e60dfd5 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 2d9a5857c..e918574df 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 10944bc17..14ea1cf79 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;