From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [RFC v2] ethdev: add IF-MIB attributes implementation Date: Fri, 14 Jul 2017 11:33:17 +0200 Message-ID: <4423375.FJpTyN2xBj@xps> 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Reshma Pattan , bruce.richardson@intel.com, ferruh.yigit@intel.com, radu.nicolau@intel.com, john.mcnamara@intel.com, dev@dpdk.org To: Stephen Hemminger 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) In-Reply-To: <20170713170757.13fc0b44@xeon-e3> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.