netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] igb: extend PTP timestamp adjustments to i211
@ 2024-02-27 18:49 Tony Nguyen
  2024-02-28  9:37 ` Jiri Pirko
  2024-02-29  4:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 9+ messages in thread
From: Tony Nguyen @ 2024-02-27 18:49 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Oleksij Rempel, anthony.l.nguyen, richardcochran,
	nathan.sullivan, Jacob Keller, Pucha Himasekhar Reddy

From: Oleksij Rempel <o.rempel@pengutronix.de>

The i211 requires the same PTP timestamp adjustments as the i210,
according to its datasheet. To ensure consistent timestamping across
different platforms, this change extends the existing adjustments to
include the i211.

The adjustment result are tested and comparable for i210 and i211 based
systems.

Fixes: 3f544d2a4d5c ("igb: adjust PTP timestamps for Tx/Rx latency")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_ptp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 319c544b9f04..f94570556120 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -957,7 +957,7 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
 
 	igb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
 	/* adjust timestamp for the TX latency based on link speed */
-	if (adapter->hw.mac.type == e1000_i210) {
+	if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
 		switch (adapter->link_speed) {
 		case SPEED_10:
 			adjust = IGB_I210_TX_LATENCY_10;
@@ -1003,6 +1003,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
 			ktime_t *timestamp)
 {
 	struct igb_adapter *adapter = q_vector->adapter;
+	struct e1000_hw *hw = &adapter->hw;
 	struct skb_shared_hwtstamps ts;
 	__le64 *regval = (__le64 *)va;
 	int adjust = 0;
@@ -1022,7 +1023,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
 	igb_ptp_systim_to_hwtstamp(adapter, &ts, le64_to_cpu(regval[1]));
 
 	/* adjust timestamp for the RX latency based on link speed */
-	if (adapter->hw.mac.type == e1000_i210) {
+	if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
 		switch (adapter->link_speed) {
 		case SPEED_10:
 			adjust = IGB_I210_RX_LATENCY_10;
-- 
2.41.0


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

* Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-27 18:49 [PATCH net] igb: extend PTP timestamp adjustments to i211 Tony Nguyen
@ 2024-02-28  9:37 ` Jiri Pirko
  2024-02-28 12:28   ` Oleksij Rempel
  2024-02-29  4:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 9+ messages in thread
From: Jiri Pirko @ 2024-02-28  9:37 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, Oleksij Rempel,
	richardcochran, nathan.sullivan, Jacob Keller,
	Pucha Himasekhar Reddy

Tue, Feb 27, 2024 at 07:49:41PM CET, anthony.l.nguyen@intel.com wrote:
>From: Oleksij Rempel <o.rempel@pengutronix.de>
>
>The i211 requires the same PTP timestamp adjustments as the i210,
>according to its datasheet. To ensure consistent timestamping across
>different platforms, this change extends the existing adjustments to
>include the i211.
>
>The adjustment result are tested and comparable for i210 and i211 based
>systems.
>
>Fixes: 3f544d2a4d5c ("igb: adjust PTP timestamps for Tx/Rx latency")

IIUC, you are just extending the timestamp adjusting to another HW, not
actually fixing any error, don't you? In that case, I don't see why not
to rather target net-next and avoid "Fixes" tag. Or do I misunderstand
this?


>Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
>Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
>Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
>Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
>---
> drivers/net/ethernet/intel/igb/igb_ptp.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
>index 319c544b9f04..f94570556120 100644
>--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
>+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
>@@ -957,7 +957,7 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
> 
> 	igb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval);
> 	/* adjust timestamp for the TX latency based on link speed */
>-	if (adapter->hw.mac.type == e1000_i210) {
>+	if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
> 		switch (adapter->link_speed) {
> 		case SPEED_10:
> 			adjust = IGB_I210_TX_LATENCY_10;
>@@ -1003,6 +1003,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
> 			ktime_t *timestamp)
> {
> 	struct igb_adapter *adapter = q_vector->adapter;
>+	struct e1000_hw *hw = &adapter->hw;
> 	struct skb_shared_hwtstamps ts;
> 	__le64 *regval = (__le64 *)va;
> 	int adjust = 0;
>@@ -1022,7 +1023,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va,
> 	igb_ptp_systim_to_hwtstamp(adapter, &ts, le64_to_cpu(regval[1]));
> 
> 	/* adjust timestamp for the RX latency based on link speed */
>-	if (adapter->hw.mac.type == e1000_i210) {
>+	if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) {
> 		switch (adapter->link_speed) {
> 		case SPEED_10:
> 			adjust = IGB_I210_RX_LATENCY_10;
>-- 
>2.41.0
>
>

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

* Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-28  9:37 ` Jiri Pirko
@ 2024-02-28 12:28   ` Oleksij Rempel
  2024-02-28 17:43     ` Keller, Jacob E
  0 siblings, 1 reply; 9+ messages in thread
