From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [RFC v2] ethdev: add IF-MIB attributes implementation Date: Thu, 13 Jul 2017 17:07:57 -0700 Message-ID: <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> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: thomas@monjalon.net, bruce.richardson@intel.com, ferruh.yigit@intel.com, radu.nicolau@intel.com, john.mcnamara@intel.com, dev@dpdk.org To: Reshma Pattan Return-path: Received: from mail-pg0-f44.google.com (mail-pg0-f44.google.com [74.125.83.44]) by dpdk.org (Postfix) with ESMTP id ED93E2935 for ; Fri, 14 Jul 2017 02:08:07 +0200 (CEST) Received: by mail-pg0-f44.google.com with SMTP id t186so37132594pgb.1 for ; Thu, 13 Jul 2017 17:08:07 -0700 (PDT) In-Reply-To: <1499963067-32504-1-git-send-email-reshma.pattan@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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)?