Message ID | 1418897809-14674-1-git-send-email-michael.qiu@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 3FFC07F49; Thu, 18 Dec 2014 11:17:12 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C4B157F48 for <dev@dpdk.org>; Thu, 18 Dec 2014 11:16:59 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 18 Dec 2014 02:16:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,600,1413270000"; d="scan'208";a="639593650" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 18 Dec 2014 02:16:58 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id sBIAGu71021849; Thu, 18 Dec 2014 18:16:56 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id sBIAGr36014709; Thu, 18 Dec 2014 18:16:55 +0800 Received: (from dayuqiu@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id sBIAGrRA014704; Thu, 18 Dec 2014 18:16:53 +0800 From: Michael Qiu <michael.qiu@intel.com> To: dev@dpdk.org Date: Thu, 18 Dec 2014 18:16:49 +0800 Message-Id: <1418897809-14674-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Michael Qiu
Dec. 18, 2014, 10:16 a.m. UTC
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=secondary --file-prefix=rte
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 <yong.liu@intel.com>
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
Comments
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=secondary --file-prefix=rte > 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 <yong.liu@intel.com> > Signed-off-by: Michael Qiu <michael.qiu@intel.com> > --- > 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() != RTE_PROC_PRIMARY){ > struct igb_tx_queue *txq; > - /* TX queue function in primary, set by last queue initialized */ > - txq = 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 = 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? */ I'm just not sure if it is better to terminated when Tx queues are NULL in secondary process. 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 = ixgbe_recv_scattered_pkts;
> -----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 > > 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=secondary --file-prefix=rte > > 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 <yong.liu@intel.com> > > Signed-off-by: Michael Qiu <michael.qiu@intel.com> > > --- > > 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() != RTE_PROC_PRIMARY){ > > struct igb_tx_queue *txq; > > - /* TX queue function in primary, set by last queue initialized > */ > > - txq = 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 = 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? */ > > I'm just not sure if it is better to terminated when Tx queues are NULL > in secondary process. > Well, in case of test app, it does not need any ports, so it should work anyway. 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 = > ixgbe_recv_scattered_pkts;
On Thu, Dec 18, 2014 at 10:22:28AM +0000, Qiu, Michael wrote: > 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=secondary --file-prefix=rte > > 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 <yong.liu@intel.com> > > Signed-off-by: Michael Qiu <michael.qiu@intel.com> > > --- > > 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() != RTE_PROC_PRIMARY){ > > struct igb_tx_queue *txq; > > - /* TX queue function in primary, set by last queue initialized */ > > - txq = 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 = 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? */ > > I'm just not sure if it is better to terminated when Tx queues are NULL > in secondary process. > > Thanks > Michael No, don't terminate. Printing a message is enough. > > + PMD_INIT_LOG(INFO, "Last tx queue initialized fail in " > > + "secondary process, please verify if tx " > > + "queues were initialized in primary " > > + "process!\n"); > > + } Maybe shorten message to: "No TX queues configured yet. Using default TX function." > > > > if (eth_dev->data->scattered_rx) > > eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts; > >
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu > Sent: Thursday, December 18, 2014 10:17 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ixgbe: fix segmentation fault when start > secondary process > > 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=secondary --file-prefix=rte > 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 <yong.liu@intel.com> > Signed-off-by: Michael Qiu <michael.qiu@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
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() != RTE_PROC_PRIMARY){ struct igb_tx_queue *txq; - /* TX queue function in primary, set by last queue initialized */ - txq = 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 = 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? */ + 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 = ixgbe_recv_scattered_pkts;