DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
@ 2019-03-19  3:04 Wei Zhao
  2019-03-19  3:04 ` Wei Zhao
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-19  3:04 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

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.

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

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 4 ++--
 drivers/net/iavf/iavf_vchnl.c  | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 846e604..49c9499 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;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..d9a376e 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -609,7 +609,7 @@ 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;
@@ -618,6 +618,12 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
 	}
 
+	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;
-- 
2.7.5

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

* [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  3:04 [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error Wei Zhao
@ 2019-03-19  3:04 ` Wei Zhao
  2019-03-19  4:00 ` Zhang, Qi Z
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-19  3:04 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

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.

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

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
---
 drivers/net/iavf/iavf_ethdev.c | 4 ++--
 drivers/net/iavf/iavf_vchnl.c  | 8 +++++++-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 846e604..49c9499 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;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..d9a376e 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -609,7 +609,7 @@ 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;
@@ -618,6 +618,12 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
 	}
 
+	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;
-- 
2.7.5


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  3:04 [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error Wei Zhao
  2019-03-19  3:04 ` Wei Zhao
@ 2019-03-19  4:00 ` Zhang, Qi Z
  2019-03-19  4:00   ` Zhang, Qi Z
  2019-03-19  5:57   ` Zhao1, Wei
  2019-03-19  4:16 ` Stillwell Jr, Paul M
  2019-03-22  6:27 ` [dpdk-dev] [PATCH v2] " Wei Zhao
  3 siblings, 2 replies; 20+ messages in thread
From: Zhang, Qi Z @ 2019-03-19  4:00 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, March 19, 2019 11:05 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH] net/iavf: fix vertor interrupt number configuration error
> 
> 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.
> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 4 ++--  drivers/net/iavf/iavf_vchnl.c  | 8
> +++++++-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index
> 846e604..49c9499 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; diff --git


Looks like something missing in below else branch

			} else {
                       /* If Rx interrupt is reuquired, and we can use
                         * multi interrupts, then the vec is from 1
                         */
                        vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
                                              intr_handle->nb_efd);
                        vf->msix_base = IAVF_RX_VEC_START;
                        vec = IAVF_RX_VEC_START;
                        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                                vf->rxq_map[vec] |= 1 << i;
                                intr_handle->intr_vec[i] = vec++;
                                if (vec >= vf->nb_msix)
                                        vec = IAVF_RX_VEC_START;
                        }
                        PMD_DRV_LOG(DEBUG,
                                    "%u vectors are mapping to %u Rx queues",
                                    vf->nb_msix, dev->data->nb_rx_queues);
                }
Should we also reserve 1 vector for admin queue in this case, 
or looks like some Rx queue will share the irq vector with admin queue during iavf_config_irq_map which is not expected?


> a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 6381fb6..d9a376e 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -609,7 +609,7 @@ 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; @@ -618,6 +618,12
> @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
>  	}
> 
> +	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;
> --
> 2.7.5

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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  4:00 ` Zhang, Qi Z
@ 2019-03-19  4:00   ` Zhang, Qi Z
  2019-03-19  5:57   ` Zhao1, Wei
  1 sibling, 0 replies; 20+ messages in thread
From: Zhang, Qi Z @ 2019-03-19  4:00 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, March 19, 2019 11:05 AM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH] net/iavf: fix vertor interrupt number configuration error
> 
> 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.
> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 4 ++--  drivers/net/iavf/iavf_vchnl.c  | 8
> +++++++-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index
> 846e604..49c9499 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; diff --git


Looks like something missing in below else branch

			} else {
                       /* If Rx interrupt is reuquired, and we can use
                         * multi interrupts, then the vec is from 1
                         */
                        vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
                                              intr_handle->nb_efd);
                        vf->msix_base = IAVF_RX_VEC_START;
                        vec = IAVF_RX_VEC_START;
                        for (i = 0; i < dev->data->nb_rx_queues; i++) {
                                vf->rxq_map[vec] |= 1 << i;
                                intr_handle->intr_vec[i] = vec++;
                                if (vec >= vf->nb_msix)
                                        vec = IAVF_RX_VEC_START;
                        }
                        PMD_DRV_LOG(DEBUG,
                                    "%u vectors are mapping to %u Rx queues",
                                    vf->nb_msix, dev->data->nb_rx_queues);
                }
Should we also reserve 1 vector for admin queue in this case, 
or looks like some Rx queue will share the irq vector with admin queue during iavf_config_irq_map which is not expected?


