All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] X710-T4L: 5Gb support for IEEE1588
@ 2021-05-07  6:14 Alex Sergeev
  2021-05-07 17:35 ` Jesse Brandeburg
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Sergeev @ 2021-05-07  6:14 UTC (permalink / raw)
  To: intel-wired-lan

Hello,

I got forwarded here by folks at e1000-devel at .

We have tried to use PTP with X710-T4L and 5Gb link, and encountered
clockcheck problem in phc2sys:

Apr 30 22:57:36 budtb phc2sys[5940]: [50.569] clockcheck: clock jumped
forward or running faster than expected!

After further code examination, it turned out that 5Gb case is not handled
in i40e_ptp.c

Here's the naive version of the patch that fixed the problem for us:

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index f1f6fc3744e9..5747b652ee9e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -12,12 +12,13 @@
  *
  * Much like the 82599, the update period is dependent upon the link speed:
  * At 40Gb link or no link, the period is 1.6ns.
- * At 10Gb link, the period is multiplied by 2. (3.2ns)
+ * At 5Gb or 10Gb link, the period is multiplied by 2. (3.2ns)
  * At 1Gb link, the period is multiplied by 20. (32ns)
  * 1588 functionality is not supported at 100Mbps.
  */
 #define I40E_PTP_40GB_INCVAL 0x0199999999ULL
 #define I40E_PTP_10GB_INCVAL_MULT 2
+#define I40E_PTP_5GB_INCVAL_MULT    2
 #define I40E_PTP_1GB_INCVAL_MULT 20

 #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1
 BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
@@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
  case I40E_LINK_SPEED_10GB:
      mult = I40E_PTP_10GB_INCVAL_MULT;
      break;
+ case I40E_LINK_SPEED_5GB:
+     mult = I40E_PTP_5GB_INCVAL_MULT;
+     break;
  case I40E_LINK_SPEED_1GB:
      mult = I40E_PTP_1GB_INCVAL_MULT;
      break;

What's the process to get it applied upstream?

Thanks,
Alex Sergeev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20210506/0ff8de27/attachment.html>
-------------- next part --------------
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index f1f6fc3744e9..5747b652ee9e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -12,12 +12,13 @@
  *
  * Much like the 82599, the update period is dependent upon the link speed:
  * At 40Gb link or no link, the period is 1.6ns.
- * At 10Gb link, the period is multiplied by 2. (3.2ns)
+ * At 5Gb or 10Gb link, the period is multiplied by 2. (3.2ns)
  * At 1Gb link, the period is multiplied by 20. (32ns)
  * 1588 functionality is not supported at 100Mbps.
  */
 #define I40E_PTP_40GB_INCVAL		0x0199999999ULL
 #define I40E_PTP_10GB_INCVAL_MULT	2
+#define I40E_PTP_5GB_INCVAL_MULT    2
 #define I40E_PTP_1GB_INCVAL_MULT	20
 
 #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1  BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
@@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
 	case I40E_LINK_SPEED_10GB:
 		mult = I40E_PTP_10GB_INCVAL_MULT;
 		break;
+	case I40E_LINK_SPEED_5GB:
+		mult = I40E_PTP_5GB_INCVAL_MULT;
+		break;
 	case I40E_LINK_SPEED_1GB:
 		mult = I40E_PTP_1GB_INCVAL_MULT;
 		break;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] X710-T4L: 5Gb support for IEEE1588
  2021-05-07  6:14 [Intel-wired-lan] X710-T4L: 5Gb support for IEEE1588 Alex Sergeev
@ 2021-05-07 17:35 ` Jesse Brandeburg
  2021-05-07 20:57   ` Alex Sergeev
  0 siblings, 1 reply; 4+ messages in thread
From: Jesse Brandeburg @ 2021-05-07 17:35 UTC (permalink / raw)
  To: intel-wired-lan

Alex Sergeev wrote:

> Hello,
> 
> I got forwarded here by folks at e1000-devel at .
> 
> We have tried to use PTP with X710-T4L and 5Gb link, and encountered
> clockcheck problem in phc2sys:
> 
> Apr 30 22:57:36 budtb phc2sys[5940]: [50.569] clockcheck: clock jumped
> forward or running faster than expected!
> 
> After further code examination, it turned out that 5Gb case is not handled
> in i40e_ptp.c
> 
> Here's the naive version of the patch that fixed the problem for us:
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> index f1f6fc3744e9..5747b652ee9e 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> @@ -12,12 +12,13 @@
>   *
>   * Much like the 82599, the update period is dependent upon the link speed:
>   * At 40Gb link or no link, the period is 1.6ns.
> - * At 10Gb link, the period is multiplied by 2. (3.2ns)
> + * At 5Gb or 10Gb link, the period is multiplied by 2. (3.2ns)
>   * At 1Gb link, the period is multiplied by 20. (32ns)
>   * 1588 functionality is not supported at 100Mbps.
>   */
>  #define I40E_PTP_40GB_INCVAL 0x0199999999ULL
>  #define I40E_PTP_10GB_INCVAL_MULT 2
> +#define I40E_PTP_5GB_INCVAL_MULT    2
>  #define I40E_PTP_1GB_INCVAL_MULT 20
> 
>  #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1
>  BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
> @@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
>   case I40E_LINK_SPEED_10GB:
>       mult = I40E_PTP_10GB_INCVAL_MULT;
>       break;
> + case I40E_LINK_SPEED_5GB:
> +     mult = I40E_PTP_5GB_INCVAL_MULT;
> +     break;
>   case I40E_LINK_SPEED_1GB:
>       mult = I40E_PTP_1GB_INCVAL_MULT;
>       break;
> 
> What's the process to get it applied upstream?

Hi Alex, that's totally a bug, I've filed an internal bug and we'll be
providing a patch for this problem shortly.

We'll be sure to credit you for the work to find the bug and proposal
for the fix!

If you wish to have the patch be authored by you, you're welcome to
resend to this list with a correctly formatted git patch from
git-format-patch and git-send-email. If you do nothing, we'll just take
care of it. :-)

Thanks for the report and the fix!
Jesse

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] X710-T4L: 5Gb support for IEEE1588
  2021-05-07 17:35 ` Jesse Brandeburg
