All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bowers, AndrewX <andrewx.bowers@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S90 6/8] i40e: avoid overflow in i40e_ptp_adjfreq()
Date: Mon, 23 Apr 2018 20:58:05 +0000	[thread overview]
Message-ID: <26D9FDECA4FBDD4AADA65D8E2FC68A4A1A976988@ORSMSX104.amr.corp.intel.com> (raw)
In-Reply-To: <20180420084140.8081-6-alice.michael@intel.com>

> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Friday, April 20, 2018 1:42 AM
> To: Michael, Alice <alice.michael@intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S90 6/8] i40e: avoid overflow in
> i40e_ptp_adjfreq()
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> When operating at 1GbE, the base incval for the PTP clock is so large that
> multiplying it by numbers close to the max_adj can overflow the u64.
> 
> Rather than attempting to limit the max_adj to a value small enough to avoid
> overflow, instead calculate the incvalue adjustment based on the 40GbE
> incvalue, and then multiply that by the scaling factor for the link speed.
> 
> This sacrifices a small amount of precision in the adjustment but we avoid
> erratic behavior of the clock due to the overflow caused if ppb is very near
> the maximum adjustment.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e.h     |  2 +-
>  drivers/net/ethernet/intel/i40e/i40e_ptp.c | 41 ++++++++++++++++++++--
> --------
>  2 files changed, 28 insertions(+), 15 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>



  reply	other threads:[~2018-04-23 20:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-20  8:41 [Intel-wired-lan] [next PATCH S90 1/8] i40e/i40evf: cleanup incorrect function doxygen comments Alice Michael
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 2/8] i40e: fix reading LLDP configuration Alice Michael
2018-04-23 20:56   ` Bowers, AndrewX
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 3/8] i40e: Add advertising 10G LR mode Alice Michael
2018-04-23 20:56   ` Bowers, AndrewX
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 4/8] i40evf: Fix turning TSO, GSO and GRO on after Alice Michael
2018-04-23  8:55   ` Jablonski, Pawel
2018-04-23 20:57   ` Bowers, AndrewX
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 5/8] i40e: Fix multiple issues with UDP tunnel offload filter configuration Alice Michael
2018-04-23 20:57   ` Bowers, AndrewX
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 6/8] i40e: avoid overflow in i40e_ptp_adjfreq() Alice Michael
2018-04-23 20:58   ` Bowers, AndrewX [this message]
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 7/8] i40e/i40evf: take into account queue map from vf when handling queues Alice Michael
2018-04-23 20:58   ` Bowers, AndrewX
2018-04-20  8:41 ` [Intel-wired-lan] [next PATCH S90 8/8] i40e: use %pI4b instead of byte swapping before dev_err Alice Michael
2018-04-23 20:59   ` Bowers, AndrewX
2018-04-23 20:55 ` [Intel-wired-lan] [next PATCH S90 1/8] i40e/i40evf: cleanup incorrect function doxygen comments Bowers, AndrewX

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=26D9FDECA4FBDD4AADA65D8E2FC68A4A1A976988@ORSMSX104.amr.corp.intel.com \
    --to=andrewx.bowers@intel.com \
    --cc=intel-wired-lan@osuosl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.