octeontx2-af: add support for custom KPU entries
[linux-2.6-microblaze.git] / drivers / net / ethernet / marvell / octeontx2 / af / npc_profile.h
index 5c372d2..de3a60c 100644 (file)
 #ifndef NPC_PROFILE_H
 #define NPC_PROFILE_H
 
-#define NPC_KPU_PROFILE_VER    0x0000000100050000
+#define NPC_KPU_PROFILE_VER    0x0000000100050000
+#define NPC_KPU_VER_MAJ(ver)   ((u16)(((ver) >> 32) & 0xFFFF))
+#define NPC_KPU_VER_MIN(ver)   ((u16)(((ver) >> 16) & 0xFFFF))
+#define NPC_KPU_VER_PATCH(ver) ((u16)((ver) & 0xFFFF))
 
 #define NPC_IH_W               0x8000
 #define NPC_IH_UTAG            0x2000
@@ -442,7 +445,28 @@ enum NPC_ERRLEV_E {
        NPC_ERRLEV_ENUM_LAST = 16,
 };
 
-static const struct npc_kpu_profile_action ikpu_action_entries[] = {
+#define NPC_KPU_NOP_CAM                \
+       {                       \
+               NPC_S_NA, 0xff, \
+               0x0000,         \
+               0x0000,         \
+               0x0000,         \
+               0x0000,         \
+               0x0000,         \
+               0x0000,         \
+       }
+
+#define NPC_KPU_NOP_ACTION                     \
+       {                                       \
+               NPC_ERRLEV_RE, NPC_EC_NOERR,    \
+               0, 0, 0, 0, 0,                  \
+               NPC_S_NA, 0, 0,                 \
+               NPC_LID_LA, NPC_LT_NA,          \
+               0,                              \
+               0, 0, 0, 0,                     \
+       }
+
+static struct npc_kpu_profile_action ikpu_action_entries[] = {
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                12, 16, 20, 0, 0,
@@ -1021,7 +1045,9 @@ static const struct npc_kpu_profile_action ikpu_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu1_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu1_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU1_ETHER, 0xff,
                NPC_ETYPE_IP,
@@ -1699,7 +1725,9 @@ static const struct npc_kpu_profile_cam kpu1_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu2_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu2_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU2_CTAG, 0xff,
                NPC_ETYPE_IP,
@@ -2827,7 +2855,9 @@ static const struct npc_kpu_profile_cam kpu2_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu3_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu3_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU3_CTAG, 0xff,
                NPC_ETYPE_IP,
@@ -3946,7 +3976,9 @@ static const struct npc_kpu_profile_cam kpu3_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu4_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu4_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU4_MPLS, 0xff,
                NPC_MPLS_S,
@@ -4102,7 +4134,9 @@ static const struct npc_kpu_profile_cam kpu4_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu5_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu5_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU5_IP, 0xff,
                0x0000,
@@ -4672,7 +4706,9 @@ static const struct npc_kpu_profile_cam kpu5_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu6_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu6_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU6_IP6_EXT, 0xff,
                0x0000,
@@ -5017,7 +5053,9 @@ static const struct npc_kpu_profile_cam kpu6_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu7_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu7_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU7_IP6_EXT, 0xff,
                0x0000,
@@ -5236,7 +5274,9 @@ static const struct npc_kpu_profile_cam kpu7_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu8_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU8_TCP, 0xff,
                0x0000,
@@ -5977,7 +6017,9 @@ static const struct npc_kpu_profile_cam kpu8_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu9_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu9_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU9_TU_MPLS_IN_GRE, 0xff,
                NPC_MPLS_S,
@@ -6448,7 +6490,9 @@ static const struct npc_kpu_profile_cam kpu9_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu10_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu10_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU10_TU_MPLS, 0xff,
                NPC_MPLS_S,
@@ -6613,7 +6657,9 @@ static const struct npc_kpu_profile_cam kpu10_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu11_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu11_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU11_TU_ETHER, 0xff,
                NPC_ETYPE_IP,
@@ -6922,7 +6968,9 @@ static const struct npc_kpu_profile_cam kpu11_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu12_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu12_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU12_TU_IP, 0xff,
                NPC_IPNH_TCP,
@@ -7177,7 +7225,9 @@ static const struct npc_kpu_profile_cam kpu12_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu13_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu13_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU13_TU_IP6_EXT, 0xff,
                0x0000,
@@ -7189,7 +7239,9 @@ static const struct npc_kpu_profile_cam kpu13_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu14_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu14_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU14_TU_IP6_EXT, 0xff,
                0x0000,
@@ -7201,7 +7253,9 @@ static const struct npc_kpu_profile_cam kpu14_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu15_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu15_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU15_TU_TCP, 0xff,
                0x0000,
@@ -7402,7 +7456,9 @@ static const struct npc_kpu_profile_cam kpu15_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_cam kpu16_cam_entries[] = {
+static struct npc_kpu_profile_cam kpu16_cam_entries[] = {
+       NPC_KPU_NOP_CAM,
+       NPC_KPU_NOP_CAM,
        {
                NPC_S_KPU16_TCP_DATA, 0xff,
                0x0000,
@@ -7459,7 +7515,9 @@ static const struct npc_kpu_profile_cam kpu16_cam_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu1_action_entries[] = {
+static struct npc_kpu_profile_action kpu1_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 3, 0,
@@ -8084,7 +8142,9 @@ static const struct npc_kpu_profile_action kpu1_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu2_action_entries[] = {
+static struct npc_kpu_profile_action kpu2_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 2, 0,
@@ -9087,7 +9147,9 @@ static const struct npc_kpu_profile_action kpu2_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu3_action_entries[] = {
+static struct npc_kpu_profile_action kpu3_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 1, 0,
@@ -10082,7 +10144,9 @@ static const struct npc_kpu_profile_action kpu3_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu4_action_entries[] = {
+static struct npc_kpu_profile_action kpu4_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 0,
@@ -10221,7 +10285,9 @@ static const struct npc_kpu_profile_action kpu4_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu5_action_entries[] = {
+static struct npc_kpu_profile_action kpu5_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_LC, NPC_EC_IP_TTL_0,
                0, 0, 0, 0, 1,
@@ -10728,7 +10794,9 @@ static const struct npc_kpu_profile_action kpu5_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu6_action_entries[] = {
+static struct npc_kpu_profile_action kpu6_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 1,
@@ -11035,7 +11103,9 @@ static const struct npc_kpu_profile_action kpu6_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu7_action_entries[] = {
+static struct npc_kpu_profile_action kpu7_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 1,
@@ -11230,7 +11300,9 @@ static const struct npc_kpu_profile_action kpu7_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu8_action_entries[] = {
+static struct npc_kpu_profile_action kpu8_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_LD, NPC_EC_TCP_FLAGS_FIN_ONLY,
                0, 0, 0, 0, 1,
@@ -11889,7 +11961,9 @@ static const struct npc_kpu_profile_action kpu8_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu9_action_entries[] = {
+static struct npc_kpu_profile_action kpu9_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 0,
@@ -12308,7 +12382,9 @@ static const struct npc_kpu_profile_action kpu9_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu10_action_entries[] = {
+static struct npc_kpu_profile_action kpu10_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 1, 0,
@@ -12455,7 +12531,9 @@ static const struct npc_kpu_profile_action kpu10_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu11_action_entries[] = {
+static struct npc_kpu_profile_action kpu11_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                8, 0, 6, 0, 0,
@@ -12730,7 +12808,9 @@ static const struct npc_kpu_profile_action kpu11_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu12_action_entries[] = {
+static struct npc_kpu_profile_action kpu12_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                2, 12, 0, 2, 0,
@@ -12957,7 +13037,9 @@ static const struct npc_kpu_profile_action kpu12_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu13_action_entries[] = {
+static struct npc_kpu_profile_action kpu13_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 1,
@@ -12968,7 +13050,9 @@ static const struct npc_kpu_profile_action kpu13_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu14_action_entries[] = {
+static struct npc_kpu_profile_action kpu14_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 1,
@@ -12979,7 +13063,9 @@ static const struct npc_kpu_profile_action kpu14_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu15_action_entries[] = {
+static struct npc_kpu_profile_action kpu15_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_LG, NPC_EC_TCP_FLAGS_FIN_ONLY,
                0, 0, 0, 0, 1,
@@ -13158,7 +13244,9 @@ static const struct npc_kpu_profile_action kpu15_action_entries[] = {
        },
 };
 
-static const struct npc_kpu_profile_action kpu16_action_entries[] = {
+static struct npc_kpu_profile_action kpu16_action_entries[] = {
+       NPC_KPU_NOP_ACTION,
+       NPC_KPU_NOP_ACTION,
        {
                NPC_ERRLEV_RE, NPC_EC_NOERR,
                0, 0, 0, 0, 1,