@@ -958,6 +958,25 @@ static void virtqueue_vring_init_split(struct vring_virtqueue *vq)
}
}
+static void virtqueue_reinit_split(struct vring_virtqueue *vq)
+{
+ int size, i;
+
+ memset(vq->split.vring.desc, 0, vq->split.queue_size_in_bytes);
+
+ size = sizeof(struct vring_desc_state_split) * vq->split.vring.num;
+ memset(vq->split.desc_state, 0, size);
+
+ size = sizeof(struct vring_desc_extra) * vq->split.vring.num;
+ memset(vq->split.desc_extra, 0, size);
+
+ for (i = 0; i < vq->split.vring.num - 1; i++)
+ vq->split.desc_extra[i].next = i + 1;
+
+ virtqueue_init(vq, vq->split.vring.num);
+ virtqueue_vring_init_split(vq);
+}
+
static void virtqueue_vring_attach_split(struct vring_virtqueue *vq,
struct vring_virtqueue_split *vring)
{