patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: Jiang Mao <maox.jiang@intel.com>, xiaolong.ye@intel.com
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors
Date: Tue, 21 Jul 2020 11:57:38 +0800
Message-ID: <13cbfa88-5d4d-7d6b-5b3a-9f77b411692b@intel.com> (raw)
In-Reply-To: <20200708195034.4495-1-maox.jiang@intel.com>

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

  reply	other threads:[~2020-07-21  3:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09  2:25 [dpdk-stable] " Jiang Mao
2020-06-09  2:25 ` [dpdk-stable] [PATCH 2/2] net/i40e: fix fdir allocating msix resource error Jiang Mao
2020-06-17  5:43   ` [dpdk-stable] [dpdk-dev] " Huang, ZhiminX
2020-07-08 19:52   ` [dpdk-stable] " Jiang Mao
2020-07-20 10:31     ` [dpdk-stable] [dpdk-dev] " Zhang, Qi Z
2020-07-21 19:51     ` [dpdk-stable] [PATCH] " Jiang Mao
2020-06-17  5:42 ` [dpdk-stable] [dpdk-dev] [PATCH 1/2] net/i40e: fix binding interrupt without msix vectors Huang, ZhiminX
2020-07-08 19:50 ` [dpdk-stable] " Jiang Mao
2020-07-21  3:57   ` Jeff Guo [this message]
2020-07-21  6:50     ` [dpdk-stable] [dpdk-dev] " Jiang, MaoX
2020-07-22 17:57   ` [dpdk-stable] [PATCH v3 " Jiang Mao
2020-07-22 17:57     ` [dpdk-stable] [PATCH v3 2/2] net/i40e: fix fdir allocating msix resource error Jiang Mao
2020-07-23 16:11       ` [dpdk-stable] [PATCH v4 " Jiang Mao
2020-07-23 12:40         ` Zhang, Qi Z
2020-07-23 15:27     ` [dpdk-stable] [PATCH v4 1/2] net/i40e: fix binding interrupt without msix vectors Jiang Mao
2020-07-23 12:40       ` 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=13cbfa88-5d4d-7d6b-5b3a-9f77b411692b@intel.com \
    --to=jia.guo@intel.com \
    --cc=dev@dpdk.org \
    --cc=maox.jiang@intel.com \
    --cc=stable@dpdk.org \
    --cc=xiaolong.ye@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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git