Page MenuHomeFreeBSD

if_veb: Add veb(4) pseudo network device
Needs ReviewPublic

Authored by acesp25 on Sun, Oct 18, 5:58 AM.
Tags
None
Referenced Files
F176394152: D60834.diff
Sun, Oct 18, 12:57 PM
F176387922: D60834.id190172.diff
Sun, Oct 18, 11:32 AM
F176374573: D60834.diff
Sun, Oct 18, 8:39 AM
F176365716: D60834.id190172.diff
Sun, Oct 18, 6:45 AM
F176365546: D60834.diff
Sun, Oct 18, 6:42 AM
F176365463: D60834.id.diff
Sun, Oct 18, 6:41 AM

Details

Reviewers
melifaro
Summary

veb(4) is a minimal L2 Ethernet bridge for virtual topologies such
as bhyve(8) VMs and VNET jail(8)s. It is modeled on OpenBSD's veb(4)
and derived from if_bridge.c, but it is not a replacement for
bridge(4): it has no STP, no pfil(9) hooks, and no implicit host
presence. The host joins a veb explicitly through a vport,
which behaves as an ordinary Ethernet interface.

veb is configured over netlink, and ifconfig(8) gains veb support.
Because veb ports reuse ifp->if_bridge, bridge_ifdetach() now checks
that the departing interface's if_bridge_input is bridge_input
before treating if_bridge as one of its members.

Notes:

  • Control plane is netlink-only (IFLA_INFO_DATA for link attributes, plus a small "veb" genl family for the address table)
  • Follow-up: ifconfig.8 documentation for veb commands

Feedback is especially welcome on the netlink implementation and the vport design.

Test Plan

17 tests in total, to run the tests:

$ kyua test -k /usr/tests/sys/net/Kyuafile if_veb
if_veb:bridge_mutual_exclusion  ->  passed  [0.098s]
if_veb:create_destroy  ->  passed  [0.083s]
if_veb:delete_with_ports  ->  passed  [0.083s]
if_veb:flags  ->  passed  [0.103s]
if_veb:learning  ->  passed  [0.139s]
if_veb:mtu  ->  passed  [0.130s]
if_veb:no_host_presence  ->  passed  [1.159s]
if_veb:port_add_del  ->  passed  [0.106s]
if_veb:port_departure  ->  passed  [0.079s]
if_veb:private_ports  ->  passed  [2.241s]
if_veb:static_addresses  ->  passed  [0.149s]
if_veb:timeout  ->  passed  [0.072s]
if_veb:transmit_ipv4_multicast  ->  passed  [1.171s]
if_veb:transmit_ipv4_unicast  ->  passed  [0.098s]
if_veb:unprivileged  ->  passed  [0.076s]
if_veb:vport_constraints  ->  passed  [0.097s]
if_veb:vport_host_path  ->  passed  [0.086s]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 78330
Build 75213: arc lint + arc unit