From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com [209.85.212.171]) by dpdk.org (Postfix) with ESMTP id 57E984C6E for ; Thu, 1 Aug 2013 18:00:46 +0200 (CEST) Received: by mail-wi0-f171.google.com with SMTP id hr7so5270395wib.4 for ; Thu, 01 Aug 2013 09:01:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=sO+AYb5OzK8MXf6wcTG5mTUQDmXlVxfhX8nm/xy4oQA=; b=o/We6QDR7IVKr0V+PX7IOFi6yePTgamiORhf44xSl74X8rrkPqT6rr1dG/PdtvHzsH yYc3rMCfwVGnd2LBixG3Zml+zp1Lvcff/nKovelwotmjqVesvZNJMSd1v+hGX4apaciI pUcBP41iyDwMGuxS50NOu4ZeqGF5XXT3jSTg7RilOZrHEYZsvpxcp8rMd2RgJLU9HK/A 9ycfFoGmsGU8Kxpe+BOykwR1j4kN085BCreoobDuiAiTzeTiVwzhV3ObY3ffiByFEJxx 8lLGk/6Jr8+o41MTnFXm5NBYkyGVQN4Ii8YoSG4cnSrd7z7H+Il20l90h/4dYdVE8Ywo d9+g== X-Received: by 10.180.37.20 with SMTP id u20mr1764507wij.21.1375372870593; Thu, 01 Aug 2013 09:01:10 -0700 (PDT) Received: from angus.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id nb12sm4724606wic.3.2013.08.01.09.01.08 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 09:01:09 -0700 (PDT) From: Thomas Monjalon Organization: 6WIND To: Marc Sune Date: Thu, 1 Aug 2013 18:01:07 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) References: <51FA80BF.2020801@bisdn.de> In-Reply-To: <51FA80BF.2020801@bisdn.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201308011801.08070.thomas.monjalon@6wind.com> X-Gm-Message-State: ALoCoQkmXe35/R5pXq+wOd8NQwO6+Yypqn8siZ5cy7vz+Hr9v8NXeU8oqn1GrBimpctnKiY/6zMv Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Non-argv dependant rte_eal_init() call 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: Thu, 01 Aug 2013 16:00:46 -0000 Hello, 01/08/2013 17:37, Marc Sune : > In our case, we are right now simply faking the argv, which is a little > bit ugly: > > //... > 37 const char* argv[EAL_ARGS] = {"./fake", "-c",CORE_MASK, > "-n",NUM_CACHE_LINES, ""}; > //... > 53 ret = rte_eal_init(EAL_ARGS, (char**)argv); > 54 if (ret < 0) > 55 rte_exit(EXIT_FAILURE, "rte_eal_init failed"); > //... > You should provide a better binary name because in your example, your logs will be prefixed with "fake" which is, I agree with you, a little bit ugly ;) > IMHO it would make more sense to have actually two calls, adding a > library-like initialization. Something like: > > > /* > * In the comments a warning that this should be called at the very > beginning of the program. > *... > */ > int rte_eal_init(eal_coremask_t core_mask, unsigned int num_of_lines > /*More parameters here...*/); > > /* > * > */ > int rte_eal_init_argv(int argc, char **argv); > > The problem with your proposal is that the number of options is static. So when adding a new option in future releases, all the applications should be updated to give a (probably null) value for this new option. Not sure it is an improvement. > Btw, the same applies to the mangling of the main() (MAIN) routine. Is > this really necessary? Isn't it enough to clearly state in the > documentation that certain API calls need to be made on the very > beginning of the application? Not sure to understand this point. MAIN is only defined in examples for the bare-metal use case. What is the link with the API ? -- Thomas