From owner-freebsd-current@FreeBSD.ORG Tue Sep 2 18:56:58 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3C8010656CF for ; Tue, 2 Sep 2008 18:56:57 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id 1AAE88FC90 for ; Tue, 2 Sep 2008 18:53:34 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so1593029fgb.35 for ; Tue, 02 Sep 2008 11:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=BLJGy/cgf1kB687+m4MMag2Y3UFBSj8JSw0MbwpApEA=; b=XWC91jICK/4fwVEj+kSzb4LXS06nrbH4e6aZlizjsvA8lcUTC0B1ua79Og0DqlfeG3 vtvxhzf6ZHOv4F+WmcYOffTGTtTK/fdFN8D7E/SI7/lOMb9f9JGlKSCMHtrf1dAntb1k NPdNXOPXEZuD9SXP5jQTYrWlbGeJ7ZdsscDVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=mg0fZG4EeQLbuTrCaGtrF/Qfjj8PF4MxD0exx7ymSCDcn0DXxHgeSRM2j5BPqA2THY MOfyjzFfQHJvksSrl4/dcLlvnOoynpnqgRhSWiq8ALjd4kCONFGLxSLpcCqzcMKuCNop sVSonDP/4waKTI9geivlD9m58LMAYrj/Lzdcw= Received: by 10.86.79.19 with SMTP id c19mr5871026fgb.79.1220381611000; Tue, 02 Sep 2008 11:53:31 -0700 (PDT) Received: by 10.86.70.1 with HTTP; Tue, 2 Sep 2008 11:53:30 -0700 (PDT) Message-ID: Date: Tue, 2 Sep 2008 11:53:30 -0700 From: "Maksim Yevmenkin" To: "Andrew Thompson" In-Reply-To: <20080902183243.GC12367@citylink.fud.org.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080902174540.GB12367@citylink.fud.org.nz> <20080902183243.GC12367@citylink.fud.org.nz> Cc: current@freebsd.org Subject: Re: m_uiotombuf alignment X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2008 18:57:02 -0000 On 9/2/08, Andrew Thompson wrote: > On Tue, Sep 02, 2008 at 10:54:08AM -0700, Maksim Yevmenkin wrote: > > Andrew, > > > > > I have a patch here to removing the alignment of the align parameter. I > > > can not see why it was added as it up to the caller to specify this, it > > > breaks tap(4) on strict alignment machines as m_uiotombuf is called with > > > ETHER_ALIGN. Also 'align' isnt a great description of this field, its > > > more a padding or data offset. > > > > hmm... strange... from cvs > > > > === > > > > Revision 1.53 > > Wed May 4 18:55:02 2005 UTC (3 years, 4 months ago) by emax > > Branches: MAIN > > > > Change m_uiotombuf so it will accept offset at which data should be copied > > to the mbuf. Offset cannot exceed MHLEN bytes. This is currently used to > > fix Ethernet header alignment problem on alpha and sparc64. Also change all > > users of m_uiotombuf to pass proper offset. > > > > Reviewed by: jmg, sam > > Tested by: Sten Spans "sten AT blinkenlights DOT nl" > > MFC after: 1 week > > > > === > > > > could you please explain how and on which platforms it breaks tap(4)? > > > That revision had the correct behaviour, it was broken in r1.169 > > Rewrite m_uiotombuf() to use m_getm2() for mbuf allocation and do the > uiomove() in a tight loop over the mbuf chain. Add a flags parameter to > accept mbuf flags to be passed to m_getm2(). Adjust all callers for the > extra parameter. > > Sponsored by: TCP/IP Optimization Fundraise 2005 ahh... i see... i was looking at the wrong revision :) yes, i agree with you. i do not see the reason for the alignment of the align parameter. thanks, max