From owner-freebsd-arch Mon Oct 7 16:40:11 2002 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 C852F37B401; Mon, 7 Oct 2002 16:40:08 -0700 (PDT) Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 372BE43E42; Mon, 7 Oct 2002 16:40:08 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by sccrmhc02.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20021007234007.RWGE27763.sccrmhc02.attbi.com@InterJet.elischer.org>; Mon, 7 Oct 2002 23:40:07 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA36379; Mon, 7 Oct 2002 16:23:02 -0700 (PDT) Date: Mon, 7 Oct 2002 16:23:00 -0700 (PDT) From: Julian Elischer To: Sam Leffler Cc: freebsd-arch@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: CFR: m_tag patch In-Reply-To: <185201c26e54$43339f40$52557f42@errno.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 7 Oct 2002, Sam Leffler wrote: > > So all this is to say that you want m_tag_id to be u_int32_t. Having > another 16-bit field is immaterial to anything I've thought of but given > that switching to a 32-bit tag_id will require allocating an additional > 32-bit item you can have that for free since there's little point in having > a 32-bit length. The obvious downside is that m_tag structs now go from 8 > bytes to 12, but this is still a darn sight better than allocating a 256 > byte mbuf. sure... "an extra 4 bytes please sir" :-) > > If you allocate tag id's using your 32-bit time scheme then the fixed values > above would never be hit since they are all for impossible times and so > there'd be no conflict. Just make them all IDs in a single "Legacy" API > > > > > (this is a contrived example because priority is a "BASE API" metadata > > type in netgraph, and the base API doesn't have a magic number at the > > moment but probably should have one. (certainly would in this case) > > > > > > As I mentionned before, it is also not clear to me that the metadata > > needs to be in linked list form, but I could live with it. > > > > Sounds to me like the real issue for you is insuring unique m_tag_id values. > We're certainly less likely to have collisions with a 32-bit value than a > 16-bit value and expanding this way gives you your "field ID" too. I guess > the question I have is whether the existing API's that search only by > "cookie" are sufficient for your needs. If so then I'm ok with changing > things. Otherwise we have an API incompatibility with openbsd that I'd like > to avoid. You could "mis-use" the API identifier as you suggest, or you could just keep them in theID and have "Legacy" API identifier of 1034032666 (the output of date -u +'%s' for right now.. the suggested method of deriving an API ID.) I'd rather not pollute the namespace of other modules, but it's up to you. first check if it's an API you understand. if not skip to next if it is, go to some switch table to identify more exactly.. heck take API identifier #0 :-) I have actually had code with 2 version sof the same API. Being able to just assign a different API ID was good. I could support both sorts of input. Julian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message