From owner-freebsd-hackers@FreeBSD.ORG Wed May 11 00:42:25 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A1521065670; Wed, 11 May 2011 00:42:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2954B8FC0A; Wed, 11 May 2011 00:42:25 +0000 (UTC) Received: from [192.168.14.163] ([24.114.252.233]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p4B0bg7h034687 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 10 May 2011 18:37:47 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Tue, 10 May 2011 11:06:52 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <34CF3ED0-52BC-4D0E-922A-FE26F624E77F@gmail.com> <20110508131643.GA23650@alchemy.franken.de> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 10 May 2011 18:37:47 -0600 (MDT) Cc: freebsd-hackers@freebsd.org, Damjan Marion , Marius Strobl Subject: Re: Embedded switch instead of stadard PHY X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 00:42:25 -0000 On May 9, 2011, at 12:30 AM, Adrian Chadd wrote: > On 8 May 2011 21:16, Marius Strobl wrote: >=20 > [snip] >=20 >> Depends on what you understand by properly. One idea I particularly >> like is to handle switch ports as pseudo-interfaces hanging off of = the >> the MAC driver parent roughly similar to vlan(4). That way you'd have >> per port link status and could configure the media. >=20 > The reason I like this is because I realise that these switch PHYs > tend to have quite a bit of varying but useful functionality, that > isn't just "multi-port single-VLAN switch PHY." >=20 > Besides there being per-port status, there can also be per-port > error/packet/byte counts, VLAN setups (tagged/untagged), QoS > configuration, sometimes some L2 filtering and (even more creepy) > sometimes L3 filtering/routing. >=20 > They can sometimes hang off the MII bus, but ISTR datasheets which > show they can hang off an SPI bus too. So although they can look like > PHYs complete with the register layouts, there's extended commands to > implement other features as well. There may even be more than one CPU > ethernet port hooked up - I think the Routerstation Pro has both CPU > GigE ports wired to the switch PHY and defaults to mapping port 1 -> > arge0 and Port 2,3,4,5 -> arge1. >=20 > I'd really appreciate it if someone were able to sit down, take the > existing work done by Luiz and others and flesh out a bare minimum set > of switch PHY drivers that configure them with some sensible defaults > (rather than leaving it up to the boot firmware to do it for you) and > have all of the interface/configuration glue in the kernel. As I said > earlier, figuring out how to expose all the functionality - including > per-port error counts and such - can come later. Yes. Agreed. Stated a bit more elegantly than I just did... Handling = non-localized connections is critical here. The embedded world has a = lot of funky interconnects that map poorly into our device model. = Having the association handled at a higher level will help us connect = these things. In the designs I've seen, this can happen both for the = switches we're talking about, as well as PHYs. I believe there are some = CPUs where talking to the PHY doesn't go through the MAC.... Warner=