[v2] net/iavf: fix vertor interrupt number configuration error
diff mbox series

Message ID 1553236034-45852-1-git-send-email-wei.zhao1@intel.com
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series
  • [v2] net/iavf: fix vertor interrupt number configuration error
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Zhao1, Wei March 22, 2019, 6:27 a.m. UTC
There is a issue when iavf do vertor interrupt configuration,
it will miss one interrupt vector which set admin queue interrupt
when communicate with host PF. The AVF driver needs to send an
extra vector number to the Linux PF to work around an issue with
interrupt vector mapping. The admin queue needs to be added
to the number of queues sent to the PF. This patch also set tx
queue interrupt vector as a work around, but it maybe cause tx
function receive interrupt in some scenario.

Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

---

v2:
update git log and add new work around
---
 drivers/net/iavf/iavf_ethdev.c |  6 +++---
 drivers/net/iavf/iavf_vchnl.c  | 10 ++++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

Patch
diff mbox series

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 846e604..e8582f6 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -308,7 +308,7 @@  static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 	if (!dev->data->dev_conf.intr_conf.rxq ||
 	    !rte_intr_dp_is_en(intr_handle)) {
 		/* Rx interrupt disabled, Map interrupt only for writeback */
-		vf->nb_msix = 1;
+		vf->nb_msix = 2;
 		if (vf->vf_res->vf_cap_flags &
 		    VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
 			/* If WB_ON_ITR supports, enable it */
@@ -338,7 +338,7 @@  static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 			vf->rxq_map[vf->msix_base] |= 1 << i;
 	} else {
 		if (!rte_intr_allow_others(intr_handle)) {
-			vf->nb_msix = 1;
+			vf->nb_msix = 2;
 			vf->msix_base = IAVF_MISC_VEC_ID;
 			for (i = 0; i < dev->data->nb_rx_queues; i++) {
 				vf->rxq_map[vf->msix_base] |= 1 << i;
@@ -352,7 +352,7 @@  static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 			 * multi interrupts, then the vec is from 1
 			 */
 			vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
-					      intr_handle->nb_efd);
+					      intr_handle->nb_efd + 1);
 			vf->msix_base = IAVF_RX_VEC_START;
 			vec = IAVF_RX_VEC_START;
 			for (i = 0; i < dev->data->nb_rx_queues; i++) {
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..b6c55e5 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -609,15 +609,21 @@  iavf_config_irq_map(struct iavf_adapter *adapter)
 		return -ENOMEM;
 
 	map_info->num_vectors = vf->nb_msix;
-	for (i = 0; i < vf->nb_msix; i++) {
+	for (i = 0; i < vf->nb_msix - 1; i++) {
 		vecmap = &map_info->vecmap[i];
 		vecmap->vsi_id = vf->vsi_res->vsi_id;
 		vecmap->rxitr_idx = IAVF_ITR_INDEX_DEFAULT;
 		vecmap->vector_id = vf->msix_base + i;
-		vecmap->txq_map = 0;
 		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
+		vecmap->txq_map = vecmap->rxq_map;
 	}
 
+	vecmap = &map_info->vecmap[i];
+	vecmap->vsi_id = vf->vsi_res->vsi_id;
+	vecmap->vector_id = 0;
+	vecmap->txq_map = 0;
+	vecmap->rxq_map = 0;
+
 	args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP;
 	args.in_args = (u8 *)map_info;
 	args.in_args_size = len;