You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**CLI**: `vmm-cli.py deploy --net bridge`, `--net user`, or `--net macvtap`
25
25
-**Web UI**: Networking dropdown in the deploy dialog
26
26
-**API**: `networking: { mode: "bridge" }` in `VmConfiguration`
27
27
28
-
Only the mode is per-VM; the bridge interface name always comes from the global config.
28
+
The bridge interface name comes from the global config unless the node lists it in `cvm.allowed_bridges`. VMs may also override the vhost and queue settings — see [network-data-plane.md](network-data-plane.md).
29
29
30
30
## Host setup
31
31
@@ -143,9 +143,15 @@ mode = "bridge"
143
143
bridge = "dstack-br0"
144
144
```
145
145
146
-
### QEMU bridge helper setup (required for both options)
146
+
### QEMU bridge helper setup (needed unless every bridge NIC goes through netd)
147
147
148
148
The bridge helper allows QEMU to create and attach TAP devices without VMM needing root privileges.
149
+
It is used only on the single-queue bridge paths; a NIC that `netd` builds never touches it, so a
150
+
node that runs `netd` for all of its bridge VMs does not need it at all.
151
+
152
+
The VMM probes `/usr/lib/qemu/qemu-bridge-helper`, `/usr/libexec/qemu-bridge-helper` and
153
+
`/usr/local/libexec/qemu-bridge-helper`. Set `cvm.qemu_bridge_helper` in `vmm.toml` for a path
- VMM passes `-netdev bridge,id=net0,br=<bridge>` to QEMU
163
-
- QEMU's bridge helper (setuid) creates a TAP device and attaches it to the bridge
168
+
- With more than one queue pair, or with libvirt filtering on, `netd` creates the TAP and the VMM passes `-netdev tap,id=net0,ifname=<tap>,...` — this is the usual case on a node running `netd` with multi-vCPU VMs, since queue pairs default to the VM's vCPU count. Without `netd`, a bridge NIC that took that default drops back to one queue pair and takes a helper path below
169
+
- Otherwise the VMM passes `-netdev tap,id=net0,br=<bridge>,helper=<qemu-bridge-helper>,vhost=on`, or `-netdev bridge,id=net0,br=<bridge>` when vhost is off or no helper is found
170
+
- QEMU's bridge helper (setuid) creates a TAP device and attaches it to the bridge on the two helper paths
164
171
- Guest MAC address is derived from SHA256 of the VM ID, with an optional configurable prefix (stable across restarts for DHCP IP consistency)
165
172
- The host DHCP server (dnsmasq) assigns an IP to the VM
166
-
-When QEMU exits, the TAP device is automatically destroyed
167
-
- VMM does not need root or`CAP_NET_ADMIN`
173
+
-On the two bridge-helper paths the TAP disappears when QEMU exits; a `netd`-created TAP is persistent and is deleted when the VMM tears the VM's networking down
174
+
-The VMM process itself needs neither root nor`CAP_NET_ADMIN` on any path; the `netd` path moves that privilege into a separate root service instead
168
175
169
176
### MAC address prefix
170
177
@@ -194,13 +201,15 @@ The remaining bytes are derived from the VM ID hash. The prefix applies to all n
194
201
195
202
### Mixing networking modes
196
203
197
-
Bridge and passt VMs can coexist. Set the global default in `vmm.toml` and override per-VM as needed:
204
+
Bridge and user-mode VMs can coexist. Set the global default in `vmm.toml` and override per-VM as needed:
198
205
199
206
```bash
200
-
# Global default is bridge, but deploy this VM with passt
# Global default is bridge, but deploy this VM with user networking
208
+
vmm-cli.py deploy --name my-vm --image dstack-0.5.6 --compose app.yaml --net user
202
209
```
203
210
204
-
### vhost-net and TDX
211
+
### vhost-net and multiqueue
212
+
213
+
Bridge NICs use the host kernel's vhost-net data plane by default, and can expose several virtio-net queue pairs. Both are configurable per node and per VM — see [network-data-plane.md](network-data-plane.md) for the knobs, the mode support matrix, and how to pick a queue count.
205
214
206
-
vhost-net (kernel data plane offload for virtio-net) is **not enabled** for bridge mode. TDX encrypts guest memory, which prevents the host kernel from performing DMA-based packet offload. The default QEMU userspace virtio backend is used instead.
215
+
vhost-net works in a TDX guest: the virtio rings and buffers live in shared, unencrypted memory so that a host-side backend can reach them, which is the same mechanism `vhost-vsock-pci` has always relied on.
0 commit comments