From 38073c41816f756bc0553deb3dfc27f8b24c3f10 Mon Sep 17 00:00:00 2001 From: Kip Macy Date: Sat, 14 Apr 2007 19:42:20 +0000 Subject: [PATCH] pad out m_hdr to make pkthdr word-aligned shuffle pkthdr.len so that pkthdr.header is aligned without compiler added padding Reviewed by: rwatson, andre, sam --- sys/sys/mbuf.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index b9f1c185f4ae..58ad3a6d58d6 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -77,6 +77,12 @@ struct mb_args { }; #endif /* _KERNEL */ +#if defined(__LP64__) +#define M_HDR_PAD 6 +#else +#define M_HDR_PAD 2 +#endif + /* * Header present at the beginning of every mbuf. */ @@ -87,6 +93,7 @@ struct m_hdr { int mh_len; /* amount of data in this mbuf */ int mh_flags; /* flags; see below */ short mh_type; /* type of data in this mbuf */ + uint8_t pad[M_HDR_PAD];/* word align */ }; /* @@ -105,9 +112,9 @@ struct m_tag { */ struct pkthdr { struct ifnet *rcvif; /* rcv interface */ - int len; /* total packet length */ /* variables for ip and tcp reassembly */ void *header; /* pointer to packet header */ + int len; /* total packet length */ /* variables for hardware checksum */ int csum_flags; /* flags regarding checksum */ int csum_data; /* data field used by csum routines */