Intel-Wired-Lan Archive on 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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox