Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23353587rwd; Fri, 30 Jun 2023 23:54:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7K0OWkRYarkDx7NhDJsP5JvEsIy4uW3wPCVDql0b9CJUR0FsCYhr9QHxHSDjZj0VHkJL0a X-Received: by 2002:a05:6a20:6aa2:b0:11f:3f4b:9687 with SMTP id bi34-20020a056a206aa200b0011f3f4b9687mr4166913pzb.56.1688194496243; Fri, 30 Jun 2023 23:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688194496; cv=none; d=google.com; s=arc-20160816; b=LvfE260b9l0xdQBZLE1V/SnZ9NVLIQf35gG75YSlTEIcPqSuDJDqU2B26ocym4LlTD M9I4QMp9ivCZIG1sUOzuMsyvjr59YYgDR9FprWgafI228N8Noh8nK6LCkzm5FrUQ3w8+ BQl8jjXfZi4TqUQhJ7FyGWJCxfGhNBLVe514Mzf+BDJMoMDVGy/Jc+DDptGrvC4yHhkW KcIxPv5batBajXFrMEan9k5i2p5SvZSl0yLif9AJB+98tNScgDN65ZQ0B0FkHo9rFbYy Unwtc8uMNmy98P5njaC/A06zTMhlQFicHrd8lokqeI668xMEKFlJJMXv3Ffhde+UIFDb kU1w== 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=tAX9BS9Qmyzlmpr1k17sJ0Kzs+6bGB2QVrF/rbwEyDA=; fh=PzWIi6JmlJNekYqVy23433fKO6OE4+V62ucRx731HUI=; b=ftzOhY5MVuHmJxAQcK3P0ZeIQY9P8Mq4yRKwh3Z9MoinbAqydguIVPmnk+9Cconvvy 96amad2RlG8VsyERSTXbsvNOM/ovAY3b7gsFdrUgPJEemnxMd3oZLUQ9a5SXPmCQRyex e5qUlQuPt03cLctDvRqkjVwa9AXPw3s7jOAtzvr7vnQbVy9T0FsYP22uCoAJl2Jlf25r dQD5MiTHAEv59E53vdu05k5aFyCi3/vLHG/OmmbCQOVnl86szh0+29N+dusxVR/wlAO+ LgjBXpW2ornsfnrGXNTKEo/9dGkFXG+2D2vufzdgfDyHK8BRSYiMFh3BWFAj4bjUs1Ui calg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ZuIrsAKU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a655c43000000b0054fe7a4c49esi14213206pgr.824.2023.06.30.23.54.42; Fri, 30 Jun 2023 23:54:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ZuIrsAKU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbjGAGxr (ORCPT + 99 others); Sat, 1 Jul 2023 02:53:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjGAGwd (ORCPT ); Sat, 1 Jul 2023 02:52:33 -0400 Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A6AA59D1; Fri, 30 Jun 2023 23:46:05 -0700 (PDT) Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id DA027120013; Sat, 1 Jul 2023 09:45:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru DA027120013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1688193913; bh=tAX9BS9Qmyzlmpr1k17sJ0Kzs+6bGB2QVrF/rbwEyDA=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=ZuIrsAKUgIIAI/gz+9h8+K5YWi24Ay6yb7ZOOCoPYgDWuC74XPsz5xP0ybSzLvcRg apwZjdkn97erCGzWnZHT75IMNpEw1ltqmZVL5eBV2E0p9J+dBGaojo5Zly7GU9mdJ3 VbbMfhwEbIvlb4TAcMhFzbEAxRyt5MnO2sdmU5rrW06RdvRQBMqwDLY19pFaZQJL/p 7k354IQyClbkpsHTgQvWUZI1CG5Ijj1B/VXAaPi2Vk4SB4YL7KHcSbawvzUtWyodBM dxvDbin/HeEAebVL9XIM3rx1TnNl/dj48VVJPOxBVwkwuaYWTdNaFZiJfcndSH0S3V MtyNbiPro15Wg== 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, 1 Jul 2023 09:45:12 +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, 1 Jul 2023 09:44:49 +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: , , , , , , , Arseniy Krasnov Subject: [RFC PATCH v5 10/17] vhost/vsock: support MSG_ZEROCOPY for transport Date: Sat, 1 Jul 2023 09:39:40 +0300 Message-ID: <20230701063947.3422088-11-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230701063947.3422088-1-AVKrasnov@sberdevices.ru> References: <20230701063947.3422088-1-AVKrasnov@sberdevices.ru> 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: 178380 [Jun 30 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: AVKrasnov@sberdevices.ru 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: 517 517 b0056c19d8e10afbb16cb7aad7258dedb0179a79, {Tracking_from_domain_doesnt_match_to}, sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1, FromAlignment: s, {Tracking_white_helo}, 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/07/01 04:02:00 #21597763 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add 'msgzerocopy_allow()' callback for vhost transport. Signed-off-by: Arseniy Krasnov --- Changelog: v4 -> v5: * Move 'msgzerocopy_allow' right after seqpacket callbacks. drivers/vhost/vsock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index cb00e0e059e4..3fd0ab0c0edc 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