All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
@ 2020-05-25  8:18 ` Fugang Duan
  0 siblings, 0 replies; 6+ messages in thread
From: Fugang Duan @ 2020-05-25  8:18 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, kuba, davem
  Cc: netdev, mcoquelin.stm32, p.zabel, linux-stm32, linux-arm-kernel,
	fugang.duan

For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
PTP v2/802.AS1, any layer, any kind of event packet, but HW only
take timestamp snapshot for below PTP message: sync, Pdelay_req,
Pdelay_resp.

Then it causes below issue when test E2E case:
ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp

Timestamp snapshot dependency on register bits in received path:
SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
01         x         0          SYNC, Follow_Up, Delay_Req,
                                Delay_Resp, Pdelay_Req, Pdelay_Resp,
                                Pdelay_Resp_Follow_Up
01         0         1          SYNC, Pdelay_Req, Pdelay_Resp

For dwmac v5.10a, enabling all events by setting register
DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
to 0’b0, which can support all required events.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index b6f92c7..73677c3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -630,7 +630,8 @@ 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;
-			ts_event_en = PTP_TCR_TSEVNTENA;
+			if (priv->synopsys_id != DWMAC_CORE_5_10)
+				ts_event_en = PTP_TCR_TSEVNTENA;
 			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
 			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
 			ptp_over_ethernet = PTP_TCR_TSIPENA;
-- 
2.7.4


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

* [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
@ 2020-05-25  8:18 ` Fugang Duan
  0 siblings, 0 replies; 6+ messages in thread
From: Fugang Duan @ 2020-05-25  8:18 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, kuba, davem
  Cc: fugang.duan, mcoquelin.stm32, netdev, p.zabel, linux-stm32,
	linux-arm-kernel

For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
PTP v2/802.AS1, any layer, any kind of event packet, but HW only
take timestamp snapshot for below PTP message: sync, Pdelay_req,
Pdelay_resp.

Then it causes below issue when test E2E case:
ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp

Timestamp snapshot dependency on register bits in received path:
SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
01         x         0          SYNC, Follow_Up, Delay_Req,
                                Delay_Resp, Pdelay_Req, Pdelay_Resp,
                                Pdelay_Resp_Follow_Up
01         0         1          SYNC, Pdelay_Req, Pdelay_Resp

For dwmac v5.10a, enabling all events by setting register
DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
to 0’b0, which can support all required events.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index b6f92c7..73677c3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -630,7 +630,8 @@ 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;
-			ts_event_en = PTP_TCR_TSEVNTENA;
+			if (priv->synopsys_id != DWMAC_CORE_5_10)
+				ts_event_en = PTP_TCR_TSEVNTENA;
 			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
 			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
 			ptp_over_ethernet = PTP_TCR_TSIPENA;
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
  2020-05-25  8:18 ` Fugang Duan
@ 2020-05-26 23:28   ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-05-26 23:28 UTC (permalink / raw)
  To: fugang.duan
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, kuba, netdev,
	mcoquelin.stm32, p.zabel, linux-stm32, linux-arm-kernel

From: Fugang Duan <fugang.duan@nxp.com>
Date: Mon, 25 May 2020 16:18:14 +0800

> For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
> PTP v2/802.AS1, any layer, any kind of event packet, but HW only
> take timestamp snapshot for below PTP message: sync, Pdelay_req,
> Pdelay_resp.
> 
> Then it causes below issue when test E2E case:
> ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
> ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
> ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
> ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
> ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
> ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
> ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
> ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
> ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp
> 
> Timestamp snapshot dependency on register bits in received path:
> SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
> 01         x         0          SYNC, Follow_Up, Delay_Req,
>                                 Delay_Resp, Pdelay_Req, Pdelay_Resp,
>                                 Pdelay_Resp_Follow_Up
> 01         0         1          SYNC, Pdelay_Req, Pdelay_Resp
> 
> For dwmac v5.10a, enabling all events by setting register
> DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
> to 0’b0, which can support all required events.
> 
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>

Applied and queued up for -stable, thanks.

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

* Re: [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
@ 2020-05-26 23:28   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-05-26 23:28 UTC (permalink / raw)
  To: fugang.duan
  Cc: p.zabel, alexandre.torgue, netdev, joabreu, mcoquelin.stm32,
	kuba, peppe.cavallaro, linux-stm32, linux-arm-kernel

From: Fugang Duan <fugang.duan@nxp.com>
Date: Mon, 25 May 2020 16:18:14 +0800

> For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
> PTP v2/802.AS1, any layer, any kind of event packet, but HW only
> take timestamp snapshot for below PTP message: sync, Pdelay_req,
> Pdelay_resp.
> 
> Then it causes below issue when test E2E case:
> ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
> ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
> ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
> ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
> ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
> ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
> ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
> ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
> ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp
> 
> Timestamp snapshot dependency on register bits in received path:
> SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
> 01         x         0          SYNC, Follow_Up, Delay_Req,
>                                 Delay_Resp, Pdelay_Req, Pdelay_Resp,
>                                 Pdelay_Resp_Follow_Up
> 01         0         1          SYNC, Pdelay_Req, Pdelay_Resp
> 
> For dwmac v5.10a, enabling all events by setting register
> DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
> to 0’b0, which can support all required events.
> 
> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>

Applied and queued up for -stable, thanks.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
@ 2020-05-25  8:09 ` Fugang Duan
  0 siblings, 0 replies; 6+ messages in thread
