[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200830092212.GA6861@duo.ucw.cz>
Date: Sun, 30 Aug 2020 11:22:12 +0200
From: Pavel Machek <pavel@....cz>
To: Andrew Lunn <andrew@...n.ch>
Cc: Marek Behún <marek.behun@....cz>,
netdev@...r.kernel.org, linux-leds@...r.kernel.org,
jacek.anaszewski@...il.com, Dan Murphy <dmurphy@...com>,
Ondřej Jirman <megous@...ous.com>,
Russell King <linux@...linux.org.uk>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Gregory Clement <gregory.clement@...tlin.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC leds + net-next v4 0/2] Add support for LEDs on
Marvell PHYs
Hi!
> > > The phydev name is not particularly nice:
> > >
> > > !mdio-mux!mdio@...witch@...dio:00
...
> > > 400d0000.ethernet-1:00
> > > 400d0000.ethernet-1:01
> > > fixed-0:00
> >
> > Not nice, I see. In particular, it contains ":"... which would be a
> > problem.
> >
> > > The interface name are:
> > >
> > > 1: lo:
> > > 2: eth0:
> > > 3: eth1:
...
> > > 13: optical3@...1:
> > > 14: optical4@...1:
> >
> > OTOH... renaming LEDs when interface is renamed... sounds like a
> > disaster, too.
>
> I don't think it is. The stack has all the needed support. There is a
> notification before the rename, and another notification after the
> rename. Things like bonding, combing two interfaces into one and load
> balancing, etc. hook these notifiers. There is plenty of examples to
> follow. What i don't know about is the lifetime of files under
> /sys/class/led, does the destroying of an LED block while one of the
> files is open?.
Well, there may be no problems on the networking side, but I'd prefer
not to make LED side more complex. Files could be open, and userland
could have assumptions about LEDs not changing names...
> > > You could make a good guess at matching to two together, but it is
> > > error prone. Phys are low level things which the user is not really
> > > involved in. They interact with interface names. ethtool, ip, etc, all
> > > use interface names. In fact, i don't know of any tool which uses
> > > phydev names.
> >
> > So... proposal:
> >
> > Users should not be dealing with sysfs interface directly, anyway. We
> > should have a tool for that. It can live in kernel/tools somewhere, I
> > guess.
>
> We already have one, ethtool(1).
Well... ethtool is for networking, we'll want to have a ledtool, too :-).
> > Would we name leds phy0:... (with simple incrementing number), and
> > expose either interface name or phydev name as a attribute?
> >
> > So user could do
> >
> > cat /sys/class/leds/phy14:green:foobar/netdev
> > lan5@...1:
>
> Which is the wrong way around. ethtool will be passed the interface
> name and an PHY descriptor of some sort, and it has to go search
> through all the LEDs to find the one with this attribute. I would be
> much more likely to add a sysfs link from
> /sys/class/net/lan5/phy:left:green to
> /sys/class/leds/phy14:left:green.
Okay, that might be even better, as it provides links in the more
useful direction.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists