Page MenuHomeFreeBSD

bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()
ClosedPublic

Authored by vmaffione on Jun 9 2019, 9:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 8:45 AM
Unknown Object (File)
Mon, Apr 8, 4:19 PM
Unknown Object (File)
Feb 23 2024, 4:34 AM
Unknown Object (File)
Jan 28 2024, 4:09 AM
Unknown Object (File)
Jan 28 2024, 4:09 AM
Unknown Object (File)
Jan 28 2024, 4:09 AM
Unknown Object (File)
Jan 12 2024, 7:35 AM
Unknown Object (File)
Dec 30 2023, 5:27 PM

Details

Summary

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

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

pmooney_pfmooney.com added inline comments.
usr.sbin/bhyve/pci_virtio_block.c
42

Worth adding the include to virtio.h rather than requiring it in each of the consumers?

usr.sbin/bhyve/pci_virtio_block.c
42

Agree, that was also my idea. But I observed that virtio.h does not include anything, so I assumed there was a reason for that.
Does anyone have objections on adding include <machine/atomic.h> in virtio.h?

Moved include <machine/atomic.h> to virtio.h.

In D20581#445096, @v.maffione_gmail.com wrote:

Moved include <machine/atomic.h> to virtio.h.

I am ok with this, but could you please produce your diff relative to /usr/src?

This revision is now accepted and ready to land.Jun 10 2019, 8:34 PM

Provide patch relative to /usr/src/.

This revision now requires review to proceed.Jun 10 2019, 8:35 PM
This revision is now accepted and ready to land.Jun 10 2019, 8:40 PM
This revision was automatically updated to reflect the committed changes.