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: 570ba37898 ("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>
This commit is contained in:
Hariprasad Kelam 2026-02-16 14:33:38 +05:30 committed by Jakub Kicinski
parent 284f1f176f
commit 45be47bf5d

View File

@ -1042,32 +1042,35 @@ void rvu_npc_update_flowkey_alg_idx(struct rvu *rvu, u16 pcifunc, int nixlf,
rvu_write64(rvu, blkaddr, rvu_write64(rvu, blkaddr,
NPC_AF_MCAMEX_BANKX_ACTION(index, bank), *(u64 *)&action); NPC_AF_MCAMEX_BANKX_ACTION(index, bank), *(u64 *)&action);
/* update the VF flow rule action with the VF default entry action */
if (mcam_index < 0)
npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc,
*(u64 *)&action);
/* update the action change in default rule */ /* update the action change in default rule */
pfvf = rvu_get_pfvf(rvu, pcifunc); pfvf = rvu_get_pfvf(rvu, pcifunc);
if (pfvf->def_ucast_rule) if (pfvf->def_ucast_rule)
pfvf->def_ucast_rule->rx_action = action; pfvf->def_ucast_rule->rx_action = action;
index = npc_get_nixlf_mcam_index(mcam, pcifunc, if (mcam_index < 0) {
nixlf, NIXLF_PROMISC_ENTRY); /* update the VF flow rule action with the VF default
* entry action
*/
npc_update_vf_flow_entry(rvu, mcam, blkaddr, pcifunc,
*(u64 *)&action);
/* If PF's promiscuous entry is enabled, index = npc_get_nixlf_mcam_index(mcam, pcifunc,
* Set RSS action for that entry as well nixlf, NIXLF_PROMISC_ENTRY);
*/
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr,
alg_idx);
index = npc_get_nixlf_mcam_index(mcam, pcifunc, /* If PF's promiscuous entry is enabled,
nixlf, NIXLF_ALLMULTI_ENTRY); * Set RSS action for that entry as well
/* If PF's allmulti entry is enabled, */
* Set RSS action for that entry as well npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index,
*/ blkaddr, alg_idx);
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index, blkaddr,
alg_idx); index = npc_get_nixlf_mcam_index(mcam, pcifunc,
nixlf, NIXLF_ALLMULTI_ENTRY);
/* If PF's allmulti entry is enabled,
* Set RSS action for that entry as well
*/
npc_update_rx_action_with_alg_idx(rvu, action, pfvf, index,
blkaddr, alg_idx);
}
} }
void npc_enadis_default_mce_entry(struct rvu *rvu, u16 pcifunc, void npc_enadis_default_mce_entry(struct rvu *rvu, u16 pcifunc,