DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
@ 2020-06-09  1:37 Jiang Mao
  2020-06-09  1:37 ` [dpdk-dev] [PATCH 2/2] net/i40e: fix fdir allocating msix resource error Jiang Mao
  2020-06-09  2:02 ` [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Ye Xiaolong
  0 siblings, 2 replies; 8+ messages in thread
From: Jiang Mao @ 2020-06-09  1:37 UTC (permalink / raw)
  To: xiaolong.ye; +Cc: dev, Jiang Mao

The value of vsi->nb_msix shouldn`t be zero, otherwise, all of interrupts will be bind to vector 0.

Signed-off-by: Jiang Mao <maox.jiang@intel.com>

Fixes: 4861cde461 (i40e: new poll mode driver)
---
 drivers/net/i40e/i40e_ethdev.c | 41 +++++++++++++++++++++++-----------
 drivers/net/i40e/i40e_ethdev.h |  2 +-
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 970a31cb2..33ed556c8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2013,7 +2013,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,
 	I40E_WRITE_FLUSH(hw);
 }
 
-void
+int
 i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2033,10 +2033,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 
 	/* VF bind interrupt */
 	if (vsi->type == I40E_VSI_SRIOV) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		}
 		__vsi_queues_bind_intr(vsi, msix_vect,
-				       vsi->base_queue, vsi->nb_qps,
-				       itr_idx);
-		return;
+							   vsi->base_queue, vsi->nb_qps,
+							   itr_idx);
+		return 0;
 	}
 
 	/* PF & VMDq bind interrupt */
@@ -2053,16 +2057,19 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 	}
 
 	for (i = 0; i < vsi->nb_used_qps; i++) {
-		if (nb_msix <= 1) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		} else if (nb_msix <= 1) {
 			if (!rte_intr_allow_others(intr_handle))
 				/* allow to share MISC_VEC_ID */
 				msix_vect = I40E_MISC_VEC_ID;
 
 			/* no enough msix_vect, map all to one */
 			__vsi_queues_bind_intr(vsi, msix_vect,
-					       vsi->base_queue + i,
-					       vsi->nb_used_qps - i,
-					       itr_idx);
+								   vsi->base_queue + i,
+								   vsi->nb_used_qps - i,
+								   itr_idx);
 			for (; !!record && i < vsi->nb_used_qps; i++)
 				intr_handle->intr_vec[queue_idx + i] =
 					msix_vect;
@@ -2078,6 +2085,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 		msix_vect++;
 		nb_msix--;
 	}
+
+	return 0;
 }
 
 static void
@@ -2318,21 +2327,27 @@ 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;
-	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	if (ret < 0)
+		return ret;
 	i40e_vsi_enable_queues_intr(main_vsi);
 
 	/* 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;
-		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);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
 	/* enable FDIR MSIX interrupt */
 	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
+		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
+										I40E_ITR_INDEX_NONE);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
 	}
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index e5d0ce53f..33fbe776b 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1248,7 +1248,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);
-void 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);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
 int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/i40e: fix fdir allocating msix resource error
  2020-06-09  1:37 [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Jiang Mao
@ 2020-06-09  1:37 ` Jiang Mao
  2020-06-09  2:02 ` [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Ye Xiaolong
  1 sibling, 0 replies; 8+ messages in thread
From: Jiang Mao @ 2020-06-09  1:37 UTC (permalink / raw)
  To: xiaolong.ye; +Cc: dev, Jiang Mao

Fdir allocating msix resource is not strictly necessary, if no resource left, print a warning message.

Signed-off-by: Jiang Mao <maox.jiang@intel.com>

Fixes: 4861cde461 (i40e: new poll mode driver)
---
 drivers/net/i40e/i40e_ethdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 33ed556c8..acc43077d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -5744,6 +5744,17 @@ i40e_vsi_setup(struct i40e_pf *pf,
 			vsi->nb_msix = RTE_MIN(vsi->nb_qps,
 					       RTE_MAX_RXTX_INTR_VEC_ID);
 		}
+	} else if (type == I40E_VSI_FDIR) {
+		ret = i40e_res_pool_alloc(&pf->msix_pool, 1);
+		if (ret < 0) {
+			PMD_DRV_LOG(WARNING, "MSIX vectors used up, FDIR can`t bind interrupt");
+			vsi->msix_intr = 0;
+			vsi->nb_msix = 0;
+		} else {
+			vsi->msix_intr = ret;
+			vsi->nb_msix = 1;
+		}
+
 	} else if (type != I40E_VSI_SRIOV) {
 		ret = i40e_res_pool_alloc(&pf->msix_pool, 1);
 		if (ret < 0) {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
  2020-06-09  1:37 [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Jiang Mao
  2020-06-09  1:37 ` [dpdk-dev] [PATCH 2/2] net/i40e: fix fdir allocating msix resource error Jiang Mao
@ 2020-06-09  2:02 ` Ye Xiaolong
  1 sibling, 0 replies; 8+ messages in thread
From: Ye Xiaolong @ 2020-06-09  2:02 UTC (permalink / raw)
  To: Jiang Mao; +Cc: dev

On 06/09, Jiang Mao wrote:
>The value of vsi->nb_msix shouldn`t be zero, otherwise, all of interrupts will be bind to vector 0.
>
>Signed-off-by: Jiang Mao <maox.jiang@intel.com>
>
>Fixes: 4861cde461 (i40e: new poll mode driver)

Fixes tag should be put before SOB line and please cc stable@dpdk.org.

>---
> drivers/net/i40e/i40e_ethdev.c | 41 +++++++++++++++++++++++-----------
> drivers/net/i40e/i40e_ethdev.h |  2 +-
> 2 files changed, 29 insertions(+), 14 deletions(-)
>
>diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
>index 970a31cb2..33ed556c8 100644
>--- a/drivers/net/i40e/i40e_ethdev.c
>+++ b/drivers/net/i40e/i40e_ethdev.c
>@@ -2013,7 +2013,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,
> 	I40E_WRITE_FLUSH(hw);
> }
> 
>-void
>+int
> i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
> {
> 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
>@@ -2033,10 +2033,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
> 
> 	/* VF bind interrupt */
> 	if (vsi->type == I40E_VSI_SRIOV) {
>+		if (vsi->nb_msix == 0) {
>+			PMD_DRV_LOG(ERR, "No msix resource");
>+			return -EINVAL;
>+		}
> 		__vsi_queues_bind_intr(vsi, msix_vect,
>-				       vsi->base_queue, vsi->nb_qps,
>-				       itr_idx);
>-		return;
>+							   vsi->base_queue, vsi->nb_qps,
>+							   itr_idx);

The indentation seems weird, please keep it as before, and same for other
occurrences in this patch.

>+		return 0;
> 	}
> 
> 	/* PF & VMDq bind interrupt */
>@@ -2053,16 +2057,19 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
> 	}
> 
> 	for (i = 0; i < vsi->nb_used_qps; i++) {
>-		if (nb_msix <= 1) {
>+		if (vsi->nb_msix == 0) {
>+			PMD_DRV_LOG(ERR, "No msix resource");
>+			return -EINVAL;
>+		} else if (nb_msix <= 1) {
> 			if (!rte_intr_allow_others(intr_handle))
> 				/* allow to share MISC_VEC_ID */
> 				msix_vect = I40E_MISC_VEC_ID;
> 
> 			/* no enough msix_vect, map all to one */
> 			__vsi_queues_bind_intr(vsi, msix_vect,
>-					       vsi->base_queue + i,
>-					       vsi->nb_used_qps - i,
>-					       itr_idx);
>+								   vsi->base_queue + i,
>+								   vsi->nb_used_qps - i,
>+								   itr_idx);
> 			for (; !!record && i < vsi->nb_used_qps; i++)
> 				intr_handle->intr_vec[queue_idx + i] =
> 					msix_vect;
>@@ -2078,6 +2085,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
> 		msix_vect++;
> 		nb_msix--;
> 	}
>+
>+	return 0;
> }
> 
> static void
>@@ -2318,21 +2327,27 @@ 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;
>-	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
>+	ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
>+	if (ret < 0)
>+		return ret;
> 	i40e_vsi_enable_queues_intr(main_vsi);
> 
> 	/* 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;
>-		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);
>+		if (ret < 0)
>+			return ret;
> 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
> 	}
> 
> 	/* enable FDIR MSIX interrupt */
> 	if (pf->fdir.fdir_vsi) {
>-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
>-					  I40E_ITR_INDEX_NONE);
>+		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
>+										I40E_ITR_INDEX_NONE);
>+		if (ret < 0)
>+			return ret;
> 		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
> 	}
> 
>diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
>index e5d0ce53f..33fbe776b 100644
>--- a/drivers/net/i40e/i40e_ethdev.h
>+++ b/drivers/net/i40e/i40e_ethdev.h
>@@ -1248,7 +1248,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);
>-void 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);
> void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
> int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
> 			   struct i40e_vsi_vlan_pvid_info *info);
>-- 
>2.17.1
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
  2020-07-21  3:57   ` Jeff Guo
@ 2020-07-21  6:50     ` Jiang, MaoX
  0 siblings, 0 replies; 8+ messages in thread
From: Jiang, MaoX @ 2020-07-21  6:50 UTC (permalink / raw)
  To: Guo, Jia, Ye, Xiaolong; +Cc: dev, stable

Thanks Jia. Comments as below.

> -----Original Message-----
> From: Guo, Jia
> Sent: Tuesday, July 21, 2020 11:58 AM
> To: Jiang, MaoX <maox.jiang@intel.com>; Ye, Xiaolong
> <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without
> msix vectors
> 
> hi, jiang mao
> 
> On 7/9/2020 3:50 AM, Jiang Mao wrote:
> > The value of vsi->nb_msix shouldn`t be zero, otherwise, all of
> > interrupts will be bind to vector 0.
> >
> > Fixes: 4861cde461 (i40e: new poll mode driver)
> > Cc: stable@dpdk.org
> 
> 
> Blank line is need before Signed-off. And please remember --reply-to when
> you send new version patch to trace the comments.
> 
> 
> > Signed-off-by: Jiang Mao <maox.jiang@intel.com>
> > ---
> >   drivers/net/i40e/i40e_ethdev.c | 31 +++++++++++++++++++++++--------
> >   drivers/net/i40e/i40e_ethdev.h |  2 +-
> >   2 files changed, 24 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.c
> b/drivers/net/i40e/i40e_ethdev.c
> > index 777e149..16fcb8d 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -2001,7 +2001,7 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> >   	I40E_WRITE_FLUSH(hw);
> >   }
> >
> > -void
> > +int
> >   i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
> >   {
> >   	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
> > @@ -2021,10 +2021,14 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> >
> >   	/* VF bind interrupt */
> >   	if (vsi->type == I40E_VSI_SRIOV) {
> > +		if (vsi->nb_msix == 0) {
> > +			PMD_DRV_LOG(ERR, "No msix resource");
> > +			return -EINVAL;
> > +		}
> >   		__vsi_queues_bind_intr(vsi, msix_vect,
> >   				       vsi->base_queue, vsi->nb_qps,
> >   				       itr_idx);
> > -		return;
> > +		return 0;
> >   	}
> >
> >   	/* PF & VMDq bind interrupt */
> > @@ -2041,7 +2045,10 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> >   	}
> >
> >   	for (i = 0; i < vsi->nb_used_qps; i++) {
> > -		if (nb_msix <= 1) {
> > +		if (vsi->nb_msix == 0) {
> > +			PMD_DRV_LOG(ERR, "No msix resource");
> > +			return -EINVAL;
> > +		} else if (nb_msix <= 1) {
> >   			if (!rte_intr_allow_others(intr_handle))
> >   				/* allow to share MISC_VEC_ID */
> >   				msix_vect = I40E_MISC_VEC_ID;
> > @@ -2066,6 +2073,8 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> >   		msix_vect++;
> >   		nb_msix--;
> >   	}
> > +
> > +	return 0;
> >   }
> >
> >   static void
> > @@ -2306,21 +2315,27 @@ void i40e_flex_payload_reg_set_default(struct
> i40e_hw *hw)
> >   	/* 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;
> > -	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
> > +	ret = i40e_vsi_queues_bind_intr(main_vsi,
> I40E_ITR_INDEX_DEFAULT);
> > +	if (ret < 0)
> 
> 
> Better to add some print log out of the calling if it is need. Below is
> the same.

At i40e_vsi_queues_bind_intr(), I have add a print log, I think it`s enough, otherwise it will add too many print log in code.

> 
> 
> > +		return ret;
> >   	i40e_vsi_enable_queues_intr(main_vsi);
> >
> >   	/* 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;
> > -		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);
> > +		if (ret < 0)
> > +			return ret;
> >   		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
> >   	}
> >
> >   	/* enable FDIR MSIX interrupt */
> >   	if (pf->fdir.fdir_vsi) {
> > -		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
> > -					  I40E_ITR_INDEX_NONE);
> > +		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
> > +						I40E_ITR_INDEX_NONE);
> > +		if (ret < 0)
> > +			return ret;
> >   		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
> >   	}
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev.h
> b/drivers/net/i40e/i40e_ethdev.h
> > index e5d0ce5..33fbe77 100644
> > --- a/drivers/net/i40e/i40e_ethdev.h
> > +++ b/drivers/net/i40e/i40e_ethdev.h
> > @@ -1248,7 +1248,7 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf,
> >   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);
> > -void 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);
> >   void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
> >   int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
> >   			   struct i40e_vsi_vlan_pvid_info *info);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
  2020-07-08 19:50 ` Jiang Mao
@ 2020-07-21  3:57   ` Jeff Guo
  2020-07-21  6:50     ` Jiang, MaoX
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Guo @ 2020-07-21  3:57 UTC (permalink / raw)
  To: Jiang Mao, xiaolong.ye; +Cc: dev, stable

hi, jiang mao

On 7/9/2020 3:50 AM, Jiang Mao wrote:
> The value of vsi->nb_msix shouldn`t be zero, otherwise, all of
> interrupts will be bind to vector 0.
>
> Fixes: 4861cde461 (i40e: new poll mode driver)
> Cc: stable@dpdk.org


