diff options
author | glebius <glebius@FreeBSD.org> | 2013-03-17 07:39:45 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2013-03-17 07:39:45 +0000 |
commit | 7bcebf010f85ebc9c6893f5aef56eb0a8cd73529 (patch) | |
tree | 0746cfaa3216088ee4f2ce7087964b186283bb2d | |
parent | 09c3ea7c844d5dbcddd89629f703b84c753cdd17 (diff) | |
download | FreeBSD-src-7bcebf010f85ebc9c6893f5aef56eb0a8cd73529.zip FreeBSD-src-7bcebf010f85ebc9c6893f5aef56eb0a8cd73529.tar.gz |
Add MEXT_ALIGN() macro, similar to M_ALIGN() and MH_ALIGN(), but for
mbufs with external buffer.
-rw-r--r-- | sys/sys/mbuf.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index a4b0f71..ec10bc6 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -195,7 +195,7 @@ struct mbuf { #define M_FIRSTFRAG 0x00001000 /* packet is first fragment */ #define M_LASTFRAG 0x00002000 /* packet is last fragment */ #define M_SKIP_FIREWALL 0x00004000 /* skip firewall processing */ -#define M_FREELIST 0x00008000 /* mbuf is on the free list */ + /* 0x00008000 free */ #define M_VLANTAG 0x00010000 /* ether_vtag is valid */ #define M_PROMISC 0x00020000 /* packet was not for us */ #define M_NOFREE 0x00040000 /* do not free mbuf, embedded in cluster */ @@ -708,6 +708,18 @@ m_last(struct mbuf *m) } while (0) /* + * As above, for mbuf with external storage. + */ +#define MEXT_ALIGN(m, len) do { \ + KASSERT((m)->m_flags & M_EXT, \ + ("%s: MEXT_ALIGN not an M_EXT mbuf", __func__)); \ + KASSERT((m)->m_data == (m)->m_ext.ext_buf, \ + ("%s: MEXT_ALIGN not a virgin mbuf", __func__)); \ + (m)->m_data += ((m)->m_ext.ext_size - (len)) & \ + ~(sizeof(long) - 1); \ +} while (0) + +/* * Compute the amount of space available before the current start of data in * an mbuf. * |