diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-06-30 10:02:57 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-09 16:06:37 -0500 |
commit | fc5b81d1f6df7342f0963120b2cf3e919d6fc08a (patch) | |
tree | 039af2c51677ee408f18873f697b7f9b80c64715 /qemu-options.hx | |
parent | df7a607b6b1cf3966ba30e7c7bae7c1ae348d679 (diff) |
net: set a default value for sndbuf=
On reflection, perhaps it does make sense to set a default value for
the sndbuf= tap parameter.
For best effect, sndbuf= should be set to just below the capacity of
the physical NIC.
Setting it higher will cause packets to be dropped before the limit
is hit. Setting it much lower will not cause any problems unless
you set it low enough such that the guest cannot queue up new packets
before the NIC has emptied its queue.
In Linux, txqueuelen=1000 by default for ethernet NICs. Given a 1500
byte MTU, 1Mb is a good choice for sndbuf.
If it turns out that txqueuelen is actually much lower than this, then
sndbuf is essentially disabled. In the event that txqueuelen is much
higher, it's unlikely that the NIC will be able to empty a 1Mb queue.
Thanks to Herbert Xu for this logic.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Cc: Herbert Xu <herbert.xu@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-options.hx')
-rw-r--r-- | qemu-options.hx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qemu-options.hx b/qemu-options.hx index a94f9d38aa..8947d05393 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -778,7 +778,8 @@ DEF("net", HAS_ARG, QEMU_OPTION_net, " use '[down]script=no' to disable script execution;\n" " use 'fd=h' to connect to an already opened TAP interface\n" #ifdef TUNSETSNDBUF - " use 'sndbuf=nbytes' to limit the size of the send buffer\n" + " use 'sndbuf=nbytes' to limit the size of the send buffer; the\n" + " default of 'sndbuf=1048576' can be disabled using 'sndbuf=0'\n" #endif #endif "-net socket[,vlan=n][,name=str][,fd=h][,listen=[host]:port][,connect=host:port]\n" |