Skip to content

Commit 21bc54f

Browse files
Gerard Garciamstsirkin
authored andcommitted
vhost/vsock: drop space available check for TX vq
Remove unnecessary use of enable/disable callback notifications and the incorrect more space available check. The virtio_transport_tx_work handles when the TX virtqueue has more buffers available. Signed-off-by: Gerard Garcia <ggarcia@deic.uab.cat> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 5201261 commit 21bc54f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

net/vmw_vsock/virtio_transport.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
8787

8888
vq = vsock->vqs[VSOCK_VQ_TX];
8989

90-
/* Avoid unnecessary interrupts while we're processing the ring */
91-
virtqueue_disable_cb(vq);
92-
9390
for (;;) {
9491
struct virtio_vsock_pkt *pkt;
9592
struct scatterlist hdr, buf, *sgs[2];
@@ -99,7 +96,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
9996
spin_lock_bh(&vsock->send_pkt_list_lock);
10097
if (list_empty(&vsock->send_pkt_list)) {
10198
spin_unlock_bh(&vsock->send_pkt_list_lock);
102-
virtqueue_enable_cb(vq);
10399
break;
104100
}
105101

@@ -118,13 +114,13 @@ virtio_transport_send_pkt_work(struct work_struct *work)
118114
}
119115

120116
ret = virtqueue_add_sgs(vq, sgs, out_sg, in_sg, pkt, GFP_KERNEL);
117+
/* Usually this means that there is no more space available in
118+
* the vq
119+
*/
121120
if (ret < 0) {
122121
spin_lock_bh(&vsock->send_pkt_list_lock);
123122
list_add(&pkt->list, &vsock->send_pkt_list);
124123
spin_unlock_bh(&vsock->send_pkt_list_lock);
125-
126-
if (!virtqueue_enable_cb(vq) && ret == -ENOSPC)
127-
continue; /* retry now that we have more space */
128124
break;
129125
}
130126

0 commit comments

Comments
 (0)