From owner-freebsd-net@FreeBSD.ORG Sat Jan 28 23:00:23 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CDDC1065670 for ; Sat, 28 Jan 2012 23:00:23 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id CECED8FC08 for ; Sat, 28 Jan 2012 23:00:22 +0000 (UTC) Received: by wgbdr11 with SMTP id dr11so3190234wgb.31 for ; Sat, 28 Jan 2012 15:00:21 -0800 (PST) Received: by 10.180.89.71 with SMTP id bm7mr14901816wib.20.1327791621197; Sat, 28 Jan 2012 15:00:21 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.208.210 with HTTP; Sat, 28 Jan 2012 15:00:01 -0800 (PST) In-Reply-To: <20120129001251.7e4cfe83.ray@ddteam.net> References: <20120120221319.ca8b631f.ray@freebsd.org> <30A45A1E-CA13-4AC8-86FB-F8E06301D1F6@lassitu.de> <20120122195130.360261ce.ray@freebsd.org> <0E31FEC4-963D-4AC8-9AB7-EE6D6D7F86EE@lassitu.de> <20120129001251.7e4cfe83.ray@ddteam.net> From: Juli Mallett Date: Sat, 28 Jan 2012 15:00:01 -0800 X-Google-Sender-Auth: -ga7FvK7qbBxsus2YXrZSJahcsA Message-ID: To: Aleksandr Rybalko Content-Type: text/plain; charset=UTF-8 Cc: freebsd-net@freebsd.org, Adrian Chadd , freebsd-arch@freebsd.org, Aleksandr Rybalko , Stefan Bethke Subject: Re: Ethernet Switch Framework X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:00:23 -0000 On Sat, Jan 28, 2012 at 14:12, Aleksandr Rybalko wrote: > As I see from your patch, mdio/miiproxy require special bits in MAC > driver. When I design switch framework, I keeping in mind that > MAC drivers should be standard as possible I don't understand why this is desirable in practice. It's a nice theory, but it falls down when one thinks in depth about how Ethernet interfaces are used and administered vs. how switches are used and administered. What should media report? What should media changes do? What is link status? Do you show the CPU-to-switch port, or all switch ports? It makes me wonder if the understanding of the relationship in FreeBSD isn't backwards. Yes, the MAC sits on a bus and is memory-mapped, but you can conceptualize of it as a child of the PHY, rather than the parent of it, especially in systems with switch chipsets. Especially in systems where there is a switch chipset attached to multiple MACs. In that model, it makes sense to semi-generically attach a CPU-to-switch port's pseudo-PHY (or actual PHY, depending on hardware) to a MAC generically, but that doesn't meant that the switch itself is attached generically to the MAC. There are a lot of switches out there that don't look or act much like MII-driven PHYs, but which are connected over MDIO, as I've tried to stress before. I hope there will be as much separation between the MII work that is being done and the switch work that is being done as possible. I think anything else will prove rapidly-obsolete and perhaps even obstructive as soon as anyone seeks to add support for more switch chipsets to FreeBSD. I suppose the most likely reality, though, is that people simply won't add switch support to FreeBSD, and will administer them out-of-band from userland, using gross kernel shims. That is probably true whether any of the currently-outstanding work is committed or not, unfortunately :( I just hope we'll end up with something flexible enough, broad enough in applicability, narrow enough in requirements, etc., that we'll have feature-rich support for a few chipsets in tree that work in sufficiently-different manners that they can be models for other drivers in the future. Thanks, Juli.