From owner-freebsd-arch@FreeBSD.ORG Sat Apr 8 01:07:36 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5738A16A402 for ; Sat, 8 Apr 2006 01:07:36 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id D912E43D53 for ; Sat, 8 Apr 2006 01:07:35 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.248] (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id k3817YKn013618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 7 Apr 2006 18:07:35 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <44370CD6.9090006@errno.com> Date: Fri, 07 Apr 2006 18:07:34 -0700 From: Sam Leffler User-Agent: Thunderbird 1.5 (X11/20060210) MIME-Version: 1.0 To: arch@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: ifnet cloning changes X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Apr 2006 01:07:36 -0000 The patch here: http://www.freebsd.org/~sam/clone.patch modifies the SIOCIFCREATE api in the kernel so that an opaque parameter block can be passed down to ifnet cloning routines (actually the user address is passed down and the caller must do the copyin since it alone knows the size of the parameter block). This allows you to specify parameters at the time a clone is done which can greatly simplify the handling of cloned ifnets. This change is a prerequisite to bringing in my 802.11 virtual ap work which depends on this to fix vap configuration state at the time the vap is created. Only vlans use this new mechanism with the patch. It appears some other cloners could use it but are left unchanged. The second part of the patch alters ifconfig to optionally handle cloning requests with a callback. The vlan code uses this mechanism to collect cloning parameters (tag and parent device) from the command line parameters before getting called back to do the create call at which point it can pass all the parameters in to the call. These changes also simplify the code a bit. I've been waiting for 6.1 to get tagged before proposing this as the change will make head incompatible with releng6. If compatibility is important we could define a new ioctl instead and preserve the current handling of SIOCIFCREATE. Sam