Blank line is need before Signed-off. And please remember --reply-to 
when you send new version patch to trace the comments.


> Signed-off-by: Jiang Mao <maox.jiang@intel.com>
> ---
>   drivers/net/i40e/i40e_ethdev.c | 31 +++++++++++++++++++++++--------
>   drivers/net/i40e/i40e_ethdev.h |  2 +-
>   2 files changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 777e149..16fcb8d 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -2001,7 +2001,7 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
>   	I40E_WRITE_FLUSH(hw);
>   }
>   
> -void
> +int
>   i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
>   {
>   	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
> @@ -2021,10 +2021,14 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
>   
>   	/* VF bind interrupt */
>   	if (vsi->type == I40E_VSI_SRIOV) {
> +		if (vsi->nb_msix == 0) {
> +			PMD_DRV_LOG(ERR, "No msix resource");
> +			return -EINVAL;
> +		}
>   		__vsi_queues_bind_intr(vsi, msix_vect,
>   				       vsi->base_queue, vsi->nb_qps,
>   				       itr_idx);
> -		return;
> +		return 0;
>   	}
>   
>   	/* PF & VMDq bind interrupt */
> @@ -2041,7 +2045,10 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
>   	}
>   
>   	for (i = 0; i < vsi->nb_used_qps; i++) {
> -		if (nb_msix <= 1) {
> +		if (vsi->nb_msix == 0) {
> +			PMD_DRV_LOG(ERR, "No msix resource");
> +			return -EINVAL;
> +		} else if (nb_msix <= 1) {
>   			if (!rte_intr_allow_others(intr_handle))
>   				/* allow to share MISC_VEC_ID */
>   				msix_vect = I40E_MISC_VEC_ID;
> @@ -2066,6 +2073,8 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
>   		msix_vect++;
>   		nb_msix--;
>   	}
> +
> +	return 0;
>   }
>   
>   static void
> @@ -2306,21 +2315,27 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
>   	/* 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;
> -	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
> +	ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
> +	if (ret < 0)


Better to add some print log out of the calling if it is need. Below is 
the same.


> +		return ret;
>   	i40e_vsi_enable_queues_intr(main_vsi);
>   
>   	/* 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;
> -		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);
> +		if (ret < 0)
> +			return ret;
>   		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
>   	}
>   
>   	/* enable FDIR MSIX interrupt */
>   	if (pf->fdir.fdir_vsi) {
> -		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
> -					  I40E_ITR_INDEX_NONE);
> +		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
> +						I40E_ITR_INDEX_NONE);
> +		if (ret < 0)
> +			return ret;
>   		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
>   	}
>   
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index e5d0ce5..33fbe77 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -1248,7 +1248,7 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf,
>   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);
> -void 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);
>   void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
>   int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
>   			   struct i40e_vsi_vlan_pvid_info *info);

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
  2020-06-09  2:25 Jiang Mao
  2020-06-17  5:42 ` Huang, ZhiminX
@ 2020-07-08 19:50 ` Jiang Mao
  2020-07-21  3:57   ` Jeff Guo
  1 sibling, 1 reply; 8+ messages in thread
From: Jiang Mao @ 2020-07-08 19:50 UTC (permalink / raw)
  To: xiaolong.ye; +Cc: dev, stable, maox.jiang

The value of vsi->nb_msix shouldn`t be zero, otherwise, all of
interrupts will be bind to vector 0.

