From owner-freebsd-net Sun Nov 12 8:21: 9 2000 Delivered-To: freebsd-net@freebsd.org Received: from field.videotron.net (field.videotron.net [205.151.222.108]) by hub.freebsd.org (Postfix) with ESMTP id 3291D37B479 for ; Sun, 12 Nov 2000 08:21:06 -0800 (PST) Received: from modemcable213.3-201-24.mtl.mc.videotron.ca ([24.201.3.213]) by field.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0G3X00MB96QBRV@field.videotron.net> for freebsd-net@freebsd.org; Sun, 12 Nov 2000 11:20:36 -0500 (EST) Date: Sun, 12 Nov 2000 11:25:38 -0500 (EST) From: Bosko Milekic Subject: Re: M_RDONLY: review & comment In-reply-to: <200011121310.aa19093@salmon.maths.tcd.ie> X-Sender: bmilekic@jehovah.technokratis.com To: David Malone Cc: iedowse@maths.tcd.ie, freebsd-net@freebsd.org Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, 12 Nov 2000, David Malone wrote: > Ahhh, crap, I ment to reply to you about this before you committed it, > but I've been too busy. (I'm also not on freebsd-net, so I didn't notice > the post until Ian pointed it out ;-() > > I was talking to Ian about the ext_type stuff, and there is a > problem with it. The problem is that you need to allocate a static > number for each type in question, which is not good for loadable > modules which might define their own types. In general people are > trying to get away from fixed things like major device numbers and > this seems to be just another of these things. Not necessarily. If you'll notice, I changed the type for if_ti, if_wb, etc. to have only ONE type, EXT_NET_DRV. The only real important type is EXT_CLUSTER, because that's the one we always check to see if it's "this one, or all the others." The others are there mainly for debugging purposes. > I can think of two possible alternatives. One is to get rid of the > ext_type stuff, as it doesn't really buy us anything, except maybe > slightly clearer code or being able to tell the type while debugging. > > The other option I thought of is to use a char *. You could point > to a static string describing the type of external storage. This > way is still fast comparing types, just compare the pointers. If > you want to know what the type is in human readable format (for > debugging) you just look at the string it points at. Also the > kernel allocates different addresses for different strings, so > it automatically solves the problem of allocating unique numbers > to each type. > > David. There are flaws with this. One is that there's no way to know ahead of time what type has what address associated to it. I think what we should do is maybe add EXT_MOD_TYPE and all the modules adding their own ext_buf's that are _not_ network drivers can use that. Seems much simpler to me. Note that this is unlike major/minor numbers in that each type does not have to be unique. Note that I will change the short ext_type to an int. It's typically faster on the alpha and it doesn't cost us anything. Cheers, Bosko Milekic bmilekic@technokratis.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message