From owner-freebsd-net@FreeBSD.ORG Sun Jan 9 05:10:28 2011 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 44118106566C for ; Sun, 9 Jan 2011 05:10:28 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0CCB48FC0C for ; Sun, 9 Jan 2011 05:10:27 +0000 (UTC) Received: by gyf3 with SMTP id 3so7570611gyf.13 for ; Sat, 08 Jan 2011 21:10:27 -0800 (PST) Received: by 10.100.6.15 with SMTP id 15mr7305052anf.189.1294548166817; Sat, 08 Jan 2011 20:42:46 -0800 (PST) Received: from [10.0.1.198] ([72.253.42.56]) by mx.google.com with ESMTPS id i10sm35726680anh.12.2011.01.08.20.42.45 (version=SSLv3 cipher=RC4-MD5); Sat, 08 Jan 2011 20:42:46 -0800 (PST) Date: Sat, 8 Jan 2011 18:45:37 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: freebsd-net@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Subject: vlan changes to support ipoib 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: Sun, 09 Jan 2011 05:10:28 -0000 Hi Folks, I have made some changes to vlans and I was wondering if anyone would care to review or test. Especially current vlan users. The diff is here: http://people.freebsd.org/~jeff/vlan.diff I can't say that I like adding all of the function pointers but with vlan support available as a loadable module I have little choice. The new functions allow a driver to fetch the virtual interface associated with a tag, cache and fetch a cookie pointer in a virtual interface, and fetch the tag of a virtual interface. Additionally, the driver was changed to make no assumptions about address size unless the type is IFT_ETHER. This means for multicast entries we store a full sockaddr_dl rather than an ethernet address. It actually simplifies the code here. I also simplified the VLAN_ARRAY stuff by moving it into functions that match the hash names so there aren't ifdef's everywhere. I've tested both hash and array. I also changed the global mtx to an sx lock so the vlan_config event handlers can allocate memory. The way ipoib works requires a full new ipoib softc when a vlan is created. I didn't want to duplicate the vlan config logic so I store that softc using the cookie field and fetch it when necessary. As a result ipoib also doesn't need the weird vlan_input() recursion since the packets appear on the correct device as they are received. I am committing this to my infiniband tree immediately but I would like some review before I merge to current. Thanks, Jeff