Fixes: 4861cde461 (i40e: new poll mode driver)
Cc: stable@dpdk.org
Signed-off-by: Jiang Mao <maox.jiang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 31 +++++++++++++++++++++++--------
 drivers/net/i40e/i40e_ethdev.h |  2 +-
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 777e149..16fcb8d 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2001,7 +2001,7 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
 	I40E_WRITE_FLUSH(hw);
 }
 
-void
+int
 i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2021,10 +2021,14 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
 
 	/* VF bind interrupt */
 	if (vsi->type == I40E_VSI_SRIOV) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		}
 		__vsi_queues_bind_intr(vsi, msix_vect,
 				       vsi->base_queue, vsi->nb_qps,
 				       itr_idx);
-		return;
+		return 0;
 	}
 
 	/* PF & VMDq bind interrupt */
@@ -2041,7 +2045,10 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
 	}
 
 	for (i = 0; i < vsi->nb_used_qps; i++) {
-		if (nb_msix <= 1) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		} else if (nb_msix <= 1) {
 			if (!rte_intr_allow_others(intr_handle))
 				/* allow to share MISC_VEC_ID */
 				msix_vect = I40E_MISC_VEC_ID;
@@ -2066,6 +2073,8 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
 		msix_vect++;
 		nb_msix--;
 	}
