Skip to content

Commit 8bc48c4

Browse files
Hariprasad KelamSasha Levin
authored andcommitted
octeontx2-af: Fix default entries mcam entry action
[ Upstream commit 45be47bf5d7db0f762a93e9c0ede6cb3c91edf3b ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 3f483a9 commit 8bc48c4

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
@@ -1070,32 +1070,35 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf,
10701070
rvu_write64(rvu, blkaddr,
10711071
NPC_AF_MCAMEX_BANKX_ACTION(index, bank), *(u64 *)&action);
10721072

1073-
/* update the VF flow rule action with the VF default entry action */
1074-
if (mcam_index < 0)
1075-
npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc,
1076-
*(u64 *)&action);
1077-
10781073
/* update the action change in default rule */
10791074
pfvf = rvu_get_pfvf(rvu, pcifunc);
10801075
if (pfvf->def_ucast_rule)
10811076
pfvf->def_ucast_rule->rx_action = action;
10821077

1083-
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1084-
nixlf, NIXLF_PROMISC_ENTRY);
1078+
if (mcam_index < 0) {
1079+
/* update the VF flow rule action with the VF default
1080+
* entry action
1081+
*/
1082+
npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc,
1083+
*(u64 *)&action);
10851084

1086-
/* If PF's promiscuous entry is enabled,
1087-
* Set RSS action for that entry as well
1088-
*/
1089-
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr,
1090-
alg_idx);
1085+
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1086+
nixlf, NIXLF_PROMISC_ENTRY);
10911087

1092-
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1093-
nixlf, NIXLF_ALLMULTI_ENTRY);
1094-
/* If PF's allmulti entry is enabled,
1095-
* Set RSS action for that entry as well
1096-
*/
1097-
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr,
1098-
alg_idx);
1088+
/* If PF's promiscuous entry is enabled,
1089+
* Set RSS action for that entry as well
1090+
*/
1091+
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index,
1092+
blkaddr, alg_idx);
1093+
1094+
index = npc_get_nixlf_mcam_index(mcam, pcifunc,
1095+
nixlf, NIXLF_ALLMULTI_ENTRY);
1096+
/* If PF's allmulti entry is enabled,
1097+
* Set RSS action for that entry as well
1098+
*/
1099+
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index,
1100+
blkaddr, alg_idx);
1101+
}
10991102
}
11001103

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

0 commit comments

Comments
 (0)