Patch "octeontx2-af: fix infinite loop in unmapping NPC counter" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    octeontx2-af: fix infinite loop in unmapping NPC counter

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     octeontx2-af-fix-infinite-loop-in-unmapping-npc-coun.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 09862ed309ef9688ba8e841c7cc858a48b98954e
Author: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
Date:   Thu Mar 18 19:45:48 2021 +0530

    octeontx2-af: fix infinite loop in unmapping NPC counter
    
    [ Upstream commit 64451b98306bf1334a62bcd020ec92bdb4cb68db ]
    
    unmapping npc counter works in a way by traversing all mcam
    entries to find which mcam rule is associated with counter.
    But loop cursor variable 'entry' is not incremented before
    checking next mcam entry which resulting in infinite loop.
    
    This in turn hogs the kworker thread forever and no other
    mbox message is processed by AF driver after that.
    Fix this by updating entry value before checking next
    mcam entry.
    
    Fixes: a958dd59f9ce ("octeontx2-af: Map or unmap NPC MCAM entry and counter")
    Signed-off-by: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
    Signed-off-by: Sunil Kovvuri Goutham <sgoutham@xxxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index 15f70273e29c..d82a519a0cd9 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -1967,10 +1967,10 @@ int rvu_mbox_handler_npc_mcam_free_counter(struct rvu *rvu,
 		index = find_next_bit(mcam->bmap, mcam->bmap_entries, entry);
 		if (index >= mcam->bmap_entries)
 			break;
+		entry = index + 1;
 		if (mcam->entry2cntr_map[index] != req->cntr)
 			continue;
 
-		entry = index + 1;
 		npc_unmap_mcam_entry_and_cntr(rvu, mcam, blkaddr,
 					      index, req->cntr);
 	}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux