From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id A8A2A595A for ; Wed, 7 May 2014 15:06:07 +0200 (CEST) Received: by mail-wi0-f173.google.com with SMTP id bs8so9052029wib.12 for ; Wed, 07 May 2014 06:06:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=ZWXTRZjxAFZPR7H+lrfB8aicZqsHe+1YCZhAXuiJKrs=; b=RzFd7RpN4whrxcFwkdgmOMytMU+/aDx9tnJFuTQoMo9MZgsTe3hh79mSXOjG12vg/W te48944/llqyPTmXoPWt06FqaW3ReCYlA5rObOjAcq0TVCxsPWzlVluE0l9uvr8sDF7H yPabG5QrcFYbU/MdOVDogaY27BCUJpqwdX72LYMU7OYFuPwj34NA8JIl6yLoQS+C92Vf ELoRjwTGkBJTKQ+kcCVKZIgdIRejGNmt7Yxot+E2dT7NyNGgT1hdiwDOZhXDS0weiUSR AiN0JSmSku9aavo5uFkdbp5aR3FLaWcqm6ydUC8oixKUH3Z33we4DNm+U0vZyUSyOWVH m/4Q== X-Gm-Message-State: ALoCoQmv5Y3Ti/2bf2rf2xMd8VE5Y+w+xLTYKH/MesE3sjYNzPsjL3AAZvLN9VMlr/e9ALmJgB/n X-Received: by 10.180.90.132 with SMTP id bw4mr7724211wib.43.1399467971649; Wed, 07 May 2014 06:06:11 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id hg18sm31511988wib.19.2014.05.07.06.06.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 06:06:10 -0700 (PDT) From: Thomas Monjalon To: Wang Sheng-Hui Date: Wed, 07 May 2014 15:06:08 +0200 Message-ID: <1851834.kBMPGP7GOf@xps13> Organization: 6WIND User-Agent: KMail/4.13 (Linux/3.14.2-1-ARCH; KDE/4.13.0; x86_64; ; ) In-Reply-To: <2073730.rjlHe4Kf7A@xps13> References: <534CA193.2000604@gmail.com> <2073730.rjlHe4Kf7A@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] eal: parse args before any kinds of init 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: Wed, 07 May 2014 13:06:08 -0000 2014-05-05 17:50, Thomas Monjalon: > 2014-04-15 11:03, Wang Sheng-Hui: > > Parse args first, to resolve any invalid args and give out the usage > > string. E.g './helloworld --invalid', the '--invalid' will be checked > > before any init. After the options are checked, take any init actions. > > > > Signed-off-by: Wang Sheng-Hui > > [...] > > @@ -964,16 +969,16 @@ rte_eal_init(int argc, char **argv) > > > > thread_id = pthread_self(); > > > > + fctret = eal_parse_args(argc, argv); > > + if (fctret < 0) > > + exit(1); > > + > > > > if (rte_eal_log_early_init() < 0) > > > > rte_panic("Cannot init early logs\n"); > > > > if (rte_eal_cpu_init() < 0) > > > > rte_panic("Cannot detect lcores\n"); > > > > - fctret = eal_parse_args(argc, argv); > > - if (fctret < 0) > > - exit(1); > > - > > You should move eal_parse_args() just after rte_eal_log_early_init() in > order to have logs available. When double checking, I saw this commit which justify why rte_eal_cpu_init() is before eal_parse_args(): http://dpdk.org/browse/dpdk/commit/?id=f563a3727b5dba If the goal is to move debug lines in cpu_init, you should split rte_eal_log_early_init() in 2 functions: 1 to detect cores and 1 for debug summary. By the way, these are debug logs which should be disabled by default. -- Thomas