Re: [PATCH net-next v4 8/8] net: dsa: microchip: Add two-step PTP support for KSZ8463
From: Vladimir Oltean
Date: Wed Feb 18 2026 - 10:26:11 EST
On Wed, Feb 18, 2026 at 04:21:26PM +0100, Bastien Curutchet wrote:
> > You need to set port->last_tx_is_pdelayresp in the atomic section where
> > you know for sure that there's a single TX timestampable skb in flight.
> > There's no explicit lock which creates that atomic section, but the fact
> > that the worker kthread of the tagger processes work items one by one is
> > what gives you that guarantee.
>
> Thank you for the explanations. I suspected a race condition here but I
> didn't know how to mitigate it. I tested a new version on my side with
> port->last_tx_is_pdelayresp set in the ksz_port_deferred_xmit() worker and
> it works fine.
Good.
Next question: if the logic is all in ksz_port_deferred_xmit(), which is
sleepable and sends packets one by one, do you actually need to save the
packet type in port->last_tx_is_pdelayresp? Can't you just keep a local
variable with it?