From: Arthur Kepner <akepner@sgi.com>
To: netdev@vger.kernel.org
Subject: [PATCH] mlx4_core: module param to limit msix vec allocation
Date: Thu, 26 Aug 2010 10:06:46 -0700 [thread overview]
Message-ID: <20100826170646.GB27157@sgi.com> (raw)
(Resending to netdev. Previously sent to linux-rdma)
The mlx4_core driver allocates 'nreq' msix vectors (and irqs),
where:
nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
num_possible_cpus() + 1);
ConnectX HCAs support 512 event queues (4 reserved). On a system
with enough processors, we get:
mlx4_core 0006:01:00.0: Requested 508 vectors, but only 256 MSI-X vectors available, trying again
Further attempts (by other drivers) to allocate interrupts fail,
because mlx4_core got 'em all.
Use a module parameter to limit the number of MSI-X vectors that
the mlx4_core driver will attempt to allocate.
Signed-off-by: Arthur Kepner <akepner@sgi.com>
---
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 5102ab1..3eba2f3 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -68,6 +68,10 @@ static int msi_x = 1;
module_param(msi_x, int, 0444);
MODULE_PARM_DESC(msi_x, "attempt to use MSI-X if nonzero");
+static int max_msi_x_vec = 64;
+module_param(max_msi_x_vec, int, 0444);
+MODULE_PARM_DESC(max_msi_x_vec, "max MSI-X vectors we'll attempt to allocate");
+
#else /* CONFIG_PCI_MSI */
#define msi_x (0)
@@ -968,8 +972,10 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
int i;
if (msi_x) {
+ nreq = min_t(int, num_possible_cpus() + 1, max_msi_x_vec);
nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
- num_possible_cpus() + 1);
+ nreq);
+
entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
if (!entries)
goto no_msi;
next reply other threads:[~2010-08-26 17:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 17:06 Arthur Kepner [this message]
2010-08-26 19:24 ` [PATCH] mlx4_core: module param to limit msix vec allocation David Miller
2010-09-03 20:30 ` Arthur Kepner
2010-09-03 21:46 ` David Miller
2010-09-03 22:13 ` Arthur Kepner
2010-09-04 2:30 ` David Miller
2010-09-06 17:42 ` Arthur Kepner
2010-09-06 19:51 ` David Miller
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=20100826170646.GB27157@sgi.com \
--to=akepner@sgi.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.