From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5 2/7] net: Add common PTP structures and functions Date: Wed, 11 Nov 2015 12:24:08 +0100 Message-ID: <9597952.RAeuTaHzco@xps13> References: <1443799208-9408-1-git-send-email-danielx.t.mrzyglod@intel.com> <3105785.kBVynf3MPa@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: "Mcnamara, John" Return-path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id DC2592E83 for ; Wed, 11 Nov 2015 12:25:20 +0100 (CET) Received: by wmdw130 with SMTP id w130so108786062wmd.0 for ; Wed, 11 Nov 2015 03:25:20 -0800 (PST) In-Reply-To: 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" 2015-11-11 10:45, Mcnamara, John: > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > > The library librte_net gather some structures and functions for network > > headers/layers parsing. > > These PTP functions looks really generic. Why not add them in EAL? > > Maybe they could benefit from specific implementations in the arch/ > > directory. > > Hi Thomas, > > How about the following location and new header file? > > lib/librte_eal/common/include/rte_time.h Yes > > > +static inline uint64_t > > > +timespec_to_ns(const struct timespec *ts) > > [...] > > > +static inline struct timespec > > > +ns_to_timespec(uint64_t nsec) > > [...] > > > +static inline uint64_t > > > +cyclecounter_cycles_to_ns(const struct cyclecounter *cc, > > > + uint64_t cycles, uint64_t mask, uint64_t *frac) > > [...] > > > +static inline uint64_t > > > +cyclecounter_cycles_to_ns_backwards(const struct cyclecounter *cc, > > > + uint64_t cycles, uint64_t frac) > > > > They must be prefixed with rte_ with full doxygen comments. > > We can do that. But is the intention that these function are public? We really only need them internally. It is possible that they could be used somewhere else but probably not likely. How about if we document them but mark them as @internal in Doxygen. Then if they are require by some other libs they can be made external at a later stage. Yes they can be marked @internal with rte_ prefix.