char: tcp: increase size of buffer that holds data to be sent out
PATCH 1/1 char: tcp: increase size of buffer that holds data to be sent out
1k is too less; at least send out 4k of data from a chardev.
--- qemu-char.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-char.c +1 -1
@@ -1996,7 +1996,7 @@ static void tcp_chr_read(void *opaque) {CharDriverState *chr = opaque;TCPCharDriver *s = chr->opaque; -uint8_t buf[1024 ]; +uint8_t buf[4096 ];int len, size;if (!s->connected || s->max_size <=0 )
Signature · 1 line
1.6.2.5
Quoted 1 line · Amit Shah
1k is too less; at least send out 4k of data from a chardev.
This one only touches unix/tcp sockets; the others use a 1k buffer as well; I'll send a new patch that converts all the users to a consistent buffer size.
Quoted 22 lines
Signed-off-by Amit Shah <[email protected]>--- qemu-char.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)qemu-char.c +1
-1@@ -1996,7 +1996,7 @@ static void tcp_chr_read(void *opaque) {CharDriverState *chr = opaque;TCPCharDriver *s = chr->opaque; -uint8_t buf[1024 ]; +uint8_t buf[4096 ];int len, size;if (!s->connected || s->max_size <=0 )Signature · 1 line
1.6.2.5
Amit
Quoted 2 lines · Amit Shah
1k is too less; at least send out 4k of data from a chardev.
Why is 1k too small?
Regards,
Anthony Liguori
Quoted 5 lines · Anthony Liguori
Quoted 2 lines · Amit Shah
1k is too less; at least send out 4k of data from a chardev.
Why is 1k too small?
Definitely depends on the apps that pump in the data. If an app has data to pump, it will keep pumping as much data as possible (eg, Linux syscalls issue read / write requests for 32k bytes of data).
The char devices have a 'can_read' call to determine how much the backend can accept.
We're artificially limiting to 1k in this code, even if the app can pump and the backend can receive, resulting in multiple splits.
In the case of virtio, 4k is available if the guest is able to receive data.
Amit