Date: Wed, 29 Jun 2005 11:11:30 +0900 From: Pyun YongHyeon <yongari@rndsoft.co.kr> To: Andrew Thompson <thompsa@freebsd.org> Cc: freebsd-pf@freebsd.org Subject: Re: ia64/81284: Unaligned Reference with pf on 5.4/IA64 Message-ID: <20050629021130.GA8832@rndsoft.co.kr> In-Reply-To: <200506282100.j5SL0bmv063764@freefall.freebsd.org> References: <200506282100.j5SL0bmv063764@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 28, 2005 at 09:00:37PM +0000, Andrew Thompson wrote: > The following reply was made to PR ia64/81284; it has been noted by GNATS. > > From: Andrew Thompson <thompsa@freebsd.org> > To: bug-followup@FreeBSD.org > Cc: > Subject: Re: ia64/81284: Unaligned Reference with pf on 5.4/IA64 > Date: Wed, 29 Jun 2005 08:50:18 +1200 > > A complementary patch for bridge.c using the same macros and routines as > if_bridge. As far as I can tell ipv6 isn't filtered. > I think your patch will work for bridge/if_bridge case. But it would not fix other handlers that run at IP layer. I guess it would also panic in pf/ipf/ipfw at IPv4/IPv6 pfil handler when it was not processed by bridge/if_bridge. I believe developers already know how to fix this specific issue but it's matter of how to handle this kind of unaligned access efficiently. I guess the root cause of the unaligned access comes from ethernet driver. Most ethernet drivers(except em(4)) had aligned received packet on architectures with strict alignment(em(4) with JUMBO frames passes unaligned packet data to upper layer). So aligning the packet data was one of big pain for driver writers on hardwares that have DMA limitations. Using m_copyup(9) would greatly decrease the burden on driver layer. In addition it wouldn't give additional penalty on architectures that allows non-aligned access. However it requires all packet handlers(bridge, pf/ipf/ipfw, netgraph, IPv4, IPv6 etc) should check alignment right before accessing the data. That would increase code size and duplication. Personally I prefer handling of alignment in driver or ethernet layer due to simplicity. Other developers may have different views. -- Regards, Pyun YongHyeon http://www.kr.freebsd.org/~yongari | yongari@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050629021130.GA8832>