Page MenuHomeFreeBSD

bhyve: add support for ng_device network backend
ClosedPublic

Authored by quentin.thebault_defenso.fr on Sep 15 2025, 3:58 AM.
Tags
None
Referenced Files
F138139039: D52542.id162409.diff
Sat, Nov 29, 5:10 AM
F138092007: D52542.id162128.diff
Fri, Nov 28, 8:07 PM
Unknown Object (File)
Thu, Nov 27, 5:25 PM
Unknown Object (File)
Thu, Nov 27, 3:26 PM
Unknown Object (File)
Thu, Nov 27, 1:48 PM
Unknown Object (File)
Tue, Nov 25, 6:33 PM
Unknown Object (File)
Tue, Nov 25, 2:23 AM
Unknown Object (File)
Tue, Nov 25, 1:32 AM

Details

Summary

Signed-off-by: Quentin Thébault <quentin.thebault@defenso.fr>
Sponsored by: Defenso

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The bhyve.8 man page needs to be updated to mention the new backend.

usr.sbin/bhyve/net_backends.c
123

The && should be on the previous line.

Added bhyve.8 changes and fixed if syntax.

quentin.thebault_defenso.fr added inline comments.
usr.sbin/bhyve/net_backends.c
123

Done, thank you.

quentin.thebault_defenso.fr marked an inline comment as done.

Removed superfluous Xo and Xc in bhyve.8

tap_init() will open the device and add it to the mevent loop, which uses kevent() under the hood. But, ng_device doesn't implement d_kqfilter, i.e., ngd_cdevsw doesn't have a d_kqfilter implementation, in contrast with tap devices. How does bhyve know when to read packets from the device?

usr.sbin/bhyve/bhyve.8
551

New sentences should start on new lines.

tap_init() will open the device and add it to the mevent loop, which uses kevent() under the hood. But, ng_device doesn't implement d_kqfilter, i.e., ngd_cdevsw doesn't have a d_kqfilter implementation, in contrast with tap devices. How does bhyve know when to read packets from the device?

Please have a look at parent revision D52541, which adds kevent support to ng_device.

tap_init() will open the device and add it to the mevent loop, which uses kevent() under the hood. But, ng_device doesn't implement d_kqfilter, i.e., ngd_cdevsw doesn't have a d_kqfilter implementation, in contrast with tap devices. How does bhyve know when to read packets from the device?

Please have a look at parent revision D52541, which adds kevent support to ng_device.

Aha! :) I left some comments there.

This diff looks ok to me.

usr.sbin/bhyve/bhyve.8
549
quentin.thebault_defenso.fr marked an inline comment as done.

Add reference to netgraph(4)

This looks ok to me, but it depends on the other revision, which is as-yet unfinished.

This revision is now accepted and ready to land.Oct 17 2025, 4:55 PM