]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()
authorvmaffione <vmaffione@FreeBSD.org>
Tue, 11 Jun 2019 15:52:41 +0000 (15:52 +0000)
committervmaffione <vmaffione@FreeBSD.org>
Tue, 11 Jun 2019 15:52:41 +0000 (15:52 +0000)
commit59105dcf0774512011e9a73e9d1ed3876235d249
treebdeedee0bc2b99df0a4847b9a4169a121d6b00db
parentb88349203f128c339e91811bb399c83cc09a4d6a
bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()

The VirtIO standard supports two schemes for notification suppression:
a notification enable bit and a more sophisticated one (event_idx) that
also supports delayed notifications. Currently bhyve fully supports
only the first scheme. This patch hides the notification suppression
internals by means of two inline routines, vq_kick_enable() and
vq_kick_disable(), and makes the code more readable.
Moreover, further improve readability by replacing the call to mb()
with a call to atomic_thread_fence_seq_cst(), which is already used
in virtio.c

Reviewed by: pmooney_pfmooney.com, bryanv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20581
usr.sbin/bhyve/pci_virtio_console.c
usr.sbin/bhyve/pci_virtio_net.c
usr.sbin/bhyve/pci_virtio_scsi.c
usr.sbin/bhyve/virtio.c
usr.sbin/bhyve/virtio.h