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:	Fri, 19 Sep 2014 17:19:26 +0200
From:	Richard Cochran <richardcochran@...il.com>
To:	Alexander Duyck <alexander.h.duyck@...el.com>
Cc:	davem@...emloft.net, nhorman@...hat.com, netdev@...r.kernel.org,
	john.fastabend@...il.com, matthew.vick@...el.com,
	jeffrey.t.kirsher@...el.com, sassmann@...hat.com
Subject: Re: [net-next PATCH 28/29] fm10k: Add support for ptp to hw specific
 files

On Fri, Sep 19, 2014 at 07:36:56AM -0700, Alexander Duyck wrote:
> On 09/19/2014 12:38 AM, Richard Cochran wrote:
> > On Thu, Sep 18, 2014 at 06:40:30PM -0400, Alexander Duyck wrote:
> > 
> >> +static s32 fm10k_adjust_systime_pf(struct fm10k_hw *hw, s32 ppb)
> >> +{
> >> +	u64 systime_adjust;
> >> +
> >> +	/* if sw_addr is not set we don't have switch register access */
> >> +	if (!hw->sw_addr)
> >> +		return ppb ? FM10K_ERR_PARAM : 0;
> >> +
> >> +	/* we must convert the value from parts per billion to parts per
> >> +	 * 2^48 cycles.  In addition we can only use the upper 30 bits of
> >> +	 * the value when making the change so that restricts us futher.
> >> +	 * The math for this is equivilent to ABS(pps) * 2^40 / 10 ^ 9,

...

> 2.  The value is in 2 ^ 48 units, and the OS wants to give us a value in
> parts per billion, not parts per 256 * 2 ^ 40.  So in order to simplify
> things I dropped the lower 8 bits and only update

So what does the comment in the code about "upper 30 bits" mean?

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