netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>, Andrew Lunn <andrew@lunn.ch>
Cc: Michal Kubecek <mkubecek@suse.cz>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: ethtool 5.7: netlink ENOENT error when setting WOL
Date: Sun, 14 Jun 2020 09:44:30 -0700	[thread overview]
Message-ID: <e9e6994d-50da-da4a-5992-872c5aa1fafb@gmail.com> (raw)
In-Reply-To: <2994dba7-c038-5702-a5ec-e11d5741a1e5@gmail.com>



On 6/14/2020 9:14 AM, Heiner Kallweit wrote:
> On 10.06.2020 22:05, Andrew Lunn wrote:
>>> Not sure it makes sense to build ETHTOOL_NETLINK as a module, but at
>>> least ensuring that ETHTOOL_NETLINK is built into the kernel if PHYLIB=y
>>> or PHYLIB=m would make sense, or, better we find a way to decouple the
>>> two by using function pointers from the phy_driver directly that way
>>> there is no symbol dependency (but reference counting has to work).
>>
>> Hi Florian
>>
>> It is not so easy to make PHYLIB=m work. ethtool netlink needs to call
>> into the phylib core in order to trigger a cable test, not just PHY
>> drivers.
>>
>> Ideas welcome.
>>
> When looking at functions like phy_start_cable_test() we could do the
> following: Most of it doesn't need phylib and could be moved to
> ethtool/cabletest.c. Or maybe into a separate ethtool phylib glue
> code source file. The phylib calls (phy_link_down, phy_trigger_machine)
> then would have to be moved into the cable_test_start callback.
> I see that each callback implementation then would have some
> boilerplate code. But maybe we could facilitate this with few helpers,
> so that a cable test callback would look like:
> 
> phy_cable_test_boiler_start()
> actual_cable_test()
> phy_cable_test_boiler_end()

Yes, that could work, the other possibility would be to extend
ethtool_ops and add cable_test_start function pointers, and then we just
punt onto the network device driver to call the appropriate PHYLIB
function. That way we already have a mechanism in place for registering
callbacks which is based upon the network device driver lifecycle, and
from the network device driver is guaranteed to load PHYLIB because of
direct symbol dependencies. The caveat with that approach is that each
network device driver needs top opt in for those, as opposed to us
defaulting to using PHYLIB and enabling all drivers that use PHYLIB by
default.
-- 
Florian

      reply	other threads:[~2020-06-14 16:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  8:26 ethtool 5.7: netlink ENOENT error when setting WOL Heiner Kallweit
2020-06-10  8:52 ` Heiner Kallweit
2020-06-10  9:13   ` Michal Kubecek
2020-06-10 10:50     ` Heiner Kallweit
2020-06-10 11:53       ` Michal Kubecek
2020-06-14 22:35         ` Heiner Kallweit
2020-06-14 23:26           ` Michal Kubecek
2020-06-15  6:20             ` Heiner Kallweit
2020-06-10 15:27       ` Florian Fainelli
2020-06-10 20:05         ` Andrew Lunn
2020-06-14 16:14           ` Heiner Kallweit
2020-06-14 16:44             ` Florian Fainelli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9e6994d-50da-da4a-5992-872c5aa1fafb@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=hkallweit1@gmail.com \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).