From owner-freebsd-arch Mon Oct 7 17: 6:31 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 82D2B37B401; Mon, 7 Oct 2002 17:06:29 -0700 (PDT) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 19F2243E77; Mon, 7 Oct 2002 17:06:29 -0700 (PDT) (envelope-from sam@errno.com) Received: from melange (melange.errno.com [66.127.85.82]) (authenticated bits=0) by ebb.errno.com (8.12.5/8.12.1) with ESMTP id g9806P1H005894 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 7 Oct 2002 17:06:26 -0700 (PDT)?g (envelope-from sam@errno.com)œ X-Authentication-Warning: ebb.errno.com: Host melange.errno.com [66.127.85.82] claimed to be melange Message-ID: <18d301c26e5e$8b5c7a30$52557f42@errno.com> From: "Sam Leffler" To: "Julian Elischer" Cc: , References: Subject: Re: CFR: m_tag patch Date: Mon, 7 Oct 2002 17:06:25 -0700 Organization: Errno Consulting MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 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: > > > > 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 > Good idea; I see the way out. Try this: struct m_tag { SLIST_ENTRY(m_tag) m_tag_link; /* List of packet tags */ u_int16_t m_tag_id; /* Tag ID */ u_int16_t m_tag_len; /* Length of data */ u_int32_t m_tag_cookie; /* Module/ABI */ }; Then define the "Legacy ABI" to be zero (or whatever you want). Then all the m_tag_* routines that I specified work only for the Legacy ABI. (Whether this is done with shims or whatever doesn't matter.) This gives me the compatiblity I want with openbsd and gives you the functionality you need for netgraph. For new work we can specify users should avoid the Legacy ABI. Cost is basically 4 bytes per tag and an extra compare when walking the tags. Happy? Sam To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message