Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp77106pxb; Mon, 13 Sep 2021 13:24:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRzcQMes7OS/1253sUXtkKzjNwVp0ZMGXp9QSLigk5Xe872AOZN7DS9xpWGY8d4li3mfa1 X-Received: by 2002:a05:6402:222b:: with SMTP id cr11mr15399529edb.392.1631564643389; Mon, 13 Sep 2021 13:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631564643; cv=none; d=google.com; s=arc-20160816; b=DG9ufKItqeCUccEB3PX3bzZxCHtxp8ERT/ZwQ9ZWgh0eZNC1BCjZ/WvV1nqe+/K8WX VrCwxRvx4n6g7h5ics5GO2zujMBqTcLcXKXnMr1Kn10Y1FsuDu9lZ4qF12eodbO3IFWo HNYN5MNVrCl3BxkGjS1yPGFTBF2me9v7tdOP+5NG16xzIu4wNJifngX7KTvWvIez2ePB AypzqrXHBNJUrLW8I+TrFPrCCc0KsF1tefpkWcZg7JBKeJrcCx8do31NyepfUYiwPAeO 9k0UFBAlyDjXX1AeQ4naTBaEJ+i5kwwNeyyASms1Y1Jwm3QeYRhZgNSGkpbl9/AeW8LY Zgwg== 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=P5VF7EijXCM1oHzqQ5ekqVwT8UkKr5UyMTT8bQXzy/w=; b=ahmJ5pcT2RNFeZvhFfibvbl9Kk+l2WPjbgNG0PjYAb0NQIiqqn2sKyy1HreuUV6EgO w4brKhzKtYdl5VfTPXjAYXuytO9ZoFTaXo97acY/ZoaLXCTwL+FSeaN7C5Z2Y5kxPwRE 6L1f8nuIbUJ7mpWc6N7NrZ3Fvuglmhc6c4an9CRZD4Fd//+oZBVOLPKtaXgRcxS7Zcz9 bQxXyPtaLxKredLlZVjpsfIw0Meuw+a72i/Yg0Sk0XT59k344nL2NJHetS510Jbzk1o7 2KQJBsPbY3IVmgA8+5bWEPA4HMINVgMdgnhJWbm4s7lYDFRvzHJG2fFdONuI/EkLcXnO OzLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nRKviDp4; 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 l24si8687662edw.288.2021.09.13.13.23.39; Mon, 13 Sep 2021 13:24:03 -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=nRKviDp4; 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 S244334AbhIMNxC (ORCPT + 99 others); Mon, 13 Sep 2021 09:53:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:56742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244520AbhIMNtd (ORCPT ); Mon, 13 Sep 2021 09:49:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 532F7615A7; Mon, 13 Sep 2021 13:33:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539989; bh=THjmkN4IrmEmXAnjmVwMBcNKVGzPoxjWTK/k6RcvrOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nRKviDp4+yJ6Jo2wwZ6TYxS9bNelJqZcoW3Dm4luE1/HHJjDNmLfNn/KfVcytexnh xrQdsb6isvl7FjhCrZ+IOO8diCyd8mriIRUGhoRul5tQ9weT6ibdnUBQgdwVSxkQP7 Xf16DCrH4o6EDtwTvisQpUhiTPvD1U/whiTeCgGY= 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.10 211/236] octeontx2-af: Fix loop in free and unmap counter Date: Mon, 13 Sep 2021 15:15:16 +0200 Message-Id: <20210913131107.551684345@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 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