Commit 4cb2cce0 authored by Kiran Kumar K's avatar Kiran Kumar K Committed by David S. Miller

octeontx2-af: add parser support for NAT-T-ESP

Add support for NAT-T-ESP to KPU parser configuration. NAT ESP is a UDP
based protocol. So move ESP to LE so that both UDP and ESP can be
extracted.
Signed-off-by: default avatarKiran Kumar K <kirankumark@marvell.com>
Acked-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 246f7d84
...@@ -81,7 +81,6 @@ enum npc_kpu_ld_ltype { ...@@ -81,7 +81,6 @@ enum npc_kpu_ld_ltype {
NPC_LT_LD_CUSTOM0, NPC_LT_LD_CUSTOM0,
NPC_LT_LD_CUSTOM1, NPC_LT_LD_CUSTOM1,
NPC_LT_LD_IGMP = 8, NPC_LT_LD_IGMP = 8,
NPC_LT_LD_ESP,
NPC_LT_LD_AH, NPC_LT_LD_AH,
NPC_LT_LD_GRE, NPC_LT_LD_GRE,
NPC_LT_LD_NVGRE, NPC_LT_LD_NVGRE,
...@@ -93,6 +92,7 @@ enum npc_kpu_ld_ltype { ...@@ -93,6 +92,7 @@ enum npc_kpu_ld_ltype {
enum npc_kpu_le_ltype { enum npc_kpu_le_ltype {
NPC_LT_LE_VXLAN = 1, NPC_LT_LE_VXLAN = 1,
NPC_LT_LE_GENEVE, NPC_LT_LE_GENEVE,
NPC_LT_LE_ESP,
NPC_LT_LE_GTPU = 4, NPC_LT_LE_GTPU = 4,
NPC_LT_LE_VXLANGPE, NPC_LT_LE_VXLANGPE,
NPC_LT_LE_GTPC, NPC_LT_LE_GTPC,
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#define NPC_UDP_PORT_VXLANGPE 4790 #define NPC_UDP_PORT_VXLANGPE 4790
#define NPC_UDP_PORT_GENEVE 6081 #define NPC_UDP_PORT_GENEVE 6081
#define NPC_UDP_PORT_MPLS 6635 #define NPC_UDP_PORT_MPLS 6635
#define NPC_UDP_PORT_ESP 4500
#define NPC_VXLANGPE_NP_IP 0x1 #define NPC_VXLANGPE_NP_IP 0x1
#define NPC_VXLANGPE_NP_IP6 0x2 #define NPC_VXLANGPE_NP_IP6 0x2
...@@ -197,7 +198,6 @@ enum npc_kpu_parser_state { ...@@ -197,7 +198,6 @@ enum npc_kpu_parser_state {
NPC_S_KPU8_IGMP, NPC_S_KPU8_IGMP,
NPC_S_KPU8_ICMP6, NPC_S_KPU8_ICMP6,
NPC_S_KPU8_GRE, NPC_S_KPU8_GRE,
NPC_S_KPU8_ESP,
NPC_S_KPU8_AH, NPC_S_KPU8_AH,
NPC_S_KPU9_TU_MPLS_IN_GRE, NPC_S_KPU9_TU_MPLS_IN_GRE,
NPC_S_KPU9_TU_MPLS_IN_NSH, NPC_S_KPU9_TU_MPLS_IN_NSH,
...@@ -209,6 +209,7 @@ enum npc_kpu_parser_state { ...@@ -209,6 +209,7 @@ enum npc_kpu_parser_state {
NPC_S_KPU9_GENEVE, NPC_S_KPU9_GENEVE,
NPC_S_KPU9_GTPC, NPC_S_KPU9_GTPC,
NPC_S_KPU9_GTPU, NPC_S_KPU9_GTPU,
NPC_S_KPU9_ESP,
NPC_S_KPU10_TU_MPLS_IN_VXLANGPE, NPC_S_KPU10_TU_MPLS_IN_VXLANGPE,
NPC_S_KPU10_TU_MPLS_PL, NPC_S_KPU10_TU_MPLS_PL,
NPC_S_KPU10_TU_MPLS, NPC_S_KPU10_TU_MPLS,
...@@ -4056,6 +4057,7 @@ static const struct npc_kpu_profile_cam kpu4_cam_entries[] = { ...@@ -4056,6 +4057,7 @@ static const struct npc_kpu_profile_cam kpu4_cam_entries[] = {
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000,
}, },
{ {
NPC_S_KPU4_FDSA, 0xff, NPC_S_KPU4_FDSA, 0xff,
...@@ -5421,15 +5423,24 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = { ...@@ -5421,15 +5423,24 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
}, },
{ {
NPC_S_KPU8_UDP, 0xff, NPC_S_KPU8_UDP, 0xff,
NPC_UDP_PORT_ESP,
0xffff,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
},
{
NPC_S_KPU8_UDP, 0xff,
0x0000,
0x0000,
NPC_UDP_PORT_ESP,
0xffff,
0x0000, 0x0000,
0x0000, 0x0000,
}, },
{ {
NPC_S_KPU8_SCTP, 0xff, NPC_S_KPU8_UDP, 0xff,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
...@@ -5438,7 +5449,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = { ...@@ -5438,7 +5449,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
0x0000, 0x0000,
}, },
{ {
NPC_S_KPU8_ICMP, 0xff, NPC_S_KPU8_SCTP, 0xff,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
...@@ -5447,7 +5458,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = { ...@@ -5447,7 +5458,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
0x0000, 0x0000,
}, },
{ {
NPC_S_KPU8_IGMP, 0xff, NPC_S_KPU8_ICMP, 0xff,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
...@@ -5456,7 +5467,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = { ...@@ -5456,7 +5467,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
0x0000, 0x0000,
}, },
{ {
NPC_S_KPU8_ICMP6, 0xff, NPC_S_KPU8_IGMP, 0xff,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
...@@ -5465,7 +5476,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = { ...@@ -5465,7 +5476,7 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
0x0000, 0x0000,
}, },
{ {
NPC_S_KPU8_ESP, 0xff, NPC_S_KPU8_ICMP6, 0xff,
0x0000, 0x0000,
0x0000, 0x0000,
0x0000, 0x0000,
...@@ -6403,6 +6414,15 @@ static const struct npc_kpu_profile_cam kpu9_cam_entries[] = { ...@@ -6403,6 +6414,15 @@ static const struct npc_kpu_profile_cam kpu9_cam_entries[] = {
0x0000, 0x0000,
NPC_MPLS_S, NPC_MPLS_S,
}, },
{
NPC_S_KPU9_ESP, 0xff,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
},
{ {
NPC_S_NA, 0X00, NPC_S_NA, 0X00,
0x0000, 0x0000,
...@@ -10246,8 +10266,8 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = { ...@@ -10246,8 +10266,8 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = {
}, },
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 2, 0, 0, 0, 0, 3, 0,
NPC_S_KPU8_ESP, 20, 1, NPC_S_KPU9_ESP, 20, 1,
NPC_LID_LC, NPC_LT_LC_IP, NPC_LID_LC, NPC_LT_LC_IP,
0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
...@@ -10350,8 +10370,8 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = { ...@@ -10350,8 +10370,8 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = {
}, },
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 2, 0, 0, 0, 0, 3, 0,
NPC_S_KPU8_ESP, 0, 1, NPC_S_KPU9_ESP, 0, 1,
NPC_LID_LC, NPC_LT_LC_IP_OPT, NPC_LID_LC, NPC_LT_LC_IP_OPT,
0, 0,
0, 0xf, 0, 2, 0, 0xf, 0, 2,
...@@ -10558,8 +10578,8 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = { ...@@ -10558,8 +10578,8 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = {
}, },
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 2, 0, 0, 0, 0, 3, 0,
NPC_S_KPU8_ESP, 40, 1, NPC_S_KPU9_ESP, 40, 1,
NPC_LID_LC, NPC_LT_LC_IP6_EXT, NPC_LID_LC, NPC_LT_LC_IP6_EXT,
0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
...@@ -10833,8 +10853,8 @@ static const struct npc_kpu_profile_action kpu6_action_entries[] = { ...@@ -10833,8 +10853,8 @@ static const struct npc_kpu_profile_action kpu6_action_entries[] = {
}, },
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 1, 0, 0, 0, 0, 2, 0,
NPC_S_KPU8_ESP, 8, 0, NPC_S_KPU9_ESP, 8, 0,
NPC_LID_LC, NPC_LT_NA, NPC_LID_LC, NPC_LT_NA,
0, 0,
1, 0xff, 0, 3, 1, 0xff, 0, 3,
...@@ -10937,8 +10957,8 @@ static const struct npc_kpu_profile_action kpu6_action_entries[] = { ...@@ -10937,8 +10957,8 @@ static const struct npc_kpu_profile_action kpu6_action_entries[] = {
}, },
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 1, 0, 0, 0, 0, 2, 0,
NPC_S_KPU8_ESP, 8, 0, NPC_S_KPU9_ESP, 8, 0,
NPC_LID_LC, NPC_LT_NA, NPC_LID_LC, NPC_LT_NA,
0, 0,
1, 0xff, 0, 3, 1, 0xff, 0, 3,
...@@ -11052,8 +11072,8 @@ static const struct npc_kpu_profile_action kpu7_action_entries[] = { ...@@ -11052,8 +11072,8 @@ static const struct npc_kpu_profile_action kpu7_action_entries[] = {
}, },
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
NPC_S_KPU8_ESP, 8, 0, NPC_S_KPU9_ESP, 8, 0,
NPC_LID_LC, NPC_LT_NA, NPC_LID_LC, NPC_LT_NA,
0, 0,
1, 0xff, 0, 3, 1, 0xff, 0, 3,
...@@ -11373,6 +11393,22 @@ static const struct npc_kpu_profile_action kpu8_action_entries[] = { ...@@ -11373,6 +11393,22 @@ static const struct npc_kpu_profile_action kpu8_action_entries[] = {
0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}, },
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 0,
NPC_S_KPU9_ESP, 8, 1,
NPC_LID_LD, NPC_LT_LD_UDP,
0,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 0,
NPC_S_KPU9_ESP, 8, 1,
NPC_LID_LD, NPC_LT_LD_UDP,
0,
0, 0, 0, 0,
},
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 7, 0, 0, 0, 0, 7, 0,
...@@ -11413,14 +11449,6 @@ static const struct npc_kpu_profile_action kpu8_action_entries[] = { ...@@ -11413,14 +11449,6 @@ static const struct npc_kpu_profile_action kpu8_action_entries[] = {
0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}, },
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 1,
NPC_S_NA, 0, 1,
NPC_LID_LD, NPC_LT_LD_ESP,
0,
0, 0, 0, 0,
},
{ {
NPC_ERRLEV_RE, NPC_EC_NOERR, NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
...@@ -12248,6 +12276,14 @@ static const struct npc_kpu_profile_action kpu9_action_entries[] = { ...@@ -12248,6 +12276,14 @@ static const struct npc_kpu_profile_action kpu9_action_entries[] = {
0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
}, },
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 1,
NPC_S_NA, 0, 1,
NPC_LID_LE, NPC_LT_LE_ESP,
0,
0, 0, 0, 0,
},
{ {
NPC_ERRLEV_LE, NPC_EC_UNK, NPC_ERRLEV_LE, NPC_EC_UNK,
0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
...@@ -13316,8 +13352,8 @@ static const struct npc_lt_def_cfg npc_lt_defaults = { ...@@ -13316,8 +13352,8 @@ static const struct npc_lt_def_cfg npc_lt_defaults = {
}, },
.rx_ipsec = { .rx_ipsec = {
{ {
.lid = NPC_LID_LD, .lid = NPC_LID_LE,
.ltype_match = NPC_LT_LD_ESP, .ltype_match = NPC_LT_LE_ESP,
.ltype_mask = 0x0F, .ltype_mask = 0x0F,
}, },
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment