Re: [PATCH net-next v2] net: dsa: mv88e6xxx: extend PTP gettime function to read system clock

From: Andrew Lunn
Date: Mon Aug 05 2019 - 09:58:43 EST

On Mon, Aug 05, 2019 at 10:26:42AM +0200, Hubert Feurstein wrote:
> From: Hubert Feurstein <h.feurstein@xxxxxxxxx>

Hi Hubert

In your RFC patch, there was some interesting numbers. Can you provide
numbers of just this patch? How much of an improvement does it make?

Your RFC patch pushed these ptp_read_system_{pre|post}ts() calls down
into the MDIO driver. This patch is much less invasive, but i wonder
how much a penalty you paid?

Did you also try moving these calls into global2_avb.c, around the one
write that really matters?

It was speculated that the jitter comes from contention on the mdio
bus lock. Did you investigate this? If you can prove this true, one
thing to try is to take the mdio bus lock in the mv88e6xxx driver,
take the start timestamp, call __mdiobus_write(), and then the end
timestamp. The bus contention is then outside your time snapshot.

We could even think about adding a mdiobus_write variant which does
all this. I'm sure other DSA drivers would find it useful, if it
really does help.