From: Oleksij Rempel @ 2024-02-28 12:28 UTC (permalink / raw)
  To: Jiri Pirko
  Cc: Tony Nguyen, davem, kuba, pabeni, edumazet, netdev,
	richardcochran, nathan.sullivan, Jacob Keller,
	Pucha Himasekhar Reddy

On Wed, Feb 28, 2024 at 10:37:56AM +0100, Jiri Pirko wrote:
> Tue, Feb 27, 2024 at 07:49:41PM CET, anthony.l.nguyen@intel.com wrote:
> >From: Oleksij Rempel <o.rempel@pengutronix.de>
> >
> >The i211 requires the same PTP timestamp adjustments as the i210,
> >according to its datasheet. To ensure consistent timestamping across
> >different platforms, this change extends the existing adjustments to
> >include the i211.
> >
> >The adjustment result are tested and comparable for i210 and i211 based
> >systems.
> >
> >Fixes: 3f544d2a4d5c ("igb: adjust PTP timestamps for Tx/Rx latency")
> 
> IIUC, you are just extending the timestamp adjusting to another HW, not
> actually fixing any error, don't you? In that case, I don't see why not
> to rather target net-next and avoid "Fixes" tag. Or do I misunderstand
> this?

From my perspective, it was an error, since two nearly identical systems
with only one difference (one used i210 other i211) showed different PTP
measurements. So, it would be nice if distributions would include this
fix. On other hand, I'm ok with what ever maintainer would decide how
to handle this patch.

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* RE: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-28 12:28   ` Oleksij Rempel
@ 2024-02-28 17:43     ` Keller, Jacob E
  2024-02-29  4:20       ` Jakub Kicinski
  2024-02-29  8:29       ` Jiri Pirko
  0 siblings, 2 replies; 9+ messages in thread
From: Keller, Jacob E @ 2024-02-28 17:43 UTC (permalink / raw)
  To: Oleksij Rempel, Jiri Pirko
  Cc: Nguyen, Anthony L, davem, kuba, pabeni, edumazet, netdev,
	richardcochran, nathan.sullivan, Pucha, HimasekharX Reddy



> -----Original Message-----
> From: Oleksij Rempel <o.rempel@pengutronix.de>
> Sent: Wednesday, February 28, 2024 4:28 AM
> To: Jiri Pirko <jiri@resnulli.us>
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; davem@davemloft.net;
> kuba@kernel.org; pabeni@redhat.com; edumazet@google.com;
> netdev@vger.kernel.org; richardcochran@gmail.com; nathan.sullivan@ni.com;
> Keller, Jacob E <jacob.e.keller@intel.com>; Pucha, HimasekharX Reddy
> <himasekharx.reddy.pucha@intel.com>
> Subject: Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
> 
> On Wed, Feb 28, 2024 at 10:37:56AM +0100, Jiri Pirko wrote:
> > Tue, Feb 27, 2024 at 07:49:41PM CET, anthony.l.nguyen@intel.com wrote:
> > >From: Oleksij Rempel <o.rempel@pengutronix.de>
> > >
> > >The i211 requires the same PTP timestamp adjustments as the i210,
> > >according to its datasheet. To ensure consistent timestamping across
> > >different platforms, this change extends the existing adjustments to
> > >include the i211.
> > >
> > >The adjustment result are tested and comparable for i210 and i211 based
> > >systems.
> > >
> > >Fixes: 3f544d2a4d5c ("igb: adjust PTP timestamps for Tx/Rx latency")
> >
> > IIUC, you are just extending the timestamp adjusting to another HW, not
> > actually fixing any error, don't you? In that case, I don't see why not
> > to rather target net-next and avoid "Fixes" tag. Or do I misunderstand
> > this?
> 
> From my perspective, it was an error, since two nearly identical systems
> with only one difference (one used i210 other i211) showed different PTP
> measurements. So, it would be nice if distributions would include this
> fix. On other hand, I'm ok with what ever maintainer would decide how
> to handle this patch.
> 
> Regards,
> Oleksij

Without this, the i211 doesn't apply the Tx/Rx latency adjustments, so the timestamps would be less accurate than if the corrections are applied. On the one hand I guess this is a "feature" and the lack of a feature isn't a bug, so maybe its not viewed as a bug fix then.

