From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A03C0A823 for ; Mon, 15 Jan 2018 11:55:57 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2018 02:55:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,363,1511856000"; d="scan'208";a="10198722" Received: from jguo15x-mobl3.ccr.corp.intel.com (HELO [10.67.68.50]) ([10.67.68.50]) by fmsmga007.fm.intel.com with ESMTP; 15 Jan 2018 02:55:54 -0800 To: Thomas Monjalon References: <1515575544-2141-3-git-send-email-jia.guo@intel.com> <1515679534-22473-1-git-send-email-jia.guo@intel.com> <6774704.u5U2Uf1Nb3@xps> Cc: dev@dpdk.org, stephen@networkplumber.org, bruce.richardson@intel.com, ferruh.yigit@intel.com, gaetan.rivet@6wind.com, konstantin.ananyev@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, jingjing.wu@intel.com, helin.zhang@intel.com, motih@mellanox.com From: "Guo, Jia" Message-ID: Date: Mon, 15 Jan 2018 18:55:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <6774704.u5U2Uf1Nb3@xps> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH V10 1/2] eal: add uevent monitor api and callback func 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: Mon, 15 Jan 2018 10:55:58 -0000 On 1/15/2018 7:16 AM, Thomas Monjalon wrote: > Hi, > > 11/01/2018 15:05, Jeff Guo: >> +/* A genaral callback for all registerd devices */ > Typos: genaral, registerd > > So the callback is only for registered devices? > What about hotplugged devices? the hotplugged devices is managed by the application, if it prior registered and in the app's hotplug device list, will always be monitor whenever it plug in and out. the eal only care about the registered devices. >> +/** >> + * It registers the callback for the specific event. Multiple >> + * callbacks cal be registered at the same time. >> + * @param event >> + * The device event type. >> + * @param cb_fn >> + * callback address. >> + * @param cb_arg >> + * address of parameter for callback. >> + * >> + * @return >> + * - On success, zero. >> + * - On failure, a negative value. >> + */ >> +int rte_dev_callback_register(char *dev_name, >> + rte_dev_event_cb_fn cb_fn, void *cb_arg); >> + >> +/** >> + * It unregisters the callback according to the specified event. >> + * >> + * @param event >> + * The event type which corresponding to the callback. >> + * @param cb_fn >> + * callback address. >> + * address of parameter for callback, (void *)-1 means to remove all >> + * registered which has the same callback address. >> + * >> + * @return >> + * - On success, return the number of callback entities removed. >> + * - On failure, a negative value. >> + */ >> +int rte_dev_callback_unregister(char *dev_name, >> + rte_dev_event_cb_fn cb_fn, void *cb_arg); > These new functions should be tagged as experimental. got it. >> +/** >> + * Start the device event monitoring. >> + * >> + * @param none >> + * @return >> + * - On success, zero. >> + * - On failure, a negative value. >> + */ >> +int >> +rte_dev_evt_mntr_start(void); > Should be experimental too, as every new public functions. > > Please avoid shortening function name too much. > rte_dev_event_monitor_start is more pleasant to read. yes , choose the more pleasant way.