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 12
12
kernel initrdPath
13
13
storeOnDisk storeDisk ;
14
14
15
+ tapMultiQueue = vcpu > 1 ;
16
+
15
17
inherit ( import ../. { nixpkgs-lib = pkgs . lib ; } ) withDriveLetters ;
16
18
volumes = withDriveLetters microvmConfig ;
17
19
63
65
echo '${ builtins . toJSON data } ' | nc -U "${ socket } "
64
66
'' ;
65
67
in {
68
+ inherit tapMultiQueue ;
69
+
66
70
command = lib . escapeShellArgs (
67
71
[
68
72
"${ pkgs . stratovirt } /bin/stratovirt"
112
116
[
113
117
( if type == "macvtap" then "tap" else "${ type } " )
114
118
"id=${ id } "
119
+ "queues=${ toString ( lib . min 16 vcpu ) } "
115
120
]
116
121
++ lib . optionals ( type == "user" && forwardPortsOptions != [ ] ) forwardPortsOptions
117
122
++ lib . optionals ( type == "bridge" ) [
@@ -126,7 +131,15 @@ in {
126
131
)
127
132
)
128
133
# 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
+ )
130
143
] ) interfaces
131
144
)
132
145
++
You can’t perform that action at this time.
0 commit comments