From patchwork Fri Dec 19 06:59:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Qiu X-Patchwork-Id: 2107 Return-Path: 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 628B22A1A; Fri, 19 Dec 2014 07:59:46 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8DDB018F for ; Fri, 19 Dec 2014 07:59:42 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 18 Dec 2014 22:59:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="501388538" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 18 Dec 2014 22:55:14 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id sBJ6xWSg019716; Fri, 19 Dec 2014 14:59:32 +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 sBJ6xU5p017164; Fri, 19 Dec 2014 14:59:32 +0800 Received: (from dayuqiu@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id sBJ6xSEP017160; Fri, 19 Dec 2014 14:59:28 +0800 From: Michael Qiu To: dev@dpdk.org Date: Fri, 19 Dec 2014 14:59:18 +0800 Message-Id: <1418972358-17130-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1418897809-14674-1-git-send-email-michael.qiu@intel.com> References: <1418897809-14674-1-git-send-email-michael.qiu@intel.com> Subject: [dpdk-dev] [PATCH v2] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Michael Qiu --- v2 --> v1: Log clean up lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 9401916..d585aa4 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -749,9 +749,17 @@ 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 { + /* Use default TX function if we get here */ + PMD_INIT_LOG(INFO, "No TX queues configured yet. " + "Using default TX function\n"); + } if (eth_dev->data->scattered_rx) eth_dev->rx_pkt_burst = ixgbe_recv_scattered_pkts;