Shell copy_file() issue with NFS and small MAC receive buffer
kevin.kirspel at optimedical.com
Fri Apr 1 00:22:20 UTC 2011
The problem is the number of 1500 byte fractional packets sent over by the NFS server at one time. 8192 / 1500 = 6 fractional packets (sent one after the other). This causes my receive buffer to fill up before the packets can be processed. To solve this problem, the NFS client in RTEMS has a global variable named nfsStBlksize. This limits the number of fractional packets that the NFS server can send before looking for the ack packet. In my case, 4096 / 1500 = 3 fractional packets which can be handled by the receive buffer. Various Ethernet MACs have different buffer sizes which is why you probably did not see the issue.
From: Chris Johns [mailto:chrisj at rtems.org]
Sent: Thursday, March 31, 2011 8:04 PM
To: Kirspel, Kevin
Cc: rtems-users at rtems.org
Subject: Re: Shell copy_file() issue with NFS and small MAC receive buffer
On 1/04/11 8:59 AM, Kirspel, Kevin wrote:
> I am upgrading from 4.9 to 4.10 and I have come across an issue between
> the RTEMS shell and NFS networking.
> In 4.10, I cannot copy files from an NFS share to the RTEMS file system
> (which works fine in 4.9). I traced it back to the copy_file() function
> in the RTEMS shell (utils-cp.c). In the 4.9 version, the buffer size was
> set to 4096. In 4.10, the buffer size is set to 8192. This causes a
> problem with my NFS because my Ethernet MAC/PHY only has a 8192 receive
TCP should manage this for you. The 8K NFS read request should be sent
broken up into the ethernet MTU (~1500 bytes) packets.
> I have to set the NFS nfsStBlksize to 4096 to prevent buffer
> overflows. The copy_file() function is requesting 8192 bytes from the
> nfs_file_read() function which has only a4096 block size. In this case,
> the NFS server does not respond to the request. I get the following error:
> RPCIO: server '192.168.21.204' not responding - still trying
> NFS (proc 6) - RPC: Timed out
What is the NFS server ?
I have been running this code on MCF5235 and PC BSPs connected to a
Linux NFS server and saw no problems.
More information about the users