From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wiles, Keith" Subject: Re: [RFC PATCH] eal:Add new API for parsing args at rte_eal_init time Date: Wed, 3 Jun 2015 19:43:21 +0000 Message-ID: References: <1433357393-54434-1-git-send-email-keith.wiles@intel.com> <3638515.Z9q363AFg3@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable To: Thomas Monjalon , "dev@dpdk.org" Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id ECCA4234 for ; Wed, 3 Jun 2015 21:43:25 +0200 (CEST) In-Reply-To: <3638515.Z9q363AFg3@xps13> Content-Language: en-US Content-ID: 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" On 6/3/15, 2:24 PM, "Thomas Monjalon" wrote: >Hi Keith, > >2015-06-03 13:49, Keith Wiles: >> Signed-off-by: Keith Wiles >> --- >> lib/librte_eal/bsdapp/eal/eal.c | 20 ++++++++++++++++++++ >> lib/librte_eal/common/include/rte_eal.h | 32 >>++++++++++++++++++++++++++++++++ >> 2 files changed, 52 insertions(+) > >These comments would be useful: >As a RFC patch, it is not complete yet. >This new API may be used for . I was going to add this to the real patch: The new API is to reduce some of the clutter in the applications. Most of the applications need to do the following: int ret =3D rte_eal_init(argc, argv); if ( ret < 0 ) rte_exit(EXIT_FAILURE, "rte_eal_init: failed!"); argc -=3D ret; argv +=3D ret; ret =3D parse_args(argc, argv); if ( ret < 0 ) rte_exit(EXIT_FAILURE, "parse_args:failed!"); With this new API: int ret =3D rte_eal_init_parse(argc, argv, parse_args); if ( ret < 0 ) rte_exit(EXIT_FAILURE, "rte_eal_init_parse: Failed!"); >