DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michael Qiu <michael.qiu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] ixgbe: fix segmentation fault when start secondary process
Date: Thu, 18 Dec 2014 18:16:49 +0800	[thread overview]
Message-ID: <1418897809-14674-1-git-send-email-michael.qiu@intel.com> (raw)

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? */
+			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;
-- 
1.9.3

             reply	other threads:[~2014-12-18 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 10:16 Michael Qiu [this message]
2014-12-18 10:22 ` Qiu, Michael
2014-12-18 10:27   ` De Lara Guarch, Pablo
2014-12-18 10:28   ` Bruce Richardson
2014-12-18 10:38 ` De Lara Guarch, Pablo
2014-12-19  6:59 ` [dpdk-dev] [PATCH v2] " Michael Qiu
2014-12-19  8:28   ` Thomas Monjalon
2014-12-19 22:40     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1418897809-14674-1-git-send-email-michael.qiu@intel.com \
    --to=michael.qiu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).