Date: Wed, 13 Jun 2001 04:07:16 +0900 (JST) From: Hajimu UMEMOTO <ume@mahoroba.org> To: brooks@one-eyed-alien.net Cc: hackers@FreeBSD.ORG, brian@Awfulhak.org, phk@critter.freebsd.dk, arch@FreeBSD.ORG Subject: Re: cloning network interfaces Message-ID: <20010613.040716.115941864.ume@mahoroba.org> In-Reply-To: <20010611142030.A15283@Odin.AC.HMC.Edu> References: <20010608191904.A18847@Odin.AC.HMC.Edu> <20010610.232907.74740159.ume@mahoroba.org> <20010611142030.A15283@Odin.AC.HMC.Edu>
next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> On Mon, 11 Jun 2001 14:20:31 -0700 >>>>> Brooks Davis <brooks@one-eyed-alien.net> said: brooks> On Sun, Jun 10, 2001 at 11:29:07PM +0900, Hajimu UMEMOTO wrote: > I think it is not BSD network way. Recent NetBSD has network > interface cloning. It uses SIOCIFCREATE and SIOCIFDESTROY. It may > good to port it to FreeBSD. brooks> I've looked it over and I generally like it. There is one problem brooks> though. That's the requirement that you use static units. The problem brooks> with this is that it forces you to implement free unit scanning in brooks> userland if you just want to create a unit and don't care what it is. brooks> If you have to do this, and things are being changed at any kind of brooks> significant rate, you have race condition between scanning the brooks> interface list for a free unit and trying to allocate it. This race can brooks> theoreticaly lead to starvation. I see. brooks> My proposed solution is threefold. First, change the ifc_create pointer's brooks> type to: brooks> int (*ifc_create)(struct if_clone *, int *); brooks> so you can return a unit if the caller requests a wildcard unit (by brooks> passing -1). Second, move unit management in to the driver rather then brooks> just using ifunit in if_clone_create. Drivers could choose to implement brooks> wildcarding or not and if not could simply use ifunit for their test. brooks> Third, make if_clone_lookup treat names like "gif#" as a wildcard brooks> request and set unit to -1 as appropriate. These changes break brooks> compatability with NetBSD slightly, but it's just a few lines to convert brooks> an existing NetBSD clone_create handler to this style and it could brooks> easily be handled with #ifdef's. brooks> Thoughts, comments, objections? I like your idea. I'm serving tunnel broker using DTCP (Dynamic Tunnel Configuration Protocol) in our ISP. So, I'm grad if we have dynamic gif creation, too. -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@bisd.hitachi.co.jp ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010613.040716.115941864.ume>