File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 1212 kernel initrdPath
1313 storeOnDisk storeDisk ;
1414
15+ tapMultiQueue = vcpu > 1 ;
16+
1517 inherit ( import ../. { nixpkgs-lib = pkgs . lib ; } ) withDriveLetters ;
1618 volumes = withDriveLetters microvmConfig ;
1719
6365 echo '${ builtins . toJSON data } ' | nc -U "${ socket } "
6466 '' ;
6567in {
68+ inherit tapMultiQueue ;
69+
6670 command = lib . escapeShellArgs (
6771 [
6872 "${ pkgs . stratovirt } /bin/stratovirt"
112116 [
113117 ( if type == "macvtap" then "tap" else "${ type } " )
114118 "id=${ id } "
119+ "queues=${ toString ( lib . min 16 vcpu ) } "
115120 ]
116121 ++ lib . optionals ( type == "user" && forwardPortsOptions != [ ] ) forwardPortsOptions
117122 ++ lib . optionals ( type == "bridge" ) [
@@ -126,7 +131,15 @@ in {
126131 )
127132 )
128133 # TODO: devType (0x10 + i)
129- "-device" "virtio-net-${ devType 30 } ,id=net_${ id } ,netdev=${ id } ,mac=${ mac } "
134+ "-device" (
135+ lib . concatStringsSep "," [
136+ "virtio-net-${ devType 30 } "
137+ "id=net_${ id } "
138+ "netdev=${ id } "
139+ "mac=${ mac } "
140+ "mq=${ if tapMultiQueue then "on" else "off" } "
141+ ]
142+ )
130143 ] ) interfaces
131144 )
132145 ++
You can’t perform that action at this time.
0 commit comments