[NFS] SUNRPC: Lack of RPC record fragments / Pynfs test WRT5 - st_write.testLargeData

Andre van Hoorn andre.van.hoorn at informatik.uni-oldenburg.de
Tue Sep 5 03:48:35 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil Brown schrieb:
> On Monday September 4, andre.van.hoorn at informatik.uni-oldenburg.de wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi,
>>
>>
>> I'm communicating with the linux NFS kernel server via RPC using the
>> sunrpc implementation in glibc. On certain RPC record sizes, glibc
>> starts to use record fragmentation (whereas the sunrpc kernel client
>> doesn't) and the sunrpc linux kernel server implementation lacks the RPC
>> record "defragmentation" functionality as can be seen in
>> net/sunrpc/svcsock.c:
>>
>> svsk->sk_reclen = ntohl(svsk->sk_reclen);
>> if (!(svsk->sk_reclen & 0x80000000)) {
>>   /* FIXME: technically, a record can be fragmented,
>>    *  and non-terminal fragments will not have the top
>>    *  bit set in the fragment length header.
>>    *  But apparently no known nfs clients send fragmented
>>    *  records. */
>>    printk(KERN_NOTICE "RPC: bad TCP reclen 0x%08lx (non-terminal)\n",
>>          (unsigned long) svsk->sk_reclen);
>>    goto err_delete;
>> }
>>
>> Unfortunately, I didn't find a way to disable the use of fragmentation
>> in glibc. Is there an existing patch for the kernel to support
>> fragmented records?
> 
> Not that I am aware of, and it would be fairly non-trivial to
> implement, for relatively little gain.
> 
> You should be able to avoid fragmentation with glibc by setting
> 'sendsz' large enough.
> When you call clnttcp_create, pass a big number for the 5th arg.
> 
> NeilBrown
> 

Thanks, calling clnttcp_create with sendsz=65724 avoids the
fragmentation by the glibc and NFS "splits" the packets instead.

I recognized (I don't know if I am the first one but I just read
http://linux-nfs.org/pipermail/nfsv4/2005-October/002760.html) the RPC
fragmentation problem (here in the python rpc lib instead of glibc)
could also be the reason why Pynfs test "WRT5 - st_write.testLargeData"
fails -- if this is still the case.

Executing this test on my system, the nfs server (respectively sunrpc)
dumps the message "RPC: bad TCP reclen 0x00000800 (non-terminal)".




André
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/SvTLKwmE5jzZmkRAr+bAJ4hguBP13iU3VKg2glLkZ4pR4rOugCg3QTe
9Wz2dLaOEPMHYBsyh48nKsk=
=Ikcs
-----END PGP SIGNATURE-----


More information about the NFSv4 mailing list