lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 13 Apr 2011 15:39:28 -0700
From:	"Allan, Bruce W" <bruce.w.allan@...el.com>
To:	Ben Hutchings <bhutchings@...arflare.com>
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [net-next-2.6 RFC PATCH v2 01/13] ethtool: allow custom
 interval for physical identification



>-----Original Message-----
>From: Ben Hutchings [mailto:bhutchings@...arflare.com]
>Sent: Wednesday, April 13, 2011 1:25 PM
>To: Allan, Bruce W
>Cc: netdev@...r.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;
>
>		do {
>			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.

Thanks,
Bruce.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