Re: [PATCH 1/3] net: macb: Fix PTP one step sync support

From: Harini Katakam
Date: Wed May 18 2022 - 06:32:00 EST


Hi Jakub,

<snip>
>
> > > > @@ -1158,13 +1192,14 @@ static int macb_tx_complete(struct macb_queue *queue, int budget)
> > > >
> > > > /* First, update TX stats if needed */
> > > > if (skb) {
> > > > - if (unlikely(skb_shinfo(skb)->tx_flags &
> > > > - SKBTX_HW_TSTAMP) &&
> > > > - gem_ptp_do_txstamp(queue, skb, desc) == 0) {
> > > > - /* skb now belongs to timestamp buffer
> > > > - * and will be removed later
> > > > - */
> > > > - tx_skb->skb = NULL;
> > > > + if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
> > >
> > > ptp_oss already checks if HW_TSTAMP is set.
> >
> > The check for SKBTX_HW_TSTAMP is required here universally and not
> > just inside ptp_oss.
> > I will remove the redundant check in ptp_oss instead. Please see the
> > reply below.
>
> But then you need to add this check in the padding/fcs call site and
> the place where NOCRC is set. If you wrap the check for SKBTX_HW_TSTAMP
> in the helper with likely() and remove the inline - will the compiler
> not split the function and inline just that check? And leave the rest
> as a functionname.part... thing?

Yes, I checked the disassembly and this is what's happening. This
should be good for
the non-PTP packet (going to "likely" branch) and the rest of ptp_oss
is evaluated for
PTP packets.

Regards,
Harini