Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp153473pxb; Mon, 13 Sep 2021 15:39:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcPb0CVDBTJtg/juqljSlxAqc9LuRnFYW39UAzEFORUKfPXz6V1sXtdjiZiGYWQpCZy1gj X-Received: by 2002:a02:9204:: with SMTP id x4mr11765213jag.45.1631572781567; Mon, 13 Sep 2021 15:39:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631572781; cv=none; d=google.com; s=arc-20160816; b=uX03w3AVGpv0euaZznSkaAhG8mIHhh+OQc2JTTZP2cEQqqIKhLpR7QovOJHdJa1T4R 0sMacB2EB965H2+7Pq/USHXDhiWuko5UEafuM9Rv4cfcOlLNj3v6wirCVDpldlchKIEq wf9GSQsG1+3llc3zPVi3eGvCehyPTJup6Ro3dolae86AZOl4Tz8ssRP+nJEE1Qcyma1z uQFmDLKU+8c27S73DCf3911lEwCt5UPJomoEMLW7X65CyCvW5ubCpeh0mUS97X54vlsZ nKeVmaETb+66XtlznrRx+ld2Kz7JxO4z+hu2NwuZyyhhsSnzSgUgmnyS5+5cpsIVa4hP FQHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XNBERf2K0PkP+Kc21T+etuUA1F6/Vk5c3EYRPfVSiQA=; b=rKZWO1j7GD1FkYGoZaC++D+vYHa7HORcyXrNxrQa2eaZ39iA9NcQjKq4bWtBUtQa58 ET9S9wcaNN8ky+6tM2+Xw1rhN6BpAV2cAktxq3lnq8BMZ+V904n6ySn10aUtIG3og8ZG lTSd91GuOmbirgcZtPrWcZ5BD/WsYPS9OIJ71ujWrY+7j7eO0OQBYSIKqi+hCdXwfJ3v Jr5nGC5KBstqssu4nT/9laFMvqScmvFAlGiMtY/tC08vGhzr6G7iqWKdA183LS97C0zt vnKLnkLmXuHO3WxTYU8WN/87d8uNSRP2gfn+4iaSc7n5v2vED42wWXb6sTi3JosRQUf4 xTMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PMHzi/Sx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si8180740ilc.170.2021.09.13.15.39.28; Mon, 13 Sep 2021 15:39:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PMHzi/Sx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345257AbhIMOQv (ORCPT + 99 others); Mon, 13 Sep 2021 10:16:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:37126 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243944AbhIMOOC (ORCPT ); Mon, 13 Sep 2021 10:14:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7880B6140D; Mon, 13 Sep 2021 13:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540600; bh=bF1kSNWdgEWd+b9+KRnjYqdWrfx+deOW6qC9Jl1vvxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PMHzi/Sx9fGQfyTPIcOAN2eMhyc1BbmFTxiV02O2MHoHTLynmDvB5JhHvz6ejkPAk gFzmrkZRS9j96f/xo6XBNhJvEpDzOQ4i/HgSz5G0t/XMw/PBShgxNt+hcEUvS25g3b c8OZp4fhZESnnu7DaHfttYjddAHINgjSyDEEIQ8U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Subbaraya Sundeep , Sunil Goutham , "David S. Miller" , Sasha Levin Subject: [PATCH 5.13 258/300] octeontx2-af: Fix loop in free and unmap counter Date: Mon, 13 Sep 2021 15:15:19 +0200 Message-Id: <20210913131118.057330178@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Subbaraya Sundeep [ 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 Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 0bc4529691ec..53ee1785c931 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -2567,10 +2567,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