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 8B0227F48 for ; Thu, 18 Dec 2014 11:23:09 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 18 Dec 2014 02:23:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,600,1413270000"; d="scan'208";a="649748914" Received: from pgsmsx102.gar.corp.intel.com ([10.221.44.80]) by fmsmga002.fm.intel.com with ESMTP; 18 Dec 2014 02:23:07 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX102.gar.corp.intel.com (10.221.44.80) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 18 Dec 2014 18:22:30 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.5]) with mapi id 14.03.0195.001; Thu, 18 Dec 2014 18:22:28 +0800 From: "Qiu, Michael" To: "dev@dpdk.org" Thread-Topic: [PATCH] ixgbe: fix segmentation fault when start secondary process Thread-Index: AQHQGqvK/KOnZhxeBkKigozLvY5+fA== Date: Thu, 18 Dec 2014 10:22:28 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CA0D64@SHSMSX101.ccr.corp.intel.com> References: <1418897809-14674-1-git-send-email-michael.qiu@intel.com> 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] 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:23:10 -0000 On 12/18/2014 6:17 PM, Qiu, Michael wrote:=0A= > EAL: probe driver: 8086:10fb rte_ixgbe_pmd=0A= > EAL: PCI memory mapped at 0x7f18c2a00000=0A= > EAL: PCI memory mapped at 0x7f18c2a80000=0A= > Segmentation fault (core dumped)=0A= >=0A= > This is introduced by commit: 46bc9d75=0A= > ixgbe: fix multi-process support=0A= > When start primary process with command line:=0A= > ./app/test/test -n 1 -c ffff -m 64=0A= > then start the second one:=0A= > ./app/test/test -n 1 --proc-type=3Dsecondary --file-prefix=3Drte=0A= > This segment-fault will occur.=0A= >=0A= > Root cause is test app on primary process only starts device, but=0A= > the queue need initialized by manually command line.=0A= > So the tx queue is still NULL when secondary process startup.=0A= >=0A= > Reported-by: Yong Liu =0A= > Signed-off-by: Michael Qiu =0A= > ---=0A= > lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 16 +++++++++++++---=0A= > 1 file changed, 13 insertions(+), 3 deletions(-)=0A= >=0A= > diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/i= xgbe_ethdev.c=0A= > index 9401916..87ed6ee 100644=0A= > --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c=0A= > +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c=0A= > @@ -749,9 +749,19 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct et= h_driver *eth_drv,=0A= > */=0A= > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY){=0A= > struct igb_tx_queue *txq;=0A= > - /* TX queue function in primary, set by last queue initialized */=0A= > - txq =3D eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];=0A= > - set_tx_function(eth_dev, txq);=0A= > + /* TX queue function in primary, set by last queue initialized=0A= > + * Tx queue may not initialized by primary process=0A= > + * */=0A= > + if (eth_dev->data->tx_queues) {=0A= > + txq =3D eth_dev->data->tx_queues[eth_dev->data->nb_tx_queues-1];=0A= > + set_tx_function(eth_dev, txq);=0A= > + } else {=0A= > + /* Shall we exit this process if we get here? */=0A= =0A= I'm just not sure if it is better to terminated when Tx queues are NULL=0A= in secondary process.=0A= =0A= Thanks=0A= Michael=0A= > + PMD_INIT_LOG(INFO, "Last tx queue initialized fail in "=0A= > + "secondary process, please verify if tx "=0A= > + "queues were initialized in primary "=0A= > + "process!\n");=0A= > + }=0A= > =0A= > if (eth_dev->data->scattered_rx)=0A= > eth_dev->rx_pkt_burst =3D ixgbe_recv_scattered_pkts;=0A= =0A=