[v4] net/i40e: fix multi-queue Rx interrupt for VF

Message ID 20200117082258.2437-1-lunyuanx.cui@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v4] net/i40e: fix multi-queue Rx interrupt for VF |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Cui, LunyuanX Jan. 17, 2020, 8:22 a.m. UTC
  The interrupt vector which bind to queues should not larger than
the max avaiable vertor. It will cause port start failed. This patch
changed the judgement condition of the limited vector id. It can
effectively avoid 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>
---
v4:
- Change commit message

v3:
- Change commit message

v2:
- Change commit message
---
 drivers/net/i40e/i40e_ethdev_vf.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
  

Comments

Qiming Yang Jan. 17, 2020, 8:31 a.m. UTC | #1
> -----Original Message-----
> From: Cui, LunyuanX <lunyuanx.cui@intel.com>
> Sent: Friday, January 17, 2020 4:23 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Cui, LunyuanX
> <lunyuanx.cui@intel.com>
> Subject: [PATCH v4] net/i40e: fix multi-queue Rx interrupt for VF
> 
> The interrupt vector which bind to queues should not larger than the max
> avaiable vertor. It will cause port start failed. This patch changed the judgement
> condition of the limited vector id. It can effectively avoid 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>

Reviewed-by: Qiming Yang <qiming.yang@intel.com>

> ---
> v4:
> - Change commit message
> 
> 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
  
Xiaolong Ye Feb. 3, 2020, 9:54 a.m. UTC | #2
On 01/17, Lunyuan Cui wrote:
>The interrupt vector which bind to queues should not larger than

should not be larger than

>the max avaiable vertor. It will cause port start failed. This patch

s/avaiable/available
s/vertor/vector

>changed the judgement condition of the limited vector id. It can
>effectively avoid vector id out of range.
>
>Fixes: 5b8d2d89dd99 (net/i40e: enable multi-queue Rx interrupt for VF)

Should be

Fixes: 6a6cf5f88b4a ("net/i40e: enable multi-queue Rx interrupt for VF")


Applied to dpdk-next-net-intel with above fixes, Thanks.

>
>Signed-off-by: Lunyuan Cui <lunyuanx.cui@intel.com>
>---
>v4:
>- Change commit message
>
>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
>
  

Patch

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;
 	}