From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id 61EFD5957 for ; Tue, 10 Nov 2015 12:26:47 +0100 (CET) Received: by wmww144 with SMTP id w144so113202409wmw.1 for ; Tue, 10 Nov 2015 03:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=82iXWLWdNfD3VT6iRRw1s1bEFGtY48hTeyFCShZmdl4=; b=jThZoKxuZ0irbalBCo2XbmM0w79/Ig9XUermZBLS3CoiWgJQ+cvNHmh2NrXp5xas3x qWPpKOhW5tB/PvAmmNTVSA8ZudgG7SINY0gyS0e3bAqiUPXJby03g8pj1UPThRC6dNHW mNAvp5fHhFIwdGc/wXuzA1pVluxFx+HNe56bhMKAkKkGe3JI7rDRxUbZvrOEzDTHVeN/ 07Z9yjh+09gnbCXcIuWvQ5rjOXj6JKG694DAqXNJdhHLAY9l0cfd4m3nhcNP0bmHkxvs Nqq4aMbXr27gSZ99qf9Sa2mVD+8Qkut6zjxUpbrEqmA42pgBXTsSKG9lbC36CwPHvmCX JM3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=82iXWLWdNfD3VT6iRRw1s1bEFGtY48hTeyFCShZmdl4=; b=Q1jjj0STtzzF7C+YkRGCq3RAljy8L96HygUXDIrO+/NQ9DEyf59d/pkprDqgkzf65m WpI5KhgAx8i37givJ5Ttw93ElURKZ9igIg9hAXxGjzKHWcc/N0gAJDnHVfCzViaQRsrj THWHwBdSuHJFtAfsjEbRTqRtMuZTyu//sHsIhV2CaJ6+RdnO4n6srrN3NsvPoOnXVGam TjV/ylYv5Z7qPY42NUIsBjYYdSNQjARhyTogzGNMkUJfMV/+VPOfni36vzNI7hS39MgX o7xoKKwW2CmIYFfQYSHLkSMnqBH6BSmSWqgQ7LQtwNlcBEPGVTTtIC5US6OSqnzwnlFn mjfw== X-Gm-Message-State: ALoCoQnxnWn2bOqQF/BJ8u5IKDyPW8L225Hhkfa9eKjzbWtki+bgfhKqCo8oED43K4EsFPu66GEt X-Received: by 10.28.55.209 with SMTP id e200mr29887246wma.79.1447154807170; Tue, 10 Nov 2015 03:26:47 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by smtp.gmail.com with ESMTPSA id s189sm968459wmf.16.2015.11.10.03.26.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Nov 2015 03:26:46 -0800 (PST) From: Thomas Monjalon To: Daniel Mrzyglod Date: Tue, 10 Nov 2015 12:25:35 +0100 Message-ID: <3105785.kBVynf3MPa@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1446732366-10044-3-git-send-email-danielx.t.mrzyglod@intel.com> References: <1443799208-9408-1-git-send-email-danielx.t.mrzyglod@intel.com> <1446732366-10044-1-git-send-email-danielx.t.mrzyglod@intel.com> <1446732366-10044-3-git-send-email-danielx.t.mrzyglod@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 2/7] net: Add common PTP structures and functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2015 11:26:47 -0000 2015-11-05 15:06, Daniel Mrzyglod: > This patch add common functions and structures used for PTP processing. > > Signed-off-by: Daniel Mrzyglod > --- > lib/librte_net/Makefile | 2 +- > lib/librte_net/rte_ptp.h | 105 +++++++++++++++++++++++++++++++++++++++++++++++ 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. > +/* > + * Structure for cyclecounter IEEE1588 functionality. > + */ > +struct cyclecounter { > + uint64_t (*read)(struct rte_eth_dev *dev); This field is not used. Please avoid using a reference to ethdev here. > + uint64_t mask; > + uint32_t shift; > +}; > + > +/* > + * Structure to hold and calculate Unix epoch time. > + */ > +struct timecounter { > + struct cyclecounter *cc; > + uint64_t cycle_last; > + uint64_t nsec; > + uint64_t mask; > + uint64_t frac; > +}; This structure is not used. It is not clear what these structures are for, and what means each field. When adding a new field in an API, it must be commented in doxygen. > +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.