Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michael Walle <michael@walle.cc>
To: "Marek Behún" <kabel@kernel.org>
Cc: andrew@lunn.ch, anthony.l.nguyen@intel.com,
	bigeasy@linutronix.de, davem@davemloft.net,
	dvorax.fuxbrumer@linux.intel.com, f.fainelli@gmail.com,
	hkallweit1@gmail.com, jacek.anaszewski@gmail.com,
	kuba@kernel.org, kurt@linutronix.de, linux-leds@vger.kernel.org,
	netdev@vger.kernel.org, pavel@ucw.cz, sasha.neftin@intel.com,
	vinicius.gomes@intel.com, vitaly.lifshits@intel.com
Subject: Re: [PATCH net-next 5/5] igc: Export LEDs
Date: Tue, 27 Jul 2021 17:53:58 +0200	[thread overview]
Message-ID: <8edcc387025a6212d58fe01865725734@walle.cc> (raw)
In-Reply-To: <20210727172828.1529c764@thinkpad>

Hi,

Am 2021-07-27 17:28, schrieb Marek Behún:
> On Tue, 27 Jul 2021 17:03:53 +0200
> Michael Walle <michael@walle.cc> wrote:
> 
>> I wasn't talking about ethN being same as the network interface name.
>> For clarity I'll use ethernetN now. My question was why would you
>> use ethmacN or ethphyN instead if just ethernetN for both. What is
>> the reason for having two different names? I'm not sure who is using
>> that name anyway. If it is for an user, I don't think he is interested
>> in knowing wether that LED is controlled by the PHY or by the MAC.
> 
> Suppose that the system has 2 ethernet MACs, each with an attached PHY.
> Each MAC-PHY pair has one LED, but one MAC-PHY pair has the LED
> attached to the MAC, and the second pair has the LED attached to the
> PHY:
>      +------+        +------+
>      | macA |        | macB |
>      +-+--+-+        +-+----+
>        |  |            |
>       /   +------+   +-+----+
>    ledA   | phyA |   | phyB |
>           +------+   +----+-+
>                           |
>                            \
>                             ledB
> 
> Now suppose that during system initialization the system enumerates
> MACs and PHYs in different order:
>    macA -> 0      phyA -> 1
>    macB -> 1      phyB -> 0
> 
> If we used the devicename as you are suggesting, then for the two LEDs
> the devicename part would be the same:
>   ledA -> macA -> ethernet0
>   ledB -> phyB -> ethernet0
> although they are clearly on different MACs.

Why is that the case? Why can't both the MAC and the PHY request a 
unique
name from the same namespace? As Andrew pointed out, the names in
/sys/class/leds don't really matter. Ok, it will still depend on the
probe order which might not be the case if you split it between ethmac
and ethphy.

Sorry, if I may ask stupid questions here. I don't want to cause much
trouble, here. I was just wondering why we have to make up two different
(totally unrelated names to the network interface names) instead of just
one (again totally unrelated to the interface name and index).

> We could create a simple atomically increasing index only for MACs, and
> for a LED connected to a PHY, instead of using the PHY's index, we
> would look at the attached MAC and use the MAC index.

Oh, I see. I was assuming we are talking about "just a number" not
related to anything.

> The problem is that PHYs and MACs are not always attached, and are not
> necessarily mapped 1-to-1. It is possible to have a board where one PHY
> can connect to 2 different MACs and you can switch between them, and
> also vice versa.
> 
>> > So it can for example happen that within a network namespace you
>> > have only one interface, eth0, but in /sys/class/leds you would see
>> >   eth0:green:activity
>> >   eth1:green:activity
>> > So you would know that there are at least 2 network interfaces on the
>> > system, and also with renaming it can happen that the first LED is not
>> > in fact connected to the eth0 interface in your network namespace.
>> 
>> But the first problem persists wether its named ethernetN or ethphyN,
>> no?
> 
> No. The N in the "ethphyN" for etherent PHYs is supposed to be 
> unrelated
> to the N in "ethN" for interface names. So if you have eth0 network
> interface with attached phy ethphy0, this is a coincidence. (That is
> why Andrew is proposing to start the index for PHYs at a different
> number, like 42.)

Yes, in my case ethernet0 has nothing to do with eth0, either.

But I was actually referring to your "you see the leds in /sys/ of all
the network adapters". That problem still persists, right?

