* [dpdk-dev] [PATCH] net/i40e: fixed multi-queue Rx interrupt for VF
@ 2020-01-10 8:35 Lunyuan Cui
2020-01-14 2:04 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui
2020-01-14 6:25 ` [dpdk-dev] [PATCH v3] net/i40e: fix " Lunyuan Cui
0 siblings, 2 replies; 3+ messages in thread
From: Lunyuan Cui @ 2020-01-10 8:35 UTC (permalink / raw)
To: dev; +Cc: Qiming Yang, Lunyuan Cui
The value of vectors bound to each queue could not large than
the max usable vector. It will let devices start failed.
This patch fixed this issue.
Fixes: 5b8d2d89dd99 (net/i40e: enable multi-queue Rx interrupt for VF)
Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
drivers/net/i40e/i40e_ethdev_vf.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 479f8282c..d514e8991 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -657,7 +657,6 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
uint32_t vector_id;
int i, err;
- uint16_t nb_msix;
if (dev->data->dev_conf.intr_conf.rxq != 0 &&
rte_intr_allow_others(intr_handle))
@@ -665,9 +664,6 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
else
vector_id = I40E_MISC_VEC_ID;
- nb_msix = RTE_MIN(vf->vf_res->max_vectors,
- intr_handle->nb_efd);
-
map_info = (struct virtchnl_irq_map_info *)cmd_buffer;
map_info->num_vectors = dev->data->nb_rx_queues;
for (i = 0; i < dev->data->nb_rx_queues; i++) {
@@ -682,7 +678,7 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
intr_handle->intr_vec[i] = vector_id;
if (vector_id > I40E_MISC_VEC_ID)
vector_id++;
- if (vector_id > nb_msix)
+ if (vector_id >= vf->vf_res->max_vectors)
vector_id = I40E_RX_VEC_START;
}
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH v2] net/i40e: fixed multi-queue Rx interrupt for VF
2020-01-10 8:35 [dpdk-dev] [PATCH] net/i40e: fixed multi-queue Rx interrupt for VF Lunyuan Cui
@ 2020-01-14 2:04 ` Lunyuan Cui
2020-01-14 6:25 ` [dpdk-dev] [PATCH v3] net/i40e: fix " Lunyuan Cui
1 sibling, 0 replies; 3+ messages in thread
From: Lunyuan Cui @ 2020-01-14 2:04 UTC (permalink / raw)
To: dev; +Cc: Qiming Yang, Lunyuan Cui
The value of vectors bound to each queue could not large
than the max usable vector. It will let devices start failed.
vf->vf_res->max_vectors is equal to the max vector number.
intr_handle->nb_efd is equal to queue number. Whichever one is
less, it is no need to check intr_handle->nb_efd when we keep
vector value less than vector number.
This patch fixed this issue.
Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
v2:
- Change commit message
---
drivers/net/i40e/i40e_ethdev_vf.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 479f8282c..d514e8991 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -657,7 +657,6 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
uint32_t vector_id;
int i, err;
- uint16_t nb_msix;
if (dev->data->dev_conf.intr_conf.rxq != 0 &&
rte_intr_allow_others(intr_handle))
@@ -665,9 +664,6 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
else
vector_id = I40E_MISC_VEC_ID;
- nb_msix = RTE_MIN(vf->vf_res->max_vectors,
- intr_handle->nb_efd);
-
map_info = (struct virtchnl_irq_map_info *)cmd_buffer;
map_info->num_vectors = dev->data->nb_rx_queues;
for (i = 0; i < dev->data->nb_rx_queues; i++) {
@@ -682,7 +678,7 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
intr_handle->intr_vec[i] = vector_id;
if (vector_id > I40E_MISC_VEC_ID)
vector_id++;
- if (vector_id > nb_msix)
+ if (vector_id >= vf->vf_res->max_vectors)
vector_id = I40E_RX_VEC_START;
}
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-dev] [PATCH v3] net/i40e: fix multi-queue Rx interrupt for VF
2020-01-10 8:35 [dpdk-dev] [PATCH] net/i40e: fixed multi-queue Rx interrupt for VF Lunyuan Cui
2020-01-14 2:04 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui
@ 2020-01-14 6:25 ` Lunyuan Cui
1 sibling, 0 replies; 3+ messages in thread
From: Lunyuan Cui @ 2020-01-14 6:25 UTC (permalink / raw)
To: dev; +Cc: Qiming Yang, Lunyuan Cui
The vector id bound to each queue could not large than the max
usable vector. It will cause port start failed. This patch fixed
this issue.
And in this patch I changed judgement condition for the limit
of vector id. vf->vf_res->max_vectors represents the number of
usable vectors. It can effectively prevent vector id out of range.
Fixes: 5b8d2d89dd99 (net/i40e: enable multi-queue Rx interrupt for VF)
Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
---
v3:
- Change commit message
v2:
- Change commit message
---
drivers/net/i40e/i40e_ethdev_vf.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 479f8282c..d514e8991 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -657,7 +657,6 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
uint32_t vector_id;
int i, err;
- uint16_t nb_msix;
if (dev->data->dev_conf.intr_conf.rxq != 0 &&
rte_intr_allow_others(intr_handle))
@@ -665,9 +664,6 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
else
vector_id = I40E_MISC_VEC_ID;
- nb_msix = RTE_MIN(vf->vf_res->max_vectors,
- intr_handle->nb_efd);
-
map_info = (struct virtchnl_irq_map_info *)cmd_buffer;
map_info->num_vectors = dev->data->nb_rx_queues;
for (i = 0; i < dev->data->nb_rx_queues; i++) {
@@ -682,7 +678,7 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
intr_handle->intr_vec[i] = vector_id;
if (vector_id > I40E_MISC_VEC_ID)
vector_id++;
- if (vector_id > nb_msix)
+ if (vector_id >= vf->vf_res->max_vectors)
vector_id = I40E_RX_VEC_START;
}
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-14 6:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10 8:35 [dpdk-dev] [PATCH] net/i40e: fixed multi-queue Rx interrupt for VF Lunyuan Cui
2020-01-14 2:04 ` [dpdk-dev] [PATCH v2] " Lunyuan Cui
2020-01-14 6:25 ` [dpdk-dev] [PATCH v3] net/i40e: fix " Lunyuan Cui
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).