> a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 6381fb6..d9a376e 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -609,7 +609,7 @@ 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; @@ -618,6 +618,12
> @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
>  	}
> 
> +	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;
> --
> 2.7.5


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  3:04 [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error Wei Zhao
  2019-03-19  3:04 ` Wei Zhao
  2019-03-19  4:00 ` Zhang, Qi Z
@ 2019-03-19  4:16 ` Stillwell Jr, Paul M
  2019-03-19  4:16   ` Stillwell Jr, Paul M
  2019-03-21  3:30   ` Zhao1, Wei
  2019-03-22  6:27 ` [dpdk-dev] [PATCH v2] " Wei Zhao
  3 siblings, 2 replies; 20+ messages in thread
From: Stillwell Jr, Paul M @ 2019-03-19  4:16 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable, Zhang, Qi Z, Zhao1, Wei


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> Sent: Monday, March 18, 2019 8:05 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number
> configuration error
> 

Should the patch name be net/avf?

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

I would reword this to be clearer, something like:

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.

> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 4 ++--  drivers/net/iavf/iavf_vchnl.c  | 8
> +++++++-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 846e604..49c9499 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; diff --
> git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 6381fb6..d9a376e 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -609,7 +609,7 @@ 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; @@ -618,6
> +618,12 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
>  	}
> 
> +	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;
> --
> 2.7.5

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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  4:16 ` Stillwell Jr, Paul M
@ 2019-03-19  4:16   ` Stillwell Jr, Paul M
  2019-03-21  3:30   ` Zhao1, Wei
  1 sibling, 0 replies; 20+ messages in thread
From: Stillwell Jr, Paul M @ 2019-03-19  4:16 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable, Zhang, Qi Z, Zhao1, Wei


> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> Sent: Monday, March 18, 2019 8:05 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number
> configuration error
> 

Should the patch name be net/avf?

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

I would reword this to be clearer, something like:

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.

> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> ---
>  drivers/net/iavf/iavf_ethdev.c | 4 ++--  drivers/net/iavf/iavf_vchnl.c  | 8
> +++++++-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
> index 846e604..49c9499 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; diff --
> git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 6381fb6..d9a376e 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -609,7 +609,7 @@ 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; @@ -618,6
> +618,12 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
>  	}
> 
> +	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;
> --
> 2.7.5


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  4:00 ` Zhang, Qi Z
  2019-03-19  4:00   ` Zhang, Qi Z
@ 2019-03-19  5:57   ` Zhao1, Wei
  2019-03-19  5:57     ` Zhao1, Wei
  1 sibling, 1 reply; 20+ messages in thread
From: Zhao1, Wei @ 2019-03-19  5:57 UTC (permalink / raw)
  To: Zhang, Qi Z, dev; +Cc: stable



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, March 19, 2019 12:01 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix vertor interrupt number configuration error
> 
> 
> 
> > -----Original Message-----
> > From: Zhao1, Wei
> > Sent: Tuesday, March 19, 2019 11:05 AM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [PATCH] net/iavf: fix vertor interrupt number configuration
> > error
> >
> > 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.
> >
> > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> > ---
> >  drivers/net/iavf/iavf_ethdev.c | 4 ++--
> > drivers/net/iavf/iavf_vchnl.c  | 8
> > +++++++-
> >  2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index
> > 846e604..49c9499 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; diff --
> git
> 
> 
> Looks like something missing in below else branch
> 
> 			} else {
>                        /* If Rx interrupt is reuquired, and we can use
>                          * multi interrupts, then the vec is from 1
>                          */
>                         vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
>                                               intr_handle->nb_efd);
>                         vf->msix_base = IAVF_RX_VEC_START;
>                         vec = IAVF_RX_VEC_START;
>                         for (i = 0; i < dev->data->nb_rx_queues; i++) {
>                                 vf->rxq_map[vec] |= 1 << i;
>                                 intr_handle->intr_vec[i] = vec++;
>                                 if (vec >= vf->nb_msix)
>                                         vec = IAVF_RX_VEC_START;
>                         }
>                         PMD_DRV_LOG(DEBUG,
>                                     "%u vectors are mapping to %u Rx queues",
>                                     vf->nb_msix, dev->data->nb_rx_queues);
>                 }
> Should we also reserve 1 vector for admin queue in this case, or looks like
> some Rx queue will share the irq vector with admin queue during
> iavf_config_irq_map which is not expected?


Yes,  we should change to
"
			vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
					      intr_handle->nb_efd) + 1;
"
in  v2 

> 
> 
> > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> > 6381fb6..d9a376e 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -609,7 +609,7 @@ 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; @@ -618,6
> +618,12
> > @@ iavf_config_irq_map(struct iavf_adapter *adapter)
> >  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
> >  	}
> >
> > +	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;
> > --
> > 2.7.5

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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  5:57   ` Zhao1, Wei
@ 2019-03-19  5:57     ` Zhao1, Wei
  0 siblings, 0 replies; 20+ messages in thread
From: Zhao1, Wei @ 2019-03-19  5:57 UTC (permalink / raw)
  To: Zhang, Qi Z, dev; +Cc: stable



> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Tuesday, March 19, 2019 12:01 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: RE: [PATCH] net/iavf: fix vertor interrupt number configuration error
> 
> 
> 
> > -----Original Message-----
> > From: Zhao1, Wei
> > Sent: Tuesday, March 19, 2019 11:05 AM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [PATCH] net/iavf: fix vertor interrupt number configuration
> > error
> >
> > 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.
> >
> > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> > ---
> >  drivers/net/iavf/iavf_ethdev.c | 4 ++--
> > drivers/net/iavf/iavf_vchnl.c  | 8
> > +++++++-
> >  2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index
> > 846e604..49c9499 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; diff --
> git
> 
> 
> Looks like something missing in below else branch
> 
> 			} else {
>                        /* If Rx interrupt is reuquired, and we can use
>                          * multi interrupts, then the vec is from 1
>                          */
>                         vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
>                                               intr_handle->nb_efd);
>                         vf->msix_base = IAVF_RX_VEC_START;
>                         vec = IAVF_RX_VEC_START;
>                         for (i = 0; i < dev->data->nb_rx_queues; i++) {
>                                 vf->rxq_map[vec] |= 1 << i;
>                                 intr_handle->intr_vec[i] = vec++;
>                                 if (vec >= vf->nb_msix)
>                                         vec = IAVF_RX_VEC_START;
>                         }
>                         PMD_DRV_LOG(DEBUG,
>                                     "%u vectors are mapping to %u Rx queues",
>                                     vf->nb_msix, dev->data->nb_rx_queues);
>                 }
> Should we also reserve 1 vector for admin queue in this case, or looks like
> some Rx queue will share the irq vector with admin queue during
> iavf_config_irq_map which is not expected?


Yes,  we should change to
"
			vf->nb_msix = RTE_MIN(vf->vf_res->max_vectors,
					      intr_handle->nb_efd) + 1;
"
in  v2 

> 
> 
> > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> > 6381fb6..d9a376e 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -609,7 +609,7 @@ 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; @@ -618,6
> +618,12
> > @@ iavf_config_irq_map(struct iavf_adapter *adapter)
> >  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
> >  	}
> >
> > +	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;
> > --
> > 2.7.5


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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  4:16 ` Stillwell Jr, Paul M
  2019-03-19  4:16   ` Stillwell Jr, Paul M
@ 2019-03-21  3:30   ` Zhao1, Wei
  2019-03-21  3:30     ` Zhao1, Wei
  1 sibling, 1 reply; 20+ messages in thread
From: Zhao1, Wei @ 2019-03-21  3:30 UTC (permalink / raw)
  To: Stillwell Jr, Paul M, dev; +Cc: stable, Zhang, Qi Z



> -----Original Message-----
> From: Stillwell Jr, Paul M
> Sent: Tuesday, March 19, 2019 12:17 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number
> configuration error
> 
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> > Sent: Monday, March 18, 2019 8:05 PM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number
> > configuration error
> >
> 
> Should the patch name be net/avf?

No, DPDK has change name to iavf in recent days.
 
> 
> > 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.
> >
> 
> I would reword this to be clearer, something like:
> 
> 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.

Good, add in v2 later

> 
> > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> > ---
> >  drivers/net/iavf/iavf_ethdev.c | 4 ++--
> > drivers/net/iavf/iavf_vchnl.c  | 8
> > +++++++-
> >  2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 846e604..49c9499 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; diff --
> git
> > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> > 6381fb6..d9a376e 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -609,7 +609,7 @@ 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; @@ -618,6
> > +618,12 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
> >  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
> >  	}
> >
> > +	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;
> > --
> > 2.7.5

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

* Re: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error
  2019-03-21  3:30   ` Zhao1, Wei
