On 2018年10月15日 16:20, Wei Xu wrote:
+static void virtio_queue_set_notification_packed(VirtQueue *vq, int enable)
+{
+ VRingPackedDescEvent e;
+ VRingMemoryRegionCaches *caches;
+
+ rcu_read_lock();
+ caches = vring_get_region_caches(vq);
+ vring_packed_event_read(vq->vdev, &caches->device, &e);
+
+ if (!enable) {
+ e.flags = RING_EVENT_FLAGS_DISABLE;
+ goto out;
+ }
+
+ e.flags = RING_EVENT_FLAGS_ENABLE;
+ if (virtio_vdev_has_feature(vq->vdev, VIRTIO_RING_F_EVENT_IDX)) {
+ uint16_t off_wrap = vq->event_idx | vq->event_wrap_counter << 15;
Btw, why not just use shadow_avail_idx here?
It is nice to do that but an issue here is that it is 'shadow_avail_idx' for
Rx but 'used_idx' for Tx when setting up for a kick, haven't figured out a
clear fix because it helps easier migration part work, any idea?
Wei
I'm not sure I get the point here. Why need to care about used_idx when
enabling guest kick?
Thanks