Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp141851pxb; Mon, 16 Aug 2021 01:54:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr4eX9XGWk7EbZMmXQIiDEgYGPHT9IEW02tAGhVh4CTewFiHXW1kZaFVI30Bl9bsHy6rHZ X-Received: by 2002:a5d:928c:: with SMTP id s12mr11879331iom.151.1629104041354; Mon, 16 Aug 2021 01:54:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629104041; cv=none; d=google.com; s=arc-20160816; b=OuJb64sdb8Tb4Qx5it8K49/M1GkVgUj1+58ORKx0TIFrwyre0U1crxNZswFHyPdQsO iHnvmZna69xXQL/8nfwdhrPkIQX9aVGNbE54rZkf5tGQvPXhXrbPN4Q1Iz1tFUBW2QBJ xfdvpOnyEtBCJgThGsbDQi7UcSV9xwy+kHFlVKKa2jCX0G7ARXcHvFtyIafI2oDdOf+1 uV2JNs3R5qvLjKtRrC034aRIyh98/knxiIrznb5OsxSWVD6MmbvQ0dYPOyK9W7CdiwhI B8XNiN/Y49Ss6eaug0x8fOtb8T9Nvfh92C6YjfDNX+wToUGFy7z/IHArXRGPDT7jb2J3 0CQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K9e95vKrX+vI3giEHBb/r5WlATln69n3y2C0yRMrXCE=; b=pXsnJ6GcRsMDaqPr48H42FSErFPt/o7GSVzIlT6Do+KQHevDPGwjURjFY+3ts/vT3G rmGJPWJYsWTQW4JjsDXsEUakNX4kluOH4zuMbLCkryYmaQTccbrycsnHqkj9HTjR5EWd o/V4ZtmQXSIXwMQQ0LV7maGwQT+x8eiASxSc4IhoQmRDhqAbX2d6msOfxzHbUqFsqKfN OnoFb7zab5y2x39pR7JqOaSsZmxw5quPFRHfEmCog4KWOLQodMSMeuvAKQj0QuoJOECf aSIzmRdGTDqWzmV2wwPGiyC5obwPWGxQqsyI36m/ir5QSugdL5JDKsVt5DQbt8+GR9xt tsDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kaspersky.com header.s=mail202102 header.b="bN/U1BU2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kaspersky.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si11708773jaj.64.2021.08.16.01.53.50; Mon, 16 Aug 2021 01:54:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kaspersky.com header.s=mail202102 header.b="bN/U1BU2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=kaspersky.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235153AbhHPIxI (ORCPT + 99 others); Mon, 16 Aug 2021 04:53:08 -0400 Received: from mx13.kaspersky-labs.com ([91.103.66.164]:11698 "EHLO mx13.kaspersky-labs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235109AbhHPIxF (ORCPT ); Mon, 16 Aug 2021 04:53:05 -0400 Received: from relay13.kaspersky-labs.com (unknown [127.0.0.10]) by relay13.kaspersky-labs.com (Postfix) with ESMTP id 0C864520F2C; Mon, 16 Aug 2021 11:52:30 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaspersky.com; s=mail202102; t=1629103950; bh=K9e95vKrX+vI3giEHBb/r5WlATln69n3y2C0yRMrXCE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=bN/U1BU2frI9QgVluNQAqwDiIJb5xslpeOfJftuQrbhZpdS+0fcvBsF0YaMpJfHgW btf7Ag0tn5esRF0j1O+X1o6i1Z7yc7eSdeUAj64eDyRVrNycVS+TTZAsMPqSG8ZTI8 cCyNO1DuEdp6N/qPUsqs+1EsfxduVj1e4neNdRY+jayjVnSuGu5j90606FxbB4sHWl FoA1UvsBnNUIXcyLYu/4OGJh0dj1jShv+js/syELXISfVNfPca/XqtsuI5yMOKr93h UcG+HhvCmSnroiQESOReg8n7VdsmHoovRoRwvSXSmCvKMWK5iidCiDTgDs/H6pwYJG 0ZUKHuTCAwnHg== Received: from mail-hq2.kaspersky.com (unknown [91.103.66.206]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail-hq2.kaspersky.com", Issuer "Kaspersky MailRelays CA G3" (verified OK)) by mailhub13.kaspersky-labs.com (Postfix) with ESMTPS id C1EA0520FCD; Mon, 16 Aug 2021 11:52:29 +0300 (MSK) Received: from arseniy-pc.avp.ru (10.16.171.77) by hqmailmbx3.avp.ru (10.64.67.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 16 Aug 2021 11:52:29 +0300 From: Arseny Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Arseny Krasnov , Colin Ian King , Andra Paraschiv , Norbert Slusarek CC: , , , , , Subject: [RFC PATCH v3 4/6] virtio/vsock: support MSG_EOR bit processing Date: Mon, 16 Aug 2021 11:52:20 +0300 Message-ID: <20210816085223.4174366-1-arseny.krasnov@kaspersky.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210816085036.4173627-1-arseny.krasnov@kaspersky.com> References: <20210816085036.4173627-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.16.171.77] X-ClientProxiedBy: hqmailmbx3.avp.ru (10.64.67.243) To hqmailmbx3.avp.ru (10.64.67.243) X-KSE-ServerInfo: hqmailmbx3.avp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 08/16/2021 08:40:34 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 165570 [Aug 16 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: arseny.krasnov@kaspersky.com X-KSE-AntiSpam-Info: LuaCore: 454 454 39c6e442fd417993330528e7f9d13ac1bf7fdf8c X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: 127.0.0.199:7.1.2;arseniy-pc.avp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;kaspersky.com:7.1.1 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Deterministic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 08/16/2021 08:42:00 X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 16.08.2021 4:09:00 X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KSE-AttachmentFiltering-Interceptor-Info: no applicable attachment filtering rules found X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit X-KLMS-Rule-ID: 52 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, disabled by settings X-KLMS-AntiSpam-Interceptor-Info: not scanned X-KLMS-AntiPhishing: Clean, bases: 2021/08/16 06:42:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2021/08/16 02:10:00 #17042267 X-KLMS-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If packet has 'EOR' bit - set MSG_EOR in 'recvmsg()' flags. Signed-off-by: Arseny Krasnov Reviewed-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- 2.25.1