netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mvpp2 switch from gmac to xlg requires ifdown/ifup
@ 2021-07-23  1:52 Marek Behún
  2021-07-23  8:05 ` Russell King (Oracle)
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Behún @ 2021-07-23  1:52 UTC (permalink / raw)
  To: Russell King; +Cc: netdev

Hello Russell (and possibly others),

I discovered that with mvpp2 when switching from gmac (sgmii or
2500base-x mode) to xlg (10gbase-r mode) due to phylink requesting this
change, the link won't come up unless I do
  ifconfig ethX down
  ifconfig ethX up

Can be reproduced on MacchiatoBIN:
1. connect the two 10g RJ-45 ports (88X3310 PHY) with one cable
2. bring the interfaces up
3. the PHYs should link in 10gbase-t, links on MACs will go up in
   10gbase-r
4. use ethtool on one of the interfaces to advertise modes only up to
   2500base-t
5. the PHYs will unlink and then link at 2.5gbase-t, links on MACs will
   go up in 2500base-x
6. use ethtool on the same interface as in step 4 to advertise all
   supported modes

7. the PHYs will unlink and then link at 10gbase-t, BUT MACs won't link
   !!!
8. execute
     ifconfig ethX down ; ifconfig ethX up
   on both interfaces. After this, the MACs will successfully link in
   10gbase-r with the PHYs

It seems that the mvpp2 driver code needs to make additional stuff when
chaning mode from gmac to xlg. I haven't yet been able to find out
what, though.

BTW I discovered this because I am working on adding support for
5gbase-r mode to mvpp2, so that the PHY can support 5gbase-t on copper
side.
The ifdown/ifup cycle is required when switching from gmac to xlg, i.e.:
	sgmii		to	5gbase-r
	sgmii		to	10gbase-r
	2500base-x	to	5gbase-r
	2500base-x	to	10gbase-r
but also when switching from xlg to different xlg:
	5gbase-r	to	10gbase-r
	10gbase-r	to	5gbase-r

Did someone notice this bug? I see that Russell made some changes in
the phylink pcs API that touched mvpp2 (the .mac_config method got
split into .mac_prepare, .mac_config and .mac_finish, and also some
other changes). I haven't tried yet if the switch from gmac to xlg
worked at some time in the past. But if it did, maybe these changes
could be the cause?

Marek

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

end of thread, other threads:[~2021-07-26 17:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-23  1:52 mvpp2 switch from gmac to xlg requires ifdown/ifup Marek Behún
2021-07-23  8:05 ` Russell King (Oracle)
2021-07-26 15:52   ` Marek Behún
2021-07-26 16:43     ` Russell King (Oracle)
2021-07-26 17:03       ` Marek Behún

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