Page MenuHomeFreeBSD

bhyve: add support for ng_device network backend
Needs ReviewPublic

Authored by quentin.thebault_defenso.fr on Sep 15 2025, 3:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 7:12 PM
Unknown Object (File)
Thu, Oct 9, 10:06 PM
Unknown Object (File)
Thu, Oct 9, 6:48 PM
Unknown Object (File)
Thu, Oct 9, 6:47 PM
Unknown Object (File)
Thu, Oct 9, 6:47 PM
Unknown Object (File)
Thu, Oct 9, 6:47 PM
Unknown Object (File)
Thu, Oct 9, 6:47 PM
Unknown Object (File)
Thu, Oct 9, 6:47 PM

Details

Reviewers
glebius
zlei
kevans
Group Reviewers
bhyve
Summary

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

Diff Detail

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

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)