Page MenuHomeFreeBSD

bhyve: Move the slirp backend out into a separate process
Needs ReviewPublic

Authored by markj on Wed, Oct 29, 8:36 PM.
Tags
None
Referenced Files
F134041740: D53454.id.diff
Thu, Oct 30, 6:37 AM
F134041642: D53454.id165356.diff
Thu, Oct 30, 6:35 AM
F134019661: D53454.id165355.diff
Thu, Oct 30, 2:07 AM
F134015374: D53454.diff
Thu, Oct 30, 1:17 AM
F134012990: D53454.diff
Thu, Oct 30, 12:48 AM
F134012952: D53454.diff
Thu, Oct 30, 12:47 AM
F134010490: D53454.id165355.diff
Thu, Oct 30, 12:19 AM
F134007559: D53454.id165356.diff
Wed, Oct 29, 11:53 PM

Details

Reviewers
None
Group Reviewers
bhyve
Summary

The previous implementation implemented hostfwd rules which would allow
the host to connect to the guest via a NATed TCP connection. libslirp
also permits NAT in the other direction, but this was prevented by
bhyve's capsicum sandbox.

To make the slirp backend more useful, split the backend out into a
separate process which does not enter capability mode if outbound
connections are permitted (enabled by setting the new "open" keyword).
The process communicates with the bhyve network frontend (typically a
virtio network interface) using a unix SOCK_SEQPACKET socket pair. If
the bhyve process exits, the helper will automatically exit.

Aside from this restructuring, there is not much actual change. Many
slirp parameters are still hard-coded for now, though this may change.
The "restricted" feature is toggled by the new "open" keyword; the
backend is restricted by default for compatibility with 15.0 and 14.3.

Each packet now has to traverse an extra socket, but this overhead
should be acceptable given that the slirp backend cannot be said to
provide high-performance networking. With iperf3 I can get 4Gbps from
the guest to the host.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 68244
Build 65127: arc lint + arc unit