Skip to content

Commit 8d5ac87

Browse files
Arseny Krasnovmstsirkin
authored andcommitted
virtio/vsock: support MSG_EOR bit processing
If packet has 'EOR' bit - set MSG_EOR in 'recvmsg()' flags. Signed-off-by: Arseny Krasnov <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 1af7e55 commit 8d5ac87

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

net/vmw_vsock/virtio_transport_common.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,12 @@ virtio_transport_alloc_pkt(struct virtio_vsock_pkt_info *info,
7676
goto out;
7777

7878
if (msg_data_left(info->msg) == 0 &&
79-
info->type == VIRTIO_VSOCK_TYPE_SEQPACKET)
79+
info->type == VIRTIO_VSOCK_TYPE_SEQPACKET) {
8080
pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM);
81+
82+
if (info->msg->msg_flags & MSG_EOR)
83+
pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOR);
84+
}
8185
}
8286

8387
trace_virtio_transport_alloc_pkt(src_cid, src_port,
@@ -460,6 +464,9 @@ static int virtio_transport_seqpacket_do_dequeue(struct vsock_sock *vsk,
460464
if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOM) {
461465
msg_ready = true;
462466
vvs->msg_count--;
467+
468+
if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOR)
469+
msg->msg_flags |= MSG_EOR;
463470
}
464471

465472
virtio_transport_dec_rx_pkt(vvs, pkt);

0 commit comments

Comments
 (0)