Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp360071rdg; Tue, 10 Oct 2023 12:23:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyXiNzSYQgsYXpo6OEflaDxustsqg1HJUhyzEprIacMPhbIaQbAgZrbZBiJ1zZ6akrKu/v X-Received: by 2002:a17:903:230b:b0:1c5:cf7c:4d50 with SMTP id d11-20020a170903230b00b001c5cf7c4d50mr29941127plh.18.1696965825616; Tue, 10 Oct 2023 12:23:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696965825; cv=none; d=google.com; s=arc-20160816; b=XaHvEMjIvPywkt3a/WFx+EC1gu5XT8yu7p85fpnQ4UK0mIerlZDcKiqCkkJtEdSSUT /g51Wvksq2nzqpAdBp7BKSv8QNhepoixCdEwTh5Hxc20rtEc932gfd+viD4+Okv/SYUV b5H6x88JqbzP9oQgfcgE0Zmbmod3wU7JZufORXcsruxC9Nz3yt1SusLq5DD0uC/j1Eu9 hWmdVhSlNeUTmAn7LzBSj5vcPCdxOvwtK5DaX+vJ+/sxkXuhqCFGVX1gbiS9ae+TjX8p dh7XAjmE6SgbgVKGGmKXM1owCh9Nqjgs8zhaaQanrLgvw4hOzjT2vAQqZife/TREmzfs uKNg== 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:dkim-filter; bh=3EZqTPtuxFGmvEgTrKtTokMxFFsO4LUHGPete/15D7A=; fh=wIHqZpOIuzcidDZ82yQbOZuyHJty7uvaWDEh/efoVzA=; b=Y45b1Ni1MM0wcHbnmEwjFxu7n4KxRja5XIw6Ofm3mp1l7ZNtdFs/xayX0AKjCZGNwf 94U3LNeADSRDQike0kwkbAx9moYzsI4xaneYF2l9u3MTzD8eq6baohYCC/NR3uDnKSxN N99L3Pf5PW8tCbzKRgcy3XcxpVf9LwztbGugZUl+L+JZIsifdzM4FJX02aufEeTKirk8 VhL0ITVG28BslkeWrz3EZz64PTYONU0tRsHL2H9efrmxrHmDtOKE7KqRbYaMEVFwYPns XakxaXR/jw5zkWLBHvZlHHbUqvNz6rQxlzoYPiyFQnSiVSoQAxAu1el4zhdNvN4BNhJP dr7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Z2Ap1WrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i7-20020a17090332c700b001bc650255b6si13354864plr.390.2023.10.10.12.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 12:23:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=Z2Ap1WrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5A71C80CA0AC; Tue, 10 Oct 2023 12:23:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344049AbjJJTXW (ORCPT + 99 others); Tue, 10 Oct 2023 15:23:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234378AbjJJTXA (ORCPT ); Tue, 10 Oct 2023 15:23:00 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F5E11A; Tue, 10 Oct 2023 12:22:48 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 4150F10000F; Tue, 10 Oct 2023 22:22:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 4150F10000F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696965766; bh=3EZqTPtuxFGmvEgTrKtTokMxFFsO4LUHGPete/15D7A=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=Z2Ap1WrRNYBfusfEnJaYCdhJpB7Gj+oRXFd2HOblkSLJg5VNSGOwUZZNRV2/bhAKL pBYe+G6dSp+/ZF1Y5HOG1H6xKEXT9BJES+6nIxvrn1MMO0WThmf4HcbLjQg02e8FB5 EwgnlDA4w9IFPajExGqxSpaij0xYfYRrKT5+k1HZ+sIkFXC75e7OrDrzeDzhsI5vxm BoxAIADkc3g9dawz8kfPCZ6M38ZPWD3ghkrIvjI0VVHuPk5rW9L0gRIVwocMHQykX7 Ze0Ied5h1WPhh+1CLTXwSJIXc+CFeX15EOzuo2iyBGnWJ/U4g+AOfaiLA+jT48PDJe pac5xkPIBorow== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Tue, 10 Oct 2023 22:22:46 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Tue, 10 Oct 2023 22:22:45 +0300 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: , , , , , , Subject: [PATCH net-next v4 05/12] vhost/vsock: support MSG_ZEROCOPY for transport Date: Tue, 10 Oct 2023 22:15:17 +0300 Message-ID: <20231010191524.1694217-6-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20231010191524.1694217-1-avkrasnov@salutedevices.com> References: <20231010191524.1694217-1-avkrasnov@salutedevices.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 180515 [Oct 10 2023] X-KSMG-AntiSpam-Version: 6.0.0.2 X-KSMG-AntiSpam-Envelope-From: avkrasnov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 536 536 1ae19c7800f69da91432b5e67ed4a00b9ade0d03, {Tracking_from_domain_doesnt_match_to}, 127.0.0.199:7.1.2;salutedevices.com:7.1.1;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/10/10 16:15:00 #22148151 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 10 Oct 2023 12:23:41 -0700 (PDT) X-Spam-Level: ** Add 'msgzerocopy_allow()' callback for vhost transport. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- drivers/vhost/vsock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 83711aad855c..f75731396b7e 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -398,6 +398,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 = { @@ -431,6 +436,8 @@ static struct virtio_transport vhost_transport = { .seqpacket_allow = vhost_transport_seqpacket_allow, .seqpacket_has_data = virtio_transport_seqpacket_has_data, + .msgzerocopy_allow = vhost_transport_msgzerocopy_allow, + .notify_poll_in = virtio_transport_notify_poll_in, .notify_poll_out = virtio_transport_notify_poll_out, .notify_recv_init = virtio_transport_notify_recv_init, -- 2.25.1