From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 128BCC32750 for ; Tue, 13 Aug 2019 06:29:11 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id A07FF20673 for ; Tue, 13 Aug 2019 06:29:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A07FF20673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1148C8F96; Tue, 13 Aug 2019 08:29:09 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4D2705681; Tue, 13 Aug 2019 08:29:06 +0200 (CEST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 23:29:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,380,1559545200"; d="scan'208";a="260034419" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.5]) by orsmga001.jf.intel.com with ESMTP; 12 Aug 2019 23:29:03 -0700 Date: Tue, 13 Aug 2019 14:28:15 +0800 From: Ye Xiaolong To: Xiao Zhang Cc: dev@dpdk.org, beilei.xing@intel.com, stable@dpdk.org Message-ID: <20190813062815.GA10508@intel.com> References: <1565631812-3136-1-git-send-email-xiao.zhang@intel.com> <1565692851-36962-1-git-send-email-xiao.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1565692851-36962-1-git-send-email-xiao.zhang@intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [v5] net/i40e: fix vf runtime queues rss config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, Xiao On 08/13, Xiao Zhang wrote: >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. So the original code of lookup table configuration is problematic? Can we just remove them? Thanks, Xiaolong > >Fixes: cea7a51c1750 ("i40evf: support RSS") >Cc: stable@dpdk.org > >Signed-off-by: Xiao Zhang >--- >v5 fix compile issue >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..c77b30c 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_info; >+ 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_info = rte_zmalloc("i40e_rss_lut", rss_lut_size, 0); >+ if (!lut_info) { >+ PMD_DRV_LOG(ERR, "No memory can be allocated"); >+ return -ENOMEM; >+ } >+ >+ for (i = 0; i < rss_lut_size; i++) >+ lut_info[i] = i % vf->num_queue_pairs; >+ >+ ret = i40evf_set_rss_lut(&vf->vsi, lut_info, >+ rss_lut_size); >+ rte_free(lut_info); >+ if (ret) >+ return ret; > } > > rss_conf = vf->dev_data->dev_conf.rx_adv_conf.rss_conf; >-- >2.7.4 >