From: Ben Hutchings <bhutchings@solarflare.com>
To: "Allan, Bruce W" <bruce.w.allan@intel.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval for physical identification
Date: Wed, 13 Apr 2011 23:44:39 +0100 [thread overview]
Message-ID: <1302734679.2873.23.camel@bwh-desktop> (raw)
In-Reply-To: <8DD2590731AB5D4C9DBF71A877482A90018A3427B6@orsmsx509.amr.corp.intel.com>
On Wed, 2011-04-13 at 15:39 -0700, Allan, Bruce W wrote:
>
> >-----Original Message-----
> >From: Ben Hutchings [mailto:bhutchings@solarflare.com]
> >Sent: Wednesday, April 13, 2011 1:25 PM
> >To: Allan, Bruce W
> >Cc: netdev@vger.kernel.org
> >Subject: Re: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval
> >for physical identification
> >
> >I'm sure there ought to be a clearer way to do this, and to avoid any
> >weird effects from integer overflow in the multiplication. How about
> >using an inner loop for each second:
> >
> > /* Driver expects to be called at twice the frequency in rc */
> > int n = rc * 2, i, interval = HZ / n;
> >
/* Count down seconds */
> > do {
/* Count down iterations per second */
> > i = n;
> > do {
> > rtnl_lock();
> > rc = dev->ethtool_ops->set_phys_id(
> > dev, (i & 1) ? ETHTOOL_ID_OFF : ETHTOOL_ID_ON);
> > rtnl_unlock();
> > if (rc)
> > break;
> > schedule_timeout_interruptible(interval);
> > } while (!signal_pending(current) && --i != 0);
> > } while (!signal_pending(current) &&
> > (id.data == 0 || --id.data != 0));
> >
> >Ben.
>
> OK, if that is clearer to you...v3 forthcoming.
I guess it wouldn't hurt to add comemnts too. Would you agree that it's
clear with the additions above?
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2011-04-13 22:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-13 19:58 [net-next-2.6 RFC PATCH v2 00/13] ethtool: allow custom interval for Bruce Allan
2011-04-13 19:58 ` [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom interval for physical identification Bruce Allan
2011-04-13 20:25 ` Ben Hutchings
2011-04-13 22:39 ` Allan, Bruce W
2011-04-13 22:44 ` Ben Hutchings [this message]
2011-04-13 22:55 ` Allan, Bruce W
2011-04-13 19:58 ` [net-next-2.6 RFC PATCH v2 02/13] benet: set ethtool set_phys_id on/off cycle frequency to 1/sec Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 03/13] bnx2: " Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 04/13] bnx2x: " Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 05/13] cxgb3: " Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 06/13] ewrk3: set ethtool set_phys_id on/off cycle frequency to 2/sec Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 07/13] niu: set ethtool set_phys_id on/off cycle frequency to 1/sec Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 08/13] pcnet32: set ethtool set_phys_id on/off cycle frequency to 2/sec Bruce Allan
2011-04-14 14:00 ` Don Fry
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 09/13] s2io: set ethtool set_phys_id on/off cycle frequency to 1/sec Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 10/13] sfc: " Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 11/13] skge: set ethtool set_phys_id on/off cycle frequency to 2/sec Bruce Allan
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 12/13] sky2: set ethtool set_phys_id on/off cycle frequency to 1/sec Bruce Allan
2011-04-13 21:00 ` Stephen Hemminger
2011-04-13 19:59 ` [net-next-2.6 RFC PATCH v2 13/13] tg3: " Bruce Allan
2011-04-13 20:11 ` [net-next-2.6 RFC PATCH v2 00/13] ethtool: allow custom interval for Ben Hutchings
2011-04-13 20:25 ` David Miller
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=1302734679.2873.23.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=bruce.w.allan@intel.com \
--cc=netdev@vger.kernel.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