diff options
author | Arseny Krasnov <arseny.krasnov@kaspersky.com> | 2021-09-03 15:32:48 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2021-09-05 16:23:09 -0400 |
commit | 8d5ac871b556c73b042438dc1c811c554dadca52 (patch) | |
tree | 7d458c2f0b1eca5f547580c649095404d2835f44 /net/vmw_vsock | |
parent | 1af7e55511fe194a07f3fa4e77b5b9d10bdd9208 (diff) | |
download | linux-8d5ac871b556c73b042438dc1c811c554dadca52.tar.gz linux-8d5ac871b556c73b042438dc1c811c554dadca52.tar.bz2 linux-8d5ac871b556c73b042438dc1c811c554dadca52.zip |
virtio/vsock: support MSG_EOR bit processing
If packet has 'EOR' bit - set MSG_EOR in 'recvmsg()' flags.
Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210903123251.3273639-1-arseny.krasnov@kaspersky.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r-- | net/vmw_vsock/virtio_transport_common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 4d5a93beceb0..59ee1be5a6dd 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -76,8 +76,12 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info, goto out; if (msg_data_left(info->msg) == 0 && - info->type == VIRTIO_VSOCK_TYPE_SEQPACKET) + info->type == VIRTIO_VSOCK_TYPE_SEQPACKET) { pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM); + + if (info->msg->msg_flags & MSG_EOR) + pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOR); + } } trace_virtio_transport_alloc_pkt(src_cid, src_port, @@ -460,6 +464,9 @@ static int virtio_transport_seqpacket_do_dequeue(struct vsock_sock *vsk, if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOM) { msg_ready = true; vvs->msg_count--; + + if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOR) + msg->msg_flags |= MSG_EOR; } virtio_transport_dec_rx_pkt(vvs, pkt); |