OSDN Git Service

vsock/virtio: change the maximum packet size allowed
authorStefano Garzarella <sgarzare@redhat.com>
Tue, 30 Jul 2019 15:43:34 +0000 (17:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Jul 2019 22:00:00 +0000 (15:00 -0700)
Since now we are able to split packets, we can avoid limiting
their sizes to VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE.
Instead, we can use VIRTIO_VSOCK_MAX_PKT_BUF_SIZE as the max
packet size.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/virtio_transport_common.c

index 56fab3f..94cc0fa 100644 (file)
@@ -181,8 +181,8 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
        vvs = vsk->trans;
 
        /* we can send less than pkt_len bytes */
-       if (pkt_len > VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE)
-               pkt_len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE;
+       if (pkt_len > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE)
+               pkt_len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE;
 
        /* virtio_transport_get_credit might return less than pkt_len credit */
        pkt_len = virtio_transport_get_credit(vvs, pkt_len);