From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 730BAA09EF for ; Tue, 12 Jan 2021 03:25:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C832140D52; Tue, 12 Jan 2021 03:25:10 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 22A18140D21; Tue, 12 Jan 2021 03:25:06 +0100 (CET) IronPort-SDR: DvbvgmQJh1TgQoQB01hPvbPMDMXiwky57V8GOniXJ56/GhbTkRzHImAi0LPX8pr3R1mjjAHNpW SztRbGdHP8pA== X-IronPort-AV: E=McAfee;i="6000,8403,9861"; a="157746729" X-IronPort-AV: E=Sophos;i="5.79,340,1602572400"; d="scan'208";a="157746729" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2021 18:25:06 -0800 IronPort-SDR: qlNqTdmza3v1gu48vBe+GZLAohgg5ibgKESz1tka+5Q2Sfww/LI28mKCserSnIhM4W8SslP9xY CAXZ8cZ1y8AA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,340,1602572400"; d="scan'208";a="363347161" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga002.jf.intel.com with ESMTP; 11 Jan 2021 18:25:05 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 11 Jan 2021 18:25:04 -0800 Received: from shsmsx606.ccr.corp.intel.com (10.109.6.216) by SHSMSX606.ccr.corp.intel.com (10.109.6.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 12 Jan 2021 10:25:02 +0800 Received: from shsmsx606.ccr.corp.intel.com ([10.109.6.216]) by SHSMSX606.ccr.corp.intel.com ([10.109.6.216]) with mapi id 15.01.1713.004; Tue, 12 Jan 2021 10:25:02 +0800 From: "Xie, WeiX" To: "Zhang, AlvinX" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Zhang, AlvinX" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ice: fix initialization of RSS look-up table Thread-Index: AQHW5ZAFVrkNAEuS6kqk7suC2yoLw6ojSRkg Date: Tue, 12 Jan 2021 02:25:02 +0000 Message-ID: References: <20210108072910.11184-1-alvinx.zhang@intel.com> In-Reply-To: <20210108072910.11184-1-alvinx.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.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] net/ice: fix initialization of RSS look-up table X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" Tested-by: Xie,WeiX < weix.xie@intel.com> Regards, Xie Wei > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang,Alvin > Sent: Friday, January 8, 2021 3:29 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Zhang, AlvinX ; > stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/ice: fix initialization of RSS look-up ta= ble >=20 > From: Alvin Zhang >=20 > RSS look-up table initialization is done incorrectly due to divide-by-zer= o error. > Add a check to rx-queue count. >=20 > Fixes: 50370662b727 ("net/ice: support device and queue ops") > Cc: stable@dpdk.org >=20 > Signed-off-by: Alvin Zhang > --- > drivers/net/ice/ice_ethdev.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c > index 9a5d6a5..9cef73e 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -3268,10 +3268,12 @@ static int ice_init_rss(struct ice_pf *pf) > if (dev->data->dev_conf.rxmode.mq_mode & > ETH_MQ_RX_RSS_FLAG) > dev->data->dev_conf.rxmode.offloads |=3D > DEV_RX_OFFLOAD_RSS_HASH; >=20 > - ret =3D ice_init_rss(pf); > - if (ret) { > - PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); > - return ret; > + if (dev->data->nb_rx_queues) { > + ret =3D ice_init_rss(pf); > + if (ret) { > + PMD_DRV_LOG(ERR, "Failed to enable rss for PF"); > + return ret; > + } > } >=20 > return 0; > -- > 1.8.3.1