Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3054546rwe; Mon, 29 Aug 2022 05:13:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR4MEAa7GSPuJ6JWfgRicajownSN0RmiwXstK1aDF+4dND2u1l4PCSoBYqV7Ip3wH4bZRYth X-Received: by 2002:a17:907:d0f:b0:731:5c2:a9a5 with SMTP id gn15-20020a1709070d0f00b0073105c2a9a5mr12818761ejc.413.1661775184276; Mon, 29 Aug 2022 05:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775184; cv=none; d=google.com; s=arc-20160816; b=0oL1CjvMJkuPS1bygZ5yu/rGJYaO7WgOKPXrA1BIAJEH9aAju6++jQQ7QVsrQ88v4Q VAfQcwTGKa0wgwdOvw8v6zp8e/UyN2Cxo2sj9wdopKbO4sK6MDlnOsklY0HptmR+hIDq CNJX5YbKgAMS53dzK8L/+2l0OxBZ8rjdJWlMrv2tgPCyudvl1y5VevxGpRUgXN6ESdaq zX1K9fgcc35xAoHtA7fNgNw05JMTXEyHIjsDkcvb+3O7WsXgY+ywFF7JyiRgq8taxNNr tUcMtn3T0qRYdwXZ0lC2/9ltKziNbuR14HVEgL6FEZKmiulFnoOa4Zo3LtVQVgn0xtJm eI5Q== 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=VtODscIPPU4uPn+jgBMFcNmv25Ony+/OUq033H1FgdM=; b=W84dUwUxHQWwC27WwlnTF7/SAGKBKwXqemGjLahlJn2t/WtOULZn9OjqPMEGgCrZla F1Rhs0Br8KHqb9s4nxIxnyGa28xtHqSfBnFlXacEmjImaHsNJVlshEW0vV26EVclGtmR VKI9ub+XZxh0wsohtk3ojtymVvJj+FLBoWzci7UioZj1q+rUf72kf+UwjoiyXT3bH/b8 YzYO97EcZ6uhKKxmiuwCFqJe4UxUKSHe+ex8453KehJImFYWA/1h7C+ZkxPFRQ4OMWPo WjX2FIGajqmcXq6OAjps1u/+K6p674EjD215/E7Ewm7lTFXF1FgvqQMCu7AgbkgRMkVq Ltrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aFzLzp57; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020a1709064bd300b0073dced7204bsi5347259ejv.767.2022.08.29.05.12.37; Mon, 29 Aug 2022 05:13:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aFzLzp57; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230359AbiH2LM0 (ORCPT + 99 others); Mon, 29 Aug 2022 07:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbiH2LLz (ORCPT ); Mon, 29 Aug 2022 07:11:55 -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 042C36BD6F; Mon, 29 Aug 2022 04:08:22 -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 F0BFFB80EFE; Mon, 29 Aug 2022 11:05:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43F29C433D6; Mon, 29 Aug 2022 11:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771147; bh=iNS9lmGg7cs0ns3adudyXzKIqRSAekCu57/qbPqQYDc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aFzLzp57ToYjkc/0O8Lxwhm8IUc6sESRoFHxU4W4UI7oJJvqdDg3uV6KXXaHCWOaC Jh4xu6jwVX3BqHBRkFSOQXwc2eCvNQp/8hyeE4L6iQ5kF8CZdr3UQfbJlFW9pVVkDz VtA1zPfkSPhBv94R5cvC5MWPnK2yDacCzq1HmhQI= 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.10 31/86] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Date: Mon, 29 Aug 2022 12:58:57 +0200 Message-Id: <20220829105757.828198418@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105756.500128871@linuxfoundation.org> References: <20220829105756.500128871@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 23b80aa171dd0..819f9df9425c6 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -599,7 +599,7 @@ static int bnxt_hwrm_func_vf_resc_cfg(struct bnxt *bp, int num_vfs, bool reset) hw_resc->max_stat_ctxs -= le16_to_cpu(req.min_stat_ctx) * n; hw_resc->max_vnics -= le16_to_cpu(req.min_vnics) * n; if (bp->flags & BNXT_FLAG_CHIP_P5) - hw_resc->max_irqs -= vf_msix * n; + hw_resc->max_nqs -= vf_msix; rc = pf->active_vfs; } -- 2.35.1