From owner-svn-src-user@FreeBSD.ORG Thu Nov 22 16:48:58 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DADB720B; Thu, 22 Nov 2012 16:48:58 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8C598FC13; Thu, 22 Nov 2012 16:48:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMGmwMb024181; Thu, 22 Nov 2012 16:48:58 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMGmwAE024180; Thu, 22 Nov 2012 16:48:58 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211221648.qAMGmwAE024180@svn.freebsd.org> From: Andre Oppermann Date: Thu, 22 Nov 2012 16:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r243409 - user/andre/tcp_workqueue/sys/sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 16:48:58 -0000 Author: andre Date: Thu Nov 22 16:48:58 2012 New Revision: 243409 URL: http://svnweb.freebsd.org/changeset/base/243409 Log: lign and pad the mbuf header structures using the __aligned() attribute instead of manual padding. The alignment and padding is set to sizeof(void *) to align to the native pointer width on all architectures. Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/mbuf.h Thu Nov 22 16:20:08 2012 (r243408) +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Thu Nov 22 16:48:58 2012 (r243409) @@ -79,12 +79,6 @@ 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. */ @@ -94,8 +88,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 */ -}; +} __aligned(sizeof(void *)); /* * Packet tag structure (see below for details). @@ -137,7 +130,7 @@ struct pkthdr { u_int16_t vt_nrecs; /* # of IGMPv3 records in this chain */ } PH_vt; SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ -}; +} __aligned(sizeof(void *)); #define csum_data PH_cd.cd_data #define csum_l2hlen PH_cd.PHCD_hdr.l2hlen #define csum_l3hlen PH_cd.PHCD_hdr.l3hlen @@ -157,7 +150,7 @@ struct m_ext { u_int ext_size; /* size of buffer, for ext_free */ volatile u_int *ref_cnt; /* pointer to ref count info */ int ext_type; /* type of external storage */ -}; +} __aligned(sizeof(void *)); /* * The core of the mbuf object along with some shortcut defines for practical