netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: libwx: fix alloc msix vectors failed
@ 2024-04-18  2:15 Duanqiang Wen
  2024-04-19 10:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Duanqiang Wen @ 2024-04-18  2:15 UTC (permalink / raw)
  To: netdev, jiawenwu, mengyuanlou, davem, edumazet, kuba, pabeni,
	linyunsheng
  Cc: Duanqiang Wen

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: 3f703186113f ("net: libwx: Add irq flow functions")
Signed-off-by: Duanqiang Wen <duanqiangwen@net-swift.com>
---
 drivers/net/ethernet/wangxun/libwx/wx_lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
index 6dff2c85682d..6fae161cbcb8 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -1598,7 +1598,7 @@ static void wx_set_num_queues(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;
 
 	/* We start by asking for one vector per queue pair */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: libwx: fix alloc msix vectors failed
  2024-04-18  2:15 [PATCH net] net: libwx: fix alloc msix vectors failed Duanqiang Wen
@ 2024-04-19 10:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-19 10:30 UTC (permalink / raw)
  To: Duanqiang Wen
  Cc: netdev, jiawenwu, mengyuanlou, davem, edumazet, kuba, pabeni,
	linyunsheng

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 18 Apr 2024 10:15:56 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net] net: libwx: fix alloc msix vectors failed
    https://git.kernel.org/netdev/net/c/69197dfc6400

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-19 10:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-18  2:15 [PATCH net] net: libwx: fix alloc msix vectors failed Duanqiang Wen
2024-04-19 10:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).