+
+	return 0;
 }
 
 static void
@@ -2306,21 +2315,27 @@ void i40e_flex_payload_reg_set_default(struct i40e_hw *hw)
 	/* 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;
-	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	if (ret < 0)
+		return ret;
 	i40e_vsi_enable_queues_intr(main_vsi);
 
 	/* 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;
-		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);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
 	/* enable FDIR MSIX interrupt */
 	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
+		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
+						I40E_ITR_INDEX_NONE);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
 	}
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index e5d0ce5..33fbe77 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1248,7 +1248,7 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf,
 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);
-void 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);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
 int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
  2020-06-09  2:25 Jiang Mao
@ 2020-06-17  5:42 ` Huang, ZhiminX
  2020-07-08 19:50 ` Jiang Mao
  1 sibling, 0 replies; 8+ messages in thread
From: Huang, ZhiminX @ 2020-06-17  5:42 UTC (permalink / raw)
  To: Jiang, MaoX; +Cc: dev, stable, Jiang, MaoX

Tested-by: zhiminx.huang@intel.com

Regards,
HuangZhiMin

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jiang Mao
Sent: Tuesday, June 9, 2020 10:26 AM
To: Ye, Xiaolong <xiaolong.ye@intel.com>
Cc: dev@dpdk.org; stable@dpdk.org; Jiang, MaoX <maox.jiang@intel.com>
Subject: [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors

The value of vsi->nb_msix shouldn`t be zero, otherwise, all of interrupts will be bind to vector 0.

Fixes: 4861cde461 (i40e: new poll mode driver)
Cc: stable@dpdk.org
Signed-off-by: Jiang Mao <maox.jiang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 41 +++++++++++++++++++++++-----------
 drivers/net/i40e/i40e_ethdev.h |  2 +-
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 970a31cb2..33ed556c8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2013,7 +2013,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,
 	I40E_WRITE_FLUSH(hw);
 }
 
-void
+int
 i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)  {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev; @@ -2033,10 +2033,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 
 	/* VF bind interrupt */
 	if (vsi->type == I40E_VSI_SRIOV) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		}
 		__vsi_queues_bind_intr(vsi, msix_vect,
-				       vsi->base_queue, vsi->nb_qps,
-				       itr_idx);
-		return;
+							   vsi->base_queue, vsi->nb_qps,
+							   itr_idx);
+		return 0;
 	}
 
 	/* PF & VMDq bind interrupt */
@@ -2053,16 +2057,19 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 	}
 
 	for (i = 0; i < vsi->nb_used_qps; i++) {
-		if (nb_msix <= 1) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		} else if (nb_msix <= 1) {
 			if (!rte_intr_allow_others(intr_handle))
 				/* allow to share MISC_VEC_ID */
 				msix_vect = I40E_MISC_VEC_ID;
 
 			/* no enough msix_vect, map all to one */
 			__vsi_queues_bind_intr(vsi, msix_vect,
-					       vsi->base_queue + i,
-					       vsi->nb_used_qps - i,
-					       itr_idx);
+								   vsi->base_queue + i,
+								   vsi->nb_used_qps - i,
+								   itr_idx);
 			for (; !!record && i < vsi->nb_used_qps; i++)
 				intr_handle->intr_vec[queue_idx + i] =
 					msix_vect;
@@ -2078,6 +2085,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 		msix_vect++;
 		nb_msix--;
 	}
+
+	return 0;
 }
 
 static void
@@ -2318,21 +2327,27 @@ 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;
-	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	if (ret < 0)
+		return ret;
 	i40e_vsi_enable_queues_intr(main_vsi);
 
 	/* 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;
-		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);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
 	/* enable FDIR MSIX interrupt */
 	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
+		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
+										I40E_ITR_INDEX_NONE);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
 	}
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index e5d0ce53f..33fbe776b 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1248,7 +1248,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); -void 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);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);  int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
--
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
@ 2020-06-09  2:25 Jiang Mao
  2020-06-17  5:42 ` Huang, ZhiminX
  2020-07-08 19:50 ` Jiang Mao
  0 siblings, 2 replies; 8+ messages in thread
From: Jiang Mao @ 2020-06-09  2:25 UTC (permalink / raw)
  To: xiaolong.ye; +Cc: dev, stable, Jiang Mao

The value of vsi->nb_msix shouldn`t be zero, otherwise, all of interrupts will be bind to vector 0.

Fixes: 4861cde461 (i40e: new poll mode driver)
Cc: stable@dpdk.org
Signed-off-by: Jiang Mao <maox.jiang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 41 +++++++++++++++++++++++-----------
 drivers/net/i40e/i40e_ethdev.h |  2 +-
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 970a31cb2..33ed556c8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2013,7 +2013,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect,
 	I40E_WRITE_FLUSH(hw);
 }
 
