From: Subbaraya Sundeep <[email protected]>

In npc_update_vf_flow_entry function the loop cursor
'index' is being changed inside the loop causing
the loop to spin forever. This in turn hogs the kworker
thread forever and no other mbox message is processed
by AF driver after that. Fix this by using
another variable in the loop.

Fixes: 568c5c35 ("octeontx2-af: Update forwarding rule action")
Change-Id: If60d6d994d808d6f0c6fe686bc022682ec5fe1ee
Signed-off-by: Subbaraya Sundeep <[email protected]>
Reviewed-on: https://sj1git1.cavium.com/c/IP/SW/kernel/linux/+/42411
Tested-by: sa_ip-sw-jenkins <[email protected]>
Reviewed-by: Sunil Kovvuri Goutham <[email protected]>
Signed-off-by: Ruiqiang Hao <[email protected]>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c 
b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index a6fe23a36fbc..40ab70af2d15 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -793,7 +793,7 @@ void rvu_npc_enable_bcast_entry(struct rvu *rvu, u16 
pcifunc, bool enable)
 static void npc_update_vf_flow_entry(struct rvu *rvu, struct npc_mcam *mcam,
                                     int blkaddr, u16 pcifunc, u64 rx_action)
 {
-       int actindex, index, bank;
+       int actindex, index, bank, entry;
        bool enable;
 
        if (!(pcifunc & RVU_PFVF_FUNC_MASK))
@@ -804,7 +804,7 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, 
struct npc_mcam *mcam,
                if (mcam->entry2target_pffunc[index] == pcifunc) {
                        bank = npc_get_bank(mcam, index);
                        actindex = index;
-                       index &= (mcam->banksize - 1);
+                       entry = index & (mcam->banksize - 1);
 
                        /* read vf flow entry enable status */
                        enable = is_mcam_entry_enabled(rvu, mcam, blkaddr,
@@ -814,7 +814,7 @@ static void npc_update_vf_flow_entry(struct rvu *rvu, 
struct npc_mcam *mcam,
                                              false);
                        /* update 'action' */
                        rvu_write64(rvu, blkaddr,
-                                   NPC_AF_MCAMEX_BANKX_ACTION(index, bank),
+                                   NPC_AF_MCAMEX_BANKX_ACTION(entry, bank),
                                    rx_action);
                        if (enable)
                                npc_enable_mcam_entry(rvu, mcam, blkaddr,
-- 
2.14.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9401): 
https://lists.yoctoproject.org/g/linux-yocto/message/9401
Mute This Topic: https://lists.yoctoproject.org/mt/79974874/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to