From patchwork Sat Jun 3 20:49:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 102923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1844759vqr; Sat, 3 Jun 2023 14:06:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5T/aQOoM3l6cKj6vXyyhTqMpbDTDWHCJDx1s3SGiAokj2g8PJojmC0Rx0eO4NeMds8Tvq8 X-Received: by 2002:a05:6a21:338f:b0:114:f824:655 with SMTP id yy15-20020a056a21338f00b00114f8240655mr330607pzb.58.1685826384906; Sat, 03 Jun 2023 14:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685826384; cv=none; d=google.com; s=arc-20160816; b=hIBErFhbmaTtRsh6NsBnLUfP3Wn4YqRyPtzvBMznOmCjd6NAF4cyohvObLoia5piZL exwAvS2p/rWP9X+xCjB6IY1M+SlASmmCqlSKK7y6ptqXf6t3E2Hl3PpmmLrhtYquGPPy QJki1r633ZZ8qETQLtLXc2D799TpQAYnV+K2vPOD3M3g8ey7A0mcUZstSmA4z00SD8JW NJh6YHkndXQatmhxa3LOia4AzQHBhRpS76DckT557aukAPNodaKZ/IjJJRcwXquQzavm V7Etrtpvf2hh8mqmxdctDs7oKQwZuvKNba1+YHniYHCkRReGqMu7b25dVSRYz2SHxgro IP8Q== 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=s7f/CfLQJryGc9if2/VYU5WFEpGy8lqbWfJnGVRm084=; b=mHrTXaGJoY3ro0S354xvDnFLMXn3iKUBSsrD80O2arIUgUN5DAKiK/s49goWSGaY8W oRhtOnv4QJf0NOOy8D/uSmT8HPzKsasIG+pvnAiyZNSs8Ff4nwa1/YBzKa0p1gyXxn3n 7yNkqNENaBuyxiPMHPXnc9Tc2wlQOWklY7UTuQ0SQlQ/QZkzKZW8cTv7UFAnbno4BE3U +yRkvuynPVnJVhFCPQ75jLuavGIc1otnf3grAEsCgTgSAp4vUmRrMvJ3gHv/2II17Xos DpaPid+5jcKmc/yc1n1jfcWQDAM6AP99sUCBQDVA08tPrVhF1n2xq1G9pgDqY9z1UkRD sCXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=RycjFhVi; 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 19-20020a631753000000b005346bd7dee9si3093727pgx.682.2023.06.03.14.06.12; Sat, 03 Jun 2023 14:06:24 -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=RycjFhVi; 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 S233213AbjFCUzb (ORCPT + 99 others); Sat, 3 Jun 2023 16:55:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232738AbjFCUzF (ORCPT ); Sat, 3 Jun 2023 16:55:05 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52E681B3; Sat, 3 Jun 2023 13:54:56 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id E6C6C5FD3B; Sat, 3 Jun 2023 23:54:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1685825688; bh=s7f/CfLQJryGc9if2/VYU5WFEpGy8lqbWfJnGVRm084=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=RycjFhViTCCFq7j0f484NCTdGFhR5aOYYJyrnGolcXq19hWg1MDLtcNa2f5NNUGEu cBqptqlP4FZzR9rZubfb8PhQCA30pChiPty3bxB+/nELqpRVsf6LKsSnvUMUhlsM+e skJ5TVarQ7GGpNbj0ppLHcCgMa/C8GVPg578oXNlkxkTrnYoxiYPadHsrJAz8tNu1D mdwZK62T8RqgAzifwok2MYd5Kyg6nqIDTi1EyCM6wvgotlBj8lmA+L7PfGsYoZXwpW 0RzzQMbi30g0aPKC0JSb2UG0Tmoi5XQlXyyhhUSAnvcXUSxbE7TKgWYjC4OEpdgCs+ 8U1nfszD18U2g== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sat, 3 Jun 2023 23:54:48 +0300 (MSK) 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 v4 11/17] vsock/virtio: support MSG_ZEROCOPY for transport Date: Sat, 3 Jun 2023 23:49:33 +0300 Message-ID: <20230603204939.1598818-12-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230603204939.1598818-1-AVKrasnov@sberdevices.ru> References: <20230603204939.1598818-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) 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/06/03 16:55:00 #21417531 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767717087327056682?= X-GMAIL-MSGID: =?utf-8?q?1767717087327056682?= Add 'msgzerocopy_allow()' callback for virtio transport. 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 6053d8341091..d9ffa16dda69 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -438,6 +438,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 = { @@ -484,6 +489,8 @@ static struct virtio_transport virtio_transport = { .notify_buffer_size = virtio_transport_notify_buffer_size, .read_skb = virtio_transport_read_skb, + + .msgzerocopy_allow = virtio_transport_msgzerocopy_allow, }, .send_pkt = virtio_transport_send_pkt,