DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Reshma Pattan <reshma.pattan@intel.com>,
	bruce.richardson@intel.com, ferruh.yigit@intel.com,
	radu.nicolau@intel.com, john.mcnamara@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC v2] ethdev: add IF-MIB attributes implementation
Date: Fri, 14 Jul 2017 11:33:17 +0200	[thread overview]
Message-ID: <4423375.FJpTyN2xBj@xps> (raw)
In-Reply-To: <20170713170757.13fc0b44@xeon-e3>

14/07/2017 02:07, Stephen Hemminger:
> On Thu, 13 Jul 2017 17:24:27 +0100
> Reshma Pattan <reshma.pattan@intel.com> 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 <rte_malloc.h>
> >  #include <rte_pci.h>
> >  #include <rte_ethdev.h>
> > +#include <rte_cycles.h>
> >  
> >  /**
> >   * 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.

  reply	other threads:[~2017-07-14  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-13 14:48 [dpdk-dev] [RFC] " Reshma Pattan
2017-07-13 16:24 ` [dpdk-dev] [RFC v2] " Reshma Pattan
2017-07-14  0:07   ` Stephen Hemminger
2017-07-14  9:33     ` Thomas Monjalon [this message]
2017-07-18 14:43   ` [dpdk-dev] [RFC v3] " Reshma Pattan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4423375.FJpTyN2xBj@xps \
    --to=thomas@monjalon.net \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=radu.nicolau@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).