@ 2019-03-21  3:30     ` Zhao1, Wei
  0 siblings, 0 replies; 20+ messages in thread
From: Zhao1, Wei @ 2019-03-21  3:30 UTC (permalink / raw)
  To: Stillwell Jr, Paul M, dev; +Cc: stable, Zhang, Qi Z



> -----Original Message-----
> From: Stillwell Jr, Paul M
> Sent: Tuesday, March 19, 2019 12:17 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number
> configuration error
> 
> 
> > -----Original Message-----
> > From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> > Sent: Monday, March 18, 2019 8:05 PM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number
> > configuration error
> >
> 
> Should the patch name be net/avf?

No, DPDK has change name to iavf in recent days.
 
> 
> > 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.
> >
> 
> I would reword this to be clearer, something like:
> 
> 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.

Good, add in v2 later

> 
> > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > Signed-off-by: Zhao Wei <wei.zhao1@intel.com>
> > ---
> >  drivers/net/iavf/iavf_ethdev.c | 4 ++--
> > drivers/net/iavf/iavf_vchnl.c  | 8
> > +++++++-
> >  2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 846e604..49c9499 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; diff --
> git
> > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> > 6381fb6..d9a376e 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -609,7 +609,7 @@ 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; @@ -618,6
> > +618,12 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
> >  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
> >  	}
> >
> > +	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;
> > --
> > 2.7.5


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

* [dpdk-dev] [PATCH v2] net/iavf: fix vertor interrupt number configuration error
  2019-03-19  3:04 [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error Wei Zhao
                   ` (2 preceding siblings ...)
  2019-03-19  4:16 ` Stillwell Jr, Paul M
@ 2019-03-22  6:27 ` Wei Zhao
  2019-03-22  6:27   ` Wei Zhao
  2019-03-26  2:40   ` [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor " Wei Zhao
  3 siblings, 2 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-22  6:27 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

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

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

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

* [dpdk-dev] [PATCH v2] net/iavf: fix vertor interrupt number configuration error
  2019-03-22  6:27 ` [dpdk-dev] [PATCH v2] " Wei Zhao
@ 2019-03-22  6:27   ` Wei Zhao
  2019-03-26  2:40   ` [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor " Wei Zhao
  1 sibling, 0 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-22  6:27 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

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

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


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

* [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-22  6:27 ` [dpdk-dev] [PATCH v2] " Wei Zhao
  2019-03-22  6:27   ` Wei Zhao
@ 2019-03-26  2:40   ` Wei Zhao
  2019-03-26  2:40     ` Wei Zhao
  2019-03-26  5:07     ` [dpdk-dev] [PATCH v4] " Wei Zhao
  1 sibling, 2 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-26  2:40 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to align to kernel iavf code when setting Tx
queue interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP,
if not it maybe cause restart iavf port error 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

v3:
update git comment and change fix code as suggestion
---
 drivers/net/iavf/iavf_vchnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..3f8c115 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -614,8 +614,8 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 		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;
 	}
 
 	args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP;
