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 DB049A052A for ; Wed, 23 Dec 2020 08:05:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D532ACA39; Wed, 23 Dec 2020 08:05:10 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 5F309CA39; Wed, 23 Dec 2020 08:05:07 +0100 (CET) IronPort-SDR: p3S6CRd1nLzzuT4a8RtWZ9mnX8PztmuQqp35auhNBj+ipK48Zxxwfv5nL5Z775qEt1zo0OuqIP VfAML1PQEbTA== X-IronPort-AV: E=McAfee;i="6000,8403,9843"; a="163695671" X-IronPort-AV: E=Sophos;i="5.78,441,1599548400"; d="scan'208";a="163695671" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2020 23:05:05 -0800 IronPort-SDR: iSWZmsYTT2yIGROFO+/40rCjdjKAaBRlN5hp0ttLic276zyH56gW1QHBHRkP6TOz34dWzKjn7s z53HDSH5SCUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,441,1599548400"; d="scan'208";a="342158322" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga003.jf.intel.com with ESMTP; 22 Dec 2020 23:05:05 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 22 Dec 2020 23:05:04 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 23 Dec 2020 15:05:02 +0800 Received: from shsmsx603.ccr.corp.intel.com ([10.109.6.143]) by SHSMSX603.ccr.corp.intel.com ([10.109.6.143]) with mapi id 15.01.1713.004; Wed, 23 Dec 2020 15:05:01 +0800 From: "Yu, DapengX" To: "Chen, BoX C" , "Yang, Qiming" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/ice: check Rx queue number on RSS init Thread-Index: AQHW2Oy7clJG5nJpuE6C9IuHA4XY56oDsBgAgACOzFA= Date: Wed, 23 Dec 2020 07:05:01 +0000 Message-ID: References: <20201223053018.103877-1-dapengx.yu@intel.com> In-Reply-To: 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: check Rx queue number on RSS init 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 Chen Bo, Without this patch, I have reproduced your unexpected test result on XXV710= (with i40e pmd driver). That means the unexpected situation as the below is a new issue different f= rom the original one that this patch try to resolve. The unexpected is not caused by the patch. The unexpected situation can be reproduced in this way, at the end, testpmd= exit with error, and the terminal cannot echo keyboard input. testpmd> port stop all testpmd> port config all rxq 0 testpmd> port config all txq 0 testpmd> show config rxtx testpmd> port start all testpmd> show config rxtx testpmd> start EAL: Error - exiting with code: 1 Cause: Either rxq or txq are 0, cannot use io fwd mode -----Original Message----- From: Chen, BoX C=20 Sent: Wednesday, December 23, 2020 2:23 PM To: Yu, DapengX ; Yang, Qiming ; Zhang, Qi Z Cc: dev@dpdk.org; Yu, DapengX ; stable@dpdk.org Subject: RE: [dpdk-dev] [PATCH] net/ice: check Rx queue number on RSS init Hi, Dapeng Regards, Chen Bo > -----Original Message----- > From: dev On Behalf Of dapengx.yu@intel.com > Sent: December 23, 2020 13:30 > To: Yang, Qiming ; Zhang, Qi Z=20 > > Cc: dev@dpdk.org; Yu, DapengX ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/ice: check Rx queue number on RSS init >=20 > From: YU DAPENG >=20 > When RSS is initialized, rx queues number is used as denominator to=20 > set default value into the RSS lookup table. If it is zero, there will=20 > be error of being divided by 0. So add value check to avoid the error. >=20 > Fixes: 50370662b727 ("net/ice: support device and queue ops") > Cc: stable@dpdk.org >=20 > Signed-off-by: YU DAPENG > --- > drivers/net/ice/ice_ethdev.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/drivers/net/ice/ice_ethdev.c=20 > b/drivers/net/ice/ice_ethdev.c index 9a5d6a559..bbb8c1460 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -3182,6 +3182,12 @@ static int ice_init_rss(struct ice_pf *pf) =20 > vsi->rss_key_size =3D ICE_AQC_GET_SET_RSS_KEY_DATA_RSS_KEY_SIZE; > vsi->rss_lut_size =3D pf->hash_lut_size; >=20 > +if (nb_q =3D=3D 0) { > +PMD_DRV_LOG(WARNING, > +"RSS is not supported as rx queues number is > zero\n"); > +return 0; > +} > + Direct return here will introduce subsequent exceptions, the tetpmd will ex= it. testpmd> port start all Configuring Port 0 (socket 1) ice_init_rss(): RSS is not supported as rx queues number is zero Port 0: 68:20:20:06:01:00 Configuring Port 1 (socket 1) ice_init_rss(): RSS is not supported as rx queues number is zero Port 1: 68:20:20:06:01:01 Checking link statuses... Done testpmd> Port 1: link state change event testpmd> show config rxtx io packet forwarding packets/burst=3D32 nb forwarding cores=3D1 - nb forwarding ports=3D2 port 0: RX queue number: 0 Tx queue number: 1 Rx offloads=3D0x0 Tx offloads=3D0x10000 Invalid RX queue_id=3D0 RX queue: 0 RX desc=3D0 - RX free threshold=3D32 RX threshold registers: pthresh=3D8 hthresh=3D8 wthresh=3D0 RX Offloads=3D0x0 TX queue: 0 TX desc=3D1024 - TX free threshold=3D32 TX threshold registers: pthresh=3D32 hthresh=3D0 wthresh=3D0 TX offloads=3D0x10000 - TX RS bit threshold=3D32 port 1: RX queue number: 0 Tx queue number: 1 Rx offloads=3D0x0 Tx offloads=3D0x10000 Invalid RX queue_id=3D0 RX queue: 0 RX desc=3D0 - RX free threshold=3D32 RX threshold registers: pthresh=3D8 hthresh=3D8 wthresh=3D0 RX Offloads=3D0x0 TX queue: 0 TX desc=3D1024 - TX free threshold=3D32 TX threshold registers: pthresh=3D32 hthresh=3D0 wthresh=3D0 TX offloads=3D0x10000 - TX RS bit threshold=3D32 testpmd> testpmd> start EAL: Error - exiting with code: 1 Cause: Either rxq or txq are 0, cannot use io fwd mode > if (is_safe_mode) { > PMD_DRV_LOG(WARNING, "RSS is not supported in safe mode\n"); return=20 > 0; > -- > 2.27.0