From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 0BEEF2935; Fri, 28 Apr 2017 10:51:49 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 01:51:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="1141218260" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 28 Apr 2017 01:51:48 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:51:48 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 01:51:48 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Fri, 28 Apr 2017 16:51:45 +0800 From: "Wu, Jingjing" To: Olivier Matz , "dev@dpdk.org" CC: "Richardson, Bruce" , "stable@dpdk.org" Thread-Topic: [PATCH 1/2] app/testpmd: fix crash at mbuf pool creation Thread-Index: AQHSvPcGVI3WpsVHLEy+Y8nTEvVf9KHafnqw Date: Fri, 28 Apr 2017 08:51:44 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810D5A14D@SHSMSX103.ccr.corp.intel.com> References: <20170424123358.5959-1-olivier.matz@6wind.com> In-Reply-To: <20170424123358.5959-1-olivier.matz@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action 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] [PATCH 1/2] app/testpmd: fix crash at mbuf pool creation 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: , X-List-Received-Date: Fri, 28 Apr 2017 08:51:50 -0000 > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Monday, April 24, 2017 8:34 PM > To: dev@dpdk.org; Wu, Jingjing > Cc: Richardson, Bruce ; stable@dpdk.org > Subject: [PATCH 1/2] app/testpmd: fix crash at mbuf pool creation >=20 > Since > commit 999b2ee0fe45 ("app/testpmd: enable NUMA support by default"), > testpmd is started with numa enabled by default. This highlights a floati= ng point > exception when started with --total-num-mbufs without any port (division = by 0). > This bug was already triggered before this commit if the --no-numa option= was > given. >=20 > This commit adds a check of the nb_ports value before doing the division.= By > looking at this code, it appears that the creation of the mbuf pool is no= t > consistent for the number of mbufs depending on the configuration. This i= s fixed > in the next commit. >=20 > Fixes: b6ea6408fbc7 ("ethdev: store numa_node per device") >=20 > CC: stable@dpdk.org > Signed-off-by: Olivier Matz > --- > app/test-pmd/testpmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index > 3a573480d..f61f31344 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -597,7 +597,7 @@ init_config(void) > uint8_t i; > unsigned int nb_mbuf; >=20 > - if (param_total_num_mbufs) > + if (param_total_num_mbufs && nb_ports !=3D 0) > nb_mbuf_per_pool =3D nb_mbuf_per_pool/nb_ports; >=20 > for (i =3D 0; i < max_socket; i++) { Acked-by: Jingjing Wu