Netdev Archive on lore.kernel.org help / color / mirror / Atom feed
From: Arseny Krasnov <arseny.krasnov@kaspersky.com> To: Stefan Hajnoczi <stefanha@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Arseny Krasnov <arseny.krasnov@kaspersky.com>, Jorgen Hansen <jhansen@vmware.com>, Norbert Slusarek <nslusarek@gmx.net>, Colin Ian King <colin.king@canonical.com>, Andra Paraschiv <andraprs@amazon.com> Cc: <kvm@vger.kernel.org>, <virtualization@lists.linux-foundation.org>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <stsp2@yandex.ru>, <oxffffaa@gmail.com> Subject: [RFC PATCH v2 2/5] vhost/vsock: support MSG_EOR bit processing Date: Tue, 10 Aug 2021 14:40:15 +0300 [thread overview] Message-ID: <20210810114018.1214619-1-arseny.krasnov@kaspersky.com> (raw) In-Reply-To: <20210810113901.1214116-1-arseny.krasnov@kaspersky.com> It works in the same way as 'end-of-message' bit: if packet has 'EOM' bit, also check for 'EOR' bit. Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com> --- drivers/vhost/vsock.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index feaf650affbe..06fc132b13c8 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -114,7 +114,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, size_t nbytes; size_t iov_len, payload_len; int head; - bool restore_flag = false; + uint32_t flags_to_restore = 0; spin_lock_bh(&vsock->send_pkt_list_lock); if (list_empty(&vsock->send_pkt_list)) { @@ -187,7 +187,12 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, */ if (le32_to_cpu(pkt->hdr.flags) & VIRTIO_VSOCK_SEQ_EOM) { pkt->hdr.flags &= ~cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM); - restore_flag = true; + flags_to_restore |= le32_to_cpu(VIRTIO_VSOCK_SEQ_EOM); + + if (le32_to_cpu(pkt->hdr.flags & VIRTIO_VSOCK_SEQ_EOR)) { + pkt->hdr.flags &= ~cpu_to_le32(VIRTIO_VSOCK_SEQ_EOR); + flags_to_restore |= le32_to_cpu(VIRTIO_VSOCK_SEQ_EOR); + } } } @@ -224,8 +229,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, * to send it with the next available buffer. */ if (pkt->off < pkt->len) { - if (restore_flag) - pkt->hdr.flags |= cpu_to_le32(VIRTIO_VSOCK_SEQ_EOM); + pkt->hdr.flags |= cpu_to_le32(flags_to_restore); /* We are queueing the same virtio_vsock_pkt to handle * the remaining bytes, and we want to deliver it -- 2.25.1
next prev parent reply other threads:[~2021-08-10 11:40 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-10 11:38 [RFC PATCH v2 0/5] virtio/vsock: introduce MSG_EOR flag for SEQPACKET Arseny Krasnov 2021-08-10 11:39 ` [RFC PATCH v2 1/5] virtio/vsock: add 'VIRTIO_VSOCK_SEQ_EOM' bit Arseny Krasnov 2021-08-11 9:00 ` Stefano Garzarella 2021-08-10 11:40 ` Arseny Krasnov [this message] 2021-08-11 9:06 ` [RFC PATCH v2 2/5] vhost/vsock: support MSG_EOR bit processing Stefano Garzarella 2021-08-10 11:40 ` [RFC PATCH v2 3/5] virito/vsock: " Arseny Krasnov 2021-08-11 9:09 ` Stefano Garzarella 2021-08-10 11:41 ` [RFC PATCH v2 4/5] af_vsock: rename variables in receive loop Arseny Krasnov 2021-08-11 9:09 ` Stefano Garzarella 2021-08-10 11:41 ` [RFC PATCH v2 5/5] vsock_test: update message bounds test for MSG_EOR Arseny Krasnov 2021-08-11 9:12 ` Stefano Garzarella
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210810114018.1214619-1-arseny.krasnov@kaspersky.com \ --to=arseny.krasnov@kaspersky.com \ --cc=andraprs@amazon.com \ --cc=colin.king@canonical.com \ --cc=davem@davemloft.net \ --cc=jasowang@redhat.com \ --cc=jhansen@vmware.com \ --cc=kuba@kernel.org \ --cc=kvm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mst@redhat.com \ --cc=netdev@vger.kernel.org \ --cc=nslusarek@gmx.net \ --cc=oxffffaa@gmail.com \ --cc=sgarzare@redhat.com \ --cc=stefanha@redhat.com \ --cc=stsp2@yandex.ru \ --cc=virtualization@lists.linux-foundation.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).