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]
Message-ID: <20190328100337.GC26076@unicorn.suse.cz>
Date:   Thu, 28 Mar 2019 11:03:37 +0100
From:   Michal Kubecek <mkubecek@...e.cz>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Jiri Pirko <jiri@...nulli.us>, Andrew Lunn <andrew@...n.ch>,
        John Linville <linville@...driver.com>,
        Stephen Hemminger <stephen@...workplumber.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v5 14/22] ethtool: provide timestamping
 information in GET_INFO request

On Wed, Mar 27, 2019 at 08:36:53PM -0700, Florian Fainelli wrote:
> 
> 
> On 3/25/2019 10:08 AM, Michal Kubecek wrote:
> > Add timestamping information as provided by ETHTOOL_GET_TS_INFO ioctl
> > command in GET_INFO reply if ETH_INFO_IM_TSINFO flag is set in the request.
> > 
> > Add constants for counts of HWTSTAMP_TX_* and HWTSTAM_FILTER_* constants
> > and provide symbolic names for timestamping related values so that they can
> > be retrieved in GET_STRSET and GET_INFO requests.
> > 
> > Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
> > ---
> 
> [snip]
> 
> > +int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info)
> > +{
> > +	const struct ethtool_ops *ops = dev->ethtool_ops;
> > +	struct phy_device *phydev = dev->phydev;
> > +	int err = 0;
> > +
> > +	memset(info, 0, sizeof(*info));
> > +	info->cmd = ETHTOOL_GET_TS_INFO;
> > +
> > +	if (phydev && phydev->drv && phydev->drv->ts_info) {
> > +		err = phydev->drv->ts_info(phydev, info);
> > +	} else if (ops->get_ts_info) {
> > +		err = ops->get_ts_info(dev, info);
> > +	} else {
> > +		info->so_timestamping = SOF_TIMESTAMPING_RX_SOFTWARE |
> > +					SOF_TIMESTAMPING_SOFTWARE;
> > +		info->phc_index = -1;
> > +	}
> 
> We don't have to solve this just yet, but this is the type of logic that
> we want to be able to change in the future, there are a number of things
> in the current ethtool code where, say, we always prefer PHY time
> stamping over MAC time stamping when there should be a choice if both
> are supported.

For the record, this is just a code block carved out of existing
ethtool_ts_info() where the only difference is that info is a pointer
rather than a structure itself.
 
> I don't know if you maintain a TODO for after when this patch series get
> merged, but we may want to start one :)

I have some informal TODO locally; some ideas are in the cover letter,
I also mentioned some in my talk last week. Perhaps it is time to make
it a publicly visible document and start collecting ideas.

Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