From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 73F5568AA for ; Thu, 18 Dec 2014 11:27:42 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 18 Dec 2014 02:27:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,600,1413270000"; d="scan'208";a="649751976" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga002.fm.intel.com with ESMTP; 18 Dec 2014 02:27:37 -0800 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.71]) by IRSMSX105.ger.corp.intel.com ([163.33.3.28]) with mapi id 14.03.0195.001; Thu, 18 Dec 2014 10:27:36 +0000 From: "De Lara Guarch, Pablo" To: "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [PATCH] ixgbe: fix segmentation fault when start secondary process Thread-Index: AQHQGqy3oj+Np79YmEi4Z32G74q5vZyVJFHg Date: Thu, 18 Dec 2014 10:27:36 +0000 Message-ID: References: <1418897809-14674-1-git-send-email-michael.qiu@intel.com> <533710CFB86FA344BFBF2D6802E60286CA0D64@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E60286CA0D64@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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] ixgbe: fix segmentation fault when start secondary process 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: Thu, 18 Dec 2014 10:27:42 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiu, Michael > Sent: Thursday, December 18, 2014 10:22 AM > To: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix segmentation fault when start > secondary process >=20 > On 12/18/2014 6:17 PM, Qiu, Michael wrote: > > EAL: probe driver: 8086:10fb rte_ixgbe_pmd > > EAL: PCI memory mapped at 0x7f18c2a00000 > > EAL: PCI memory mapped at 0x7f18c2a80000 > > Segmentation fault (core dumped) > > > > This is introduced by commit: 46bc9d75 > > ixgbe: fix multi-process support > > When start primary process with command line: > > ./app/test/test -n 1 -c ffff -m 64 > > then start the second one: > > ./app/test/test -n 1 --proc-type=3Dsecondary --file-prefix=3Drte > > This segment-fault will occur. > > > > Root cause is test app on primary process only starts device, but > > the queue need initialized by manually command line. > > So the tx queue is still NULL when secondary process startup. > > > > Reported-by: Yong Liu > > Signed-off-by: Michael Qiu > > --- > > lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 16 +++++++++++++--- > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c > b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c > > index 9401916..87ed6ee 100644 > > --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c > > +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c > > @@ -749,9 +749,19 @@ eth_ixgbe_dev_init(__attribute__((unused)) > struct eth_driver *eth_drv, > > */ > > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY){ > > struct igb_tx_queue *txq; > > - /* TX queue function in primary, set by last queue initialized > */ > > - txq =3D eth_dev->data->tx_queues[eth_dev->data- > >nb_tx_queues-1]; > > - set_tx_function(eth_dev, txq); > > + /* TX queue function in primary, set by last queue initialized > > + * Tx queue may not initialized by primary process > > + * */ > > + if (eth_dev->data->tx_queues) { > > + txq =3D eth_dev->data->tx_queues[eth_dev->data- > >nb_tx_queues-1]; > > + set_tx_function(eth_dev, txq); > > + } else { > > + /* Shall we exit this process if we get here? */ >=20 > I'm just not sure if it is better to terminated when Tx queues are NULL > in secondary process. >=20 Well, in case of test app, it does not need any ports, so it should work an= yway. Probably it does not make much sense to run two test processes in general, although it is used in multiprocess unit test. So, I would say that app should not terminate. > Thanks > Michael > > + PMD_INIT_LOG(INFO, "Last tx queue initialized fail in > " > > + "secondary process, please verify if tx " > > + "queues were initialized in primary " > > + "process!\n"); > > + } > > > > if (eth_dev->data->scattered_rx) > > eth_dev->rx_pkt_burst =3D > ixgbe_recv_scattered_pkts;