]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: abstraction for network backends
authorvmaffione <vmaffione@FreeBSD.org>
Sun, 7 Jul 2019 12:15:24 +0000 (12:15 +0000)
committervmaffione <vmaffione@FreeBSD.org>
Sun, 7 Jul 2019 12:15:24 +0000 (12:15 +0000)
commitc8edafdabc27533d9c51eddc2896e772c16d965c
tree28cf1dd98ed4d79f50fe707fa8d3a31d2fc8cc93
parent046654912ae2640691c9c22263af62da34346d74
bhyve: abstraction for network backends

Bhyve can currently emulate two virtual NICs, namely virtio-net and e1000,
and connect to the host network through two backends, namely tap and netmap.
However, there is no interface between virtual NIC functionalities and
backend functionalities. As a result, the backend code is duplicated between
the two virtual NIC implementations and also within the same virtual NIC.
Also, e1000 cannot currently use netmap as a backend.
This patch introduces a network backend API between virtio-net/e1000 and
tap/netmap, to improve code reuse and add missing functionalities.
Virtual NICs and backends can negotiate virtio-net features, such as checksum
offload and TSO. If the backend supports the features, it will propagate this
information to the guest, so that the latter can make use of them. Currently,
only netmap VALE ports support the features, but support should be added to
tap in the future.

Reviewed by: jhb, bryanv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20659
usr.sbin/bhyve/Makefile
usr.sbin/bhyve/net_backends.c [new file with mode: 0644]
usr.sbin/bhyve/net_backends.h [new file with mode: 0644]
usr.sbin/bhyve/pci_e82545.c
usr.sbin/bhyve/pci_virtio_net.c