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 B9973DE3 for ; Mon, 21 Dec 2015 16:01:22 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 21 Dec 2015 07:01:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,459,1444719600"; d="scan'208";a="878264868" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by fmsmga002.fm.intel.com with ESMTP; 21 Dec 2015 07:01:19 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.23]) by IRSMSX153.ger.corp.intel.com ([169.254.9.208]) with mapi id 14.03.0248.002; Mon, 21 Dec 2015 15:01:18 +0000 From: "Iremonger, Bernard" To: "Ananyev, Konstantin" , "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] librte_ether: fix crashes in rte_ethdev functions. Thread-Index: AQHRO+ddblZrp2EIDUKFL0pgYW7hyp7ViAJg Date: Mon, 21 Dec 2015 15:01:18 +0000 Message-ID: <8CEF83825BEC744B83065625E567D7C219F9128E@IRSMSX108.ger.corp.intel.com> References: <1450373016-16356-1-git-send-email-bernard.iremonger@intel.com> <533710CFB86FA344BFBF2D6802E6028622EFB065@SHSMSX101.ccr.corp.intel.com> <8CEF83825BEC744B83065625E567D7C219F9120C@IRSMSX108.ger.corp.intel.com> <2601191342CEEE43887BDE71AB97725836AD7438@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB97725836AD7438@irsmsx105.ger.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODI5ZDEzYTctNDUyOS00YzZkLTg0NjUtM2MwYzljNzQwODY0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX1BVQkxJQyJ9XX1dfSwiU3ViamVjdExhYmVscyI6W10sIlRNQ1ZlcnNpb24iOiIxNS40LjEwLjE5IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlhvZTBpanFxb2UyM3hDdWZOZVhVOGZUOVdmRGY3ZlM5dUNoV2d5dVlVTmc9In0= x-ctpclassification: CTP_PUBLIC x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] librte_ether: fix crashes in rte_ethdev functions. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2015 15:01:23 -0000 Hi Konstantin, > -----Original Message----- > From: Ananyev, Konstantin > Sent: Monday, December 21, 2015 12:02 PM > To: Iremonger, Bernard ; Qiu, Michael > ; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH] librte_ether: fix crashes in rte_ethdev > functions. >=20 >=20 >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Iremonger, > > Bernard > > Sent: Monday, December 21, 2015 11:40 AM > > To: Qiu, Michael; dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH] librte_ether: fix crashes in rte_ethdev > functions. > > > > Hi Michael, > > > > > -----Original Message----- > > > From: Qiu, Michael > > > Sent: Monday, December 21, 2015 9:03 AM > > > To: Iremonger, Bernard ; dev@dpdk.org > > > Subject: Re: [dpdk-dev] [PATCH] librte_ether: fix crashes in > > > rte_ethdev functions. > > > > > > On 2015/12/18 1:24, Bernard Iremonger wrote: > > > > The nb_rx_queues and nb_tx_queues are initialised before the > > > > tx_queue and rx_queue arrays are allocated. The arrays are > > > > allocated when the ethdev port is started. > > > > > > > > If any of the following functions are called before the ethdev > > > > port is started there is a segmentation fault: > > > > > > > > rte_eth_stats_get > > > > rte_eth_stats_reset > > > > rte_eth_xstats_get > > > > rte_eth_xstats_reset > > > > > > > > Fixes: af75078fece3 ("first public release") > > > > Fixes: ce757f5c9a4d ("ethdev: new method to retrieve extended > > > > statistics") > > > > Fixes: d4fef8b0d5e5 ("ethdev: expose generic and driver specific > > > > stats in xstats") > > > > Signed-off-by: Bernard Iremonger > > > > --- > > > > lib/librte_ether/rte_ethdev.c | 16 ++++++++++++---- > > > > 1 file changed, 12 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/lib/librte_ether/rte_ethdev.c > > > > b/lib/librte_ether/rte_ethdev.c index ed971b4..a0ee84d 100644 > > > > --- a/lib/librte_ether/rte_ethdev.c > > > > +++ b/lib/librte_ether/rte_ethdev.c > > > > @@ -1441,7 +1441,10 @@ rte_eth_stats_get(uint8_t port_id, struct > > > rte_eth_stats *stats) > > > > memset(stats, 0, sizeof(*stats)); > > > > > > > > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, - > > > ENOTSUP); > > > > - (*dev->dev_ops->stats_get)(dev, stats); > > > > + > > > > + if (dev->data->dev_started) > > > > + (*dev->dev_ops->stats_get)(dev, stats); > > > > + >=20 > So why it would be no possible now to get statistics on the stopped devic= e? > Konstantin I did not consider this scenario. I need to rethink this patch. Self NAK Regards, Bernard.