[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080728190707.329d247b@osprey.hogchain.net>
Date: Mon, 28 Jul 2008 19:07:07 -0500
From: Jay Cliburn <jacliburn@...lsouth.net>
To: netdev@...r.kernel.org
Cc: ian@...fray.co.uk
Subject: sendfile() behavior while troubleshooting netdevice
I'm troubleshooting the problem reported here and I need some help:
http://lkml.org/lkml/2008/7/15/325.
Summary of problem:
sendfile() + TSO + atl1 driver == corrupted file at the receiver
According to the reporter, remove either sendfile() or TSO from the
equation and no corruption occurs.
In order to bound the scope of the problem, I wrote a little sendfile()
client/server program so I can control the data being transferred and
isolate the cause of the corruption, but I can't get the program to
work right no matter *what* NIC or kernel version I use. I get
corrupted data at the receiver. Where am I going wrong?
Basically, the server listens on port 5000. The client connects and
sends the filename it wants to fetch from the server. The server
responds with the size of the file first, then calls sendfile() to ship
the file proper.
At small file sizes (<10k ish), I get good copies most of the time.
At larger file sizes (e.g. 150k), I *never* get a good copy.
Here's an example.
The hosts:
server, petrel, r8169, 192.168.1.6, 2.6.20-1.2320.fc5
client, sparrow, e100, 192.168.1.195, 2.6.25.6-27.fc8
(Note that neither of these hosts uses the atl1 driver, however I get
similar behavior whenever I employ a host that does.)
[jcliburn@...rel ~]$ ./sfsrv
sending file 'testfile' size 1600 bytes
1600 bytes sent
sending file 'testfile' size 1600 bytes
1600 bytes sent
sending file 'testfile' size 1600 bytes
1600 bytes sent
[jcliburn@...rrow ~]$ ./sfcli 192.168.1.6 testfile
connected...
file size is 1600 bytes
received 1600 bytes
[jcliburn@...rrow ~]$ ./sfcli 192.168.1.6 testfile
connected...
file size is 1600 bytes
received 1600 bytes
[jcliburn@...rrow ~]$ ./sfcli 192.168.1.6 testfile
connected...
file size is 1600 bytes
received 1592 bytes
error: expected 1600, received 1592
The last round came up short 8 bytes. Any idea why? Client and server
source code attached.
It doesn't matter which host is the server or client; data is lost
either way.
Thanks for any assistance.
Jay
View attachment "sfclient.c" of type "text/x-csrc" (2224 bytes)
View attachment "sfserver.c" of type "text/x-csrc" (2423 bytes)
Powered by blists - more mailing lists