lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 9 Jul 2019 17:23:56 +0200
From:   Antoine Tenart <antoine.tenart@...tlin.com>
To:     Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc:     Antoine Tenart <antoine.tenart@...tlin.com>, 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

Hello Jakub,

On Mon, Jul 08, 2019 at 12:06:26PM -0700, Jakub Kicinski wrote:
> 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).

I see, I should instead filter the flags based on this so that the s/w
ones still get set.

Thanks!
Antoine

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