From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
stable@dpdk.org, Cunming Liang <cunming.liang@intel.com>
Subject: [PATCH 1/4] net/i40e: fix VMDq Rx interrupt vector mapping
Date: Thu, 26 Nov 2026 13:29:05 +0000 [thread overview]
Message-ID: <20261126132909.3488716-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20261126132909.3488716-1-bruce.richardson@intel.com>
The interrupt vector list is indexed by ethdev queue ID, but the driver
derives the VMDq index from the hardware queue number. This can overwrite
a main VSI queue's vector entry and leave the VMDq queue's entry unset.
Enabling or disabling Rx interrupts can then target the wrong vector.
Pass the first ethdev queue ID for each VSI to the binding helper. VMDq
queues follow the main VSI queues in pool order, regardless of their
hardware queue numbers. Also propagate errors when recording queues
that share a vector.
Fixes: be6c228d4da3 ("i40e: support Rx interrupt")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/i40e/i40e_ethdev.c | 38 ++++++++++------------------
drivers/net/intel/i40e/i40e_ethdev.h | 2 +-
drivers/net/intel/i40e/i40e_fdir.c | 2 +-
drivers/net/intel/i40e/i40e_pf.c | 2 +-
4 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index 498c5c7ec4..5ea26c3348 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -1928,7 +1928,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,
}
int
-i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
+i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx, int ethdev_queue_base)
{
struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi);
struct rte_pci_device *pci_dev = RTE_CLASS_TO_BUS_DEVICE(dev, *pci_dev);
@@ -1937,8 +1937,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
uint16_t msix_vect = vsi->msix_intr;
uint16_t nb_msix = RTE_MIN(vsi->nb_msix,
rte_intr_nb_efd_get(intr_handle));
- uint16_t queue_idx = 0;
- int record = 0;
+ const bool record = ethdev_queue_base >= 0 && rte_intr_dp_is_en(intr_handle);
int i;
for (i = 0; i < vsi->nb_qps; i++) {
@@ -1959,18 +1958,6 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
}
/* PF & VMDq bind interrupt */
- if (rte_intr_dp_is_en(intr_handle)) {
- if (vsi->type == I40E_VSI_MAIN) {
- queue_idx = 0;
- record = 1;
- } else if (vsi->type == I40E_VSI_VMDQ2) {
- struct i40e_vsi *main_vsi =
- I40E_DEV_PRIVATE_TO_MAIN_VSI(vsi->adapter);
- queue_idx = vsi->base_queue - main_vsi->nb_qps;
- record = 1;
- }
- }
-
for (i = 0; i < vsi->nb_used_qps; i++) {
if (vsi->nb_msix == 0) {
PMD_DRV_LOG(ERR, "No msix resource");
@@ -1985,19 +1972,20 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
vsi->base_queue + i,
vsi->nb_used_qps - i,
itr_idx);
- for (; !!record && i < vsi->nb_used_qps; i++)
- rte_intr_vec_list_index_set(intr_handle,
- queue_idx + i, msix_vect);
+ for (; record && i < vsi->nb_used_qps; i++) {
+ if (rte_intr_vec_list_index_set(intr_handle,
+ ethdev_queue_base + i, msix_vect) != 0)
+ return -rte_errno;
+ }
break;
}
/* 1:1 queue/msix_vect mapping */
__vsi_queues_bind_intr(vsi, msix_vect,
vsi->base_queue + i, 1,
itr_idx);
- if (!!record)
- if (rte_intr_vec_list_index_set(intr_handle,
- queue_idx + i, msix_vect))
- return -rte_errno;
+ if (record && rte_intr_vec_list_index_set(intr_handle,
+ ethdev_queue_base + i, msix_vect) != 0)
+ return -rte_errno;
msix_vect++;
nb_msix--;
@@ -2245,7 +2233,7 @@ i40e_dev_start(struct rte_eth_dev *dev)
/* Map queues with MSIX interrupt */
main_vsi->nb_used_qps = dev->data->nb_rx_queues -
pf->nb_cfg_vmdq_vsi * RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;
- ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+ ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT, 0);
if (ret < 0)
return ret;
i40e_vsi_enable_queues_intr(main_vsi);
@@ -2253,8 +2241,8 @@ i40e_dev_start(struct rte_eth_dev *dev)
/* Map VMDQ VSI queues with MSIX interrupt */
for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
pf->vmdq[i].vsi->nb_used_qps = RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;
- ret = i40e_vsi_queues_bind_intr(pf->vmdq[i].vsi,
- I40E_ITR_INDEX_DEFAULT);
+ ret = i40e_vsi_queues_bind_intr(pf->vmdq[i].vsi, I40E_ITR_INDEX_DEFAULT,
+ main_vsi->nb_qps + i * pf->vmdq_nb_qps);
if (ret < 0)
return ret;
i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
diff --git a/drivers/net/intel/i40e/i40e_ethdev.h b/drivers/net/intel/i40e/i40e_ethdev.h
index e5e136f554..93cb8e6bac 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.h
+++ b/drivers/net/intel/i40e/i40e_ethdev.h
@@ -1368,7 +1368,7 @@ void i40e_update_vsi_stats(struct i40e_vsi *vsi);
void i40e_pf_disable_irq0(struct i40e_hw *hw);
void i40e_pf_enable_irq0(struct i40e_hw *hw);
int i40e_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete);
-int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx);
+int i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx, int ethdev_queue_base);
void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
void i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi);
int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
diff --git a/drivers/net/intel/i40e/i40e_fdir.c b/drivers/net/intel/i40e/i40e_fdir.c
index 69b3b763ba..d71d20389f 100644
--- a/drivers/net/intel/i40e/i40e_fdir.c
+++ b/drivers/net/intel/i40e/i40e_fdir.c
@@ -219,7 +219,7 @@ i40e_fdir_setup(struct i40e_pf *pf)
/* enable FDIR MSIX interrupt */
vsi->nb_used_qps = 1;
- i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE);
+ i40e_vsi_queues_bind_intr(vsi, I40E_ITR_INDEX_NONE, -1);
i40e_vsi_enable_queues_intr(vsi);
/* reserve memory for the fdir programming packet */
diff --git a/drivers/net/intel/i40e/i40e_pf.c b/drivers/net/intel/i40e/i40e_pf.c
index c76e035a42..1f816bd1f7 100644
--- a/drivers/net/intel/i40e/i40e_pf.c
+++ b/drivers/net/intel/i40e/i40e_pf.c
@@ -693,7 +693,7 @@ i40e_pf_host_process_cmd_config_irq_map(struct i40e_pf_vf *vf,
* Link all VF RX queues together. Only did mapping work.
* VF can disable/enable the intr by itself.
*/
- i40e_vsi_queues_bind_intr(vf->vsi, itr_idx);
+ i40e_vsi_queues_bind_intr(vf->vsi, itr_idx, -1);
goto send_msg;
}
--
2.55.0
next prev parent reply other threads:[~2026-11-26 13:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 13:29 [PATCH 0/4] net/i40e: fix interrupt support Bruce Richardson
2026-11-26 13:29 ` Bruce Richardson [this message]
2026-11-26 13:29 ` [PATCH 2/4] net/i40e: handle Rx interrupt vector lookup errors Bruce Richardson
2026-11-26 13:29 ` [PATCH 3/4] net/i40e: disallow interrupt support in secondaries Bruce Richardson
2026-11-26 13:29 ` [PATCH 4/4] net/i40e: fix Rx desc write-back with interrupts disabled Bruce Richardson
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=20261126132909.3488716-2-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=cunming.liang@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox