[Fwd: Re: cvs commit: src/sys/nfs nfs_common.c nfs_common.h src/sys/nfsclient nfs_socket.c]

mohans mohans at yahoo-inc.com
Fri Jul 15 16:14:38 GMT 2005


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


More information about the cvs-src mailing list