This change makes the virtio-net emulated PCI device hotpluggable
by implementing the appropriate teardown method and adding the
appropriate device initialization routines to libbbhyve.
Details
- Reviewers
- None
- Group Reviewers
bhyve
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 69805 Build 66688: arc lint + arc unit
Event Timeline
| usr.sbin/bhyve/pci_virtio_net.c | ||
|---|---|---|
| 687 | Same as D54655: the TX thread sits in pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx), so cancelling it leaves tx_mtx locked when it is destroyed. If the cancel arrives while the thread is sending, it stops at the writev() in netbe_send() with a descriptor chain half processed. A stop flag checked in the wait loop, plus pthread_cond_broadcast() and pthread_join(), avoids both. | |
| 695 | Same tap_cleanup() fd-reuse problem as in D54655 (mevent_delete() followed by an immediate close()); we saw it with virtio-net: roughly 1 in 20 re-plugged NICs got no DHCP lease. mevent_delete_close() fixes it. | |
| 696 | As in D54655, an RX callback already dispatched by the mevent thread can run after this free(sc). Here receive is not disabled before the backend is cleaned up, so the window is wider. | |