Re: [Patch net-next v3 08/13] net: dsa: microchip: ptp: add packet transmission timestamping

From: Vladimir Oltean
Date: Fri Dec 09 2022 - 10:08:18 EST


On Fri, Dec 09, 2022 at 12:54:32PM +0530, Arun Ramadoss wrote:
> From: Christian Eggers <ceggers@xxxxxxx>
>
> This patch adds the routines for transmission of ptp packets. When the
> ptp pdelay_req packet to be transmitted, it uses the deferred xmit
> worker to schedule the packets.
> During irq_setup, interrupt for Sync, Pdelay_req and Pdelay_rsp are
> enabled. So interrupt is triggered for all three packets. But for
> p2p1step, we require only time stamp of Pdelay_req packet. Hence to
> avoid posting of the completion from ISR routine for Sync and
> Pdelay_resp packets, ts_en flag is introduced. This controls which
> packets need to processed for timestamp.
> After the packet is transmitted, ISR is triggered. The time at which
> packet transmitted is recorded to separate register.
> This value is reconstructed to absolute time and posted to the user
> application through socket error queue.
>
> Signed-off-by: Christian Eggers <ceggers@xxxxxxx>
> Co-developed-by: Arun Ramadoss <arun.ramadoss@xxxxxxxxxxxxx>
> Signed-off-by: Arun Ramadoss <arun.ramadoss@xxxxxxxxxxxxx>
> ---

Reviewed-by: Vladimir Oltean <olteanv@xxxxxxxxx>