From owner-svn-src-all@FreeBSD.ORG Mon Feb 1 17:58:03 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C40F1065693; Mon, 1 Feb 2010 17:58:03 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8E58FC22; Mon, 1 Feb 2010 17:58:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o11HigY1034051; Mon, 1 Feb 2010 10:44:42 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 01 Feb 2010 10:45:37 -0700 (MST) Message-Id: <20100201.104537.578650865272929831.imp@bsdimp.com> To: brde@optusnet.com.au From: "M. Warner Losh" In-Reply-To: <20100202012830.B1230@besplex.bde.org> References: <201002011413.o11EDiPm074656@svn.freebsd.org> <20100202012830.B1230@besplex.bde.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, luigi@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r203343 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2010 17:58:03 -0000 In message: <20100202012830.B1230@besplex.bde.org> Bruce Evans writes: : Rev.1.30 attempted to fix this by also adding the __aligned(4) : attribute. : I haven't checked that this works. It adds additional unportability : and : ugliness. __packed is necessary for ARM where the rules of the ABI we use are such that this structure isn't properly packed otherwise.[*] __aligned(4) tells the compiler that pointers to this structure are 4-byte aligned, which helps on many platforms generate more optimal code. The root cause of all this mess is that 'C' doesn't have any good, easy ways to specify "on the wire" formats of structures. So we have to play these games to make the headers we snarfed off the wire match the C structs that we're using to access the fields in those structures. We are necessarily in unportability land here. It is only by the chance alignment of the x86 ABI and the wire format that the project was able to ignore the issue for so long... Warner [*] Of course, it could be argued that ARM should use a different and/or better ABI for newer cores, and I'd agree with that... But until that's fixed, we have to cope.