-michael

  reply	other threads:[~2021-07-27 15:54 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 21:24 [PATCH net-next 0/5][pull request] 1GbE Intel Wired LAN Driver Updates 2021-07-16 Tony Nguyen
2021-07-16 21:24 ` [PATCH net-next 1/5] igc: Add possibility to add flex filter Tony Nguyen
2021-07-16 21:24 ` [PATCH net-next 2/5] igc: Integrate flex filter into ethtool ops Tony Nguyen
2021-07-16 21:24 ` [PATCH net-next 3/5] igc: Allow for Flex Filters to be installed Tony Nguyen
2021-07-16 21:24 ` [PATCH net-next 4/5] igc: Make flex filter more flexible Tony Nguyen
2021-07-16 21:24 ` [PATCH net-next 5/5] igc: Export LEDs Tony Nguyen
2021-07-16 21:56   ` Andrew Lunn
2021-07-18 22:10     ` Heiner Kallweit
2021-07-18 22:33       ` Andrew Lunn
2021-07-19  6:17         ` Kurt Kanzenbach
2021-07-19  9:46           ` Jakub Kicinski
2021-07-19  6:06     ` Kurt Kanzenbach
2021-07-19 13:15       ` Andrew Lunn
2021-07-20  8:54         ` Kurt Kanzenbach
2021-07-21 19:18         ` Marek Behún
2021-07-18 22:19   ` Heiner Kallweit
2021-07-19  0:40     ` Andrew Lunn
2021-07-20 15:00       ` Heiner Kallweit
2021-07-20 15:42         ` Andrew Lunn
2021-07-20 20:29           ` Heiner Kallweit
2021-07-21 14:35             ` Andrew Lunn
2021-07-21 16:02               ` Heiner Kallweit
2021-07-21 18:23               ` Pavel Machek
2021-07-21 18:25                 ` Pavel Machek
2021-07-21 18:45             ` Marek Behún
2021-07-21 19:50               ` Andrew Lunn
2021-07-21 20:07                 ` Marek Behún
2021-07-21 20:54                   ` Andrew Lunn
2021-07-21 21:31                     ` Marek Behún
2021-07-21 22:45                     ` Pavel Machek
2021-07-22  1:45                       ` Andrew Lunn
2021-07-22  2:19                         ` Marek Behún
2021-07-21 22:34                   ` Pavel Machek
2021-07-22  3:52                   ` Florian Fainelli
2021-07-26 17:42                   ` Jacek Anaszewski
2021-07-26 18:44                     ` Marek Behún
2021-07-26 20:59                     ` Heiner Kallweit
2021-07-27  0:06                       ` Marek Behún
2021-07-27  1:57                         ` Andrew Lunn
2021-07-27  8:15                           ` Michael Walle
2021-07-27 14:56                             ` Marek Behún
2021-07-27 15:03                               ` Michael Walle
2021-07-27 15:24                                 ` Andrew Lunn
2021-07-27 15:28                                 ` Marek Behún
2021-07-27 15:53                                   ` Michael Walle [this message]
2021-07-27 16:23                                     ` Andrew Lunn
2021-07-27 16:32                                     ` Marek Behún
2021-07-27 16:42                                       ` Andrew Lunn
2021-07-27 19:42                                       ` Michael Walle
2021-07-28 20:43                                       ` Heiner Kallweit
2021-07-29  6:39                                         ` Kurt Kanzenbach
2021-07-29  8:59                                         ` Marek Behún
2021-07-29 21:54                                           ` Heiner Kallweit
2021-08-10 17:29                                         ` Pavel Machek
2021-08-10 17:55                                           ` Marek Behún
2021-08-10 19:53                                             ` Pavel Machek
2021-08-10 20:53                                               ` Marek Behún
2021-08-17 19:02                                                 ` Pavel Machek
2021-08-25 15:26                                                   ` Marek Behún
2021-08-26 12:45                                                     ` Pavel Machek
2021-08-10 20:46                                           ` Heiner Kallweit
2021-08-10 21:21                                             ` Andrew Lunn
2021-07-27 13:55                           ` Marek Behún
2021-08-10 17:22                             ` Documentation for naming LEDs was " Pavel Machek
2021-07-19 21:48   ` Jesse Brandeburg
2021-07-20 13:31     ` Kurt Kanzenbach
2021-07-17  0:30 ` [PATCH net-next 0/5][pull request] 1GbE Intel Wired LAN Driver Updates 2021-07-16 patchwork-bot+netdevbpf
2021-07-17 17:36   ` Andrew Lunn

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=8edcc387025a6212d58fe01865725734@walle.cc \
    --to=michael@walle.cc \
    --cc=andrew@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=dvorax.fuxbrumer@linux.intel.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-leds@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sasha.neftin@intel.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vitaly.lifshits@intel.com \
    --subject='Re: [PATCH net-next 5/5] igc: Export LEDs' \
    /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

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).