From owner-cvs-all@FreeBSD.ORG Fri Nov 17 08:33:16 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 00DE416A47B; Fri, 17 Nov 2006 08:33:16 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1-3.pacific.net.au [61.8.2.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7335A43D7D; Fri, 17 Nov 2006 08:33:09 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id DAD5B328060; Fri, 17 Nov 2006 19:33:07 +1100 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 6AA5B8C04; Fri, 17 Nov 2006 19:33:06 +1100 (EST) Date: Fri, 17 Nov 2006 19:33:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Yar Tikhiy In-Reply-To: <20061116090412.GB37133@comp.chem.msu.su> Message-ID: <20061117192049.H10708@delplex.bde.org> References: <3801.1163410519@critter.freebsd.dk> <20061113214928.P76443@delplex.bde.org> <20061113.101958.-861030824.imp@bsdimp.com> <20061116090412.GB37133@comp.chem.msu.su> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, jkoshy@freebsd.org, cvs-all@freebsd.org, phk@phk.freebsd.dk, cvs-src@freebsd.org, "M. Warner Losh" Subject: Re: cvs commit: src/include ar.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 08:33:16 -0000 On Thu, 16 Nov 2006, Yar Tikhiy wrote: > On Mon, Nov 13, 2006 at 10:19:58AM -0700, M. Warner Losh wrote: >> : >> : BTW, you are responsible for the __packed in . Please remove >> : it. The __CTASSERT() is enough to detect if heroic packing is ever needed. >> : The only danger is if something has grown to depend on __packed reducing >> : alignment as a side effect. E.g., suppose we had a byte string containing >> : a bytewise copy of a struct ip. If the copy might be misaligned, then it >> : should be copied to an actual struct ip before accessing it as a struct, >> : but code that accesses it directly using ((struct ip *)&bs[N]) would work >> : now due to the reduced alignment. Places that really need __packed should >> : probably use __aligned() to restore the natural alignment. >> >> DO NOT REMOVE IT. IT IS ABSOLUTELY REQUIRED FOR ARM TO WORK RIGHT. >> If you want to remove it, then you must make sure arm works right >> after it because I'll add it back. > > Many years ago I was taught that comments in code could help to > avoid such clashes in software development. Is this true no more? ;-) Apparently not. There has always been a relevant comment in : %%% /* * Mbuf adjust factor to force 32-bit alignment of IP header. * Drivers should do m_adj(m, ETHER_ALIGN) when setting up a * receive so the upper layers get the IP header properly aligned * past the 14-byte Ethernet header. */ #define ETHER_ALIGN 2 /* driver adjust for IP hdr alignment */ %%% Bruce