|
@@ -308,6 +308,11 @@ static void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool success)
|
|
|
struct vhost_virtqueue *vq = ubufs->vq;
|
|
|
int cnt = atomic_read(&ubufs->kref.refcount);
|
|
|
|
|
|
+ /* set len to mark this desc buffers done DMA */
|
|
|
+ vq->heads[ubuf->desc].len = success ?
|
|
|
+ VHOST_DMA_DONE_LEN : VHOST_DMA_FAILED_LEN;
|
|
|
+ vhost_net_ubuf_put(ubufs);
|
|
|
+
|
|
|
/*
|
|
|
* Trigger polling thread if guest stopped submitting new buffers:
|
|
|
* in this case, the refcount after decrement will eventually reach 1
|
|
@@ -318,10 +323,6 @@ static void vhost_zerocopy_callback(struct ubuf_info *ubuf, bool success)
|
|
|
*/
|
|
|
if (cnt <= 2 || !(cnt % 16))
|
|
|
vhost_poll_queue(&vq->poll);
|
|
|
- /* set len to mark this desc buffers done DMA */
|
|
|
- vq->heads[ubuf->desc].len = success ?
|
|
|
- VHOST_DMA_DONE_LEN : VHOST_DMA_FAILED_LEN;
|
|
|
- vhost_net_ubuf_put(ubufs);
|
|
|
}
|
|
|
|
|
|
/* Expects to be always run from workqueue - which acts as
|