[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190708120626.2cecc86b@cakuba.netronome.com>
Date: Mon, 8 Jul 2019 12:06:26 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Antoine Tenart <antoine.tenart@...tlin.com>
Cc: davem@...emloft.net, richardcochran@...il.com,
alexandre.belloni@...tlin.com, UNGLinuxDriver@...rochip.com,
ralf@...ux-mips.org, paul.burton@...s.com, jhogan@...nel.org,
netdev@...r.kernel.org, linux-mips@...r.kernel.org,
thomas.petazzoni@...tlin.com, allan.nielsen@...rochip.com
Subject: Re: [PATCH net-next v2 8/8] net: mscc: PTP Hardware Clock (PHC)
support
On Mon, 8 Jul 2019 10:48:09 +0200, Antoine Tenart wrote:
> > > + /* Commit back the result & save it */
> > > + memcpy(&ocelot->hwtstamp_config, &cfg, sizeof(cfg));
> > > + mutex_unlock(&ocelot->ptp_lock);
> > > +
> > > + return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0;
> > > +}
> > >
> > > +static int ocelot_get_ts_info(struct net_device *dev,
> > > + struct ethtool_ts_info *info)
> > > +{
> > > + struct ocelot_port *ocelot_port = netdev_priv(dev);
> > > + struct ocelot *ocelot = ocelot_port->ocelot;
> > > + int ret;
> > > +
> > > + if (!ocelot->ptp)
> > > + return -EOPNOTSUPP;
> >
> > Hmm.. why does software timestamping depend on PTP?
>
> Because it depends on the "PTP" register bank (and the "PTP" interrupt)
> being described and available. This is why I named the flag 'ptp', but
> it could be named 'timestamp' or 'ts' as well.
Right, but software timestamps are done by calling skb_tx_timestamp(skb)
in the driver, no need for HW support there (software RX timestamp is
handled by the stack).
Powered by blists - more mailing lists