-- 
2.7.5

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

* [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-26  2:40   ` [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor " Wei Zhao
@ 2019-03-26  2:40     ` Wei Zhao
  2019-03-26  5:07     ` [dpdk-dev] [PATCH v4] " Wei Zhao
  1 sibling, 0 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-26  2:40 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to align to kernel iavf code when setting Tx
queue interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP,
if not it maybe cause restart iavf port error 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

v3:
update git comment and change fix code as suggestion
---
 drivers/net/iavf/iavf_vchnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..3f8c115 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -614,8 +614,8 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 		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;
 	}
 
 	args.ops = VIRTCHNL_OP_CONFIG_IRQ_MAP;
-- 
2.7.5


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

* [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-26  2:40   ` [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor " Wei Zhao
  2019-03-26  2:40     ` Wei Zhao
@ 2019-03-26  5:07     ` Wei Zhao
  2019-03-26  5:07       ` Wei Zhao
  2019-03-26  7:03       ` Zhang, Qi Z
  1 sibling, 2 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-26  5:07 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to align to kernel iavf code when setting Tx
queue interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP,
if not it maybe cause restart iavf port error 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

v3:
update git comment and change fix code as suggestion

v4:
add txq_map in struct avf_info to keep vector mapping info
---
 drivers/net/iavf/iavf.h        | 1 +
 drivers/net/iavf/iavf_ethdev.c | 9 +++++++++
 drivers/net/iavf/iavf_vchnl.c  | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index e6e3e8d..81d0054 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -107,6 +107,7 @@ struct iavf_info {
 	uint16_t msix_base; /* msix vector base from */
 	/* queue bitmask for each vector */
 	uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
+	uint16_t txq_map[IAVF_MAX_MSIX_VECTORS];
 };
 
 #define IAVF_MAX_PKT_TYPE 256
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 846e604..187a31c 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 		/* map all queues to the same interrupt */
 		for (i = 0; i < dev->data->nb_rx_queues; i++)
 			vf->rxq_map[vf->msix_base] |= 1 << i;
+		for (i = 0; i < dev->data->nb_tx_queues; i++)
+			vf->txq_map[vf->msix_base] |= 1 << i;
 	} else {
 		if (!rte_intr_allow_others(intr_handle)) {
 			vf->nb_msix = 1;
@@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 				vf->rxq_map[vf->msix_base] |= 1 << i;
 				intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID;
 			}
+			for (i = 0; i < dev->data->nb_tx_queues; i++)
+				vf->txq_map[vf->msix_base] |= 1 << i;
 			PMD_DRV_LOG(DEBUG,
 				    "vector %u are mapping to all Rx queues",
 				    vf->msix_base);
@@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 				if (vec >= vf->nb_msix)
 					vec = IAVF_RX_VEC_START;
 			}
+			for (i = 0; i < dev->data->nb_tx_queues; i++) {
+				vf->txq_map[vec++] |= 1 << i;
+				if (vec >= vf->nb_msix)
+					vec = IAVF_RX_VEC_START;
+			}
 			PMD_DRV_LOG(DEBUG,
 				    "%u vectors are mapping to %u Rx queues",
 				    vf->nb_msix, dev->data->nb_rx_queues);
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..620e011 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 		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->txq_map = vf->txq_map[vf->msix_base + i];
 		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
 	}
 
-- 
2.7.5

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

