Index | Thread | Search

From:
Yuichiro NAITO <naito.yuichiro@gmail.com>
Subject:
iavf(4): multiqueues support
To:
tech@openbsd.org
Date:
Fri, 26 Jul 2024 18:30:04 +0900

Download raw body.

Thread
Hi, when I use an iavf interface on an OpenBSD virtual machine with ESXi,
iavf(4) fails to attach and doesn't works for me.

```
iavf0 at pci11 dev 0 function 0 "Intel XL710/X710 VF" rev 0x01, VF version 1.1, VF 0 VSI 19config irq map failed: -5
, msix, address 00:0c:29:a2:be:07
```

The message shows that the IRQ mapping request results in an error code -5
(IAVF_VC_RC_ERR_PARAM). The 'iavf_config_irq_map' function in the driver
sets one IRQ for the admin queue and tx/rx queue. This is a different
number of queues from the msix interrupt counts. The PF (Primary Function)
driver of the ESXi doesn't allow a signle IRQ request. With the Linux PF
driver, it won't be a problem, a signle IRQ request is allowed.

So, let's get start supporting multiqueue for the iavf drvier. We have a
chance to run iavf(4) with ESXi and improve receive side performance both
on Linux and ESXi.

My first patch is so simple that fixes bitmap calculation of 'iavf_allqueues'
macro. It is calculated from the number of queues that should be returned
from 'iavf_nqueues' macro.

OK?

diff --git a/sys/dev/pci/if_iavf.c b/sys/dev/pci/if_iavf.c
index d573d6725f4..938d9b39db4 100644
--- a/sys/dev/pci/if_iavf.c
+++ b/sys/dev/pci/if_iavf.c
@@ -717,7 +717,7 @@ static const struct iavf_aq_regs iavf_aq_regs = {
 	iavf_wr((_s), I40E_VFINT_ICR0_ENA1, I40E_VFINT_ICR0_ENA1_ADMINQ_MASK)
 
 #define iavf_nqueues(_sc)	(1 << (_sc)->sc_nqueues)
-#define iavf_allqueues(_sc)	((1 << ((_sc)->sc_nqueues+1)) - 1)
+#define iavf_allqueues(_sc)	((1 << (iavf_nqueues(_sc))) - 1)
 
 #ifdef __LP64__
 #define iavf_dmamem_hi(_ixm)	(uint32_t)(IAVF_DMA_DVA(_ixm) >> 32)


-- 
Yuichiro NAITO (naito.yuichiro@gmail.com)