|
From: | Jason Wang |
Subject: | Re: [Qemu-devel] [[RFC v3 03/12] virtio: init memory cache for packed ring |
Date: | Mon, 15 Oct 2018 15:54:08 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 2018年10月15日 15:09, Wei Xu wrote:
-hwaddr virtio_queue_get_avail_size(VirtIODevice *vdev, int n) +hwaddr virtio_queue_get_driver_size(VirtIODevice *vdev, int n) { - return offsetof(VRingAvail, ring) + - sizeof(uint16_t) * vdev->vq[n].vring.num; + int s; + + if (virtio_vdev_has_feature(vdev, VIRTIO_F_RING_PACKED)) { + return sizeof(struct VRingPackedDescEvent); + } else { + s = virtio_vdev_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + return offsetof(VRingAvail, ring) + + sizeof(uint16_t) * vdev->vq[n].vring.num + s;I tend to move this to an independent patch.You mean this two functions? Wei
I mean moving the adding of event to get_avail()/get_used(). Thanks
[Prev in Thread] | Current Thread | [Next in Thread] |