All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Shougang Wang <shougangx.wang@intel.com>, dev@dpdk.org
Cc: qiming.yang@intel.com, qi.z.zhang@intel.com
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix multiple interrupt for VF
Date: Tue, 18 Feb 2020 12:30:07 +0000	[thread overview]
Message-ID: <312857e7-1137-e0b3-13e7-639a4b4af500@intel.com> (raw)
In-Reply-To: <20200217030935.3504-1-shougangx.wang@intel.com>

On 2/17/2020 3:09 AM, Shougang Wang wrote:
> Interrupt mapping should be 1:n queue(s).This patch fixes the
> logic of interrupt bind by code reconstruction.
> 
> Fixes: 6a6cf5f88b4a ("net/i40e: enable multi-queue Rx interrupt for VF")
> 
> Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 63 ++++++++++++++++++++-----------
>  1 file changed, 42 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index b84637309..868117508 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -651,47 +651,68 @@ i40evf_config_irq_map(struct rte_eth_dev *dev)
>  {
>  	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
>  	struct vf_cmd_info args;
> -	uint8_t cmd_buffer[sizeof(struct virtchnl_irq_map_info) + \
> -		sizeof(struct virtchnl_vector_map) * dev->data->nb_rx_queues];
> +	uint8_t *cmd_buffer = NULL;
>  	struct virtchnl_irq_map_info *map_info;
>  	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
>  	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
> -	uint32_t vector_id;
> -	int i, err;
> +	uint32_t vec, cmd_buffer_size, max_vectors, nb_msix, msix_base, i;
> +	uint16_t rxq_map[vf->vf_res->max_vectors];
> +	int err;
>  
>  	if (dev->data->dev_conf.intr_conf.rxq != 0 &&
> -	    rte_intr_allow_others(intr_handle))
> -		vector_id = I40E_RX_VEC_START;
> -	else
> -		vector_id = I40E_MISC_VEC_ID;
> +		rte_intr_allow_others(intr_handle)) {
> +		msix_base = I40E_RX_VEC_START;
> +		/* For interrupt mode, available vector id is from 1. */
> +		max_vectors = vf->vf_res->max_vectors - 1;
> +		nb_msix = RTE_MIN(max_vectors, intr_handle->nb_efd);
> +
> +		vec = msix_base;
> +		for (i = 0; i < dev->data->nb_rx_queues; i++) {
> +			rxq_map[vec] |= 1 << i;

ICC is causing following error [1] which looks like a valid one, what do you
thing memset the array before using it?

[1]
.../drivers/net/i40e/i40e_ethdev_vf.c(671): warning #3656: variable "rxq_map"
may be used before its value is set
        rxq_map[vec] |= 1 << i;
        ^

      parent reply	other threads:[~2020-02-18 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17  3:09 [dpdk-dev] [PATCH] net/i40e: fix multiple interrupt for VF Shougang Wang
2020-02-18  5:50 ` Zhang, Qi Z
2020-02-18  9:38   ` Ye Xiaolong
2020-02-18 12:30 ` Ferruh Yigit [this message]

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=312857e7-1137-e0b3-13e7-639a4b4af500@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=shougangx.wang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.