-void
+int
 i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 {
 	struct rte_eth_dev *dev = vsi->adapter->eth_dev;
@@ -2033,10 +2033,14 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 
 	/* VF bind interrupt */
 	if (vsi->type == I40E_VSI_SRIOV) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		}
 		__vsi_queues_bind_intr(vsi, msix_vect,
-				       vsi->base_queue, vsi->nb_qps,
-				       itr_idx);
-		return;
+							   vsi->base_queue, vsi->nb_qps,
+							   itr_idx);
+		return 0;
 	}
 
 	/* PF & VMDq bind interrupt */
@@ -2053,16 +2057,19 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 	}
 
 	for (i = 0; i < vsi->nb_used_qps; i++) {
-		if (nb_msix <= 1) {
+		if (vsi->nb_msix == 0) {
+			PMD_DRV_LOG(ERR, "No msix resource");
+			return -EINVAL;
+		} else if (nb_msix <= 1) {
 			if (!rte_intr_allow_others(intr_handle))
 				/* allow to share MISC_VEC_ID */
 				msix_vect = I40E_MISC_VEC_ID;
 
 			/* no enough msix_vect, map all to one */
 			__vsi_queues_bind_intr(vsi, msix_vect,
-					       vsi->base_queue + i,
-					       vsi->nb_used_qps - i,
-					       itr_idx);
+								   vsi->base_queue + i,
+								   vsi->nb_used_qps - i,
+								   itr_idx);
 			for (; !!record && i < vsi->nb_used_qps; i++)
 				intr_handle->intr_vec[queue_idx + i] =
 					msix_vect;
@@ -2078,6 +2085,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx)
 		msix_vect++;
 		nb_msix--;
 	}
