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:   Thu, 30 Jul 2020 19:38:00 +0100
From:   Russell King - ARM Linux admin <linux@...linux.org.uk>
To:     Richard Cochran <richardcochran@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH RFC net-next] net: phy: add Marvell PHY PTP support

On Thu, Jul 30, 2020 at 08:53:26AM -0700, Richard Cochran wrote:
> On Wed, Jul 29, 2020 at 11:07:48PM +0100, Russell King - ARM Linux admin wrote:
> > What I see elsewhere in ethtool is that the MAC has the ability to
> > override the phylib provided functionality - for example,
> > __ethtool_get_sset_count(), __ethtool_get_strings(), and
> > ethtool_get_phy_stats().  Would it be possible to do the same in
> >  __ethtool_get_ts_info(), so at least a MAC driver can then decide
> > whether to propagate the ethtool request to phylib or not, just like
> > it can do with the SIOC*HWTSTAMP ioctls?  Essentially, reversing the
> > order of:
> > 
> >         if (phy_has_tsinfo(phydev))
> >                 return phy_ts_info(phydev, info);
> >         if (ops->get_ts_info)
> >                 return ops->get_ts_info(dev, info);
> > 
> > ?
> 
> I don't see a simple solution.  I think no matter what, the MAC
> drivers need work to allow PHY time stamping, and the great majority
> of users and driver authors are happy with MAC time stamping.

What I ended up doing was:

        if (ops->get_ts_info) {
                ret = ops->get_ts_info(dev, info);
                if (ret != -EOPNOTSUPP)
                        return ret;
        }
        if (phy_has_tsinfo(phydev))
                return phy_ts_info(phydev, info);
...

which gives the MAC first refusal.  If the MAC wishes to defer to
phylib or the default, it can just return -EOPNOTSUPP.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