On Thu, May 10, 2018 at 03:10:53PM +0800, Nan Xiao wrote:
> Per my understanding, the tcpbench.Sflag (Socket buffer size) should
> only take effect when working in TCP mode.

Why?  The kernel provides socket buffers for all protocols.  Userland
can set them and the kernel does the appropriate things.  There is
no reason to restrict setting socket buffer size to TCP.

> But according to my testing,
> it also works when tcpbench client is in UDP mode:
> 
> (1) Set buffer size less than DEFAULT_UDP_PKT (1500 - 28):
> # tcpbench -u -S 1471 127.0.0.1
> tcpbench: write: Message too long

Of course it works for UDP.  That is the expected behavior.  UDP
is atomic and if the buffer is too small for a packet, you cannot
send.

> So I think maybe it is need to check whether client is in TCP mode
> before setting buffer size, and apologize if I am wrong:

I would be very surprized by this silent restriction of tcpbench.
If I test UDP, I want to see what the kernel does if I change the
socket buffer size.

bluhm

Reply via email to