lkml.org 
[lkml]   [2021]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.10 211/236] octeontx2-af: Fix loop in free and unmap counter
    Date
    From: Subbaraya Sundeep <sbhatta@marvell.com>

    [ Upstream commit 6537e96d743b89294b397b4865c6c061abae31b0 ]

    When the given counter does not belong to the entry
    then code ends up in infinite loop because the loop
    cursor, entry is not getting updated further. This
    patch fixes that by updating entry for every iteration.

    Fixes: a958dd59f9ce ("octeontx2-af: Map or unmap NPC MCAM entry and counter")
    Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
    Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
    index 169ae491f978..7767b1111944 100644
    --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
    +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
    @@ -2081,10 +2081,11 @@ int rvu_mbox_handler_npc_mcam_unmap_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);
    }
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-09-13 15:52    [W:3.988 / U:1.604 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site