From patchwork Mon Feb 6 07:02:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 13129386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACED0C636D3 for ; Mon, 6 Feb 2023 07:02:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbjBFHCq (ORCPT ); Mon, 6 Feb 2023 02:02:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjBFHCp (ORCPT ); Mon, 6 Feb 2023 02:02:45 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C45D5249; Sun, 5 Feb 2023 23:02:43 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id B9F9B5FD03; Mon, 6 Feb 2023 10:02:41 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1675666961; bh=ks9MrMlvcf/mwHZsnaRwSHAcjAk0PfgI9BorakSSCfA=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=iLsm55ho5IXRcNXv68DhERTg+d4OMF7NPcOecauZcewk3vfvfRvXkm+CCBo+f+Lr7 4PWeXQ4mHJWjdmNgDIJUC6Cr5n9uh2HQ/3oj/9hcuOpeLQLD7URWLQ9wLf/VZp0RwH pJ69tjHmrmtQ7zf8H3LP3Zwy3QgQ/6er7RXm1fO99VSInfVsd+FJDIH4VPT8ESFEjI E1ojrsUHWdsLc5MWlcigrOHg2K1/U+LMLv8MeJ8tmtQDZ0ZzC1aoIf1rCArMOwRHiJ uzad5TpxjzePg7C3yqxVJ2szjUOWWdWWrwysq25okBvRpoEpKPMNlBrDBm3yKXLzRy YtHQUinlwpEUg== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 6 Feb 2023 10:02:41 +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 09/12] vsock/virtio: support MSG_ZEROCOPY for transport Thread-Topic: [RFC PATCH v1 09/12] vsock/virtio: support MSG_ZEROCOPY for transport Thread-Index: AQHZOfkBclfV0p5QrkafxT61PfKC7g== Date: Mon, 6 Feb 2023 07:02:41 +0000 Message-ID: <787cee22-43b7-82d9-1273-27a2d5544282@sberdevices.ru> 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: 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/virtio_transport.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index b8a7d6dc9f46..4c5f19015df7 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -432,6 +432,11 @@ static void virtio_vsock_rx_done(struct virtqueue *vq) queue_work(virtio_vsock_workqueue, &vsock->rx_work); } +static bool virtio_transport_msgzerocopy_allow(void) +{ + return true; +} + static bool virtio_transport_seqpacket_allow(u32 remote_cid); static struct virtio_transport virtio_transport = { @@ -476,6 +481,8 @@ static struct virtio_transport virtio_transport = { .notify_send_pre_enqueue = virtio_transport_notify_send_pre_enqueue, .notify_send_post_enqueue = virtio_transport_notify_send_post_enqueue, .notify_buffer_size = virtio_transport_notify_buffer_size, + + .msgzerocopy_allow = virtio_transport_msgzerocopy_allow, }, .send_pkt = virtio_transport_send_pkt,