From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3EE772BA1 for ; Tue, 4 Oct 2016 15:12:10 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 04 Oct 2016 06:11:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,295,1473145200"; d="scan'208";a="886554435" Received: from smonroyx-mobl.ger.corp.intel.com (HELO [10.237.220.71]) ([10.237.220.71]) by orsmga003.jf.intel.com with ESMTP; 04 Oct 2016 06:11:40 -0700 To: jean.tourrilhes@hpe.com, dev@dpdk.org, David Marchand References: <20160922204637.GA3166@labs.hpe.com> <20160922211728.GA3124@labs.hpe.com> From: Sergio Gonzalez Monroy Message-ID: <20493efb-6822-0847-3685-819c769e5ad2@intel.com> Date: Tue, 4 Oct 2016 14:11:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160922211728.GA3124@labs.hpe.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs 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: Tue, 04 Oct 2016 13:12:10 -0000 Hi Jean, As with your other patch, commit title needs fixing and also missing Signed-off-by line. On 22/09/2016 22:17, Jean Tourrilhes wrote: > 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); > + } > } > } > I might be missing something here so bear with me. The case you are trying to fix is, as an example, when your secondary app is using LPM but your primary is not. So basically with this patch, you are removing the tailq for LPM on secondary and continuing as normal, is that the case? I am not convinced about this approach. I guess the assumption here is that all the TAILQ infrastructure works even when the tailq list itself is NULL? I say assumption because I don't have an easy way to trigger this use case with default DPDK sample/test apps. What about letting the secondary process create a tailq if it doesn't exists? We would need to lock protect at least the register function to avoid race conditions when having multiple secondary processes. David, what do you think? Sergio