Commit 69197dfc authored by Duanqiang Wen's avatar Duanqiang Wen Committed by David S. Miller

net: libwx: fix alloc msix vectors failed

driver needs queue msix vectors and one misc irq vector,
but only queue vectors need irq affinity.
when num_online_cpus is less than chip max msix vectors,
driver will acquire (num_online_cpus + 1) vecotrs, and
call pci_alloc_irq_vectors_affinity functions with affinity
params without setting pre_vectors or post_vectors, it will
cause return error code -ENOSPC.
Misc irq vector is vector 0, driver need to set affinity params
.pre_vectors = 1.

Fixes: 3f703186 ("net: libwx: Add irq flow functions")
Signed-off-by: default avatarDuanqiang Wen <duanqiangwen@net-swift.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7586c850
...@@ -1598,7 +1598,7 @@ static void wx_set_num_queues(struct wx *wx) ...@@ -1598,7 +1598,7 @@ static void wx_set_num_queues(struct wx *wx)
*/ */
static int wx_acquire_msix_vectors(struct wx *wx) static int wx_acquire_msix_vectors(struct wx *wx)
{ {
struct irq_affinity affd = {0, }; struct irq_affinity affd = { .pre_vectors = 1 };
int nvecs, i; int nvecs, i;
/* We start by asking for one vector per queue pair */ /* We start by asking for one vector per queue pair */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment