Skip to content

Commit

Permalink
octeontx2-af: Adjust LA pointer for cpt parse header
Browse files Browse the repository at this point in the history
In case of ltype NPC_LT_LA_CPT_HDR, LA pointer is pointing to the
start of cpt parse header. Since cpt parse header has veriable
length padding, this will be a problem for DMAC extraction. Adding
KPU profile changes to adjust the LA pointer to start at ether header
in case of cpt parse header by
   - Adding ptr advance in pkind 58 to a fixed value 40
   - Adding variable length offset 7 and mask 7 (pad len in
     CPT_PARSE_HDR).
Also added the missing static declaration for npc_set_var_len_offset_pkind
function.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kiran Kumar K authored and davem330 committed Sep 30, 2021
1 parent 69508d4 commit 85212a1
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 95 deletions.
173 changes: 79 additions & 94 deletions drivers/net/ethernet/marvell/octeontx2/af/npc_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ enum npc_kpu_parser_state {
NPC_S_KPU2_PREHEADER,
NPC_S_KPU2_EXDSA,
NPC_S_KPU2_NGIO,
NPC_S_KPU2_CPT_CTAG,
NPC_S_KPU2_CPT_QINQ,
NPC_S_KPU3_CTAG,
NPC_S_KPU3_STAG,
NPC_S_KPU3_QINQ,
Expand Down Expand Up @@ -1004,11 +1006,11 @@ static struct npc_kpu_profile_action ikpu_action_entries[] = {
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
40, 54, 58, 0, 0,
NPC_S_KPU1_CPT_HDR, 0, 0,
12, 16, 20, 0, 0,
NPC_S_KPU1_CPT_HDR, 40, 0,
NPC_LID_LA, NPC_LT_NA,
0,
0, 0, 0, 0,
7, 7, 0, 0,

},
{
Expand Down Expand Up @@ -1846,80 +1848,35 @@ static struct npc_kpu_profile_cam kpu1_cam_entries[] = {
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
NPC_ETYPE_IP,
0xffff,
0x0000,
0x0000,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
NPC_ETYPE_IP6,
0xffff,
0x0000,
0x0000,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
NPC_ETYPE_CTAG,
0xffff,
0x0000,
0x0000,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
NPC_ETYPE_QINQ,
NPC_ETYPE_IP6,
0xffff,
0x0000,
0x0000,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
0x0000,
0x0000,
NPC_ETYPE_IP,
0xffff,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
NPC_ETYPE_CTAG,
0xffff,
0x0000,
0x0000,
NPC_ETYPE_IP6,
0xffff,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
0x0000,
0x0000,
NPC_ETYPE_CTAG,
0xffff,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0xffff,
0x0000,
0x0000,
NPC_ETYPE_QINQ,
0xffff,
},
{
NPC_S_KPU1_CPT_HDR, 0xff,
0x0000,
0x0000,
0x0000,
0x0000,
0x0000,
Expand Down Expand Up @@ -2929,6 +2886,42 @@ static struct npc_kpu_profile_cam kpu2_cam_entries[] = {
0x0000,
0x0000,
},
{
NPC_S_KPU2_CPT_CTAG, 0xff,
NPC_ETYPE_IP,
0xffff,
0x0000,
0x0000,
0x0000,
0x0000,
},
{
NPC_S_KPU2_CPT_CTAG, 0xff,
NPC_ETYPE_IP6,
0xffff,
0x0000,
0x0000,
0x0000,
0x0000,
},
{
NPC_S_KPU2_CPT_QINQ, 0xff,
NPC_ETYPE_CTAG,
0xffff,
NPC_ETYPE_IP,
0xffff,
0x0000,
0x0000,
},
{
NPC_S_KPU2_CPT_QINQ, 0xff,
NPC_ETYPE_CTAG,
0xffff,
NPC_ETYPE_IP6,
0xffff,
0x0000,
0x0000,
},
{
NPC_S_NA, 0X00,
0x0000,
Expand Down Expand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0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
4, 8, 0, 0, 0,
NPC_S_KPU2_QINQ, 58, 1,
NPC_S_KPU2_CPT_QINQ, 12, 1,
NPC_LID_LA, NPC_LT_LA_CPT_HDR,
NPC_F_LA_U_HAS_TAG | NPC_F_LA_L_WITH_VLAN,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
0, 0, 0, 0, 1,
NPC_S_NA, 0, 1,
NPC_LID_LA, NPC_LT_LA_CPT_HDR,
NPC_F_LA_L_UNK_ETYPE,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
12, 0, 0, 1, 0,
Expand Down Expand Up @@ -10129,6 +10082,38 @@ static struct npc_kpu_profile_action kpu2_action_entries[] = {
0,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
8, 0, 6, 2, 0,
NPC_S_KPU5_CPT_IP, 6, 1,
NPC_LID_LB, NPC_LT_LB_CTAG,
0,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
6, 0, 0, 2, 0,
NPC_S_KPU5_CPT_IP6, 6, 1,
NPC_LID_LB, NPC_LT_LB_CTAG,
0,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
8, 0, 6, 2, 0,
NPC_S_KPU5_CPT_IP, 10, 1,
NPC_LID_LB, NPC_LT_LB_STAG_QINQ,
NPC_F_LB_U_MORE_TAG | NPC_F_LB_L_WITH_CTAG,
0, 0, 0, 0,
},
{
NPC_ERRLEV_RE, NPC_EC_NOERR,
6, 0, 0, 2, 0,
NPC_S_KPU5_CPT_IP6, 10, 1,
NPC_LID_LB, NPC_LT_LB_STAG_QINQ,
NPC_F_LB_U_MORE_TAG | NPC_F_LB_L_WITH_CTAG,
0, 0, 0, 0,
},
{
NPC_ERRLEV_LB, NPC_EC_L2_K3,
0, 0, 0, 0, 1,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ int rvu_mbox_handler_npc_get_kex_cfg(struct rvu *rvu, struct msg_req *req,
return 0;
}

int
static int
npc_set_var_len_offset_pkind(struct rvu *rvu, u16 pcifunc, u64 pkind,
u8 var_len_off, u8 var_len_off_mask, u8 shift_dir)
{
Expand Down

0 comments on commit 85212a1

Please sign in to comment.