From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 505B720F for ; Thu, 29 Jun 2017 07:19:55 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 28 Jun 2017 22:19:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,278,1496127600"; d="scan'208";a="986528380" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 28 Jun 2017 22:19:53 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Jun 2017 22:18:51 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 28 Jun 2017 22:18:50 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by shsmsx102.ccr.corp.intel.com ([169.254.2.146]) with mapi id 14.03.0319.002; Thu, 29 Jun 2017 13:18:48 +0800 From: "Wu, Jingjing" To: Yong Wang CC: "dev@dpdk.org" Thread-Topic: [PATCH v2] net/i40e: fix division by 0 error Thread-Index: AQHS7BDr7p469OuDr0e4PLIMkG5NO6I7VSKQ Date: Thu, 29 Jun 2017 05:18:47 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810DB5C73@SHSMSX103.ccr.corp.intel.com> References: <1498215467-19681-1-git-send-email-wang.yong19@zte.com.cn> In-Reply-To: <1498215467-19681-1-git-send-email-wang.yong19@zte.com.cn> 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-dev] [PATCH v2] net/i40e: fix division by 0 error 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: , X-List-Received-Date: Thu, 29 Jun 2017 05:19:55 -0000 > -----Original Message----- > From: Yong Wang [mailto:wang.yong19@zte.com.cn] > Sent: Friday, June 23, 2017 6:58 PM > To: Wu, Jingjing > Cc: dev@dpdk.org; Yong Wang > Subject: [PATCH v2] net/i40e: fix division by 0 error >=20 > In function i40e_vsi_config_tc_queue_mapping(), if 'enabled_tcmap' is 0, > 'total_tc' might be 0. Then 'total_tc' might be used in a division by 0 i= n > "qpnum_per_tc =3D i40e_align_floor(vsi->nb_qps / total_tc)". Fix it by ch= anging > 'total_tc' from 0 to 1 just as func > i40e_vsi_update_queue_mapping() does. >=20 > Signed-off-by: Yong Wang Acked-by: Jingjing Wu