From: Michael Chan <michael.chan@broadcom•com>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, edumazet@google•com, kuba@kernel•org,
pabeni@redhat•com, pavan.chebbi@broadcom•com,
andrew.gospodarek@broadcom•com,
Hongguang Gao <hongguang.gao@broadcom•com>,
Somnath Kotur <somnath.kotur@broadcom•com>
Subject: [PATCH net-next 8/9] bnxt_en: Allocate the max bp->irq_tbl size for dynamic msix allocation
Date: Sat, 13 Jul 2024 16:43:38 -0700 [thread overview]
Message-ID: <20240713234339.70293-9-michael.chan@broadcom.com> (raw)
In-Reply-To: <20240713234339.70293-1-michael.chan@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1561 bytes --]
If dynamic MSIX allocation is supported, additional MSIX can be
allocated at run-time without reinitializing the existing MSIX entries.
The first step to support this dynamic scheme is to alloacte a large
enough bp->irq_tbl if dynamic allocation is supported.
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom•com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom•com>
Signed-off-by: Michael Chan <michael.chan@broadcom•com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index c0695a06744d..7483ea246c9d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10697,7 +10697,7 @@ static int bnxt_get_num_msix(struct bnxt *bp)
static int bnxt_init_int_mode(struct bnxt *bp)
{
- int i, total_vecs, max, rc = 0, min = 1, ulp_msix, tx_cp;
+ int i, total_vecs, max, rc = 0, min = 1, ulp_msix, tx_cp, tbl_size;
total_vecs = bnxt_get_num_msix(bp);
max = bnxt_get_max_func_irqs(bp);
@@ -10718,7 +10718,10 @@ static int bnxt_init_int_mode(struct bnxt *bp)
goto msix_setup_exit;
}
- bp->irq_tbl = kcalloc(total_vecs, sizeof(struct bnxt_irq), GFP_KERNEL);
+ tbl_size = total_vecs;
+ if (pci_msix_can_alloc_dyn(bp->pdev))
+ tbl_size = max;
+ bp->irq_tbl = kcalloc(tbl_size, sizeof(struct bnxt_irq), GFP_KERNEL);
if (bp->irq_tbl) {
for (i = 0; i < total_vecs; i++)
bp->irq_tbl[i].vector = pci_irq_vector(bp->pdev, i);
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2024-07-13 23:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-13 23:43 [PATCH net-next 0/9] bnxt_en: Update for net-next Michael Chan
2024-07-13 23:43 ` [PATCH net-next 1/9] bnxt_en: add support for storing crash dump into host memory Michael Chan
2024-07-15 9:28 ` Simon Horman
2024-07-13 23:43 ` [PATCH net-next 2/9] bnxt_en: add support for retrieving crash dump using ethtool Michael Chan
2024-07-15 9:28 ` Simon Horman
2024-07-13 23:43 ` [PATCH net-next 3/9] bnxt_en: Support QOS and TPID settings for the SRIOV VLAN Michael Chan
2024-07-15 9:17 ` Simon Horman
2024-07-13 23:43 ` [PATCH net-next 4/9] bnxt_en: Deprecate support for legacy INTX mode Michael Chan
2024-07-15 9:28 ` Simon Horman
2024-07-15 16:24 ` Michael Chan
2024-07-16 16:57 ` Dan Carpenter
2024-07-16 17:28 ` Michael Chan
2024-07-13 23:43 ` [PATCH net-next 5/9] bnxt_en: Remove BNXT_FLAG_USING_MSIX flag Michael Chan
2024-07-15 9:29 ` Simon Horman
2024-07-15 17:32 ` Bjorn Helgaas
2024-07-15 18:00 ` Michael Chan
2024-07-13 23:43 ` [PATCH net-next 6/9] bnxt_en: Remove register mapping to support INTX Michael Chan
2024-07-15 9:30 ` Simon Horman
2024-07-15 17:27 ` Bjorn Helgaas
2024-07-13 23:43 ` [PATCH net-next 7/9] bnxt_en: Replace deprecated PCI MSIX APIs Michael Chan
2024-07-15 9:30 ` Simon Horman
2024-07-13 23:43 ` Michael Chan [this message]
2024-07-15 9:30 ` [PATCH net-next 8/9] bnxt_en: Allocate the max bp->irq_tbl size for dynamic msix allocation Simon Horman
2024-07-15 17:33 ` Bjorn Helgaas
2024-07-13 23:43 ` [PATCH net-next 9/9] bnxt_en: Support dynamic MSIX Michael Chan
2024-07-15 9:31 ` Simon Horman
2024-07-15 17:34 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240713234339.70293-9-michael.chan@broadcom.com \
--to=michael.chan@broadcom$(echo .)com \
--cc=andrew.gospodarek@broadcom$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=hongguang.gao@broadcom$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=pavan.chebbi@broadcom$(echo .)com \
--cc=somnath.kotur@broadcom$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox