atom feed22 messages in org.freebsd.freebsd-archRe: Ethernet Switch Framework
FromSent OnAttachments
Aleksandr RybalkoJan 20, 2012 12:12 pm 
Stefan BethkeJan 20, 2012 3:34 pm 
Stefan BethkeJan 22, 2012 7:30 am 
Aleksandr RybalkoJan 22, 2012 9:51 am 
Adrian ChaddJan 24, 2012 11:12 pm 
Stefan BethkeJan 25, 2012 12:57 am 
Adrian ChaddJan 26, 2012 10:03 pm 
Aleksandr RybalkoJan 28, 2012 2:12 pm 
Juli MallettJan 28, 2012 2:59 pm 
Warner LoshJan 28, 2012 11:05 pm 
Aleksandr RybalkoJan 29, 2012 3:14 am 
Stefan BethkeJan 29, 2012 4:25 am 
Aleksandr RybalkoJan 29, 2012 4:43 am 
Stefan BethkeJan 29, 2012 4:48 am 
Stefan BethkeJan 29, 2012 5:14 am 
Marius StroblJan 29, 2012 7:31 am 
Stefan BethkeJan 29, 2012 8:00 am 
Marius StroblJan 29, 2012 8:19 am 
Stefan BethkeJan 29, 2012 8:21 am 
Marius StroblJan 29, 2012 9:31 am 
Adrian ChaddJan 29, 2012 10:59 am 
Marius StroblJan 29, 2012 2:12 pm 
Subject:Re: Ethernet Switch Framework
From:Stefan Bethke (st@lassitu.de)
Date:Jan 29, 2012 5:14:19 am
List:org.freebsd.freebsd-arch

Am 29.01.2012 um 08:05 schrieb Warner Losh:

I think that the main issue here is that we have an assumption that we have a
tree structure. However, it is more of a DAG across different domains. The
hierarchy works well when each device owns all the devices below it and only
interacted with them. Most devices are that way. However, in the embedded
world, there's lots of reach-accrosses that are expected that break the model.

What do people think would be a good approach to solve the concrete issue
without too much hackery? Aleksandr and I have presented three possible
approaches: 1. have a PHY driver that acts as a proxy and talks to a separate MDIO master 2. have a proxy between the ethernet driver and the miibus driver 3. modify miibus to have a separate device for mediachg() etc.

All three suffer from a dependency problem: miibus attachment can only complete
successfully when both the ethernet driver and the mdio driver have been
attached. In the current model, the ethernet driver provides both the MDIO
access as well as the target for the mediachg, etc. messages, so there's no
attachment ordering issue.

In my miiproxy patch (2.), it is necessary for the ethernet driver to cooperate
in this delayed attachment, by splitting out the miibus attachment from the
device_attach method implementation. That's a fairly intrusive change, and that
would need to be made to any ethernet driver that is to support such a split
MDIO/MII setup.

I tried delaying just the call to mii_attach(), but it seems that interacts
badly with an already attached interface. Specifically, I got a non-working
interface when I tried to call mii_attach() long after if_etherattach().
Additionally, if_arge (and probably most other drivers) assumes that the miibus
is attached after they've successfully attached themselves, and subsequently
runs into null pointer issues when it isn't.

Would it be possible to attach miibus without having a working PHY, and only
attach the PHYs once the MDIO device has been attached?

For the mips/atheros platforms, we could introduce ordering hints for nexus to
make sure the mdio driver gets attached before the arge's. That's a fairly
small changes (two lines), and does work, but it's more a hack than a general
solution. With my proposed change to miibus (split devices), that would bring
down the necessary changes to just a handful of lines.

Stefan