FreeBSD/src b7e2672 (r350193)usr.sbin/bhyve net_backends.c pci_virtio_net.c

MFC r349803

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
Differential Revision:  https://reviews.freebsd.org/D20659
DeltaFile
+806-0usr.sbin/bhyve/net_backends.c
+100-498usr.sbin/bhyve/pci_virtio_net.c
+87-0usr.sbin/bhyve/net_backends.h
+15-68usr.sbin/bhyve/pci_e82545.c
+2-1usr.sbin/bhyve/Makefile
+1,010-5675 files

UnifiedSplitRaw