From patchwork Mon Aug 22 15:06:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12950728 X-Patchwork-Delegate: kuba@kernel.org 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 3F100C28D13 for ; Mon, 22 Aug 2022 15:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236019AbiHVPJ3 (ORCPT ); Mon, 22 Aug 2022 11:09:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236149AbiHVPJD (ORCPT ); Mon, 22 Aug 2022 11:09:03 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CF133E748 for ; Mon, 22 Aug 2022 08:07:10 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id g16so8031570qkl.11 for ; Mon, 22 Aug 2022 08:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc; bh=vhpY4khbia4ahavuPkAyUGmPuBQwq+sJnXfnnGjoPF4=; b=Dd5w1yoZWATmRq7hi09+qmWN/5czWyBxXLz+i9wRjCr3IFbGnwK8wLJ7VSNmmQHP6g zV8y31d727WMIjesZZVb8Cr+PRXf2gMHVb6nOiB+2G781qL4k0Wh5S6yfNNN0Jx8Ak+S 0AlmxUwHWZWEDnm5I7XlWElECiKdhiVh2zGNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc; bh=vhpY4khbia4ahavuPkAyUGmPuBQwq+sJnXfnnGjoPF4=; b=rw8TGNICokhbT8qxN0up7RyEdtOVfahyCDe2Ki3x9CqhSKssDnJiqWpNqIae3gf4M/ 3PsfS/BCgUuW+ESOH3E/78xFoApkso/86lXqaNEAu5U7+h7n7WMfnQ1s1554ZBPU5rkk yasA+FnoRJa3GYOz8WdUFeNoGZIuKaFiOD0bGKG32xZmea/T/TB7IUWF/vF6+u9tekni dcPDn/PKh53y9drFxWmnb1beVzK91ozUsE40DjgTr7qEM8QT1KKdTUQvNdCCJD/63mW9 FoUPD2OXk4RqQ+QA2kWIX8kupvs3hPfN/hZfh369W0VyUkDRxrcfZiVxbkk5nwDMRAfZ ioSQ== X-Gm-Message-State: ACgBeo1ftlWCtBVi/ciE82JFS5nEsnD6wwwt4j7MDlwvFtq/4RlLdNgP s+UIjdROkP7m2KLrr+C8GAiZsA== X-Google-Smtp-Source: AA6agR58g19yRJ/OecfUFdTSjtvuk33ThLP9hmXufqqvM8VqbUPfYoI0hBeVBw+FBTcgn9RMFr/k9Q== X-Received: by 2002:a05:620a:e15:b0:6bc:980:dbaf with SMTP id y21-20020a05620a0e1500b006bc0980dbafmr4290443qkm.315.1661180829221; Mon, 22 Aug 2022 08:07:09 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id f39-20020a05622a1a2700b00342f05defd1sm9380836qtb.66.2022.08.22.08.07.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2022 08:07:08 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, gospo@broadcom.com, Vikas Gupta Subject: [PATCH net 3/4] bnxt_en: fix NQ resource accounting during vf creation on 57500 chips Date: Mon, 22 Aug 2022 11:06:53 -0400 Message-Id: <1661180814-19350-4-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> References: <1661180814-19350-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta 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 --- 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 730febd19330..a4cba7cb2783 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -623,7 +623,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; }