From: Andrew Lunn Subject: Re: [PATCH net] vlan: also check phy_driver ts_info for vlan's real device Date: Fri, 30 Mar 2018 17:36:14 +0200 Message-ID: <20180330153614.GH28244@lunn.ch> References: <1522374240-18673-1-git-send-email-liuhangbin@gmail.com> <20180330150214.GF28244@lunn.ch> <20180330152121.rmvdkjrqmhekasnh@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Hangbin Liu , netdev@vger.kernel.org, "David S. Miller" To: Richard Cochran Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:47472 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbeC3PgR (ORCPT ); Fri, 30 Mar 2018 11:36:17 -0400 Content-Disposition: inline In-Reply-To: <20180330152121.rmvdkjrqmhekasnh@localhost> Sender: netdev-owner@vger.kernel.org List-ID: 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: > > 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