virtio: make add_buf return capacity remaining
This API change means that virtio_net can tell how much capacity remains for buffers. It's necessarily fuzzy, since VIRTIO_RING_F_INDIRECT_DESC means we can fit any number of descriptors in one, *if* we can kmalloc. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Dinesh Subhraveti <dineshs@us.ibm.com>
This commit is contained in:
@@ -84,7 +84,7 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
|
||||
init_completion(&vb->acked);
|
||||
|
||||
/* We should always be able to add one buffer to an empty queue. */
|
||||
if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) != 0)
|
||||
if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) < 0)
|
||||
BUG();
|
||||
vq->vq_ops->kick(vq);
|
||||
|
||||
|
Reference in New Issue
Block a user