From patchwork Mon May 22 07:39:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 97157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1273608vqo; Mon, 22 May 2023 00:48:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ToqOtiPBw0m+9NoFaiRzoSzDcyTsRk/s/1Qbve7MIke5utFb/er3s+hDWlW/l1mJSeQt0 X-Received: by 2002:a17:90b:4d91:b0:255:7d50:c1aa with SMTP id oj17-20020a17090b4d9100b002557d50c1aamr1341539pjb.44.1684741682904; Mon, 22 May 2023 00:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684741682; cv=none; d=google.com; s=arc-20160816; b=W/VIbHFWdrlDkl1ncDtHTkVyoABkloNsceTcO2z8XcpZGYDGo8UMDYcKs5V6hZ56vi qRTxaB+HIQ4RfsTmwiDoszSp7XI4GKooB7Vevn7ApmrMR708LXGxOuANmMLKwIVIGu31 mO2BevQ6pCgMdrwwiTUsIAg9IBU3O6v+V8L8u/9uHbRKBXV1WZ/yl+Af9GyseAdRfxC8 rz6f0OUMOaNKXcUiLn44Em9lRpok4wpEIogat382wD4tQ2+B9Y1ie4anv4P3TxiiQips EwhD20QgQcyL2diTu3xuGYJIwEjRskbAxQQhkVR9/KfICCYeXvkDek4MLbSq1AtAnjmN LgIw== 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=26CL2gVE0g6kFd3ZFQdsGyNdyslfGmT/ZpPrRg3+nfI=; b=GvEk/6WD0EXodsibkvS3iUL34avZHIrHXDBpdyC2JXjF8X/f4o7RKs4XOZgXdVoFB4 FYps7R4P81J0NBCdEl3+v3YSHKd5wYd8dDnvpDUUXvTJtEBAAiyevQLIw5CQyGQeTx8L ZTIMx7pSILaFGzoTY9Qtrr9AZFioGsUceqM+i8y2rVV5RDET+8HzIg5Zivv1qYPlJ3wr YXa045006qXN/mFYai9deqjd6iSqocRCTLqmIYoUHBZzj+VmScpS6+I4BXRqiuiImFnf iIfAOtqaUV6q8JtvPIqKHx2pk+iQlnneT8i7P2rBPU3PSb3vbl1RVn68kCBOx5i8pmAT dhFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=FLz9U0xF; 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 t22-20020a17090ad51600b0024e33c63ed5si2477696pju.15.2023.05.22.00.47.51; Mon, 22 May 2023 00:48:02 -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=FLz9U0xF; 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 S232562AbjEVHp7 (ORCPT + 99 others); Mon, 22 May 2023 03:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbjEVHo6 (ORCPT ); Mon, 22 May 2023 03:44:58 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E07E4AC; Mon, 22 May 2023 00:44:56 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id DEC455FD56; Mon, 22 May 2023 10:44:54 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1684741494; bh=26CL2gVE0g6kFd3ZFQdsGyNdyslfGmT/ZpPrRg3+nfI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=FLz9U0xFG1yg33DEPX8QATfMVKIv+eXi/BP2X1RDoT4U2/0oDAcN9Vh6Nu6zxD0co zWMRbtT6Q+5gLnSt2xjK5y8EbCfMStT2XTSw95tzELfgIzKnNKCvmXDQR+l8UurAvj qT1il6NcQl46+LYAM5sXLQf1xn4C/KZY+/0PoMgcTbv2x2x70bSKzS13adOhrVzimY I3HfaSQIoidKxfUgdx7byM1/s4THYkAUuLJfiXPaOo/SGtJNufMkUCT2D3bgWumaSf 2Z6nPO9V9pXKHujqhlknh+rZTNUoZD9hseUYBCHl0W2/RdjFBxLq2N5ct+US75Lrxc +cUxOzUGPMhcw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 22 May 2023 10:44:54 +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 v3 12/17] vsock/loopback: support MSG_ZEROCOPY for transport Date: Mon, 22 May 2023 10:39:45 +0300 Message-ID: <20230522073950.3574171-13-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230522073950.3574171-1-AVKrasnov@sberdevices.ru> References: <20230522073950.3574171-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/05/22 04:49:00 #21364689 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 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?1766579694843798319?= X-GMAIL-MSGID: =?utf-8?q?1766579694843798319?= Add 'msgzerocopy_allow()' callback for loopback transport. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/vsock_loopback.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c index 5c6360df1f31..a2e4aeda2d92 100644 --- a/net/vmw_vsock/vsock_loopback.c +++ b/net/vmw_vsock/vsock_loopback.c @@ -47,6 +47,7 @@ static int vsock_loopback_cancel_pkt(struct vsock_sock *vsk) } static bool vsock_loopback_seqpacket_allow(u32 remote_cid); +static bool vsock_loopback_msgzerocopy_allow(void); static struct virtio_transport loopback_transport = { .transport = { @@ -92,11 +93,18 @@ static struct virtio_transport loopback_transport = { .notify_buffer_size = virtio_transport_notify_buffer_size, .read_skb = virtio_transport_read_skb, + + .msgzerocopy_allow = vsock_loopback_msgzerocopy_allow, }, .send_pkt = vsock_loopback_send_pkt, }; +static bool vsock_loopback_msgzerocopy_allow(void) +{ + return true; +} + static bool vsock_loopback_seqpacket_allow(u32 remote_cid) { return true;