aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_os_bsd.h
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2015-01-05 09:58:32 +0000
committerRobert Watson <rwatson@FreeBSD.org>2015-01-05 09:58:32 +0000
commited6a66ca6c2065bc1fed93e00805676a5d3b981e (patch)
tree6f98bf414ddd5e9772757ca1f6016f218ead95f8 /sys/netinet/sctp_os_bsd.h
parentcd470fead8828603c75aaa68a28a90df541c13c2 (diff)
downloadsrc-ed6a66ca6c2065bc1fed93e00805676a5d3b981e.tar.gz
src-ed6a66ca6c2065bc1fed93e00805676a5d3b981e.zip
To ease changes to underlying mbuf structure and the mbuf allocator, reduce
the knowledge of mbuf layout, and in particular constants such as M_EXT, MLEN, MHLEN, and so on, in mbuf consumers by unifying various alignment utility functions (M_ALIGN(), MH_ALIGN(), MEXT_ALIGN() in a single M_ALIGN() macro, implemented by a now-inlined m_align() function: - Move m_align() from uipc_mbuf.c to mbuf.h; mark as __inline. - Reimplement M_ALIGN(), MH_ALIGN(), and MEXT_ALIGN() using m_align(). - Update consumers around the tree to simply use M_ALIGN(). This change eliminates a number of cases where mbuf consumers must be aware of whether or not mbufs returned by the allocator use external storage, but also assumptions about the size of the returned mbuf. This will make it easier to introduce changes in how we use external storage, as well as features such as variable-size mbufs. Differential Revision: https://reviews.freebsd.org/D1436 Reviewed by: glebius, trasz, gnn, bz Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=276692
Diffstat (limited to 'sys/netinet/sctp_os_bsd.h')
-rw-r--r--sys/netinet/sctp_os_bsd.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h
index 9d5466307f50..53427ce85bc7 100644
--- a/sys/netinet/sctp_os_bsd.h
+++ b/sys/netinet/sctp_os_bsd.h
@@ -304,11 +304,7 @@ typedef struct callout sctp_os_timer_t;
#define SCTP_BUF_RECVIF(m) (m->m_pkthdr.rcvif)
#define SCTP_BUF_PREPEND M_PREPEND
-#define SCTP_ALIGN_TO_END(m, len) if(m->m_flags & M_PKTHDR) { \
- MH_ALIGN(m, len); \
- } else if ((m->m_flags & M_EXT) == 0) { \
- M_ALIGN(m, len); \
- }
+#define SCTP_ALIGN_TO_END(m, len) M_ALIGN(m, len)
/* We make it so if you have up to 4 threads
* writing based on the default size of