From owner-freebsd-hackers@FreeBSD.ORG Wed May 11 05:18:29 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 3CD7B1065672 for ; Wed, 11 May 2011 05:18:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id E6A8E8FC08 for ; Wed, 11 May 2011 05:18:28 +0000 (UTC) Received: by gwb15 with SMTP id 15so71760gwb.13 for ; Tue, 10 May 2011 22:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=32gvbCxn8ymn4ZFjvJjUCBMsLsiU/L2Tmolp9V4Pepc=; b=XEbjcDPMUeC2pvNAbNyNpTq4s0G6eDgbnC9jWBpPVFDw2yMexdzUrWbinhVn+Mzu4h NiTF3pI528TFXcar30oYaqh0ILluqNJ4tYvbjVRk4dvhfIJ3VkmezYWpS+DkyqHwJSlE 8G1AdwOR5TlMxMGHqsdAAVarO7gJN05yDoGHk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=TiNSkjvuhl47wfYZjCQBjeMijesmUiU6s0Oa/XkNP5u4QVso3N5F4dND3YVvdXPDmW YbhwqXtsmsOFZnrMVarBCxVRCUz8EX+2yftUP/CVpL9M3Cv6h0rRqQnbwJT6Yonx/YSR 8MICIsGir9bT8/s8SpS1WRjjbXIc9RjnXmZf4= MIME-Version: 1.0 Received: by 10.150.66.14 with SMTP id o14mr3339877yba.353.1305091108151; Tue, 10 May 2011 22:18:28 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.136.8 with HTTP; Tue, 10 May 2011 22:18:28 -0700 (PDT) In-Reply-To: <9B3FEB02-B71C-412B-BB7E-31A236021CDD@bsdimp.com> References: <34CF3ED0-52BC-4D0E-922A-FE26F624E77F@gmail.com> <20110508131643.GA23650@alchemy.franken.de> <9B3FEB02-B71C-412B-BB7E-31A236021CDD@bsdimp.com> Date: Wed, 11 May 2011 13:18:28 +0800 X-Google-Sender-Auth: 4I_wUuFnF8yOYG4e8vBNQjIeZH0 Message-ID: From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Marius Strobl , Luiz Otavio O Souzau , Damjan Marion 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 05:18:29 -0000 On 11 May 2011 01:01, Warner Losh wrote: > Most switches are on the PHY bus, so you can program their registers. =A0= Many are on the PHY bus multiple times. =A0Once for the real(ish) PHY they = provide and once for the switch registers they expose (for some, "twice" me= ans up to 4 times). =A0Some are just nuts. This is unfortunately why we need to have real drivers for the switch PHY chips, rather than treating them as generic PHYs. :/ > It would be nice if there was a way for a device's MII routine to control= enumeration of the PHY bus. =A0This would allow us to convert the rlswitch= device in the tree to one of these. =A0That way, it could 'filter' out the= PHYs addresses that are intended to be like traditional PHYs from the addr= esses that are intended to be used for switch management. > > We likely should also have a switch interface that one can tweak via ifco= nfig. =A0I'd like that to be an explicit goal of this work, even if others = do it. > > However, that's a big ticket item. =A0 I kinda like the 'let us put a few= of these in the tree with kludges then refactor' model, but worry we end u= p without the refactoring... If others commit to shoehorning in the PHY driver work and expose the basic guts via sysctl, I'll commit to doing a review and tidyup in a few months. This includes looking at how to take the set of switch PHYs and L3 routing/filtering that we support and figure out how to expose it in a sensible manner. So who's willing to step up and do that? Luiz? Would you be willing to take your existing switch PHY code and just expose the state via sysctl? Let's get something into -HEAD. Adrian