+
+	return 0;
 }
 
 static void
@@ -2318,21 +2327,27 @@ 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;
-	i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	ret = i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
+	if (ret < 0)
+		return ret;
 	i40e_vsi_enable_queues_intr(main_vsi);
 
 	/* 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;
-		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);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
 	}
 
 	/* enable FDIR MSIX interrupt */
 	if (pf->fdir.fdir_vsi) {
-		i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
-					  I40E_ITR_INDEX_NONE);
+		ret = i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
+										I40E_ITR_INDEX_NONE);
+		if (ret < 0)
+			return ret;
 		i40e_vsi_enable_queues_intr(pf->fdir.fdir_vsi);
 	}
 
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index e5d0ce53f..33fbe776b 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -1248,7 +1248,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);
-void 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);
 void i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi);
 int i40e_vsi_vlan_pvid_set(struct i40e_vsi *vsi,
 			   struct i40e_vsi_vlan_pvid_info *info);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-07-21  6:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-09  1:37 [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Jiang Mao
2020-06-09  1:37 ` [dpdk-dev] [PATCH 2/2] net/i40e: fix fdir allocating msix resource error Jiang Mao
2020-06-09  2:02 ` [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Ye Xiaolong
2020-06-09  2:25 Jiang Mao
2020-06-17  5:42 ` Huang, ZhiminX
2020-07-08 19:50 ` Jiang Mao
2020-07-21  3:57   ` Jeff Guo
2020-07-21  6:50     ` Jiang, MaoX

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).