From patchwork Sat Jun 3 20:49:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 102914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1841298vqr; Sat, 3 Jun 2023 13:57:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gqYX+JyE6bPuvuQRpYkBfs4d+XjQPhUZRuqLcx6gi2BLsazeCJHMhz84u47KPV0EgyySl X-Received: by 2002:a05:6358:4315:b0:123:3ea3:2bd2 with SMTP id r21-20020a056358431500b001233ea32bd2mr15406410rwc.32.1685825854440; Sat, 03 Jun 2023 13:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685825854; cv=none; d=google.com; s=arc-20160816; b=LmM7mc/Lkbt8Us1TZ1SjYYmP+N7ufEXrM6ErcpZ4Y04id1+lKX0i5cM8vry5Q67lUK fa8IZmxn1Phncv3ZOrC783IMq221Bdgc9lAXhJ9rSdOZmMLDoTKyQxcaCw3TyUNSInsu lsSmNlb+NODr+RiY2ndiw6uxRWiu5AfG03HsESKDJQbuGY8JK/jRgaoNfY+rVwg+2ff6 uKmfT+dlRBgqdnSjm/Sw8CAY0MCk75g9Rd5cGkTZCG2UaUHocnn03yxzwMlKvU5A+8Vg PEARPpOeN+76PBKC7HJqkwRdKzdKhMdCzqqkCRXGCcT1kzt8xlya3FSy4Qh77ym3ZF9j UbkA== 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=HdZxRPN2nptliGT1rzKVFvb2uPEfEVHd7Po5JBWoIOo0kPKptkAhOgN14ejMDvZ0JD SQOphc56jbgC8p9uS5yjr8v3qMq7Lgd83+qkAXG3+TG10JasqtiC5lqJWWrQ0NCpmVMx zKbDdGiPWy8iXjk77MIEBFD5ZCSM2mY203YqxQkMCZQl73U8UDF2KMwubgm4YLDp5KMi aFL2jh/CcREBjvGe30Lx3SSLNXfCd0qVNmTg3jzqskemd4TIckdcjE+H6MgtR67Ee765 AMeRGc1I2lQubhUYYSjbMeVodjVQGjPwFxmgVWDsc7sRa8ccQTyyysiETsw9y8bUSBXZ ZcBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=BKAbES7B; 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 h27-20020a63385b000000b0051b37c000dcsi3059081pgn.81.2023.06.03.13.57.23; Sat, 03 Jun 2023 13:57:34 -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=BKAbES7B; 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 S233657AbjFCUz2 (ORCPT + 99 others); Sat, 3 Jun 2023 16:55:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232743AbjFCUzF (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 52D381B1; 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 309645FD3C; Sat, 3 Jun 2023 23:54:49 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1685825689; bh=26CL2gVE0g6kFd3ZFQdsGyNdyslfGmT/ZpPrRg3+nfI=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=BKAbES7BoLlidpvw0rMtqdqB7xEXtgBURTVI82QeFolK4flgEV0OAt8pV9oMaKNMz G2bAelQ+UFia3yG6r0Sgbkso9tH0EJvEOrv3Oqdx9kU4YNtOAm5Qv66PI7Y61b5YqN FY07PX5itx9jBaOa4ekgBC+omDbdDXZCX8vRWlzXg23Rc/+/CRhW/rFg/fnVXbdFtt bRQiCz6elxUCfTWOcpa39yp30jI35ajzDyh8eIKXNbWtMyVhGPgM13+JcmFKbFaq9g oX0O+zH0GKH9U2Q/HqFll/NFiyHFYNCXjtZ0FvniLjLiViWUDJUkINLGTs4qMD5Pho aNOsouh71frMA== 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:49 +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 12/17] vsock/loopback: support MSG_ZEROCOPY for transport Date: Sat, 3 Jun 2023 23:49:34 +0300 Message-ID: <20230603204939.1598818-13-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?1767716531002311432?= X-GMAIL-MSGID: =?utf-8?q?1767716531002311432?= 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;