vhost/vsock: support SEQPACKET for transport
authorArseny Krasnov <arseny.krasnov@kaspersky.com>
Fri, 11 Jun 2021 11:13:37 +0000 (14:13 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Jun 2021 20:32:47 +0000 (13:32 -0700)
commitced7b713711fdd8f99d8d04dc53451441d194c60
tree1e5afce8532fc50493f4680731e1080d6f92bce4
parent53efbba12cc7ea2aa47d888532fdc1b3b43afef0
vhost/vsock: support SEQPACKET for transport

When received packet is copied to guests's rx queue, data buffers
of rx queue could be smaller that data buffer of input packet, so
data of input packet is copied to each rx buffer, thus each rx
buffer will be a packet with dynamically created header. Fields
of such header are initialized from header of input packet(except
length field which value is depends on number of bytes copied to
rx buffer). But in SEQPACKET case, we also need to take care of
record delimeter bit: if input packet has this bit set, we don't
copy it to header of packet in rx buffer, except case when such
rx buffer is last part of input packet. Otherwise, we will get
sequence of packets with delimeter bit set, thus braking record
bounds.
Also remove ignore of non-stream type of packets, handle SEQPACKET
feature bit.

Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/vsock.c