netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stmmac: export RX mitigation control to device tree
@ 2019-12-20 12:56 Timofey Babitskiy
  2019-12-25  0:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Timofey Babitskiy @ 2019-12-20 12:56 UTC (permalink / raw)
  To: netdev; +Cc: Giuseppe Cavallaro, alexandre.torgue, Jose Abreu

Having Rx mitigation via HW watchdog timer on is not suitable for time 
servers distributing time via NTP and PTP protocol and relying on SW 
timestamping, because Rx mitigation adds latency on receive and hence adds 
path delay assymetry, which leads to time offset on timing clients. Turning 
Rx mitigation off via platform config is not always a good option, because 
some systems use default platform configs and only tune the device tree.

Signed-off-by: Timofey Babitskiy <timofey.babitskiy@pendulum-instruments.com>
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 5 +++++
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 4845e29411e4..b4a8d3e92b44 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -258,6 +258,11 @@ properties:
       is supported. For example, this is used in case of SGMII and
       MAC2MAC connection.
 
+  snps,riwt-off:
+    $ref: /schemas/types.yaml#definitions/flag
+    description:
+      Disables RX IRQ Mitigation via HW Watchdog Timer.
+
   mdio:
     type: object
     description:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index bedaff0c13bd..42b2f99d8c90 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -465,6 +465,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
        plat->en_tx_lpi_clockgating =
                of_property_read_bool(np, "snps,en-tx-lpi-clockgating");
 
+       plat->riwt_off =
+               of_property_read_bool(np, "snps,riwt-off");
+
        /* Set the maxmtu to a default of JUMBO_LEN in case the
         * parameter is not present in the device tree.
         */

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

* Re: [PATCH] stmmac: export RX mitigation control to device tree
  2019-12-20 12:56 [PATCH] stmmac: export RX mitigation control to device tree Timofey Babitskiy
@ 2019-12-25  0:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-12-25  0:04 UTC (permalink / raw)
  To: timofey.babitskiy; +Cc: netdev, peppe.cavallaro, alexandre.torgue, joabreu

From: Timofey Babitskiy <timofey.babitskiy@pendulum-instruments.com>
Date: Fri, 20 Dec 2019 12:56:50 +0000

> Having Rx mitigation via HW watchdog timer on is not suitable for time 
> servers distributing time via NTP and PTP protocol and relying on SW 
> timestamping, because Rx mitigation adds latency on receive and hence adds 
> path delay assymetry, which leads to time offset on timing clients. Turning 
> Rx mitigation off via platform config is not always a good option, because 
> some systems use default platform configs and only tune the device tree.
> 
> Signed-off-by: Timofey Babitskiy <timofey.babitskiy@pendulum-instruments.com>

The device tree is not an appropriate place to control what is already settable
via ethtool.

Make the appropriate ethtool setting on your NTP servers.

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

end of thread, other threads:[~2019-12-25  0:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-20 12:56 [PATCH] stmmac: export RX mitigation control to device tree Timofey Babitskiy
2019-12-25  0:04 ` David Miller

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).