Page MenuHomeFreeBSD

bhyve: change vq_getchain to return iovecs in both directions
ClosedPublic

Authored by khng on Mar 26 2021, 5:25 PM.
Tags
None
Referenced Files
F81617359: D29433.id86355.diff
Fri, Apr 19, 1:15 AM
Unknown Object (File)
Wed, Apr 17, 6:29 PM
Unknown Object (File)
Fri, Mar 29, 1:46 AM
Unknown Object (File)
Feb 13 2024, 8:47 PM
Unknown Object (File)
Feb 11 2024, 9:36 PM
Unknown Object (File)
Jan 30 2024, 2:11 AM
Unknown Object (File)
Jan 30 2024, 2:10 AM
Unknown Object (File)
Jan 30 2024, 2:10 AM

Details

Summary

bhyve: change vq_getchain to return read and write iovecs

The old prototype requires callers to inspect flags of each descriptors
to get the starting position of host-to-guest iovecs.

vq_getchain() is changed to return a virtio request with both the
guest-to-host iovecs and host-to-guest iovecs recorded instead.
Callers can obtain the host-to-guest iovecs directly.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38090
Build 34979: arc lint + arc unit

Event Timeline

khng requested review of this revision.Mar 26 2021, 5:25 PM
  • Fixed loopy check fallout out when num of descs are equal to maximum number
  • No need to use memset in vq_getchain
afedorov added inline comments.
usr.sbin/bhyve/pci_virtio_9p.c
201–202

It looks like the flags[] array is no longer used.

216

Debug output doesn't make sense anymore.

  • Remove unused flags from pci_vt9p_notify
khng marked 2 inline comments as done.Mar 27 2021, 8:33 AM
afedorov added inline comments.
usr.sbin/bhyve/pci_virtio_scsi.c
623–624

enqueuedvi -> enqueued

This revision is now accepted and ready to land.Mar 28 2021, 8:59 AM
khng retitled this revision from bhyve: vq_getchain returns read iovecs and write iovecs to bhyve: change vq_getchain to return iovecs in both directions.Mar 29 2021, 5:57 PM
khng marked an inline comment as done.

Refactor the prototype to match vq_ring_enqueue_segments in sys/dev/virtio/virtqueue.c.

This revision now requires review to proceed.Mar 29 2021, 5:59 PM

@afedorov I would like to have some comments on this again.

usr.sbin/bhyve/pci_virtio_block.c
348

The previous comment inside the loop (deleted lines 348-354 in this diff) was a little clearer. I agree that the assertion should be outside the loop but the comment could be a little clearer. To a casual reader, the assertion is inverted.

usr.sbin/bhyve/virtio.c
277

It would look very slightly neater to initialise this further down, rather than where it's declared. None of the other stack variables are initialised at the top of this function.

286

E.g. initialise req = { 0 }; here.

Great! Thank you.

Approved by: philip (mentor)

This revision is now accepted and ready to land.Mar 30 2021, 2:48 AM
afedorov added inline comments.
usr.sbin/bhyve/virtio.c
216–218

“vs” argument is unused.

khng marked 2 inline comments as done.Mar 30 2021, 7:55 AM