I did some additional research and looks like Iperf client reports the amount 
of data sent by adding up the return values of write() system calls. For 
example below are two write() call cycles by Iperf client:

[pid 14025] 
write(3,"\0\0\0\16T\n\331a\0\3\2563\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\17B@"...,1470)
 = 1470
[pid 14025] nanosleep({0, 11071000},  <unfinished ...>
[pid 14026] <... nanosleep resumed> NULL) = 0
[pid 14026] nanosleep({0, 10000000}, NULL) = 0
[pid 14026] nanosleep({0, 10000000},  <unfinished ...>
[pid 14025] <... nanosleep resumed> 0xb74ba2c8) = 0
[pid 14025] gettimeofday({1409997153, 252946}, NULL) = 0
[pid 14025] 
write(3,"\0\0\0\17T\n\331a\0\3\334\22\0\0\0\0\0\0\0\1\0\0\23\211\0\0\0\0\0\17B@"...,1470)
 = 1470
[pid 14025] nanosleep({0, 11088000},  <unfinished ...>
[pid 14026] <... nanosleep resumed> NULL) = 0
[pid 14026] nanosleep({0, 10000000},  <unfinished ...>
[pid 14025] <... nanosleep resumed> 0xb74ba2c8) = 0
[pid 14025] gettimeofday({1409997153, 264721}, NULL) = 0


If write to socket was successful, i.e. kernel accepted the data, then return 
value(integer on the right of the equals sign) is the same as number of bytes 
requested for writing. If kernel did not accept the data(for example ENOBUFS is 
returned), then return value is a negative integer. I wrote a small program in 
C which writes a string into file and here is the strace comparison when 
write() is successful:

open("/media/file.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
write(3, "Test string\n", 12)           = 12
exit_group(12)                          = ?

..and when the media is full:

open("/media/file.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
write(3, "Test string\n", 12)           = -1 ENOSPC (No space left on device)
exit_group(-1)                          = ?


In a nutshell, behavior where Iperf client sends less data than specified with 
--bandwidth option in UDP mode, is not a bug. This ticket can be closed.


regards,
Martin Tonusoo
--------------------------
      LINXTELECOM
 www.linxtelecom.com
--------------------------
NOC 24/7: +372 622 3300


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to