netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dsa: phy started on dsa_register_switch()
@ 2023-01-23 18:35 Sverdlin, Alexander
  2023-01-23 18:57 ` Florian Fainelli
  0 siblings, 1 reply; 5+ messages in thread
From: Sverdlin, Alexander @ 2023-01-23 18:35 UTC (permalink / raw)
  To: olteanv@gmail.com, netdev@vger.kernel.org, f.fainelli@gmail.com,
	andrew@lunn.ch
  Cc: Freihofer, Adrian

Dear DSA maintainers,

I've been puzzled by the fact ports of the DSA switches are enabled on
bootup by default (PHYs configured, LEDs ON, etc) in contrast to the
normal Ethernet ports.

Some people tend to think this is a security issue that port is "open"
even though no configuration has been performed on the port, so I
looked into the differences between Ethernet drivers and DSA
infrastructure.

Traditionally phylink_of_phy_connect() and phylink_connect_phy() are
being called from _open() callbacks of the Ethernet drivers so
as long as the Ethernet ports are !IFF_UP PHYs are not running,
LEDs are OFF, etc.

Now with DSA phylink_of_phy_connect() is being called by
dsa_slave_phy_setup() which in turn is being called already in
dsa_slave_create(), at the time a switch is being DT-parsed and
created.

This confuses users a bit because neither CPU nor user ports have
been setup yet from userspace via netlink, yet the LEDs are ON.

The things get worse when a user performs
"ip link set dev lan1 up; ip link set dev lan1 down", because now
the LEDs go OFF.

Is this behaviour intended? Shall I try to develop patches moving
phylink_.*phy_connect to dsa_slave_open() and something similar
for CPU port?

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-23 21:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 18:35 dsa: phy started on dsa_register_switch() Sverdlin, Alexander
2023-01-23 18:57 ` Florian Fainelli
2023-01-23 19:10   ` Sverdlin, Alexander
2023-01-23 19:49   ` Andrew Lunn
2023-01-23 21:15     ` Sverdlin, Alexander

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