From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4 01/13] eal: add param register infrastructure Date: Tue, 16 Oct 2018 15:42:36 +0200 Message-ID: <3367694.NQyIiAbOc1@xps> References: <20181010105134.48079-1-kevin.laatz@intel.com> <20181011165837.81030-1-kevin.laatz@intel.com> <20181011165837.81030-2-kevin.laatz@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, harry.van.haaren@intel.com, stephen@networkplumber.org, gaetan.rivet@6wind.com, shreyansh.jain@nxp.com, mattias.ronnblom@ericsson.com, bruce.richardson@intel.com To: Kevin Laatz Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 331327CDA for ; Tue, 16 Oct 2018 15:42:39 +0200 (CEST) In-Reply-To: <20181011165837.81030-2-kevin.laatz@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, 11/10/2018 18:58, Kevin Laatz: > This commit adds infrastructure to EAL that allows an application to > register it's init function with EAL. This allows libraries to be > initialized at the end of EAL init. > > This infrastructure allows libraries that depend on EAL to be initialized > as part of EAL init, removing circular dependency issues. Let's try to have a clear documentation for this new infra. > +/** > + * @file > + * > + * This API introduces the ability to register callbacks with EAL. When You should explain when the callback is called, and what is the role of the callback. > + * registering a callback, the application also provides a flag as part of the > + * struct used to register. If the flag is passed to EAL when ruuning a DPDK What do you call a flag? Are you talking about an option to be parsed? > + * application, the relevant callback will be called at the end of EAL init. > + * For example, passing --telemetry will make the telemetry init be called at > + * the end of EAl init. > + * > + * The register API can be used to resolve circular dependency issue between > + * EAL and the library. You need to explain what is the circular dependency issue. [...] > +struct rte_param { Please add a global comment for this struct, explain what it represents. > + TAILQ_ENTRY(rte_param) next; /** The next entry in the TAILQ*/ > + char *eal_flag; /** The EAL flag */ eal_flag, The EAL flag Hum... Please use different words to explain what is a flag. If it is something to be parsed by getopt, it should be called an option, not a flag. > + char *help_text; /** Help text for the callback */ What the help text is used for? When is it printed? > + rte_param_cb cb; /** Function pointer of the callback */ > + int enabled; /** Enabled flag, should be 0 by default */ What means enabled in this context? > +}; > + > +/** > + * @internal Check if the passed flag is valid > + * > + * @param flag > + * The flag to be parsed Here too, you need to be more explicit about flag meaning. > + * > + * @return > + * 0 on success > + * @return > + * -1 on fail > + */ > +int > +rte_param_parse(char *flag); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Register a function with EAL. Registering the function will enable the > + * function to be called at the end of EAL init. > + * > + * @param reg_param > + * rte_param structure No, this is not a helpful comment. > + */ > +void __rte_experimental > +rte_param_register(struct rte_param *reg_param);