From owner-freebsd-embedded@FreeBSD.ORG Mon Dec 12 10:35:36 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 399841065672 for ; Mon, 12 Dec 2011 10:35:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id E1E0D8FC15 for ; Mon, 12 Dec 2011 10:35:35 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so6249731vcb.13 for ; Mon, 12 Dec 2011 02:35:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=lDToC9uy9Aebu0+pVbuyLxtUcXyxbGNHWGW5OIB6GCQ=; b=KwuSZ5Kwqn2QjCubCQs3RvlQYtNOrDeErlgrlV2mv7/T1bjXndM0IgYGKx5NdPmIVd nZLYCb+ESapywhrAk2IU/BFLDADMHBl1M/T/YbIBYCHaX4RL8vzSId2+nBQ+lZy9vkW3 T7a2YasliWpErR9B/6k5M/fyRuyt+iUHpgOcs= MIME-Version: 1.0 Received: by 10.52.67.111 with SMTP id m15mr9298578vdt.96.1323686135282; Mon, 12 Dec 2011 02:35:35 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.26.50 with HTTP; Mon, 12 Dec 2011 02:35:35 -0800 (PST) In-Reply-To: <20111212011517.ff4b390f.ray@ddteam.net> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <6387ABA5-AC55-49DD-9058-E45CC0A3E0A0@lassitu.de> <74E4AF57-3D22-415E-B913-176753B09B16@lassitu.de> <710E2C7A-E9AC-4103-8C61-0EDC4A3AF9DE@lassitu.de> <20111212011517.ff4b390f.ray@ddteam.net> Date: Mon, 12 Dec 2011 02:35:35 -0800 X-Google-Sender-Auth: OYM0FuToCHBx7RgiXpC7z3j_pW0 Message-ID: From: Adrian Chadd To: Aleksandr Rybalko Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2011 10:35:36 -0000 Ray, How does your userland switch configuration tool work? The one that doesn't use the switch API you've designed? I'm wondering if we shouldn't just make the first stage of this be: * Add the glue needed to detect and setup the switch/phy, expose the PHY state and PHY register operations; * fix if_arge to allow this to happen in a not so dirty fashion (ie, remove the arge0/arge1 hard coded distinction, pushing it all into hints); * do the minimum needed to support the setup where arge1 has the switch PHY, and all the odd probing issues that entails; * do the switch configuration via userland for now, rather than the switch API. Since these switch PHYs have a very large set of possible operating modes (including all kinds of L2/L3/L4 ACL modes that we haven't even begun to address, let alone devices which implement hardware NAT) I think the best thing to do right now is the minimum set of stuff needed, then do the rest via userland. As long as the PHY port state is exposed and there is some way to program the arge{0,1} MII mode, clock speed, port speed and port duplex, I think we'll be fine. I'd still like to eventually implement a switch API but I'm concerned about the amount of time it'll take to get it "right", along with all the subsequent features which vary quite wildly with devices. We may end up having to code up a way of implementing (opaque) extensions (so the switch PHY layer doesn't need to know about NAT, for example, but natd can program in rules as needed; same deal for hardware ACLs and QoS), and this may get messy. What do you think? Juli/Warner, what do you two think? Adrian