Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jul 2005 09:12:12 -0700
From:      mohans <mohans@yahoo-inc.com>
To:        Paul Saab <ps@freebsd.org>
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]
Message-ID:  <20050715161212.GA33629@yahoo-inc.com>
In-Reply-To: <42D7D0C4.30408@freebsd.org>
References:  <42D7D0C4.30408@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050715161212.GA33629>