Date: Mon, 7 Oct 2002 17:06:25 -0700 From: "Sam Leffler" <sam@errno.com> To: "Julian Elischer" <julian@elischer.org> Cc: <freebsd-arch@FreeBSD.ORG>, <freebsd-net@FreeBSD.ORG> Subject: Re: CFR: m_tag patch Message-ID: <18d301c26e5e$8b5c7a30$52557f42@errno.com> References: <Pine.BSF.4.21.0210071613260.34884-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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-net" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18d301c26e5e$8b5c7a30$52557f42>
