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 4103EA0471 for ; Tue, 13 Aug 2019 03:43:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ED5591252; Tue, 13 Aug 2019 03:43:14 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id DC21E1252; Tue, 13 Aug 2019 03:43:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 18:43:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,379,1559545200"; d="scan'208";a="351389547" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 12 Aug 2019 18:43:12 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 18:43:12 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 12 Aug 2019 18:43:11 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 12 Aug 2019 18:43:11 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.80]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.65]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 09:43:09 +0800 From: "Xing, Beilei" To: "Zhang, Xiao" , "dev@dpdk.org" CC: "stable@dpdk.org" Thread-Topic: [v4] net/i40e: fix vf runtime queues rss config Thread-Index: AQHVUOrFZgP0DYc3CE+0Lz0GeKZHiqb4ThFg Date: Tue, 13 Aug 2019 01:43:08 +0000 Message-ID: <94479800C636CB44BD422CB454846E013CE245F8@SHSMSX101.ccr.corp.intel.com> References: <1565605747-7575-1-git-send-email-xiao.zhang@intel.com> <1565631812-3136-1-git-send-email-xiao.zhang@intel.com> In-Reply-To: <1565631812-3136-1-git-send-email-xiao.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [v4] net/i40e: fix vf runtime queues rss config X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, > -----Original Message----- > From: Zhang, Xiao > Sent: Tuesday, August 13, 2019 1:44 AM > To: dev@dpdk.org > Cc: Xing, Beilei ; Zhang, Xiao ; > stable@dpdk.org > Subject: [v4] net/i40e: fix vf runtime queues rss config >=20 > I40evf queue can not work properly with kernel pf driver. Eg. when config= ure > 8 queues pair, only 4 queues can receive packets, and half packets will b= e 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. >=20 > Fixes: cea7a51c1750 ("i40evf: support RSS") > Cc: stable@dpdk.org >=20 > Signed-off-by: Xiao Zhang > --- > 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(-) >=20 > 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 =3D I40E_VF_TO_HW(vf); > struct rte_eth_rss_conf rss_conf; > uint32_t i, j, lut =3D 0, nb_q =3D (I40E_VFQF_HLUT_MAX_INDEX + 1) * 4; > + uint32_t rss_lut_size =3D (I40E_VFQF_HLUT1_MAX_INDEX + 1) * 4; > uint16_t num; > + uint8_t *lut; The pointer *lut is conflict with above 'uint32_t lut =3D 0'. > + int ret; >=20 > if (vf->dev_data->dev_conf.rxmode.mq_mode !=3D ETH_MQ_RX_RSS) { > i40evf_disable_rss(vf); > @@ -2608,12 +2611,29 @@ i40evf_config_rss(struct i40e_vf *vf) >=20 > num =3D RTE_MIN(vf->dev_data->nb_rx_queues, > I40E_MAX_QP_NUM_PER_VF); > /* Fill out the look up table */ > - for (i =3D 0, j =3D 0; i < nb_q; i++, j++) { > - if (j >=3D num) > - j =3D 0; > - lut =3D (lut << 8) | j; > - if ((i & 3) =3D=3D 3) > - I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> 2), lut); > + if (!(vf->flags & I40E_FLAG_RSS_AQ_CAPABLE)) { > + for (i =3D 0, j =3D 0; i < nb_q; i++, j++) { > + if (j >=3D num) > + j =3D 0; > + lut =3D (lut << 8) | j; > + if ((i & 3) =3D=3D 3) > + I40E_WRITE_REG(hw, I40E_VFQF_HLUT(i >> > 2), lut); > + } > + } else { > + lut =3D rte_zmalloc("i40e_rss_lut", rss_lut_size, 0); > + if (!lut) { > + PMD_DRV_LOG(ERR, "No memory can be allocated"); > + return -ENOMEM; > + } > + > + for (i =3D 0; i < rss_lut_size; i++) > + lut[i] =3D i % vf->num_queue_pairs; > + > + ret =3D i40evf_set_rss_lut(&vf->vsi, lut, > + rss_lut_size); > + rte_free(lut); > + if (ret) > + return ret; > } >=20 > rss_conf =3D vf->dev_data->dev_conf.rx_adv_conf.rss_conf; > -- > 2.7.4