DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Zhao1, Wei" <wei.zhao1@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v4] net/iavf: fix Tx interrupt vertor configuration error
Date: Tue, 26 Mar 2019 07:03:01 +0000	[thread overview]
Message-ID: <039ED4275CED7440929022BC67E7061153353827@SHSMSX103.ccr.corp.intel.com> (raw)
Message-ID: <20190326070301.UVgpvuVGdOZ4Te4hkeoa4WxsvvvElS2FenTrIC_y5XI@z> (raw)
In-Reply-To: <1553576879-8824-1-git-send-email-wei.zhao1@intel.com>



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


  parent reply	other threads:[~2019-03-26  7:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19  3:04 [dpdk-dev] [PATCH] net/iavf: fix vertor interrupt number " 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 [this message]
2019-03-26  7:03         ` Zhang, Qi Z
2019-04-02  2:49         ` Zhang, Qi Z
2019-04-02  2:49           ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=039ED4275CED7440929022BC67E7061153353827@SHSMSX103.ccr.corp.intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wei.zhao1@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).