aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bbot/agent/machine.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx
index db51e0b..14b4e21 100644
--- a/bbot/agent/machine.cxx
+++ b/bbot/agent/machine.cxx
@@ -96,6 +96,13 @@ namespace bbot
run_exit (trace, "sudo", "ip", "tuntap", "delete", t, "mode", "tap");
run (trace, "sudo", "ip", "tuntap", "add", t, "mode", "tap", "user", uid);
+
+ // Increase the transmission queue from default 1000 to prevent dropping
+ // packets under high load. See also rx/tx_queue_size in the QEMU
+ // networking setup (it's fuzzy how this is all related to each other).
+ //
+ run (trace, "sudo", "ip", "link", "set", t, "txqueuelen", "10000");
+
run (trace, "sudo", "ip", "link", "set", t, "up");
run (trace, "sudo", "ip", "link", "set", t, "master", br);
@@ -289,8 +296,14 @@ namespace bbot
// Network.
//
+ // The rx/tx queue size is between 256 (default) and 1024 and must be a
+ // power of 2. Also, maximum (1024) requires some extra support from the
+ // guest driver so we start with 512.
+ //
add ("-netdev", "tap,id=net0,script=no,ifname=" + net.iface);
- add ("-device", "virtio-net-pci,netdev=net0,mac=" + mac);
+ add ("-device", ("virtio-net-pci,netdev=net0,mac=" + mac +
+ ",tx_queue_size=512" +
+ ",rx_queue_size=512"));
// Disk.
//