Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp190258pxb; Thu, 2 Sep 2021 23:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqleWQ6LKak9J3IvBziLAk9idtmdhiLY6xGDuPjICk/CxwniKGcbDqR/jyA855FK/W0y5b X-Received: by 2002:a6b:2b97:: with SMTP id r145mr1799087ior.193.1630649883725; Thu, 02 Sep 2021 23:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630649883; cv=none; d=google.com; s=arc-20160816; b=N3QNa1X3crTgXDRfEERhueFS4msLsxBRfDnITt5gnb9MDUz/DEEaxkLNfK2bfo1IQL wUPqAehR81JReifwQ0xc2AFNxBYaYcS42J13j10jQx4gIdAebB/sWNpp/cvhkBZgNUjv OZDDGjeMQtrl8480jPksE3S4kOrjOThU1pfXUuLlPQl51MxpC7O83UBCaK/1VwL56Loi GAFOoMykmyAleDYhwQvlR/7GYOaxfJGY2+st2I7pSEENkIQ5xWi9GJIXkfWkmbNBjDXS 5fidLUza7pRRiYuEamQ1AnpD3afwiDCaBEUoTD5dk7z+OVDAxDhAlDEjCZayhmkNwX+V S80Q== 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=RmGGQw5CQYHpDUOvW1RwzfhV0iUoeHHsJy5DoR117trEt/FZnaFjOXvuv3n86UZLWC U8qhMK+SQueO2sw+s7B0xetSrCfMn3lH/Izr+TJAt8YiuKRdS28eyBWvKGZILX7o8Dmt vwtJXuIoAAuYsFQjFILlProwSC+7BTS4Wt+EvpttWQ8LhkCeHZwholezS0jywTXp1fVK oFUIyq68vsKyW14ECXLSn2aU+IlD4yEgJmlp1MyamSt/980NcUJbMd2Ar8b3HI2sZVPy P2uNY9g/v1kzUEkJWgnjh4WwncdR9p8kXjVplo/jHZFQOL3Ye4Q8aYiP1nNaIl8udqlI BJEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kaspersky.com header.s=mail202102 header.b=2ciuQE+c; 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 h30si4792548ila.1.2021.09.02.23.17.52; Thu, 02 Sep 2021 23:18:03 -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=2ciuQE+c; 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 S1346316AbhICGRF (ORCPT + 99 others); Fri, 3 Sep 2021 02:17:05 -0400 Received: from mx13.kaspersky-labs.com ([91.103.66.164]:25828 "EHLO mx13.kaspersky-labs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344995AbhICGRE (ORCPT ); Fri, 3 Sep 2021 02:17:04 -0400 Received: from relay13.kaspersky-labs.com (unknown [127.0.0.10]) by relay13.kaspersky-labs.com (Postfix) with ESMTP id 1A0B8520D44; Fri, 3 Sep 2021 09:16:03 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kaspersky.com; s=mail202102; t=1630649763; bh=K9e95vKrX+vI3giEHBb/r5WlATln69n3y2C0yRMrXCE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=2ciuQE+cW6vmwVKTDsylHOo9zQ0Oltn5fMU0rY4SacZZQtXGCX/HX35HHJYrecNp7 w5h7VVF2Zvc2zGYxCGIesvmuyFZ0YBFofRRoEQHxENGyplvbVhAd1Aqevzxd1qsuJf jqEC86FfHM4rPakppN17R2h9CnT0jUYw4FuA9xkdKmSaPIWxIT1HDQmVpHjpDxM0Q5 xefPqkVvmpG1wqpqaKGsVwQ0wRrEzgNrdaCRaBzsSB+aXQnroGxyAD+uX9u3pqpV2G vxFXDOM/N/A5BeFCnhaSum3AqDoZCasXNM7PYXQYcmXw1XIahW0yMCiAVS9KyzTMcm sJmp3YO/QzDBw== 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 C6CA2520CB7; Fri, 3 Sep 2021 09:16:02 +0300 (MSK) Received: from arseniy-pc.avp.ru (10.64.68.129) 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; Fri, 3 Sep 2021 09:16:02 +0300 From: Arseny Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Jakub Kicinski , Arseny Krasnov , Norbert Slusarek , Andra Paraschiv , Colin Ian King CC: , , , , , Subject: [PATCH net-next v4 4/6] virtio/vsock: support MSG_EOR bit processing Date: Fri, 3 Sep 2021 09:15:51 +0300 Message-ID: <20210903061554.3187949-1-arseny.krasnov@kaspersky.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210903061353.3187150-1-arseny.krasnov@kaspersky.com> References: <20210903061353.3187150-1-arseny.krasnov@kaspersky.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.64.68.129] X-ClientProxiedBy: hqmailmbx1.avp.ru (10.64.67.241) 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: 09/03/2021 05:49:39 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 165946 [Sep 03 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: 461 461 c95454ca24f64484bdf56c7842a96dd24416624e X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: arseniy-pc.avp.ru:7.1.1;127.0.0.199:7.1.2;kaspersky.com:7.1.1;d41d8cd98f00b204e9800998ecf8427e.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: 09/03/2021 05:52: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: 03.09.2021 4:06: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/09/03 04:45:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2021/09/03 02:56:00 #17151492 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