All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] i40e: fix PTP on 5Gb links
@ 2021-05-07 18:56 Jesse Brandeburg
  2021-06-23 19:58 ` Brelinski, TonyX
  0 siblings, 1 reply; 2+ messages in thread
From: Jesse Brandeburg @ 2021-05-07 18:56 UTC (permalink / raw)
  To: intel-wired-lan

As reported by Alex Sergeev, the i40e driver is incremening the PTP
clock at 10Gb speeds when linked at 5Gb. Fix this bug by making
sure that the right multiplier is selected when linked at 5Gb.

Fixes: 3dbdd6c2f70a ("i40e: Add support for 5Gbps cards")
Reported-by: Alex Sergeev <asergeev@carbonrobotics.com>
Suggested-by: Alex Sergeev <asergeev@carbonrobotics.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ptp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index f1f6fc3744e9..7b971b205d36 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -11,13 +11,14 @@
  * operate with the nanosecond field directly without fear of overflow.
  *
  * 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 40Gb, 25Gb, or no link, the period is 1.6ns.
+ * At 10Gb or 5Gb 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;

base-commit: a6f8ee58a8e35f7e4380a5efce312e2a5bc27497
-- 
2.30.2


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

* [Intel-wired-lan] [PATCH net v1] i40e: fix PTP on 5Gb links
  2021-05-07 18:56 [Intel-wired-lan] [PATCH net v1] i40e: fix PTP on 5Gb links Jesse Brandeburg
@ 2021-06-23 19:58 ` Brelinski, TonyX
  0 siblings, 0 replies; 2+ messages in thread
From: Brelinski, TonyX @ 2021-06-23 19:58 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Jesse Brandeburg
> Sent: Friday, May 7, 2021 11:56 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH net v1] i40e: fix PTP on 5Gb links
> 
> As reported by Alex Sergeev, the i40e driver is incremening the PTP clock at
> 10Gb speeds when linked at 5Gb. Fix this bug by making sure that the right
> multiplier is selected when linked at 5Gb.
> 
> Fixes: 3dbdd6c2f70a ("i40e: Add support for 5Gbps cards")
> Reported-by: Alex Sergeev <asergeev@carbonrobotics.com>
> Suggested-by: Alex Sergeev <asergeev@carbonrobotics.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_ptp.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



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

end of thread, other threads:[~2021-06-23 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 18:56 [Intel-wired-lan] [PATCH net v1] i40e: fix PTP on 5Gb links Jesse Brandeburg
2021-06-23 19:58 ` Brelinski, TonyX

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.