From patchwork Mon Feb 6 07:01:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 53035 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2094091wrn; Sun, 5 Feb 2023 23:13:54 -0800 (PST) X-Google-Smtp-Source: AK7set8aSf7jawOa5ht+aNyLCeLJBZRgHrUhk/R2wbHjVF12Nydbw0wjWsMQQE6MNlDcGCySFK++ X-Received: by 2002:a17:907:9d08:b0:887:981:5f7c with SMTP id kt8-20020a1709079d0800b0088709815f7cmr21727001ejc.11.1675667634564; Sun, 05 Feb 2023 23:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675667634; cv=none; d=google.com; s=arc-20160816; b=MgfXI9xqkQUEWOeTnsVEWvXkRok4pXHnsAa60zrB/m0WPBRcxJKP9rbtEHNeMyLlZF mCfbRQ5ErSM0z4r9KHHdygY88mmQKrg0p1ckktlv/xdy18UcQNJs0CPruH3gmQ+jsZpL onO4tB8NexFDBj0Z/ObjwET7YymPNoCbW9SYGZ/hvHmdiY49c7l8yfweQAg1zzWCCvVN fFzp+bMQM2ffqqhTAORZgYrVuhfTY+nat20eTebYuUJjkjegLdNXeZx9+Fb5O59qrYi0 VsDKuePfA9sfwQymboc0pIBIFpDoq4oPkMZQn2+Be9lSSrXIyWHd4uQr5GWhFwv1nI3n cvmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=3pLjGLtvlR8PtX7rjjJnNKnHtt2owD8Qpbd28G3wgTc=; b=vF6uZ4ACP0LL59v0RNlPSwo/zemTtlTH/lPt9HxIzM/1hVXkWCQTsGvjuWKYoqyzws kNIuqvUCeH778TaRdDCaaxTuq0iCNtIllR0kA5k/IvTfeocp0hOgwfYry7xF92UcHqJF RFdlsgac+JM9MEkKjWNwcJdYT4x/bpvAzlRsiUnDdu8OTqjY5OkRvCnvX35i8ouVIrn3 Tbm+zYkqaKbVXhqdb8LOZmph1GsJl/OMu+gsYIiMymHTBuj54g++xNJ6feMQ5r3hYaYv JgojWV3J60dEUo3MmPmnFfN1Wsizn/bZJ3kitwLUH7s+YnqHXK1zO+ruAyVr4D0fRxPz I/KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=onzOMuKA; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mr30-20020a170907829e00b0088939a81b24si9833185ejc.409.2023.02.05.23.13.31; Sun, 05 Feb 2023 23:13:54 -0800 (PST) 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=onzOMuKA; 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 S229822AbjBFHBj (ORCPT + 99 others); Mon, 6 Feb 2023 02:01:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229738AbjBFHBf (ORCPT ); Mon, 6 Feb 2023 02:01:35 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10845249; Sun, 5 Feb 2023 23:01:33 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 398595FD03; Mon, 6 Feb 2023 10:01:32 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1675666892; bh=3pLjGLtvlR8PtX7rjjJnNKnHtt2owD8Qpbd28G3wgTc=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=onzOMuKAQfwMyuJ/bb2FZ3lNAZFz2PRq07Mwmq6Wec3iQ4Iw8DZeRMefd0EXQcks2 fbpXuATimxr/R9HoeqFOV8SsthAKGxyyepzTv0mm7JPyOYc24m0ze7eI1q9IWFzuxO YWCv/4RTYITWqs9Du2Fgt3m8i16JFmEdIcFu83Sb7IGm8HfjfkbWTZk96boS3RuxtN 0AqtBQzyOffEt15g+e0qDrcJA6aTVvuJ/DqX8fL2ClxcS9X9RVNwICFT0BQoylgmII ElRDaXZl2Q5RbUpfzT9R21wAt6bGS2G28RStcasQv8ixx1tYBDrDlzW6ps6sk1Y8KW ZggL4iFV9cWDQ== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 6 Feb 2023 10:01:32 +0300 (MSK) From: Arseniy Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arseniy Krasnov , "Krasnov Arseniy" CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , kernel Subject: [RFC PATCH v1 08/12] vhost/vsock: support MSG_ZEROCOPY for transport Thread-Topic: [RFC PATCH v1 08/12] vhost/vsock: support MSG_ZEROCOPY for transport Thread-Index: AQHZOfjX+En7ow/L9km3iEiQmRP5IA== Date: Mon, 6 Feb 2023 07:01:31 +0000 Message-ID: In-Reply-To: <0e7c6fc4-b4a6-a27b-36e9-359597bba2b5@sberdevices.ru> Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-ID: <52482C1304B05940BFFBE0D5E6351FA8@sberdevices.ru> MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/02/06 01:18:00 #20834045 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_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757064865323928933?= X-GMAIL-MSGID: =?utf-8?q?1757064865323928933?= Signed-off-by: Arseniy Krasnov --- drivers/vhost/vsock.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.25.1 diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 60b9cafa3e31..afaa80203528 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -440,6 +440,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 = { @@ -485,6 +490,7 @@ static struct virtio_transport vhost_transport = { .notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue, .notify_buffer_size = virtio_transport_notify_buffer_size, + .msgzerocopy_allow = vhost_transport_msgzerocopy_allow, }, .send_pkt = vhost_transport_send_pkt,