DPDK patches and discussions
 help / color / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Zhang, Xiao" <xiao.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [v4] net/i40e: fix vf runtime queues rss config
Date: Tue, 13 Aug 2019 01:43:08 +0000
Message-ID: <94479800C636CB44BD422CB454846E013CE245F8@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1565631812-3136-1-git-send-email-xiao.zhang@intel.com>

Hi,

> -----Original Message-----
> From: Zhang, Xiao
> Sent: Tuesday, August 13, 2019 1:44 AM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Zhang, Xiao <xiao.zhang@intel.com>;
> stable@dpdk.org
> Subject: [v4] net/i40e: fix vf runtime queues rss config
> 
> I40evf queue can not work properly with kernel pf driver. Eg. when configure
> 8 queues pair, only 4 queues can receive packets, and half packets will be lost
> if using 2 queues pair.
> This issue is caused by misconfiguration of look up table, use aq command to
> setup the lut to make it work properly.
> 
> Fixes: cea7a51c1750 ("i40evf: support RSS")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiao Zhang <xiao.zhang@intel.com>
> ---
> v4 move local variable definition to the begin of the function
> v3 move LUT configuration in to i40evf_configure_rss
> v2 change for loop format to avoid build patch issue
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 32 ++++++++++++++++++++++++++------
>  1 file changed, 26 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 308fb98..8c34afb 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -2598,7 +2598,10 @@ i40evf_config_rss(struct i40e_vf *vf)
>  	struct i40e_hw *hw = I40E_VF_TO_HW(vf);
>  	struct rte_eth_rss_conf rss_conf;
>  	uint32_t i, j, lut = 0, nb_q = (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4;
> +	uint32_t rss_lut_size = (I40E_VFQF_HLUT1_MAX_INDEX + 1) * 4;
>  	uint16_t num;
> +	uint8_t *lut;

The pointer *lut is conflict with above 'uint32_t lut = 0'.

> +	int ret;
> 
>  	if (vf->dev_data->dev_conf.rxmode.mq_mode != ETH_MQ_RX_RSS) {
>  		i40evf_disable_rss(vf);
> @@ -2608,12 +2611,29 @@ i40evf_config_rss(struct i40e_vf *vf)
> 
>  	num = RTE_MIN(vf->dev_data->nb_rx_queues,
> I40E_MAX_QP_NUM_PER_VF);
>  	/* Fill out the look up table */
> -	for (i = 0, j = 0; i < nb_q; i++, j++) {
> -		if (j >= num)
> -			j = 0;
> -		lut = (lut << 8) | j;
> -		if ((i & 3) == 3)
> -			I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> 2), lut);
> +	if (!(vf->flags & I40E_FLAG_RSS_AQ_CAPABLE)) {
> +		for (i = 0, j = 0; i < nb_q; i++, j++) {
> +			if (j >= num)
> +				j = 0;
> +			lut = (lut << 8) | j;
> +			if ((i & 3) == 3)
> +				I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >>
> 2), lut);
> +		}
> +	} else {
> +		lut = rte_zmalloc("i40e_rss_lut", rss_lut_size, 0);
> +		if (!lut) {
> +			PMD_DRV_LOG(ERR, "No memory can be allocated");
> +			return -ENOMEM;
> +		}
> +
> +		for (i = 0; i < rss_lut_size; i++)
> +			lut[i] = i % vf->num_queue_pairs;
> +
> +		ret = i40evf_set_rss_lut(&vf->vsi, lut,
> +					 rss_lut_size);
> +		rte_free(lut);
> +		if (ret)
> +			return ret;
>  	}
> 
>  	rss_conf = vf->dev_data->dev_conf.rx_adv_conf.rss_conf;
> --
> 2.7.4


  parent reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07  0:09 [dpdk-dev] " Xiao Zhang
2019-08-08 16:41 ` [dpdk-dev] [v2] " Xiao Zhang
2019-08-09  2:44   ` Xing, Beilei
2019-08-09  3:25     ` Zhang, Xiao
2019-08-12 10:29   ` [dpdk-dev] [v3] " Xiao Zhang
2019-08-12 17:43     ` [dpdk-dev] [v4] " Xiao Zhang
2019-08-12 12:07       ` Aaron Conole
2019-08-13  1:43       ` Xing, Beilei [this message]
2019-08-13 10:40       ` [dpdk-dev] [v5] " Xiao Zhang
2019-08-13  2:21         ` Xing, Beilei
2019-08-13  6:28         ` Ye Xiaolong
2019-08-13  7:24           ` Zhang, Xiao
2019-08-13  7:37             ` Ye Xiaolong
2019-08-13  7:59               ` Zhang, Xiao
2019-08-13 22:17         ` [dpdk-dev] [v6] " Xiao Zhang
2019-08-13 14:55           ` Ye Xiaolong

Reply instructions:

You may reply publically 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=94479800C636CB44BD422CB454846E013CE245F8@SHSMSX101.ccr.corp.intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=xiao.zhang@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

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/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 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


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