From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B03E82211D; Tue, 16 Oct 2018 09:42:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 16 Oct 2018 09:42:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=4A/YcMINCPVpaF9KFL5aqGc4Bmili4AiUmxcn/1+HGQ=; b=reo2C0Uxcl5Y nEbHdnDUBZjwcNy+kPCgKXEsKfeBi4CohwPfDWbTtbjRa96eVSnqGKTAI/z7VWYu LkyJF6tZYXLSfmBPQYQ4Bj3bIgkqXenihN08s8JsvjfOzSmfeAVFu6Q5ERkPSF8Q du1zA/4mXftbchlZ0LuGmsjZ/9SPlvk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=4A/YcMINCPVpaF9KFL5aqGc4Bmili4AiUmxcn/1+H GQ=; b=qWUR3LkDh8vcUSCfraSO7Kpm7SnYILnrPOCUNkirbMA2QYEinxHYuHjGH GDT7hZP5Zxvf5PMPETiIkoGTn+wJcmOHFs7k2dx2rbfFlkpibpgdEEvlP3SzKqXB 96hlE5jsOZuwfvTCKipCO3tc19zWqlZFK64sY7Vzut1Y/SOUb4LmKqRgZHNbzww/ XYBn7smZ09rTVTlqrQjnTDwMsI4klO+M1ZKJcvLnSoUFFJf8s09gYjbvQGZAJ7iy WaxG9CVwajXrixETaOl0BNUUcE5DMLRasu9xRqIQTriX1sUKnR80SpldJn50bjQB Ykg/Ee8JyFdxX5qgFky4waYHSCFFA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6CBE9E455F; Tue, 16 Oct 2018 09:42:34 -0400 (EDT) From: Thomas Monjalon To: Kevin Laatz 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 Date: Tue, 16 Oct 2018 15:42:36 +0200 Message-ID: <3367694.NQyIiAbOc1@xps> In-Reply-To: <20181011165837.81030-2-kevin.laatz@intel.com> 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-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 01/13] eal: add param register infrastructure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 13:42:39 -0000 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);