From owner-freebsd-pf@FreeBSD.ORG Wed Jun 29 02:11:41 2005 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 894FF16A41C for ; Wed, 29 Jun 2005 02:11:41 +0000 (GMT) (envelope-from yongari@rndsoft.co.kr) Received: from rndsoft.co.kr (michelle.rndsoft.co.kr [211.32.202.209]) by mx1.FreeBSD.org (Postfix) with ESMTP id E5AC743D55 for ; Wed, 29 Jun 2005 02:11:40 +0000 (GMT) (envelope-from yongari@rndsoft.co.kr) Received: by simscan 1.1.0 ppid: 65106, pid: 65107, t: 1.2081s scanners:none Received: from unknown (HELO michelle.rndsoft.co.kr) (192.168.5.90) by 0 with SMTP; 29 Jun 2005 02:06:13 +0900 Received: from michelle.rndsoft.co.kr (localhost.rndsoft.co.kr [127.0.0.1]) by michelle.rndsoft.co.kr (8.13.1/8.13.1) with ESMTP id j5T2BUq0009131 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 29 Jun 2005 11:11:30 +0900 (KST) (envelope-from yongari@rndsoft.co.kr) Received: (from yongari@localhost) by michelle.rndsoft.co.kr (8.13.1/8.13.1/Submit) id j5T2BUBm009130; Wed, 29 Jun 2005 11:11:30 +0900 (KST) (envelope-from yongari@rndsoft.co.kr) Date: Wed, 29 Jun 2005 11:11:30 +0900 From: Pyun YongHyeon To: Andrew Thompson Message-ID: <20050629021130.GA8832@rndsoft.co.kr> References: <200506282100.j5SL0bmv063764@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506282100.j5SL0bmv063764@freefall.freebsd.org> User-Agent: Mutt/1.4.2.1i X-Spam-Checker-Version: SpamDetector 1.00 (2004-01-11) on Cc: freebsd-pf@freebsd.org Subject: Re: ia64/81284: Unaligned Reference with pf on 5.4/IA64 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yongari@rndsoft.co.kr List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jun 2005 02:11:41 -0000 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 > 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