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)
Sun, Nov 10, 1:50 AM
Unknown Object (File)
Oct 21 2024, 3:48 PM
Unknown Object (File)
Oct 5 2024, 5:49 AM
Unknown Object (File)
Sep 28 2024, 1:54 AM
Unknown Object (File)
Sep 26 2024, 9:20 PM
Unknown Object (File)
Sep 19 2024, 8:44 AM
Unknown Object (File)
Sep 6 2024, 8:31 AM
Unknown Object (File)
Sep 1 2024, 1:22 AM

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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pmooney_pfmooney.com added inline comments.
usr.sbin/bhyve/pci_virtio_block.c
42 ↗(On Diff #58461)

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

usr.sbin/bhyve/pci_virtio_block.c
42 ↗(On Diff #58461)

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.