From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v4 10/11] eal: replace rte_panic instances in init sequence Date: Thu, 19 Apr 2018 15:39:36 +0100 Message-ID: References: <1524117669-25729-1-git-send-email-arnon@qwilt.com> <1524117669-25729-11-git-send-email-arnon@qwilt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Arnon Warshavsky , thomas@monjalon.net, wenzhuo.lu@intel.com, declan.doherty@intel.com, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, ferruh.yigit@intel.com Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0133D7F58 for ; Thu, 19 Apr 2018 16:39:40 +0200 (CEST) In-Reply-To: <1524117669-25729-11-git-send-email-arnon@qwilt.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 19-Apr-18 7:01 AM, Arnon Warshavsky wrote: > Local functions to this file, > changing from void to int are non-abi-breaking. > For handling the single function that cannot > change from void to int due to abi, > where this is the only place it is called in, > I added a state variable that is being checked > right after the call to this function. A rewrite of commit message is in order, i think :) Something like this: Change some functions' return type from void to int. This will not break ABI because they are internal only. (see below for comments on lcore changes) > > -- > > v4 - fix split literal strings in log messages > > Signed-off-by: Arnon Warshavsky Again, please do not add patch/version notes to the commit message, put them after "---". Version history is not for commit messages, it's for people reviewing it before merge. > --- > lib/librte_eal/bsdapp/eal/eal.c | 86 ++++++++++++++------- > lib/librte_eal/bsdapp/eal/eal_thread.c | 65 +++++++++++----- > lib/librte_eal/common/eal_common_launch.c | 21 ++++++ > lib/librte_eal/common/include/rte_debug.h | 12 +++ > lib/librte_eal/linuxapp/eal/eal.c | 120 ++++++++++++++++++++---------- > lib/librte_eal/linuxapp/eal/eal_thread.c | 65 +++++++++++----- > 6 files changed, 270 insertions(+), 99 deletions(-) > > diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c > index d996190..9c2f6f1 100644 > --- a/lib/librte_eal/bsdapp/eal/eal.c > +++ b/lib/librte_eal/bsdapp/eal/eal.c > @@ -151,7 +151,7 @@ enum rte_iova_mode > * We also don't lock the whole file, so that in future we can use read-locks > * on other parts, e.g. memzones, to detect if there are running secondary > * processes. */ > -static void > +static int <...> > + > +/* move to panic state and do not return */ > +static __attribute__((noreturn)) void > +defunct_and_remain_in_endless_loop(void) > +{ > + rte_move_to_panic_state(); > + while (1) > + sleep(1); > } It seems like you're mixing two different patchsets here. Maybe it would be beneficial to put lcore changes in a separate patch? Technically, rte_panic's in lcore are not part of init sequence. (also, should panic state be volatile?) > > /* main loop of threads */ > @@ -106,8 +123,11 @@ void eal_thread_init_master(unsigned lcore_id) > if (thread_id == lcore_config[lcore_id].thread_id) > break; > } > - if (lcore_id == RTE_MAX_LCORE) > - rte_panic("cannot retrieve lcore id\n"); > + if (lcore_id == RTE_MAX_LCORE) { > + RTE_LOG(CRIT, EAL, "%s(): Cannot retrieve lcore id\n", -- Thanks, Anatoly