From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Tourrilhes Subject: [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs Date: Thu, 22 Sep 2016 14:17:28 -0700 Message-ID: <20160922211728.GA3124@labs.hpe.com> References: <20160922204637.GA3166@labs.hpe.com> Reply-To: jean.tourrilhes@hpe.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: dev@dpdk.org Return-path: Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by dpdk.org (Postfix) with ESMTP id 027B628F3 for ; Thu, 22 Sep 2016 23:17:29 +0200 (CEST) Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 2AAC964 for ; Thu, 22 Sep 2016 21:17:29 +0000 (UTC) Received: from masterns.labs.hpecorp.net (mailhub.labs.hpe.com [16.111.40.8]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id D9E7E70 for ; Thu, 22 Sep 2016 21:17:28 +0000 (UTC) Received: from bougret.labs.hpecorp.net (bougret.labs.hpecorp.net [16.111.8.16]) by masterns.labs.hpecorp.net (8.14.4/8.14.4/HPL-PA Hub) with ESMTP id u8MLHS0T023925 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 22 Sep 2016 14:17:28 -0700 Received: from jt by bougret.labs.hpecorp.net with local (Exim 4.84_2) (envelope-from ) id 1bnBN2-0000uB-6N for dev@dpdk.org; Thu, 22 Sep 2016 14:17:28 -0700 Content-Disposition: inline In-Reply-To: <20160922204637.GA3166@labs.hpe.com> 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" lib/librte_eal/common/eal_common_tailqs.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_tailqs.c b/lib/librte_eal/common/eal_common_tailqs.c index bb08ec8..6960d06 100644 --- a/lib/librte_eal/common/eal_common_tailqs.c +++ b/lib/librte_eal/common/eal_common_tailqs.c @@ -143,6 +143,8 @@ rte_eal_tailq_update(struct rte_tailq_elem *t) t->head = rte_eal_tailq_create(t->name); } else { t->head = rte_eal_tailq_lookup(t->name); + if (t->head != NULL) + rte_tailqs_count++; } } @@ -188,9 +190,16 @@ rte_eal_tailqs_init(void) if (t->head == NULL) { RTE_LOG(ERR, EAL, "Cannot initialize tailq: %s\n", t->name); - /* no need to TAILQ_REMOVE, we are going to panic in - * rte_eal_init() */ - goto fail; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { + /* no need to TAILQ_REMOVE, we are going + * to panic in rte_eal_init() */ + goto fail; + } else { + /* This means our list of constructor is + * no the same as primary. Just remove + * that missing tailq and continue */ + TAILQ_REMOVE(&rte_tailq_elem_head, t, next); + } } }