Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3490633pxf; Mon, 29 Mar 2021 03:51:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuXsOANJRRgLmg2Wj5T1z5RiVQkLvnCgP8rhyyJHQWYKam2uJipAZo4JFv7BFtOaV7lvtg X-Received: by 2002:a05:6402:6ca:: with SMTP id n10mr28261605edy.312.1617015062483; Mon, 29 Mar 2021 03:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617015062; cv=none; d=google.com; s=arc-20160816; b=Zr8bRsT8p0cjm2l661m+hAs869Kfxyds6GGQ00QcCyu5M93wZYsbaEOabSr1rLAmYB e/AEekS0jbRbxwzhwzmAZw9tbhTEFTpuiN87B7jfw+tsNPH3waqL577KZsfBZfzGVy/0 CEF9jySDwFBdU6Rx3YzuZsWSotMOhIqoiL96jIns2n3YcR0TcQfrD6w51baRG/6RIZBL gyct8OxQ0Wyr+UeaGg/LHZi6eIPAr8m02URSyQrxOIpvhq7woGBLNi0JuIIBGp1E3G8n 88azx0xIfe0VOoFDmYu2Nh3rTwfdTRxShot420oaUG4NbAqtYZiIebdLp5Gw5sfZ0Jpb CLfQ== 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=rGgvsS1SKfBSFQpplEVgpD30VOG3XTu5PvCJWhOwSoc=; b=dn/S64cNfjeJ8EZNVPFAH7a00ZrKZOib6+B6CSEiGAjstCXPcB7Q2gD5ZYh47A8Wuv REvPGS69bIHjtdIx+b+2cj3umJg/c2yo0BIgZcmxPgx+N7PMuaAtCtgWDo5FXAa78xbB Ub3m1jiAyxcuwRcq02RHPIHimFIj2Qb5ATFD/zv3tWCsahp35pF3nlVZXJB/hpV7s4ps dYeX3AJsHxeFsNRo0pOaVRkKgZ/8U8lA7Jqmhoi6D7O177hK5syu81QSU8oiBbAGYxge R8TDgPhgPoLrH8Xn5dqH9GIbYK4sWha5yJJxzm3Zn5K5Dzl3f4+KA3yTS9fj03ER82Wx tOCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xVhcIRQi; 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 v25si12518401eju.48.2021.03.29.03.50.40; Mon, 29 Mar 2021 03:51:02 -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=xVhcIRQi; 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 S234427AbhC2IjK (ORCPT + 99 others); Mon, 29 Mar 2021 04:39:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:40608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231806AbhC2IXU (ORCPT ); Mon, 29 Mar 2021 04:23:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9FFDD619CF; Mon, 29 Mar 2021 08:23:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006200; bh=drVuqeO6EH03hFK4B3qDi0ktNDzprxhN07ztrzp0zHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xVhcIRQi9B3ZQpuV5Wq2iQEWU8lPLCA53QorV4XX8CAIqM3Fyvp9rJH36gViUeM06 RcOvv1tnHnfwwmWb0DW2IQywxS4YOaMnz/0iGxrVfwgpotLgJ4XOFcKoz1RgAs8b5n iIVJgB5wLjrCuUzc9f+C9oRMpljV845qFFH/Oz+8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hariprasad Kelam , Sunil Kovvuri Goutham , "David S. Miller" , Sasha Levin Subject: [PATCH 5.10 155/221] octeontx2-af: fix infinite loop in unmapping NPC counter Date: Mon, 29 Mar 2021 09:58:06 +0200 Message-Id: <20210329075634.334220868@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Hariprasad Kelam [ 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 Signed-off-by: Sunil Kovvuri Goutham Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 2 +- 1 file changed, 1 insertion(+), 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 511b01dd03ed..169ae491f978 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -2035,10 +2035,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); } -- 2.30.1