Another interpretation is that lacking those corrections is a bug which this patch fixes.

Thanks,
Jake

> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-28 17:43     ` Keller, Jacob E
@ 2024-02-29  4:20       ` Jakub Kicinski
  2024-02-29 20:09         ` Keller, Jacob E
  2024-02-29  8:29       ` Jiri Pirko
  1 sibling, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2024-02-29  4:20 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Oleksij Rempel, Jiri Pirko, Nguyen, Anthony L, davem, pabeni,
	edumazet, netdev, richardcochran, nathan.sullivan, Pucha,
	HimasekharX Reddy

On Wed, 28 Feb 2024 17:43:03 +0000 Keller, Jacob E wrote:
> Without this, the i211 doesn't apply the Tx/Rx latency adjustments,
> so the timestamps would be less accurate than if the corrections are
> applied. On the one hand I guess this is a "feature" and the lack of
> a feature isn't a bug, so maybe its not viewed as a bug fix then.

I tossed a coin and it said.... "whatever, man". Such sass, tsk tsk.

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

* Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-27 18:49 [PATCH net] igb: extend PTP timestamp adjustments to i211 Tony Nguyen
  2024-02-28  9:37 ` Jiri Pirko
@ 2024-02-29  4:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-29  4:30 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, kuba, pabeni, edumazet, netdev, o.rempel, richardcochran,
	nathan.sullivan, jacob.e.keller, himasekharx.reddy.pucha

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 27 Feb 2024 10:49:41 -0800 you wrote:
> From: Oleksij Rempel <o.rempel@pengutronix.de>
> 
> The i211 requires the same PTP timestamp adjustments as the i210,
> according to its datasheet. To ensure consistent timestamping across
> different platforms, this change extends the existing adjustments to
> include the i211.
> 
> [...]

Here is the summary with links:
  - [net] igb: extend PTP timestamp adjustments to i211
    https://git.kernel.org/netdev/net/c/0bb7b09392eb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

* Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-28 17:43     ` Keller, Jacob E
  2024-02-29  4:20       ` Jakub Kicinski
@ 2024-02-29  8:29       ` Jiri Pirko
  1 sibling, 0 replies; 9+ messages in thread
From: Jiri Pirko @ 2024-02-29  8:29 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Oleksij Rempel, Nguyen, Anthony L, davem, kuba, pabeni, edumazet,
	netdev, richardcochran, nathan.sullivan, Pucha,
	HimasekharX Reddy

Wed, Feb 28, 2024 at 06:43:03PM CET, jacob.e.keller@intel.com wrote:
>
>
>> -----Original Message-----
>> From: Oleksij Rempel <o.rempel@pengutronix.de>
>> Sent: Wednesday, February 28, 2024 4:28 AM
>> To: Jiri Pirko <jiri@resnulli.us>
>> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; davem@davemloft.net;
>> kuba@kernel.org; pabeni@redhat.com; edumazet@google.com;
>> netdev@vger.kernel.org; richardcochran@gmail.com; nathan.sullivan@ni.com;
>> Keller, Jacob E <jacob.e.keller@intel.com>; Pucha, HimasekharX Reddy
>> <himasekharx.reddy.pucha@intel.com>
>> Subject: Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
>> 
>> On Wed, Feb 28, 2024 at 10:37:56AM +0100, Jiri Pirko wrote:
>> > Tue, Feb 27, 2024 at 07:49:41PM CET, anthony.l.nguyen@intel.com wrote:
>> > >From: Oleksij Rempel <o.rempel@pengutronix.de>
>> > >
>> > >The i211 requires the same PTP timestamp adjustments as the i210,
>> > >according to its datasheet. To ensure consistent timestamping across
>> > >different platforms, this change extends the existing adjustments to
>> > >include the i211.
>> > >
>> > >The adjustment result are tested and comparable for i210 and i211 based
>> > >systems.
>> > >
>> > >Fixes: 3f544d2a4d5c ("igb: adjust PTP timestamps for Tx/Rx latency")
>> >
>> > IIUC, you are just extending the timestamp adjusting to another HW, not
>> > actually fixing any error, don't you? In that case, I don't see why not
>> > to rather target net-next and avoid "Fixes" tag. Or do I misunderstand
>> > this?
>> 
>> From my perspective, it was an error, since two nearly identical systems
>> with only one difference (one used i210 other i211) showed different PTP
>> measurements. So, it would be nice if distributions would include this
>> fix. On other hand, I'm ok with what ever maintainer would decide how
>> to handle this patch.
>> 
>> Regards,
>> Oleksij
>
>Without this, the i211 doesn't apply the Tx/Rx latency adjustments, so the timestamps would be less accurate than if the corrections are applied. On the one hand I guess this is a "feature" and the lack of a feature isn't a bug, so maybe its not viewed as a bug fix then.

