mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
UPSTREAM: 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>
(cherry picked from commit 21bc54fc0c)
Bug: 121166534
Test: Ran cuttlefish with android-4.4 + vsock adb tunnel
Signed-off-by: Cody Schuffelen <schuffelen@google.com>
Change-Id: Id76bb00fb4393add39d876e29b0e20617c6033e7
This commit is contained in:
committed by
Alistair Strachan
parent
72e3ee7594
commit
ddabe56020
@@ -87,9 +87,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
|
||||
|
||||
vq = vsock->vqs[VSOCK_VQ_TX];
|
||||
|
||||
/* Avoid unnecessary interrupts while we're processing the ring */
|
||||
virtqueue_disable_cb(vq);
|
||||
|
||||
for (;;) {
|
||||
struct virtio_vsock_pkt *pkt;
|
||||
struct scatterlist hdr, buf, *sgs[2];
|
||||
@@ -99,7 +96,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
|
||||
spin_lock_bh(&vsock->send_pkt_list_lock);
|
||||
if (list_empty(&vsock->send_pkt_list)) {
|
||||
spin_unlock_bh(&vsock->send_pkt_list_lock);
|
||||
virtqueue_enable_cb(vq);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -118,13 +114,13 @@ virtio_transport_send_pkt_work(struct work_struct *work)
|
||||
}
|
||||
|
||||
ret = virtqueue_add_sgs(vq, sgs, out_sg, in_sg, pkt, GFP_KERNEL);
|
||||
/* Usually this means that there is no more space available in
|
||||
* the vq
|
||||
*/
|
||||
if (ret < 0) {
|
||||
spin_lock_bh(&vsock->send_pkt_list_lock);
|
||||
list_add(&pkt->list, &vsock->send_pkt_list);
|
||||
spin_unlock_bh(&vsock->send_pkt_list_lock);
|
||||
|
||||
if (!virtqueue_enable_cb(vq) && ret == -ENOSPC)
|
||||
continue; /* retry now that we have more space */
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user