Skip to content

Commit 45be47b

Browse files
Hariprasad Kelamkuba-moo
authored andcommitted
octeontx2-af: Fix default entries mcam entry action
As per design, AF should update the default MCAM action only when mcam_index is -1. A bug in the previous patch caused default entries to be changed even when the request was not for them. Fixes: 570ba37 ("octeontx2-af: Update RSS algorithm index") Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260216090338.1318976-1-hkelam@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 284f1f1 commit 45be47b

1 file changed

Lines changed: 22 additions & 19 deletions

File tree

  • drivers/net/ethernet/marvell/octeontx2/af

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,32 +1042,35 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf,
10421042
rvu_write64(rvu, blkaddr,
10431043
NPC_AF_MCAMEX_BANKX_ACTION(index, bank), *(u64 *)&action);
10441044

1045-
/* update the VF flow rule action with the VF default entry action */
1046-
if (mcam_index < 0)
1047-
npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc,
1048-
*(u64 *)&action);
1049-
10501045
/* update the action change in default rule */
10511046
pfvf = rvu_get_pfvf(rvu, pcifunc);
10521047
if (pfvf->def_ucast_rule)
10531048
pfvf->def_ucast_rule->rx_action = action;
10541049

1055-
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1056-
nixlf, NIXLF_PROMISC_ENTRY);
1050+
if (mcam_index < 0) {
1051+
/* update the VF flow rule action with the VF default
1052+
* entry action
1053+
*/
1054+
npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc,
1055+
*(u64 *)&action);
10571056

1058-
/* If PF's promiscuous entry is enabled,
1059-
* Set RSS action for that entry as well
1060-
*/
1061-
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr,
1062-
alg_idx);
1057+
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1058+
nixlf, NIXLF_PROMISC_ENTRY);
10631059

1064-
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1065-
nixlf, NIXLF_ALLMULTI_ENTRY);
1066-
/* If PF's allmulti entry is enabled,
1067-
* Set RSS action for that entry as well
1068-
*/
1069-
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr,
1070-
alg_idx);
1060+
/* If PF's promiscuous entry is enabled,
1061+
* Set RSS action for that entry as well
1062+
*/
1063+
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index,
1064+
blkaddr, alg_idx);
1065+
1066+
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1067+
nixlf, NIXLF_ALLMULTI_ENTRY);
1068+
/* If PF's allmulti entry is enabled,
1069+
* Set RSS action for that entry as well
1070+
*/
1071+
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index,
1072+
blkaddr, alg_idx);
1073+
}
10711074
}
10721075

10731076
void npc_enadis_default_mce_entry(struct rvu *rvu, u16 pcifunc,

0 commit comments

Comments
 (0)