From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6309BA00E6 for ; Tue, 6 Aug 2019 17:14:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CB821B950; Tue, 6 Aug 2019 17:14:36 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id AF79B1B945; Tue, 6 Aug 2019 17:14:34 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 08:14:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="165011385" Received: from npg-dpdk-zhangxiao.sh.intel.com ([10.67.110.190]) by orsmga007.jf.intel.com with ESMTP; 06 Aug 2019 08:14:32 -0700 From: Xiao Zhang To: dev@dpdk.org Cc: qi.z.zhang@intel.com, beilei.xing@intel.com, Xiao Zhang , stable@dpdk.org Date: Wed, 7 Aug 2019 08:09:02 +0800 Message-Id: <1565136542-7652-1-git-send-email-xiao.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] 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" I40evf queue can not work properly with kernel pf driver. Eg. when configured to use 8 queue pairs, only 4 queues can receive packets, and half packets will be lost if using 2 queue pairs. 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 --- drivers/net/i40e/i40e_ethdev_vf.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 308fb98..43ce2bd 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -2574,6 +2574,25 @@ i40evf_hw_rss_hash_set(struct i40e_vf *vf, struct rte_eth_rss_conf *rss_conf) if (ret) return ret; + if (vf->flags & I40E_FLAG_RSS_AQ_CAPABLE) { + uint8_t *lut; + uint32_t rss_lut_size = (I40E_VFQF_HLUT1_MAX_INDEX + 1) * 4; + lut = rte_zmalloc("i40e_rss_lut", rss_lut_size, 0); + if (!lut) { + PMD_DRV_LOG(ERR, "No memory can be allocated"); + return -ENOMEM; + } + + for (uint32_t 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; + } + hena = i40e_config_hena(vf->adapter, rss_conf->rss_hf); i40e_write_rx_ctl(hw, I40E_VFQF_HENA(0), (uint32_t)hena); i40e_write_rx_ctl(hw, I40E_VFQF_HENA(1), (uint32_t)(hena >> 32)); @@ -2607,13 +2626,15 @@ 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)) { + /* 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); + } } rss_conf = vf->dev_data->dev_conf.rx_adv_conf.rss_conf; -- 2.7.4