@ 2021-05-07 20:57   ` Alex Sergeev
  2021-05-07 23:35     ` Nguyen, Anthony L
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Sergeev @ 2021-05-07 20:57 UTC (permalink / raw)
  To: intel-wired-lan

Thanks for quick response and the fix!

Would it be backported to standalone drivers, or previous kernel versions
(e.g. 5.4), too?

Thanks,
Alex Sergeev


On Fri, May 7, 2021 at 10:35 AM Jesse Brandeburg <jesse.brandeburg@intel.com>
wrote:

> Alex Sergeev wrote:
>
> > Hello,
> >
> > I got forwarded here by folks at e1000-devel at .
> >
> > We have tried to use PTP with X710-T4L and 5Gb link, and encountered
> > clockcheck problem in phc2sys:
> >
> > Apr 30 22:57:36 budtb phc2sys[5940]: [50.569] clockcheck: clock jumped
> > forward or running faster than expected!
> >
> > After further code examination, it turned out that 5Gb case is not
> handled
> > in i40e_ptp.c
> >
> > Here's the naive version of the patch that fixed the problem for us:
> >
> > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > index f1f6fc3744e9..5747b652ee9e 100644
> > --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > @@ -12,12 +12,13 @@
> >   *
> >   * Much like the 82599, the update period is dependent upon the link
> speed:
> >   * At 40Gb link or no link, the period is 1.6ns.
> > - * At 10Gb link, the period is multiplied by 2. (3.2ns)
> > + * At 5Gb or 10Gb link, the period is multiplied by 2. (3.2ns)
> >   * At 1Gb link, the period is multiplied by 20. (32ns)
> >   * 1588 functionality is not supported at 100Mbps.
> >   */
> >  #define I40E_PTP_40GB_INCVAL 0x0199999999ULL
> >  #define I40E_PTP_10GB_INCVAL_MULT 2
> > +#define I40E_PTP_5GB_INCVAL_MULT    2
> >  #define I40E_PTP_1GB_INCVAL_MULT 20
> >
> >  #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1
> >  BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
> > @@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf *pf)
> >   case I40E_LINK_SPEED_10GB:
> >       mult = I40E_PTP_10GB_INCVAL_MULT;
> >       break;
> > + case I40E_LINK_SPEED_5GB:
> > +     mult = I40E_PTP_5GB_INCVAL_MULT;
> > +     break;
> >   case I40E_LINK_SPEED_1GB:
> >       mult = I40E_PTP_1GB_INCVAL_MULT;
> >       break;
> >
> > What's the process to get it applied upstream?
>
> Hi Alex, that's totally a bug, I've filed an internal bug and we'll be
> providing a patch for this problem shortly.
>
> We'll be sure to credit you for the work to find the bug and proposal
> for the fix!
>
> If you wish to have the patch be authored by you, you're welcome to
> resend to this list with a correctly formatted git patch from
> git-format-patch and git-send-email. If you do nothing, we'll just take
> care of it. :-)
>
> Thanks for the report and the fix!
> Jesse
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20210507/8b6db783/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] X710-T4L: 5Gb support for IEEE1588
  2021-05-07 20:57   ` Alex Sergeev
@ 2021-05-07 23:35     ` Nguyen, Anthony L
  0 siblings, 0 replies; 4+ messages in thread