The behaviour of i211 is the same as it always was. I mean, 3f544d2a4d5c
didn't cause any regression. From that perspective, it is clearly a
feature.

I know that in netdev we are taking the meaning of "Fixes" quite on the
edge often, but I think this is off the cliff :)


>
>Another interpretation is that lacking those corrections is a bug which this patch fixes.
>
>Thanks,
>Jake
>
>> --
>> Pengutronix e.K.                           |                             |
>> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* RE: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-29  4:20       ` Jakub Kicinski
@ 2024-02-29 20:09         ` Keller, Jacob E
  2024-02-29 20:14           ` Jakub Kicinski
  0 siblings, 1 reply; 9+ messages in thread
From: Keller, Jacob E @ 2024-02-29 20:09 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Oleksij Rempel, Jiri Pirko, Nguyen, Anthony L, davem, pabeni,
	edumazet, netdev, richardcochran, nathan.sullivan, Pucha,
	HimasekharX Reddy



> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Wednesday, February 28, 2024 8:21 PM
> To: Keller, Jacob E <jacob.e.keller@intel.com>
> Cc: Oleksij Rempel <o.rempel@pengutronix.de>; Jiri Pirko <jiri@resnulli.us>;
> Nguyen, Anthony L <anthony.l.nguyen@intel.com>; davem@davemloft.net;
> pabeni@redhat.com; edumazet@google.com; netdev@vger.kernel.org;
> richardcochran@gmail.com; nathan.sullivan@ni.com; Pucha, HimasekharX Reddy
> <himasekharx.reddy.pucha@intel.com>
> Subject: Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
> 
> On Wed, 28 Feb 2024 17:43:03 +0000 Keller, Jacob E wrote:
> > Without this, the i211 doesn't apply the Tx/Rx latency adjustments,
> > so the timestamps would be less accurate than if the corrections are
> > applied. On the one hand I guess this is a "feature" and the lack of
> > a feature isn't a bug, so maybe its not viewed as a bug fix then.
> 
> I tossed a coin and it said.... "whatever, man". Such sass, tsk tsk.

I might have not had enough caffiene when writing that email... 😊

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

* Re: [PATCH net] igb: extend PTP timestamp adjustments to i211
  2024-02-29 20:09         ` Keller, Jacob E
@ 2024-02-29 20:14           ` Jakub Kicinski
  0 siblings, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2024-02-29 20:14 UTC (permalink / raw)
  To: Keller, Jacob E
  Cc: Oleksij Rempel, Jiri Pirko, Nguyen, Anthony L, davem, pabeni,
	edumazet, netdev, richardcochran, nathan.sullivan, Pucha,
	HimasekharX Reddy

On Thu, 29 Feb 2024 20:09:03 +0000 Keller, Jacob E wrote:
> > On Wed, 28 Feb 2024 17:43:03 +0000 Keller, Jacob E wrote:  
> > > Without this, the i211 doesn't apply the Tx/Rx latency adjustments,
> > > so the timestamps would be less accurate than if the corrections are
> > > applied. On the one hand I guess this is a "feature" and the lack of
> > > a feature isn't a bug, so maybe its not viewed as a bug fix then.  
> > 
> > I tossed a coin and it said.... "whatever, man". Such sass, tsk tsk.  
> 
> I might have not had enough caffiene when writing that email... 😊

Sorry, my bad, I was barely awake. What I meant to convey is that
it's borderline, so discussing how people feel is not a good use of
anyone's time.

It's a 3 LoC change to include one chip in what's done for another chip,
it has been well tested, and has user impact. It's fine.

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

end of thread, other threads:[~2024-02-29 20:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27 18:49 [PATCH net] igb: extend PTP timestamp adjustments to i211 Tony Nguyen
2024-02-28  9:37 ` Jiri Pirko
2024-02-28 12:28   ` Oleksij Rempel
2024-02-28 17:43     ` Keller, Jacob E
2024-02-29  4:20       ` Jakub Kicinski
2024-02-29 20:09         ` Keller, Jacob E
2024-02-29 20:14           ` Jakub Kicinski
2024-02-29  8:29       ` Jiri Pirko
2024-02-29  4:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).