From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id B0BDA2882 for ; Fri, 14 Jul 2017 11:33:20 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 639552098B; Fri, 14 Jul 2017 05:33:19 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 14 Jul 2017 05:33:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=G9QdMSUFNTO7gEN WxccpV7C1/VPUmR7wT3KVJAxk6lw=; b=iHIgaYM378YU40FG+iwssezk9t+yLHS dFAYpUp+pnwEeO3btvTMFT9jf8xxLVHIFIhQ2cgs2ETjy5Scc3ZyHvZ4UEpX1g7S q36uIVqaos/HJ25ysmguJ80dNlu5nLSweDjEEy2HOzvHbhC1E21C5bwWi8zf27S4 uc4TarJN3sVw= 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-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=G9QdMSUFNTO7gENWxccpV7C1/VPUmR7wT3KVJAxk6lw=; b=Q58whyZe zY3UNhVPLWg8IIXCp+IC5UTjfZ4eN2vhc5sO4PebFYB4O01Hq0q+Yw1GFpl+FZrj gdGpkDqiI+yeJER5H3V+67rNa0cbmt9eVFZrGn3Y4GBt+KhG3fWyMRWhletnuQ2C rZviv6xiBvkDHQPUj6IgC1EVTttBJXJFxGsOrx+6FiL+nPfqfKpTGYiG0phUlonA GNGJtS7rPPf4IxD/SwcvNG75ewHAwd4wXEM9NPq8KktAnxJ2ZoxPb5Gp9WlyJynv WzchC+bXz6aJ6g9iyATLR1k6EUfq8qxLwG3jboBzQ8u8/hA8cZuPcdPOhZYn1ENo iex7tcXRoXhllg== X-ME-Sender: X-Sasl-enc: p4HmaDKOImEtrAoEqWJ/XBeti9ClbzeNMbXnqROtu3Bq 1500024799 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 0428B24038; Fri, 14 Jul 2017 05:33:19 -0400 (EDT) From: Thomas Monjalon To: Stephen Hemminger Cc: Reshma Pattan , bruce.richardson@intel.com, ferruh.yigit@intel.com, radu.nicolau@intel.com, john.mcnamara@intel.com, dev@dpdk.org Date: Fri, 14 Jul 2017 11:33:17 +0200 Message-ID: <4423375.FJpTyN2xBj@xps> In-Reply-To: <20170713170757.13fc0b44@xeon-e3> References: <1499957338-9320-1-git-send-email-reshma.pattan@intel.com> <1499963067-32504-1-git-send-email-reshma.pattan@intel.com> <20170713170757.13fc0b44@xeon-e3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [RFC v2] ethdev: add IF-MIB attributes implementation 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: Fri, 14 Jul 2017 09:33:21 -0000 14/07/2017 02:07, Stephen Hemminger: > On Thu, 13 Jul 2017 17:24:27 +0100 > Reshma Pattan wrote: > > > diff --git a/lib/librte_ether/rte_ethdev_pci.h b/lib/librte_ether/rte_ethdev_pci.h > > index 69aab03..f829407 100644 > > --- a/lib/librte_ether/rte_ethdev_pci.h > > +++ b/lib/librte_ether/rte_ethdev_pci.h > > @@ -37,6 +37,7 @@ > > #include > > #include > > #include > > +#include > > > > /** > > * Copy pci device info to the Ethernet device data. > > @@ -157,6 +158,9 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev, > > > > RTE_FUNC_PTR_OR_ERR_RET(*dev_init, -EINVAL); > > ret = dev_init(eth_dev); > > + eth_dev->data->sys_up_time_start = rte_rdtsc(); > > + eth_dev->data->if_counter_discontinuity_time = 0; > > + eth_dev->data->if_last_change = 0; > > Shouldn't this be in base eth_dev layer rather than the PCI specific code. > > If you look in rte_eth_dev_data_alloc, the dev_data is already zeroed. > > Also, DPDK in general does BSD style structure names (ie always putting prefix > on structure tags). In BSD, this is a leftover from ancient V6 UNIX where > compiler did no real checking of structure tags. My preference is that > variables and structure names be as short as possible. > > The TSC counter is not a good value to use on this anyway. You don't care > about sub-microsecond accuracy and it wraps around. Better to figure out > a better clock source. Is there a DPDK wrapper of clock_gettime(CLOCK_MONOTONIC)? In rte_cycles.h, the TSC is wrapped into rte_get_timer_cycles(). About clock_gettime(CLOCK_MONOTONIC), I think we may need to create a file rte_clock.h.