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>
2 files changed
tree: 039af2c51677ee408f18873f697b7f9b80c64715
  1. audio/
  2. block/
  3. bsd-user/
  4. darwin-user/
  5. fpu/
  6. gdb-xml/
  7. hw/
  8. linux-user/
  9. pc-bios/
  10. slirp/
  11. target-alpha/
  12. target-arm/
  13. target-cris/
  14. target-i386/
  15. target-m68k/
  16. target-microblaze/
  17. target-mips/
  18. target-ppc/
  19. target-sh4/
  20. target-sparc/
  21. tcg/
  22. tests/
  23. .gitignore
  24. a.out.h
  25. acl.c
  26. acl.h
  27. aes.c
  28. aes.h
  29. aio.c
  30. alpha-dis.c
  31. alpha.ld
  32. arm-dis.c
  33. arm-semi.c
  34. arm.ld
  35. balloon.h
  36. block.c
  37. block.h
  38. block_int.h
  39. bswap.h
  40. bt-host.c
  41. bt-host.h
  42. bt-vhci.c
  43. buffered_file.c
  44. buffered_file.h
  45. cache-utils.c
  46. cache-utils.h
  47. Changelog
  48. cmd.c
  49. cmd.h
  50. cocoa.m
  51. CODING_STYLE
  52. configure
  53. console.c
  54. console.h
  55. COPYING
  56. COPYING.LIB
  57. cpu-all.h
  58. cpu-common.h
  59. cpu-defs.h
  60. cpu-exec.c
  61. cris-dis.c
  62. curses.c
  63. curses_keys.h
  64. cutils.c
  65. d3des.c
  66. d3des.h
  67. def-helper.h
  68. device_tree.c
  69. device_tree.h
  70. dis-asm.h
  71. disas.c
  72. disas.h
  73. dma-helpers.c
  74. dma.h
  75. dyngen-exec.h
  76. elf.h
  77. elf_ops.h
  78. exec-all.h
  79. exec.c
  80. feature_to_c.sh
  81. gdbstub.c
  82. gdbstub.h
  83. gen-icount.h
  84. host-utils.c
  85. host-utils.h
  86. hostregs_helper.h
  87. hpet.h
  88. hppa-dis.c
  89. hppa.ld
  90. hxtool
  91. i386-dis.c
  92. i386.ld
  93. ia64.ld
  94. keymaps.c
  95. keymaps.h
  96. kqemu.c
  97. kqemu.h
  98. kvm-all.c
  99. kvm.h
  100. libfdt_env.h
  101. LICENSE
  102. loader.c
  103. m68k-dis.c
  104. m68k-semi.c
  105. m68k.ld
  106. MAINTAINERS
  107. Makefile
  108. Makefile.hw
  109. Makefile.target
  110. microblaze-dis.c
  111. migration-exec.c
  112. migration-tcp.c
  113. migration.c
  114. migration.h
  115. mips-dis.c
  116. mips.ld
  117. mipsel.ld
  118. module.c
  119. module.h
  120. monitor.c
  121. monitor.h
  122. nbd.c
  123. nbd.h
  124. net-checksum.c
  125. net.c
  126. net.h
  127. osdep.c
  128. osdep.h
  129. pci-ids.txt
  130. posix-aio-compat.c
  131. posix-aio-compat.h
  132. ppc-dis.c
  133. ppc.ld
  134. ppc64.ld
  135. qemu-aio.h
  136. qemu-binfmt-conf.sh
  137. qemu-char.c
  138. qemu-char.h
  139. qemu-common.h
  140. qemu-doc.texi
  141. qemu-img-cmds.hx
  142. qemu-img.c
  143. qemu-img.texi
  144. qemu-io.c
  145. qemu-lock.h
  146. qemu-log.h
  147. qemu-malloc.c
  148. qemu-monitor.hx
  149. qemu-nbd.c
  150. qemu-nbd.texi
  151. qemu-option.c
  152. qemu-option.h
  153. qemu-options.hx
  154. qemu-sockets.c
  155. qemu-tech.texi
  156. qemu-thread.c
  157. qemu-thread.h
  158. qemu-timer.h
  159. qemu-tool.c
  160. qemu.sasl
  161. qemu_socket.h
  162. readline.c
  163. readline.h
  164. README
  165. rules.mak
  166. s390-dis.c
  167. s390.ld
  168. savevm.c
  169. sdl.c
  170. sdl_keysym.h
  171. sdl_zoom.c
  172. sdl_zoom.h
  173. sdl_zoom_template.h
  174. sh4-dis.c
  175. softmmu-semi.h
  176. softmmu_defs.h
  177. softmmu_exec.h
  178. softmmu_header.h
  179. softmmu_template.h
  180. sparc-dis.c
  181. sparc.ld
  182. sparc64.ld
  183. sys-queue.h
  184. sysemu.h
  185. tap-win32.c
  186. targphys.h
  187. texi2pod.pl
  188. thunk.c
  189. thunk.h
  190. TODO
  191. tool-osdep.c
  192. translate-all.c
  193. uboot_image.h
  194. usb-bsd.c
  195. usb-linux.c
  196. usb-stub.c
  197. VERSION
  198. vgafont.h
  199. vl.c
  200. vnc-auth-sasl.c
  201. vnc-auth-sasl.h
  202. vnc-auth-vencrypt.c
  203. vnc-auth-vencrypt.h
  204. vnc-tls.c
  205. vnc-tls.h
  206. vnc.c
  207. vnc.h
  208. vnc_keysym.h
  209. vnchextile.h
  210. x86_64.ld
  211. x_keymap.c
  212. x_keymap.h