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
F145776563: D52542.id162040.diff
Tue, Feb 24, 8:42 AM
F145755397: D52542.id162040.diff
Tue, Feb 24, 12:57 AM
Unknown Object (File)
Fri, Feb 20, 9:44 AM
Unknown Object (File)
Fri, Feb 20, 8:38 AM
Unknown Object (File)
Wed, Feb 18, 5:41 PM
Unknown Object (File)
Wed, Feb 18, 3:25 PM
Unknown Object (File)
Wed, Feb 18, 1:28 PM
Unknown Object (File)
Wed, Feb 18, 1:07 PM

Details

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)

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