Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1072911rdb; Sat, 7 Oct 2023 10:29:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHc57N+TefYKEEt7wPSQVfFT1hVH32ChryzsdM4adJ+tY/o2OH7gYh920p4hDMuFE16t+1f X-Received: by 2002:a05:6e02:1a66:b0:34f:1b85:5f45 with SMTP id w6-20020a056e021a6600b0034f1b855f45mr13374812ilv.32.1696699772801; Sat, 07 Oct 2023 10:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696699772; cv=none; d=google.com; s=arc-20160816; b=DouYU4uSb0CAbhbgM7ASY5+WzfPNoO0mogBu9UUg+0sX6eN0ogiBpEuGZKLjYvepTD 5bSecgZfgQB/8IVuEi4nR72jjAg6DHxP4NrTCh72rOySAVihStABlessAknlzO387ZVn a4RZHlWsZtT8Nm5IaS6vJOkg/79yz/Kbrt8wq6pNOGDrPC9BMGG+d3Ka3K0NykAeW8yO efVubsJ7tGWDq1UIgZNddXCE12RWc96OlFnFG/SCTXgtekd5wxO+ZZrA3OwC8buz4MgG hOO4U7eZe898n3Dr/x+ZUc/4WOdtKhRc2gezAXMQu1hC3uoOxhQ5eXrD9hHfWff6ObpH BAZA== 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:dkim-filter; bh=3EZqTPtuxFGmvEgTrKtTokMxFFsO4LUHGPete/15D7A=; fh=wIHqZpOIuzcidDZ82yQbOZuyHJty7uvaWDEh/efoVzA=; b=s2oLaN7qE0jsdnJC4Hu/qa7E+MKDw395HLj290uh/FzYIt4O4lB4oVEIqJRYfNpf/r RuO8j52x3qKQIwbUbawxhZlbHdYhf9ax6oDTIg6/j/I/f7kXRlQXgx0boJyD+b+Up2Au 7BzvrZWGvzUZuFSDje01zql+FXyoJn60bwtYhh4QM/0Cx1GVyrQaoJWZ1G80ga079fBo 1qSFbA+fPkTzTatmkdPQHidj8IJ+G/dbmHY+gjK+I++vw4a77vvbntSa7DYrXXus9XD7 kbjD4zhzU6yHszQAyAcf5jTbHCRo3BDqDTLPNA0GtMKlc+Kxl1pzzoJ6vG7iOfo/Nt0o bCAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=qmhXroKZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id p24-20020a637418000000b0058978136252si5575515pgc.484.2023.10.07.10.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 10:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=qmhXroKZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8727880990EF; Sat, 7 Oct 2023 10:29:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344176AbjJGR3B (ORCPT + 99 others); Sat, 7 Oct 2023 13:29:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344090AbjJGR2w (ORCPT ); Sat, 7 Oct 2023 13:28:52 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30601AD; Sat, 7 Oct 2023 10:28:50 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 6382E12000C; Sat, 7 Oct 2023 20:28:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 6382E12000C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696699727; bh=3EZqTPtuxFGmvEgTrKtTokMxFFsO4LUHGPete/15D7A=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=qmhXroKZNAY+uynq+CSzBoZo1lp831Bg3IHh3m+bxsO1DoQhx5i/NnlgH8p0pcLPx n3Lel+JB9+0CedTei7l64Meb5rqA1F+bRqpevbNnKvbZMCPcYK/OWro+cBNmVI97SA W95KsipWoNIZ7LuGrZtZuqyD6fa2ZeZ+PG2icnSpD4qgsh8x8n+Sx6B7z4WsIMrujx y5gpe/QrL5011cw/jCQTxsCJGeUYq0Ec1s6dMhHQ6PEc/ENuykZBA7DqkPoL44lHla /x0IfkKq/IyfGfQq7L3a4DMjzYnd8VSzlwkswHfB/0PpSzdXdkh7277euTowWlKXFK hUWdCdiP75SJQ== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 7 Oct 2023 20:28:47 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Sat, 7 Oct 2023 20:28:46 +0300 From: Arseniy Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman CC: , , , , , , Subject: [PATCH net-next v3 05/12] vhost/vsock: support MSG_ZEROCOPY for transport Date: Sat, 7 Oct 2023 20:21:32 +0300 Message-ID: <20231007172139.1338644-6-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20231007172139.1338644-1-avkrasnov@salutedevices.com> References: <20231007172139.1338644-1-avkrasnov@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180453 [Oct 07 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: avkrasnov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:5.0.1,7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/07 16:48:00 #22085983 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sat, 07 Oct 2023 10:29:25 -0700 (PDT) X-Spam-Level: ** Add 'msgzerocopy_allow()' callback for vhost transport. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- drivers/vhost/vsock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 83711aad855c..f75731396b7e 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -398,6 +398,11 @@ static bool vhost_vsock_more_replies(struct vhost_vsock *vsock) return val < vq->num; } +static bool vhost_transport_msgzerocopy_allow(void) +{ + return true; +} + static bool vhost_transport_seqpacket_allow(u32 remote_cid); static struct virtio_transport vhost_transport = { @@ -431,6 +436,8 @@ static struct virtio_transport vhost_transport = { .seqpacket_allow = vhost_transport_seqpacket_allow, .seqpacket_has_data = virtio_transport_seqpacket_has_data, + .msgzerocopy_allow = vhost_transport_msgzerocopy_allow, + .notify_poll_in = virtio_transport_notify_poll_in, .notify_poll_out = virtio_transport_notify_poll_out, .notify_recv_init = virtio_transport_notify_recv_init, -- 2.25.1