All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: stmmac: Fix E2E delay mechanism
@ 2021-10-20  7:04 Kurt Kanzenbach
  2021-10-20 13:50 ` patchwork-bot+netdevbpf
  2021-10-21  6:44 ` Wong Vee Khee
  0 siblings, 2 replies; 4+ messages in thread
From: Kurt Kanzenbach @ 2021-10-20  7:04 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, Fugang Duan, Sebastian Andrzej Siewior,
	Ong Boon Leong, netdev, Kurt Kanzenbach

When utilizing End to End delay mechanism, the following error messages show up:

|root@ehl1:~# ptp4l --tx_timestamp_timeout=50 -H -i eno2 -E -m
|ptp4l[950.573]: selected /dev/ptp3 as PTP clock
|ptp4l[950.586]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
|ptp4l[950.586]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
|ptp4l[952.879]: port 1: new foreign master 001395.fffe.4897b4-1
|ptp4l[956.879]: selected best master clock 001395.fffe.4897b4
|ptp4l[956.879]: port 1: assuming the grand master role
|ptp4l[956.879]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER
|ptp4l[962.017]: port 1: received DELAY_REQ without timestamp
|ptp4l[962.273]: port 1: received DELAY_REQ without timestamp
|ptp4l[963.090]: port 1: received DELAY_REQ without timestamp

Commit f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP
packets in dwmac v5.10a") already addresses this problem for the dwmac
v5.10. However, same holds true for all dwmacs above version v4.10. Correct the
check accordingly. Afterwards everything works as expected.

Tested on Intel Atom(R) x6414RE Processor.

Fixes: 14f347334bf2 ("net: stmmac: Correctly take timestamp for PTPv2")
Fixes: f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a")
Suggested-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index eb3b7bf771d7..3d67d1fa3690 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -736,7 +736,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
 			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
 			ptp_v2 = PTP_TCR_TSVER2ENA;
 			snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
-			if (priv->synopsys_id != DWMAC_CORE_5_10)
+			if (priv->synopsys_id < DWMAC_CORE_4_10)
 				ts_event_en = PTP_TCR_TSEVNTENA;
 			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
 			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
-- 
2.30.2


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

* Re: [PATCH net] net: stmmac: Fix E2E delay mechanism
  2021-10-20  7:04 [PATCH net] net: stmmac: Fix E2E delay mechanism Kurt Kanzenbach
@ 2021-10-20 13:50 ` patchwork-bot+netdevbpf
  2021-10-21  6:44 ` Wong Vee Khee
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-20 13:50 UTC (permalink / raw)
  To: Kurt Kanzenbach
  Cc: davem, kuba, peppe.cavallaro, alexandre.torgue, joabreu,
	mcoquelin.stm32, fugang.duan, bigeasy, boon.leong.ong, netdev

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 20 Oct 2021 09:04:33 +0200 you wrote:
> When utilizing End to End delay mechanism, the following error messages show up:
> 
> |root@ehl1:~# ptp4l --tx_timestamp_timeout=50 -H -i eno2 -E -m
> |ptp4l[950.573]: selected /dev/ptp3 as PTP clock
> |ptp4l[950.586]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
> |ptp4l[950.586]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
> |ptp4l[952.879]: port 1: new foreign master 001395.fffe.4897b4-1
> |ptp4l[956.879]: selected best master clock 001395.fffe.4897b4
> |ptp4l[956.879]: port 1: assuming the grand master role
> |ptp4l[956.879]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER
> |ptp4l[962.017]: port 1: received DELAY_REQ without timestamp
> |ptp4l[962.273]: port 1: received DELAY_REQ without timestamp
> |ptp4l[963.090]: port 1: received DELAY_REQ without timestamp
> 
> [...]

Here is the summary with links:
  - [net] net: stmmac: Fix E2E delay mechanism
    https://git.kernel.org/netdev/net/c/3cb958027cb8

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] 4+ messages in thread

