Re: [PATCH net] vlan: also check phy_driver ts_info for vlan's real device
From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-30 15:36:17
From: Andrew Lunn <andrew@lunn.ch>
Date: 2018-03-30 15:36:17
On Fri, Mar 30, 2018 at 08:21:21AM -0700, Richard Cochran wrote:
On Fri, Mar 30, 2018 at 05:02:14PM +0200, Andrew Lunn wrote:quoted
Would it not be better to just call ethtool_get_ts_info() on the real device? That would then also deal with the case that the 'real' device is another virtual device stacked on top of a real device.That won't work. The returned 'ethtool_ts_info' is on the stack of ethtool_get_ts_info(). Both the top level and the inner call to will call copy_to_user(), but the top level will clobber the correct result with zeros.
Ah, O.K. But it still seems like there should be one central place to handle a device. Maybe factor out the part which deals with getting the information from the device, from the part that copies it to userspace? Andrew