netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Scott Feldman <scofeldm@cisco.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 2/3] enic: add main netdev file withmoduleinfrastructure
Date: Wed, 17 Sep 2008 20:03:49 +0100	[thread overview]
Message-ID: <1221678230.3244.101.camel@achroite> (raw)
In-Reply-To: <Pine.LNX.4.64.0809171144580.4552@palito_client100.nuovasystems.com>

On Wed, 2008-09-17 at 11:51 -0700, Scott Feldman wrote:
> On Wed, 17 Sep 2008, Ben Hutchings wrote:
> 
> > On Tue, 2008-09-16 at 18:49 -0700, Scott Feldman wrote:
> >>>> +static void enic_notify_timer(unsigned long data)
> >>>> +{
> >>>> +	struct enic *enic = (struct enic *)data;
> >>>> +
> >>>> +	enic_notify_check(enic);
> >>>> +
> >>>> +	mod_timer(&enic->notify_timer, round_jiffies(ENIC_NOTIFY_TIMER_PERIOD));
> >>>
> >>> You want round_jiffies_relative() not round_jiffies().
> >>
> >> No, I want round_jiffies().
> > [...]
> >
> > The kernel-doc says:
> > "round_jiffies() rounds an absolute time in the future (in jiffies)
> > up or down to (approximately) full seconds. This is useful for timers
> > for which the exact time they fire does not matter too much, as long as
> > they fire approximately every X seconds."
> >
> > You're passing in ENIC_NOTIFY_TIMER_PERIOD which is a relative time.
> 
> I tried both and round_jiffies(2) gave the desired result of calling the timer
> every two seconds.  Using round_jiffies_relative(2) called the timer
> continuously.

Sorry, yes, round_jiffies_relative() not only takes but also returns a
relative time - which if interpreted as absolute is always in the past.
So calling round_jiffies() is right, but the argument should be jiffies
+ ENIC_NOTIFY_TIMER_PERIOD.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


  reply	other threads:[~2008-09-17 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  3:57 [PATCH 2/3] enic: add main netdev file with module infrastructure Scott Feldman
2008-09-12 19:47 ` Ben Hutchings
2008-09-17  1:49   ` [PATCH 2/3] enic: add main netdev file with moduleinfrastructure Scott Feldman
2008-09-17 11:47     ` Ben Hutchings
2008-09-17 18:51       ` [PATCH 2/3] enic: add main netdev file withmoduleinfrastructure Scott Feldman
2008-09-17 19:03         ` Ben Hutchings [this message]
2008-09-17 19:17           ` Scott Feldman

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=1221678230.3244.101.camel@achroite \
    --to=bhutchings@solarflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=scofeldm@cisco.com \
    /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).