* Re: [PATCH net] net: stmmac: Fix E2E delay mechanism
  2021-10-20  7:04 [PATCH net] net: stmmac: Fix E2E delay mechanism Kurt Kanzenbach
  2021-10-20 13:50 ` patchwork-bot+netdevbpf
@ 2021-10-21  6:44 ` Wong Vee Khee
  2021-10-21  6:55   ` Kurt Kanzenbach
  1 sibling, 1 reply; 4+ messages in thread
From: Wong Vee Khee @ 2021-10-21  6:44 UTC (permalink / raw)
  To: Kurt Kanzenbach
  Cc: David S. Miller, Jakub Kicinski, Giuseppe Cavallaro,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Fugang Duan,
	Sebastian Andrzej Siewior, Ong Boon Leong, netdev

On Wed, Oct 20, 2021 at 09:04:33AM +0200, Kurt Kanzenbach wrote:
> When utilizing End to End delay mechanism, the following error messages show up:
> 
> |root@ehl1:~# ptp4l --tx_timestamp_timeout=50 -H -i eno2 -E -m
> |ptp4l[950.573]: selected /dev/ptp3 as PTP clock
> |ptp4l[950.586]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE
> |ptp4l[950.586]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE
> |ptp4l[952.879]: port 1: new foreign master 001395.fffe.4897b4-1
> |ptp4l[956.879]: selected best master clock 001395.fffe.4897b4
> |ptp4l[956.879]: port 1: assuming the grand master role
> |ptp4l[956.879]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER
> |ptp4l[962.017]: port 1: received DELAY_REQ without timestamp
> |ptp4l[962.273]: port 1: received DELAY_REQ without timestamp
> |ptp4l[963.090]: port 1: received DELAY_REQ without timestamp
> 
> Commit f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP
> packets in dwmac v5.10a") already addresses this problem for the dwmac
> v5.10. However, same holds true for all dwmacs above version v4.10. Correct the
> check accordingly. Afterwards everything works as expected.
> 
> Tested on Intel Atom(R) x6414RE Processor.
> 
> Fixes: 14f347334bf2 ("net: stmmac: Correctly take timestamp for PTPv2")
> Fixes: f2fb6b6275eb ("net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a")
> Suggested-by: Ong Boon Leong <boon.leong.ong@intel.com>
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index eb3b7bf771d7..3d67d1fa3690 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -736,7 +736,7 @@ static int stmmac_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
>  			config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
>  			ptp_v2 = PTP_TCR_TSVER2ENA;
>  			snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
> -			if (priv->synopsys_id != DWMAC_CORE_5_10)
> +			if (priv->synopsys_id < DWMAC_CORE_4_10)
>  				ts_event_en = PTP_TCR_TSEVNTENA;
>  			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
>  			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;

This fixes PTPv2 E2E issue on EHL-based boards. Can this also
be applied to 5.4 and onwards?

Thanks,
Vee Khee

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

* Re: [PATCH net] net: stmmac: Fix E2E delay mechanism
  2021-10-21  6:44 ` Wong Vee Khee
@ 2021-10-21  6:55   ` Kurt Kanzenbach
  0 siblings, 0 replies; 4+ messages in thread
From: Kurt Kanzenbach @ 2021-10-21  6:55 UTC (permalink / raw)
  To: Wong Vee Khee
  Cc: David S. Miller, Jakub Kicinski, Giuseppe Cavallaro,
	Alexandre Torgue, Jose Abreu, Maxime Coquelin, Fugang Duan,
	Sebastian Andrzej Siewior, Ong Boon Leong, netdev

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

On Thu Oct 21 2021, Wong Vee Khee wrote:
> This fixes PTPv2 E2E issue on EHL-based boards. Can this also
> be applied to 5.4 and onwards?

I've submitted the patch to net tree (instead of net-next) meaning it
will be picked up for stable kernels automatically.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

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

end of thread, other threads:[~2021-10-21  6:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20  7:04 [PATCH net] net: stmmac: Fix E2E delay mechanism Kurt Kanzenbach
2021-10-20 13:50 ` patchwork-bot+netdevbpf
2021-10-21  6:44 ` Wong Vee Khee
2021-10-21  6:55   ` Kurt Kanzenbach

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.