search for: vhost_transport_get_max_pkt_len

Displaying 1 result from an estimated 1 matches for "vhost_transport_get_max_pkt_len".

2018 Dec 12
0
[PATCH v2 4/5] VSOCK: increase send pkt len in mergeable mode to improve performance
...gt;mergeable)) pkt->mrg_rxbuf_hdr.num_buffers = cpu_to_le16(headcount); nbytes = copy_to_iter(&pkt->hdr, vsock_hlen, &iov_iter); if (nbytes != vsock_hlen) { @@ -303,6 +303,22 @@ static void vhost_transport_send_pkt_work(struct vhost_work *work) return len; } +static u32 +vhost_transport_get_max_pkt_len(u32 guest_cid) +{ + int len = VIRTIO_VSOCK_DEFAULT_RX_BUF_SIZE; + struct vhost_vsock *vsock; + + vsock = vhost_vsock_get(guest_cid); + if (!vsock) + return len; + + if (vsock->mergeable) + len = VIRTIO_VSOCK_MAX_PKT_BUF_SIZE; + + return len; +} + static int vhost_transport_cancel_pkt(struct...