From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wRuRMzfUDp+24b28LhwVsFhbzAEv/z6fCKy/jw7/CBI=; b=0f4TJVqTD634fLS/7M0Ulu4gO9SP+iQc1QVF9BNwZ7leUwclw/Tokm1eRAqdynDeir blNJfICyRHNt9oy6SZsebLm+J+0Er4ygNdJuk8IifnejI6+II+GZyx7twi9iqhWF7sZp JZZYxzA/nbrku+FobzTgt5URDZVU5J3U8hHjH3dOnZpdWXHzTgOkb3esy0CqnPy+Ol+g lPh2sunhxJJp2OYNAPdqFsjzaWtqllzlGnZekjlOgdI6p/2bt2miSlY8lOr9qqW2Zw5Y h+x/byeLkdimxeiowyjt2wF0a4YgxO+m/ohXeawl7GWr0HLoymkLW3AOeGuZq7K5hax+ K68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wRuRMzfUDp+24b28LhwVsFhbzAEv/z6fCKy/jw7/CBI=; b=V9hcxTzDskXeiwPPCopmEogZPUCdJSEk/XxKFp9JR5+eWcThPDAMbl7O+5UQB+ZO2I bSLH+4fCcB5bENBlsCXdpRTP6mk4AE1D8c896W8pJyqua2XaRS6ezwzcmnXg3C2dgyFG dvy5OxfkffUs0NqK3kVP9NbYz+DrlqECWSqTeiTCcfY1QAVX1o4v2XHupiCr8jweRkuK d+fW8Z8AdgbQDsNCMNZyyo3IIUYRJEZTcS0lYeiRY0nKpVdIvtjXeGC1XYRmc2R6qiE5 1DHv8+qJCZxVzIsXAunQkNwy+7qjz05SZs31JhOzOKKujpiEufnUOBU2sXaT3yiwB9xt co4A== X-Gm-Message-State: AIVw110IpIezK8/U5vqvI+nBKvAbdtkmMMI3oFv2IdquFWZiLbGVBgvU 3enimonoNzSQLCVZ X-Received: by 10.84.224.4 with SMTP id r4mr12752066plj.85.1499990887000; Thu, 13 Jul 2017 17:08:07 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id b8sm16460799pfd.65.2017.07.13.17.08.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2017 17:08:06 -0700 (PDT) Date: Thu, 13 Jul 2017 17:07:57 -0700 From: Stephen Hemminger To: Reshma Pattan Cc: thomas@monjalon.net, bruce.richardson@intel.com, ferruh.yigit@intel.com, radu.nicolau@intel.com, john.mcnamara@intel.com, dev@dpdk.org Message-ID: <20170713170757.13fc0b44@xeon-e3> In-Reply-To: <1499963067-32504-1-git-send-email-reshma.pattan@intel.com> 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 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 00:08:08 -0000 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)?