mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Zink <j.zink@pengutronix.de>
To: Richard Cochran <richardcochran@gmail.com>
Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Russell King <linux@armlinux.org.uk>,
	kernel test robot <lkp@intel.com>,
	Eric Dumazet <edumazet@google.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org,
	patchwork-jzi@pengutronix.de
Subject: Re: [PATCH v2] net: stmmac: correct MAC propagation delay
Date: Thu, 27 Jul 2023 08:39:37 +0200	[thread overview]
Message-ID: <8742d597-e8b1-705f-6616-dca4ead529f4@pengutronix.de> (raw)
In-Reply-To: <ZME/GjBWdodiUO+8@hoboy.vegasvil.org>

Hi Richard,

On 7/26/23 17:43, Richard Cochran wrote:
> On Wed, Jul 26, 2023 at 08:10:35AM +0200, Johannes Zink wrote:
> 
>> Also on a side-note, "driver nonsense" sounds a bit harsh from someone
>> always insisting that one should not compensate for bad drivers in the
>> userspace stack and instead fixing driver and hardware issues in the kernel,
>> don't you think?
> 
> Everything has its place.
> 
> The proper place to account for delay asymmetries is in the user space
> configuration, for example in linuxptp you have
This is not about Delay Asymmetry, but about Additional Errors in Path Delay, 
namely MAC Ingress and Egress Delay.

> 
>         delayAsymmetry
>                The  time  difference in nanoseconds of the transmit and receive
>                paths. This value should be positive when  the  server-to-client
>                propagation  time  is  longer  and  negative when the client-to-
>                server time is longer. The default is 0 nanoseconds.
> 
>         egressLatency
>                Specifies the  difference  in  nanoseconds  between  the  actual
>                transmission time at the reference plane and the reported trans‐
>                mit time stamp. This value will be added to egress  time  stamps
>                obtained from the hardware.  The default is 0.
> >         ingressLatency
>                Specifies the difference in nanoseconds between the reported re‐
>                ceive  time  stamp  and  the  actual reception time at reference
>                plane. This value will be subtracted from  ingress  time  stamps
>                obtained from the hardware.  The default is 0.
For the PTP stack you could probably configure these in the stack, but fixing 
the delay in the driver also has the advantage of reducing phase offset error 
when doing clock revovery from the PHC.

> 
> Trying to hard code those into the driver?  Good luck getting that
> right for everyone.
That's why we don't hardcode the values but read them from the registers 
provided by the IP core.

> 
> BTW this driver is actually for an IP core used in many, many SoCs.
> 
> How many _other_ SoCs did you test your patch on?
> 
I don't have many available, thus as stated in the description: on the i.MX8MP 
only. That's why I am implementing my stuff in the imx glue code, you're 
welcome to help testing on other hardware if you have any at hand.

Best regards
Johannes

> Thanks,
> Richard
> 
> 
> 


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


  reply	other threads:[~2023-07-27  6:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 10:01 Johannes Zink
2023-07-26  3:06 ` Jakub Kicinski
2023-07-26  3:22   ` Richard Cochran
2023-07-26  3:39     ` Jakub Kicinski
2023-07-26  6:04     ` Marc Kleine-Budde
2023-07-26 15:34       ` Richard Cochran
2023-07-27  6:40         ` Johannes Zink
2023-07-27 13:30           ` Richard Cochran
2023-07-26  6:10     ` Johannes Zink
2023-07-26 15:43       ` Richard Cochran
2023-07-27  6:39         ` Johannes Zink [this message]
2023-07-27  6:55           ` Johannes Zink
2023-07-27  7:41             ` Johannes Zink
2023-07-27  7:15           ` Kurt Kanzenbach
2023-07-27  7:18             ` Johannes Zink
2023-07-26  5:50   ` Marc Kleine-Budde
2023-07-26  3:50 ` patchwork-bot+netdevbpf
2023-07-26 18:00 ` Richard Cochran
2023-07-27  6:42   ` Johannes Zink
2023-07-27 13:34     ` Richard Cochran
2023-07-26 20:57 ` Richard Cochran
2023-07-27  7:20   ` Johannes Zink
2023-07-27 13:36     ` Richard Cochran
2023-07-31  7:00       ` Johannes Zink
2023-07-31 13:44         ` Richard Cochran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8742d597-e8b1-705f-6616-dca4ead529f4@pengutronix.de \
    --to=j.zink@pengutronix.de \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patchwork-jzi@pengutronix.de \
    --cc=peppe.cavallaro@st.com \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®