From nobody Sun Sep 7 12:18:19 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E844C6FA82 for ; Fri, 2 Sep 2022 12:42:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237180AbiIBMmH (ORCPT ); Fri, 2 Sep 2022 08:42:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237173AbiIBMkc (ORCPT ); Fri, 2 Sep 2022 08:40:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68ADAE68C6; Fri, 2 Sep 2022 05:31:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 07CA5B82A9B; Fri, 2 Sep 2022 12:29:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B10AC433D6; Fri, 2 Sep 2022 12:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1662121779; bh=ra/Uw8WmSXQfY+fMpLEKrLdp7DcB7dUfee/hSdOc/sc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rFYiwa/gVl1HeFpFDOvuPKbDs+dM9Ws1JF1lHhm/23QHyzPJP5byls2I2zALviarR 200irtTrWrJQArRcHwndksDibgAjv6Vl7W4d9Wyr9RZKmLyi6zgj9DDIiq+sTfnMf5 cnCSy22fi50bRO5QlkqpOYsIQv3U/mYdCkZL5pZQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vikas Gupta , Michael Chan , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 21/77] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Date: Fri, 2 Sep 2022 14:18:30 +0200 Message-Id: <20220902121404.354208596@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220902121403.569927325@linuxfoundation.org> References: <20220902121403.569927325@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Vikas Gupta [ Upstream commit 09a89cc59ad67794a11e1d3dd13c5b3172adcc51 ] There are 2 issues: 1. We should decrement hw_resc->max_nqs instead of hw_resc->max_irqs with the number of NQs assigned to the VFs. The IRQs are fixed on each function and cannot be re-assigned. Only the NQs are being assigned to the VFs. 2. vf_msix is the total number of NQs to be assigned to the VFs. So we should decrement vf_msix from hw_resc->max_nqs. Fixes: b16b68918674 ("bnxt_en: Add SR-IOV support for 57500 chips.") Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/= ethernet/broadcom/bnxt/bnxt_sriov.c index 452be9749827a..3434ad6824a05 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -597,7 +597,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, = int num_vfs, bool reset) hw_resc->max_stat_ctxs -=3D le16_to_cpu(req.min_stat_ctx) * n; hw_resc->max_vnics -=3D le16_to_cpu(req.min_vnics) * n; if (bp->flags & BNXT_FLAG_CHIP_P5) - hw_resc->max_irqs -=3D vf_msix * n; + hw_resc->max_nqs -=3D vf_msix; =20 rc =3D pf->active_vfs; } --=20 2.35.1