summaryrefslogtreecommitdiffstats
path: root/net/vmw_vsock/virtio_transport.c
diff options
context:
space:
mode:
authorLuigi Leonardi <luigi.leonardi@outlook.com>2024-07-30 21:43:07 +0200
committerDavid S. Miller <davem@davemloft.net>2024-08-02 10:20:28 +0200
commite6ab45005772014ce49a693a63f928203c0cbbb0 (patch)
treee9ea6a13aec5f4a2df45f5ebea0e27f601d7c792 /net/vmw_vsock/virtio_transport.c
parentvsock: add support for SIOCOUTQ ioctl (diff)
downloadlinux-e6ab45005772014ce49a693a63f928203c0cbbb0.tar.xz
linux-e6ab45005772014ce49a693a63f928203c0cbbb0.zip
vsock/virtio: add SIOCOUTQ support for all virtio based transports
Introduce support for virtio_transport_unsent_bytes ioctl for virtio_transport, vhost_vsock and vsock_loopback. For all transports the unsent bytes counter is incremented in virtio_transport_get_credit. In virtio_transport (G2H) and in vhost-vsock (H2G) the counter is decremented when the skbuff is consumed. In vsock_loopback the same skbuff is passed from the transmitter to the receiver, so the counter is decremented before queuing the skbuff to the receiver. Signed-off-by: Luigi Leonardi <luigi.leonardi@outlook.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/vmw_vsock/virtio_transport.c')
-rw-r--r--net/vmw_vsock/virtio_transport.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 64a07acfef12..e0160da4ef43 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -311,7 +311,7 @@ static void virtio_transport_tx_work(struct work_struct *work)
virtqueue_disable_cb(vq);
while ((skb = virtqueue_get_buf(vq, &len)) != NULL) {
- consume_skb(skb);
+ virtio_transport_consume_skb_sent(skb, true);
added = true;
}
} while (!virtqueue_enable_cb(vq));
@@ -540,6 +540,8 @@ static struct virtio_transport virtio_transport = {
.notify_buffer_size = virtio_transport_notify_buffer_size,
.notify_set_rcvlowat = virtio_transport_notify_set_rcvlowat,
+ .unsent_bytes = virtio_transport_unsent_bytes,
+
.read_skb = virtio_transport_read_skb,
},