Re: [RFC Patch net-next v2 3/8] net: dsa: microchip: Initial hardware time stamping support
From: Vladimir Oltean
Date: Thu Nov 24 2022 - 09:15:08 EST
On Thu, Nov 24, 2022 at 10:52:46AM +0000, Arun.Ramadoss@xxxxxxxxxxxxx wrote:
> Mistake here. It is carried forwarded from Christian Eggers patch.
Still taken from sja1105_hwtstamp_set(). Anyway, doesn't matter where
it's taken from, as long as it has a justification for being there.
> > Why do you need to call hwtstamp_set_state anyway?
>
> In tag_ksz.c, xmit function query this state, to determine whether to
> allocate the 4 PTP timestamp bytes in the skb_buffer or not. Using this
> tagger_data set state, ptp enable and disable is communicated between
> ksz_ptp.c and tag_ksz.c
Why do you need to query this state in particular, considering that the
skb goes first through the port_txtstamp() dsa_switch_ops function?
Can't you just check there if TX timestamping is enabled, and leave a
mark in KSZ_SKB_CB()?