* [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-26  5:07     ` [dpdk-dev] [PATCH v4] " Wei Zhao
@ 2019-03-26  5:07       ` Wei Zhao
  2019-03-26  7:03       ` Zhang, Qi Z
  1 sibling, 0 replies; 20+ messages in thread
From: Wei Zhao @ 2019-03-26  5:07 UTC (permalink / raw)
  To: dev; +Cc: stable, qi.z.zhang, Wei Zhao

There is need to align to kernel iavf code when setting Tx
queue interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP,
if not it maybe cause restart iavf port error 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

v3:
update git comment and change fix code as suggestion

v4:
add txq_map in struct avf_info to keep vector mapping info
---
 drivers/net/iavf/iavf.h        | 1 +
 drivers/net/iavf/iavf_ethdev.c | 9 +++++++++
 drivers/net/iavf/iavf_vchnl.c  | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h
index e6e3e8d..81d0054 100644
--- a/drivers/net/iavf/iavf.h
+++ b/drivers/net/iavf/iavf.h
@@ -107,6 +107,7 @@ struct iavf_info {
 	uint16_t msix_base; /* msix vector base from */
 	/* queue bitmask for each vector */
 	uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
+	uint16_t txq_map[IAVF_MAX_MSIX_VECTORS];
 };
 
 #define IAVF_MAX_PKT_TYPE 256
diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c
index 846e604..187a31c 100644
--- a/drivers/net/iavf/iavf_ethdev.c
+++ b/drivers/net/iavf/iavf_ethdev.c
@@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 		/* map all queues to the same interrupt */
 		for (i = 0; i < dev->data->nb_rx_queues; i++)
 			vf->rxq_map[vf->msix_base] |= 1 << i;
+		for (i = 0; i < dev->data->nb_tx_queues; i++)
+			vf->txq_map[vf->msix_base] |= 1 << i;
 	} else {
 		if (!rte_intr_allow_others(intr_handle)) {
 			vf->nb_msix = 1;
@@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 				vf->rxq_map[vf->msix_base] |= 1 << i;
 				intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID;
 			}
+			for (i = 0; i < dev->data->nb_tx_queues; i++)
+				vf->txq_map[vf->msix_base] |= 1 << i;
 			PMD_DRV_LOG(DEBUG,
 				    "vector %u are mapping to all Rx queues",
 				    vf->msix_base);
@@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev *dev,
 				if (vec >= vf->nb_msix)
 					vec = IAVF_RX_VEC_START;
 			}
+			for (i = 0; i < dev->data->nb_tx_queues; i++) {
+				vf->txq_map[vec++] |= 1 << i;
+				if (vec >= vf->nb_msix)
+					vec = IAVF_RX_VEC_START;
+			}
 			PMD_DRV_LOG(DEBUG,
 				    "%u vectors are mapping to %u Rx queues",
 				    vf->nb_msix, dev->data->nb_rx_queues);
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6381fb6..620e011 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
 		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->txq_map = vf->txq_map[vf->msix_base + i];
 		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
 	}
 
-- 
2.7.5


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

* Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-26  5:07     ` [dpdk-dev] [PATCH v4] " Wei Zhao
  2019-03-26  5:07       ` Wei Zhao
@ 2019-03-26  7:03       ` Zhang, Qi Z
  2019-03-26  7:03         ` Zhang, Qi Z
  2019-04-02  2:49         ` Zhang, Qi Z
  1 sibling, 2 replies; 20+ messages in thread
From: Zhang, Qi Z @ 2019-03-26  7:03 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, March 26, 2019 1:08 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
> 
> There is need to align to kernel iavf code when setting Tx queue interrupt vector
> in messge VIRTCHNL_OP_CONFIG_IRQ_MAP, if not it maybe cause restart iavf
> port error in some scenario.

Actually , we are not aligned with kernel iavf's implementation which assume rxq = txq

Reword the commit log as below:

	According to latest AVF virtual channel spec, interrupt vector is
    required to be configured for each Tx queue.
    The patch implemented the mechanism by assign interrupt vector to
    each Tx queue with round robin (same method for Rx queue).
    This also fixed the unexpected Tx queue config error when hosted by
    ice kernel driver.

> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel with above change.

Thanks
Qi

> ---
> 
> v2:
> update git log and add new work around
> 
> v3:
> update git comment and change fix code as suggestion
> 
> v4:
> add txq_map in struct avf_info to keep vector mapping info
> ---
>  drivers/net/iavf/iavf.h        | 1 +
>  drivers/net/iavf/iavf_ethdev.c | 9 +++++++++  drivers/net/iavf/iavf_vchnl.c
> | 2 +-
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> e6e3e8d..81d0054 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -107,6 +107,7 @@ struct iavf_info {
>  	uint16_t msix_base; /* msix vector base from */
>  	/* queue bitmask for each vector */
>  	uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
> +	uint16_t txq_map[IAVF_MAX_MSIX_VECTORS];
>  };
> 
>  #define IAVF_MAX_PKT_TYPE 256
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index
> 846e604..187a31c 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev
> *dev,
>  		/* map all queues to the same interrupt */
>  		for (i = 0; i < dev->data->nb_rx_queues; i++)
>  			vf->rxq_map[vf->msix_base] |= 1 << i;
> +		for (i = 0; i < dev->data->nb_tx_queues; i++)
> +			vf->txq_map[vf->msix_base] |= 1 << i;
>  	} else {
>  		if (!rte_intr_allow_others(intr_handle)) {
>  			vf->nb_msix = 1;
> @@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev
> *dev,
>  				vf->rxq_map[vf->msix_base] |= 1 << i;
>  				intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID;
>  			}
> +			for (i = 0; i < dev->data->nb_tx_queues; i++)
> +				vf->txq_map[vf->msix_base] |= 1 << i;
>  			PMD_DRV_LOG(DEBUG,
>  				    "vector %u are mapping to all Rx queues",
>  				    vf->msix_base);
> @@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev
> *dev,
>  				if (vec >= vf->nb_msix)
>  					vec = IAVF_RX_VEC_START;
>  			}
> +			for (i = 0; i < dev->data->nb_tx_queues; i++) {
> +				vf->txq_map[vec++] |= 1 << i;
> +				if (vec >= vf->nb_msix)
> +					vec = IAVF_RX_VEC_START;
> +			}
>  			PMD_DRV_LOG(DEBUG,
>  				    "%u vectors are mapping to %u Rx queues",
>  				    vf->nb_msix, dev->data->nb_rx_queues); diff --git
> a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 6381fb6..620e011 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  		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->txq_map = vf->txq_map[vf->msix_base + i];
>  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
>  	}
> 
> --
> 2.7.5

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

* Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-26  7:03       ` Zhang, Qi Z
@ 2019-03-26  7:03         ` Zhang, Qi Z
  2019-04-02  2:49         ` Zhang, Qi Z
  1 sibling, 0 replies; 20+ messages in thread
From: Zhang, Qi Z @ 2019-03-26  7:03 UTC (permalink / raw)
  To: Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, March 26, 2019 1:08 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> <wei.zhao1@intel.com>
> Subject: [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
> 
> There is need to align to kernel iavf code when setting Tx queue interrupt vector
> in messge VIRTCHNL_OP_CONFIG_IRQ_MAP, if not it maybe cause restart iavf
> port error in some scenario.

Actually , we are not aligned with kernel iavf's implementation which assume rxq = txq

Reword the commit log as below:

	According to latest AVF virtual channel spec, interrupt vector is
    required to be configured for each Tx queue.
    The patch implemented the mechanism by assign interrupt vector to
    each Tx queue with round robin (same method for Rx queue).
    This also fixed the unexpected Tx queue config error when hosted by
    ice kernel driver.

> 
> Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel with above change.

Thanks
Qi

> ---
> 
> v2:
> update git log and add new work around
> 
> v3:
> update git comment and change fix code as suggestion
> 
> v4:
> add txq_map in struct avf_info to keep vector mapping info
> ---
>  drivers/net/iavf/iavf.h        | 1 +
>  drivers/net/iavf/iavf_ethdev.c | 9 +++++++++  drivers/net/iavf/iavf_vchnl.c
> | 2 +-
>  3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> e6e3e8d..81d0054 100644
> --- a/drivers/net/iavf/iavf.h
> +++ b/drivers/net/iavf/iavf.h
> @@ -107,6 +107,7 @@ struct iavf_info {
>  	uint16_t msix_base; /* msix vector base from */
>  	/* queue bitmask for each vector */
>  	uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
> +	uint16_t txq_map[IAVF_MAX_MSIX_VECTORS];
>  };
> 
>  #define IAVF_MAX_PKT_TYPE 256
> diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index
> 846e604..187a31c 100644
> --- a/drivers/net/iavf/iavf_ethdev.c
> +++ b/drivers/net/iavf/iavf_ethdev.c
> @@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev
> *dev,
>  		/* map all queues to the same interrupt */
>  		for (i = 0; i < dev->data->nb_rx_queues; i++)
>  			vf->rxq_map[vf->msix_base] |= 1 << i;
> +		for (i = 0; i < dev->data->nb_tx_queues; i++)
> +			vf->txq_map[vf->msix_base] |= 1 << i;
>  	} else {
>  		if (!rte_intr_allow_others(intr_handle)) {
>  			vf->nb_msix = 1;
> @@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev
> *dev,
>  				vf->rxq_map[vf->msix_base] |= 1 << i;
>  				intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID;
>  			}
> +			for (i = 0; i < dev->data->nb_tx_queues; i++)
> +				vf->txq_map[vf->msix_base] |= 1 << i;
>  			PMD_DRV_LOG(DEBUG,
>  				    "vector %u are mapping to all Rx queues",
>  				    vf->msix_base);
> @@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct rte_eth_dev
> *dev,
>  				if (vec >= vf->nb_msix)
>  					vec = IAVF_RX_VEC_START;
>  			}
> +			for (i = 0; i < dev->data->nb_tx_queues; i++) {
> +				vf->txq_map[vec++] |= 1 << i;
> +				if (vec >= vf->nb_msix)
> +					vec = IAVF_RX_VEC_START;
> +			}
>  			PMD_DRV_LOG(DEBUG,
>  				    "%u vectors are mapping to %u Rx queues",
>  				    vf->nb_msix, dev->data->nb_rx_queues); diff --git
> a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> 6381fb6..620e011 100644
> --- a/drivers/net/iavf/iavf_vchnl.c
> +++ b/drivers/net/iavf/iavf_vchnl.c
> @@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
>  		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->txq_map = vf->txq_map[vf->msix_base + i];
>  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
>  	}
> 
> --
> 2.7.5


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

* Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
  2019-03-26  7:03       ` Zhang, Qi Z
  2019-03-26  7:03         ` Zhang, Qi Z
@ 2019-04-02  2:49         ` Zhang, Qi Z
  2019-04-02  2:49           ` Zhang, Qi Z
  1 sibling, 1 reply; 20+ messages in thread
From: Zhang, Qi Z @ 2019-04-02  2:49 UTC (permalink / raw)
  To: Zhang, Qi Z, Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Tuesday, March 26, 2019 3:03 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration
> error
> 
> 
> 
> > -----Original Message-----
> > From: Zhao1, Wei
> > Sent: Tuesday, March 26, 2019 1:08 PM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [PATCH v4] net/iavf: fix Tx interrupt vertor configuration
> > error
> >
> > There is need to align to kernel iavf code when setting Tx queue
> > interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP, if not it maybe
> > cause restart iavf port error in some scenario.
> 
> Actually , we are not aligned with kernel iavf's implementation which assume rxq
> = txq
> 
> Reword the commit log as below:
> 
> 	According to latest AVF virtual channel spec, interrupt vector is
>     required to be configured for each Tx queue.
>     The patch implemented the mechanism by assign interrupt vector to
>     each Tx queue with round robin (same method for Rx queue).
>     This also fixed the unexpected Tx queue config error when hosted by
>     ice kernel driver.
> 
> >
> > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> >
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Applied to dpdk-next-net-intel with above change.

The patch is dropped due to the limitation is removed from virtual channel, no need to worry about Tx interrupt vector in vf side.


> 
> Thanks
> Qi
> 
> > ---
> >
> > v2:
> > update git log and add new work around
> >
> > v3:
> > update git comment and change fix code as suggestion
> >
> > v4:
> > add txq_map in struct avf_info to keep vector mapping info
> > ---
> >  drivers/net/iavf/iavf.h        | 1 +
> >  drivers/net/iavf/iavf_ethdev.c | 9 +++++++++
> > drivers/net/iavf/iavf_vchnl.c
> > | 2 +-
> >  3 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> > e6e3e8d..81d0054 100644
> > --- a/drivers/net/iavf/iavf.h
> > +++ b/drivers/net/iavf/iavf.h
> > @@ -107,6 +107,7 @@ struct iavf_info {
> >  	uint16_t msix_base; /* msix vector base from */
> >  	/* queue bitmask for each vector */
> >  	uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
> > +	uint16_t txq_map[IAVF_MAX_MSIX_VECTORS];
> >  };
> >
> >  #define IAVF_MAX_PKT_TYPE 256
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 846e604..187a31c 100644
> > --- a/drivers/net/iavf/iavf_ethdev.c
> > +++ b/drivers/net/iavf/iavf_ethdev.c
> > @@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct
> > rte_eth_dev *dev,
> >  		/* map all queues to the same interrupt */
> >  		for (i = 0; i < dev->data->nb_rx_queues; i++)
> >  			vf->rxq_map[vf->msix_base] |= 1 << i;
> > +		for (i = 0; i < dev->data->nb_tx_queues; i++)
> > +			vf->txq_map[vf->msix_base] |= 1 << i;
> >  	} else {
> >  		if (!rte_intr_allow_others(intr_handle)) {
> >  			vf->nb_msix = 1;
> > @@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct
> > rte_eth_dev *dev,
> >  				vf->rxq_map[vf->msix_base] |= 1 << i;
> >  				intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID;
> >  			}
> > +			for (i = 0; i < dev->data->nb_tx_queues; i++)
> > +				vf->txq_map[vf->msix_base] |= 1 << i;
> >  			PMD_DRV_LOG(DEBUG,
> >  				    "vector %u are mapping to all Rx queues",
> >  				    vf->msix_base);
> > @@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct
> > rte_eth_dev *dev,
> >  				if (vec >= vf->nb_msix)
> >  					vec = IAVF_RX_VEC_START;
> >  			}
> > +			for (i = 0; i < dev->data->nb_tx_queues; i++) {
> > +				vf->txq_map[vec++] |= 1 << i;
> > +				if (vec >= vf->nb_msix)
> > +					vec = IAVF_RX_VEC_START;
> > +			}
> >  			PMD_DRV_LOG(DEBUG,
> >  				    "%u vectors are mapping to %u Rx queues",
> >  				    vf->nb_msix, dev->data->nb_rx_queues); diff --git
> > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> > 6381fb6..620e011 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
> >  		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->txq_map = vf->txq_map[vf->msix_base + i];
> >  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
> >  	}
> >
> > --
> > 2.7.5

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

* Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
  2019-04-02  2:49         ` Zhang, Qi Z
