On Wed, Jul 31, 2019 at 09:46:09AM +0200, antoine.ten...@bootlin.com wrote:
> On Fri, Jul 26, 2019 at 08:52:10PM +0000, Saeed Mahameed wrote:
> > On Thu, 2019-07-25 at 16:27 +0200, Antoine Tenart wrote:
> > > @@ -145,6 +151,22 @@ static irqreturn_t ocelot_xtr_irq_handler(int
> > > irq, void *arg)
> > >                   break;
> > >           }
> > >  
> > > +         if (ocelot->ptp) {
> > > +                 ocelot_ptp_gettime64(&ocelot->ptp_info, &ts);
> > > +
> > > +                 tod_in_ns = ktime_set(ts.tv_sec, ts.tv_nsec);
> > > +                 if ((tod_in_ns & 0xffffffff) < info.timestamp)
> > > +                         full_ts_in_ns = (((tod_in_ns >> 32) -
> > > 1) << 32) |
> > > +                                         info.timestamp;
> > > +                 else
> > > +                         full_ts_in_ns = (tod_in_ns &
> > > GENMASK_ULL(63, 32)) |
> > > +                                         info.timestamp;
> > > +
> > > +                 shhwtstamps = skb_hwtstamps(skb);
> > > +                 memset(shhwtstamps, 0, sizeof(struct
> > > skb_shared_hwtstamps));
> > > +                 shhwtstamps->hwtstamp = full_ts_in_ns;
> > 
> > the right way to set the timestamp is by calling: 
> > skb_tstamp_tx(skb, &tstamp);
> 
> I'll fix this.

This is in the Rx path, so we do not have to call this.

Thanks,
Antoine

-- 
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Reply via email to