From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3] rte_delay_us can be replaced with user function Date: Fri, 23 Sep 2016 16:03:06 +0200 Message-ID: <24189082.EpCgmYOVsv@xps13> References: <1469016644-6521-1-git-send-email-jozmarti@cisco.com> <1474612743-27466-1-git-send-email-jozmarti@cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: jozmarti@cisco.com Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 498C068F5 for ; Fri, 23 Sep 2016 16:03:20 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id l132so31963874wmf.1 for ; Fri, 23 Sep 2016 07:03:20 -0700 (PDT) In-Reply-To: <1474612743-27466-1-git-send-email-jozmarti@cisco.com> 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" 2016-09-23 08:39, jozmarti@cisco.com: > --- a/lib/librte_eal/common/include/generic/rte_cycles.h > +++ b/lib/librte_eal/common/include/generic/rte_cycles.h > @@ -180,15 +180,17 @@ rte_get_timer_hz(void) > default: rte_panic("Invalid timer source specified\n"); > } > } > - > /** > + * > * Wait at least us microseconds. > + * This function can be replaced with user-defined function. > + * @see rte_delay_us_callback_register > * > * @param us > * The number of microseconds to wait. > */ > void > -rte_delay_us(unsigned us); > +(*rte_delay_us)(unsigned int us); > > /** > * Wait at least ms milliseconds. > @@ -202,4 +204,22 @@ rte_delay_ms(unsigned ms) > rte_delay_us(ms * 1000); > } > > +/** > + * Blocking delay function. > + * > + * @param us > + * Number of microseconds to wait. > + */ > +void rte_delay_us_block(unsigned int us); > +/** > + * Replace rte_delay_us with user defined function. > + * > + * @param userfunc > + * User function which replaces rte_delay_us. NULL restores > + * buildin block delay function. > + */ The comment about NULL value is not valid anymore. > +void rte_delay_us_callback_register(void(*userfunc)(unsigned int)); > + > + > + > #endif /* _RTE_CYCLES_H_ */ There are extra or missing blank lines in this chunk. Except these and the above comment, it looks good to me.