From: Fugang Duan @ 2020-05-25  8:09 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, kuba, davem
  Cc: netdev, mcoquelin.stm32, p.zabel, linux-stm32, linux-arm-kernel,
	fugang.duan

For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
PTP v2/802.AS1, any layer, any kind of event packet, but HW only
take timestamp snapshot for below PTP message: sync, Pdelay_req,
Pdelay_resp.

Then it causes below issue when test E2E case:
ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp

Timestamp snapshot dependency on register bits in received path:
SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
01         x         0          SYNC, Follow_Up, Delay_Req,
                                Delay_Resp, Pdelay_Req, Pdelay_Resp,
                                Pdelay_Resp_Follow_Up
01         0         1          SYNC, Pdelay_Req, Pdelay_Resp

For dwmac v5.10a, enabling all events by setting register
DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
to 0’b0, which can support all required events.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index b6f92c7..73677c3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -630,7 +630,8 @@ 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;
-			ts_event_en = PTP_TCR_TSEVNTENA;
+			if (priv->synopsys_id != DWMAC_CORE_5_10)
+				ts_event_en = PTP_TCR_TSEVNTENA;
 			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
 			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
 			ptp_over_ethernet = PTP_TCR_TSIPENA;
-- 
2.7.4


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

* [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a
@ 2020-05-25  8:09 ` Fugang Duan
  0 siblings, 0 replies; 6+ messages in thread
From: Fugang Duan @ 2020-05-25  8:09 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, kuba, davem
  Cc: fugang.duan, mcoquelin.stm32, netdev, p.zabel, linux-stm32,
	linux-arm-kernel

For rx filter 'HWTSTAMP_FILTER_PTP_V2_EVENT', it should be
PTP v2/802.AS1, any layer, any kind of event packet, but HW only
take timestamp snapshot for below PTP message: sync, Pdelay_req,
Pdelay_resp.

Then it causes below issue when test E2E case:
ptp4l[2479.534]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.423]: port 1: received DELAY_REQ without timestamp
ptp4l[2481.758]: port 1: received DELAY_REQ without timestamp
ptp4l[2483.524]: port 1: received DELAY_REQ without timestamp
ptp4l[2484.233]: port 1: received DELAY_REQ without timestamp
ptp4l[2485.750]: port 1: received DELAY_REQ without timestamp
ptp4l[2486.888]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.265]: port 1: received DELAY_REQ without timestamp
ptp4l[2487.316]: port 1: received DELAY_REQ without timestamp

Timestamp snapshot dependency on register bits in received path:
SNAPTYPSEL TSMSTRENA TSEVNTENA 	PTP_Messages
01         x         0          SYNC, Follow_Up, Delay_Req,
                                Delay_Resp, Pdelay_Req, Pdelay_Resp,
                                Pdelay_Resp_Follow_Up
01         0         1          SYNC, Pdelay_Req, Pdelay_Resp

For dwmac v5.10a, enabling all events by setting register
DWC_EQOS_TIME_STAMPING[SNAPTYPSEL] to 2’b01, clearing bit [TSEVNTENA]
to 0’b0, which can support all required events.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index b6f92c7..73677c3 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -630,7 +630,8 @@ 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;
-			ts_event_en = PTP_TCR_TSEVNTENA;
+			if (priv->synopsys_id != DWMAC_CORE_5_10)
+				ts_event_en = PTP_TCR_TSEVNTENA;
 			ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
 			ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
 			ptp_over_ethernet = PTP_TCR_TSIPENA;
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-05-26 23:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25  8:18 [PATCH net 1/1] net: stmmac: enable timestamp snapshot for required PTP packets in dwmac v5.10a Fugang Duan
2020-05-25  8:18 ` Fugang Duan
2020-05-26 23:28 ` David Miller
2020-05-26 23:28   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2020-05-25  8:09 Fugang Duan
2020-05-25  8:09 ` Fugang Duan

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.