From: Nguyen, Anthony L @ 2021-05-07 23:35 UTC (permalink / raw)
  To: intel-wired-lan

On Fri, 2021-05-07 at 13:57 -0700, Alex Sergeev wrote:
> Thanks for quick response and the fix!
> 
> Would it be backported to standalone drivers, or previous kernel
> versions (e.g. 5.4), too?

When the patch is sent to netdev, I will add stable so that it will be
backported to applicable stable kernels.

Thanks,
Tony

> Thanks,
> Alex Sergeev
> 
> 
> On Fri, May 7, 2021 at 10:35 AM Jesse Brandeburg <
> jesse.brandeburg at intel.com> wrote:
> > Alex Sergeev wrote:
> > 
> > > Hello,
> > > 
> > > I got forwarded here by folks at e1000-devel at .
> > > 
> > > We have tried to use PTP with X710-T4L and 5Gb link, and
> > encountered
> > > clockcheck problem in phc2sys:
> > > 
> > > Apr 30 22:57:36 budtb phc2sys[5940]: [50.569] clockcheck: clock
> > jumped
> > > forward or running faster than expected!
> > > 
> > > After further code examination, it turned out that 5Gb case is
> > not handled
> > > in i40e_ptp.c
> > > 
> > > Here's the naive version of the patch that fixed the problem for
> > us:
> > > 
> > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > > b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > > index f1f6fc3744e9..5747b652ee9e 100644
> > > --- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > > +++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
> > > @@ -12,12 +12,13 @@
> > >   *
> > >   * Much like the 82599, the update period is dependent upon the
> > link speed:
> > >   * At 40Gb link or no link, the period is 1.6ns.
> > > - * At 10Gb link, the period is multiplied by 2. (3.2ns)
> > > + * At 5Gb or 10Gb link, the period is multiplied by 2. (3.2ns)
> > >   * At 1Gb link, the period is multiplied by 20. (32ns)
> > >   * 1588 functionality is not supported at 100Mbps.
> > >   */
> > >  #define I40E_PTP_40GB_INCVAL 0x0199999999ULL
> > >  #define I40E_PTP_10GB_INCVAL_MULT 2
> > > +#define I40E_PTP_5GB_INCVAL_MULT    2
> > >  #define I40E_PTP_1GB_INCVAL_MULT 20
> > > 
> > >  #define I40E_PRTTSYN_CTL1_TSYNTYPE_V1
> > >  BIT(I40E_PRTTSYN_CTL1_TSYNTYPE_SHIFT)
> > > @@ -465,6 +466,9 @@ void i40e_ptp_set_increment(struct i40e_pf
> > *pf)
> > >   case I40E_LINK_SPEED_10GB:
> > >       mult = I40E_PTP_10GB_INCVAL_MULT;
> > >       break;
> > > + case I40E_LINK_SPEED_5GB:
> > > +     mult = I40E_PTP_5GB_INCVAL_MULT;
> > > +     break;
> > >   case I40E_LINK_SPEED_1GB:
> > >       mult = I40E_PTP_1GB_INCVAL_MULT;
> > >       break;
> > > 
> > > What's the process to get it applied upstream?
> > 
> > Hi Alex, that's totally a bug, I've filed an internal bug and we'll
> > be
> > providing a patch for this problem shortly.
> > 
> > We'll be sure to credit you for the work to find the bug and
> > proposal
> > for the fix!
> > 
> > If you wish to have the patch be authored by you, you're welcome to
> > resend to this list with a correctly formatted git patch from
> > git-format-patch and git-send-email. If you do nothing, we'll just
> > take
> > care of it. :-)
> > 
> > Thanks for the report and the fix!
> > Jesse
> 
> _______________________________________________
> Intel-wired-lan mailing list
> Intel-wired-lan at osuosl.org
> https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-07 23:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  6:14 [Intel-wired-lan] X710-T4L: 5Gb support for IEEE1588 Alex Sergeev
2021-05-07 17:35 ` Jesse Brandeburg
2021-05-07 20:57   ` Alex Sergeev
2021-05-07 23:35     ` Nguyen, Anthony L

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.