From owner-cvs-src@FreeBSD.ORG Fri Jul 15 16:14:38 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3028016A41C; Fri, 15 Jul 2005 16:14:38 +0000 (GMT) (envelope-from mohans@yahoo-inc.com) Received: from mrout2.yahoo.com (mrout2.yahoo.com [216.145.54.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id DADEB43D45; Fri, 15 Jul 2005 16:14:37 +0000 (GMT) (envelope-from mohans@yahoo-inc.com) Received: from crabapple.corp.yahoo.com (crabapple.corp.yahoo.com [207.126.239.39]) by mrout2.yahoo.com (8.13.4/8.13.4/y.out) with ESMTP id j6FGCCkt026089; Fri, 15 Jul 2005 09:12:12 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=received:date:from:to:cc:subject:message-id:reply-to: references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=Kuk1yvbMIEZ0YHFFp3wv3cAmB4CspPDeH3yGZD0c0irjQP577L7H8eel/s35OodI Received: (from mohans@localhost) by crabapple.corp.yahoo.com (8.12.11/8.12.11) id j6FGCCxS034306; Fri, 15 Jul 2005 09:12:12 -0700 (PDT) (envelope-from mohans) Date: Fri, 15 Jul 2005 09:12:12 -0700 From: mohans To: Paul Saab Message-ID: <20050715161212.GA33629@yahoo-inc.com> References: <42D7D0C4.30408@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42D7D0C4.30408@freebsd.org> User-Agent: Mutt/1.4.1i Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: [Fwd: Re: cvs commit: src/sys/nfs nfs_common.c nfs_common.h src/sys/nfsclient nfs_socket.c] X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mohans@yahoo-inc.com List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2005 16:14:38 -0000 Hi Alfred, > Ugh, why not do it beforehand to reduce the copy? This looks like > you'll move all this data into a single mbuf, then possibly shift > all the contents, can't you shift the initial mbuf first, THEN > do the pullup? The change aligns (by copying) data left over the mbuf after a pullup is done. The aligned data will be returned on the subsequent call to nfs_dissect(). Post-pullup, dposp points at the byte in the mbuf chain to be returned on the next call to nfs_dissect() and dposp is what we align. There are other ways of doing this too. We could force alignment in nfsm_dissect_xx() if we notice that the data that will be returned is unaligned. I think they are all quite equivalent in terms of expense. My initial reaction was to check for alignment (and force alignment) in either in nfs_dissect() (the macro) or nfsm_dissect_xx(). For now, though, doing the alignment (if necessary) post-pullup in the guts of nfsm_disct() seems the least risky. > > - Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the > > mbuf (instead of casting m_data to a uint32). > > Also, is bcopy(9) light enough to be used for this purpose or do > we have something to do unaligned reads? The bcopy() is just for copying out the length. mohan