@ 2019-04-02  2:49           ` Zhang, Qi Z
  0 siblings, 0 replies; 20+ messages in thread
From: Zhang, Qi Z @ 2019-04-02  2:49 UTC (permalink / raw)
  To: Zhang, Qi Z, Zhao1, Wei, dev; +Cc: stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Tuesday, March 26, 2019 3:03 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration
> error
> 
> 
> 
> > -----Original Message-----
> > From: Zhao1, Wei
> > Sent: Tuesday, March 26, 2019 1:08 PM
> > To: dev@dpdk.org
> > Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei
> > <wei.zhao1@intel.com>
> > Subject: [PATCH v4] net/iavf: fix Tx interrupt vertor configuration
> > error
> >
> > There is need to align to kernel iavf code when setting Tx queue
> > interrupt vector in messge VIRTCHNL_OP_CONFIG_IRQ_MAP, if not it maybe
> > cause restart iavf port error in some scenario.
> 
> Actually , we are not aligned with kernel iavf's implementation which assume rxq
> = txq
> 
> Reword the commit log as below:
> 
> 	According to latest AVF virtual channel spec, interrupt vector is
>     required to be configured for each Tx queue.
>     The patch implemented the mechanism by assign interrupt vector to
>     each Tx queue with round robin (same method for Rx queue).
>     This also fixed the unexpected Tx queue config error when hosted by
>     ice kernel driver.
> 
> >
> > Fixes: 69dd4c3d0898 ("net/avf: enable queue and device")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> >
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Applied to dpdk-next-net-intel with above change.

The patch is dropped due to the limitation is removed from virtual channel, no need to worry about Tx interrupt vector in vf side.


> 
> Thanks
> Qi
> 
> > ---
> >
> > v2:
> > update git log and add new work around
> >
> > v3:
> > update git comment and change fix code as suggestion
> >
> > v4:
> > add txq_map in struct avf_info to keep vector mapping info
> > ---
> >  drivers/net/iavf/iavf.h        | 1 +
> >  drivers/net/iavf/iavf_ethdev.c | 9 +++++++++
> > drivers/net/iavf/iavf_vchnl.c
> > | 2 +-
> >  3 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index
> > e6e3e8d..81d0054 100644
> > --- a/drivers/net/iavf/iavf.h
> > +++ b/drivers/net/iavf/iavf.h
> > @@ -107,6 +107,7 @@ struct iavf_info {
> >  	uint16_t msix_base; /* msix vector base from */
> >  	/* queue bitmask for each vector */
> >  	uint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];
> > +	uint16_t txq_map[IAVF_MAX_MSIX_VECTORS];
> >  };
> >
> >  #define IAVF_MAX_PKT_TYPE 256
> > diff --git a/drivers/net/iavf/iavf_ethdev.c
> > b/drivers/net/iavf/iavf_ethdev.c index 846e604..187a31c 100644
> > --- a/drivers/net/iavf/iavf_ethdev.c
> > +++ b/drivers/net/iavf/iavf_ethdev.c
> > @@ -336,6 +336,8 @@ static int iavf_config_rx_queues_irqs(struct
> > rte_eth_dev *dev,
> >  		/* map all queues to the same interrupt */
> >  		for (i = 0; i < dev->data->nb_rx_queues; i++)
> >  			vf->rxq_map[vf->msix_base] |= 1 << i;
> > +		for (i = 0; i < dev->data->nb_tx_queues; i++)
> > +			vf->txq_map[vf->msix_base] |= 1 << i;
> >  	} else {
> >  		if (!rte_intr_allow_others(intr_handle)) {
> >  			vf->nb_msix = 1;
> > @@ -344,6 +346,8 @@ static int iavf_config_rx_queues_irqs(struct
> > rte_eth_dev *dev,
> >  				vf->rxq_map[vf->msix_base] |= 1 << i;
> >  				intr_handle->intr_vec[i] = IAVF_MISC_VEC_ID;
> >  			}
> > +			for (i = 0; i < dev->data->nb_tx_queues; i++)
> > +				vf->txq_map[vf->msix_base] |= 1 << i;
> >  			PMD_DRV_LOG(DEBUG,
> >  				    "vector %u are mapping to all Rx queues",
> >  				    vf->msix_base);
> > @@ -361,6 +365,11 @@ static int iavf_config_rx_queues_irqs(struct
> > rte_eth_dev *dev,
> >  				if (vec >= vf->nb_msix)
> >  					vec = IAVF_RX_VEC_START;
> >  			}
> > +			for (i = 0; i < dev->data->nb_tx_queues; i++) {
> > +				vf->txq_map[vec++] |= 1 << i;
> > +				if (vec >= vf->nb_msix)
> > +					vec = IAVF_RX_VEC_START;
> > +			}
> >  			PMD_DRV_LOG(DEBUG,
> >  				    "%u vectors are mapping to %u Rx queues",
> >  				    vf->nb_msix, dev->data->nb_rx_queues); diff --git
> > a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index
> > 6381fb6..620e011 100644
> > --- a/drivers/net/iavf/iavf_vchnl.c
> > +++ b/drivers/net/iavf/iavf_vchnl.c
> > @@ -614,7 +614,7 @@ iavf_config_irq_map(struct iavf_adapter *adapter)
> >  		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->txq_map = vf->txq_map[vf->msix_base + i];
> >  		vecmap->rxq_map = vf->rxq_map[vf->msix_base + i];
> >  	}
> >
> > --
> > 2.7.5


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

end of thread, other threads:[~2019-04-02  2:49 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19  3:04 [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number configuration error Wei Zhao
2019-03-19  3:04 ` Wei Zhao
2019-03-19  4:00 ` Zhang, Qi Z
2019-03-19  4:00   ` Zhang, Qi Z
2019-03-19  5:57   ` Zhao1, Wei
2019-03-19  5:57     ` Zhao1, Wei
2019-03-19  4:16 ` Stillwell Jr, Paul M
2019-03-19  4:16   ` Stillwell Jr, Paul M
2019-03-21  3:30   ` Zhao1, Wei
2019-03-21  3:30     ` Zhao1, Wei
2019-03-22  6:27 ` [dpdk-dev] [PATCH v2] " Wei Zhao
2019-03-22  6:27   ` Wei Zhao
2019-03-26  2:40   ` [dpdk-dev] [PATCH v3] net/iavf: fix Tx interrupt vertor " Wei Zhao
2019-03-26  2:40     ` Wei Zhao
2019-03-26  5:07     ` [dpdk-dev] [PATCH v4] " Wei Zhao
2019-03-26  5:07       ` Wei Zhao
2019-03-26  7:03       ` Zhang, Qi Z
2019-03-26  7:03         ` Zhang, Qi Z
2019-04-02  2:49         ` Zhang, Qi Z
2019-04-02  2:49           ` Zhang, Qi Z

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