Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1072853rdb; Sat, 7 Oct 2023 10:29:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnkeaIbboTz58T7J/TQkXq4B7HonHUWHHx7dhh94mGeCxJPMfEqlRwg74pcu3QPYVOhyub X-Received: by 2002:a05:6870:1493:b0:1b3:6ea7:7475 with SMTP id k19-20020a056870149300b001b36ea77475mr13514438oab.0.1696699761575; Sat, 07 Oct 2023 10:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696699761; cv=none; d=google.com; s=arc-20160816; b=HFu+J84DLkE1//nxI7da5c3Sd3apuSCds4wT2Wsg3Tv4fAZPlT3BdPci3d8gyu4RG+ L3epEnRmCYPkONfgHuFjxwK02qBXLR6vqJERQJ7BPNawb5riL4bdRb0fNajABYMPCcQ/ fL/4LGe272Fej9CvAY90Qs7cw1UoZGMEyEVdZOaAze3qMuNZjIik/dqP4hWGcM/m/xY/ BBZQd+1j4CPLhAVW/T7mLRxfPBxn6DUnBmT2MKOmMXoO/oWFPE+2YDeAcLODwmiLCDAn q3ZwbzKTdq5bEs4aPb29Sx9rXz/E2mi96iR6Ydj0x2u/gnjKAH+63JjSzSOI/SuFIo/R SYJQ== 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=7O61lqPregE+HlMhdM4ZTCsUGvDnSuOsext9GfPBTSQ=; fh=wIHqZpOIuzcidDZ82yQbOZuyHJty7uvaWDEh/efoVzA=; b=FnLJI+i3irSS4y+8J0fjsafJevwOPS3gfxkFs4FgeXP68FB7J7jx64H2mNZTFUshE1 HGHwY/8owaJ/rKcHZcU1TeGryVwnoJnMZXz7kdgDE86l11ZZUSjc6Rqrh3Jfm7gxo2P4 v+kxmKlUe0pea1lrcFqdAiwX1+MaXhf/P0bmCoD1Qc7nCwcxAPcC7nisFitNKMuUZ8mx qFKd1TAUltcYREj88fwYC1HBdHm3uhz/VXot/zkU0+2vypXs1u2+UaKYp2jDqsv3YSyc yhNBMtNxsV8m1TBev3UQauFomkKr72uapi5qXAiqEl9tQ/RjlH/ZlApXoogX0EVWr0By yg2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=MnxDrue0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id cg5-20020a056a00290500b0068a692b67b0si3932233pfb.104.2023.10.07.10.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 10:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b=MnxDrue0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id C588F80BE7E7; Sat, 7 Oct 2023 10:29:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344140AbjJGR2z (ORCPT + 99 others); Sat, 7 Oct 2023 13:28:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344076AbjJGR2v (ORCPT ); Sat, 7 Oct 2023 13:28:51 -0400 Received: from mx1.sberdevices.ru (mx1.sberdevices.ru [37.18.73.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F16A2; Sat, 7 Oct 2023 10:28:49 -0700 (PDT) Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id A6322100007; Sat, 7 Oct 2023 20:28:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru A6322100007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1696699727; bh=7O61lqPregE+HlMhdM4ZTCsUGvDnSuOsext9GfPBTSQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=MnxDrue0AY4Xv+IAxrgk8xr+6hICsszG1hES4eE2XGqOX8xi0vqs21H1W3M2R1KCx cBMtX58JakOwqcae6eJMH5iJdhXakn/MHxIbzNZFswuIlJvQVA/LmVqmhCryziAvVI B/Q/Xz8MtSgT6G/bFg4KIO1yKJCsCN/ZxPC4H3Rm01ve8bfUitVoEy8DPrVl3u0QaI wusrU+6diiR4f/jHyqcJnmXtx9NwCmw2xpEbq7Rh9ouHO16LDEAwCccNCcjXCtSH4T T5Md5eLVfmKH+OoAPC5WLYZrOfeVz0+uxhjXxwctR9mRFWdmJ3jWe2rlA/TqFBalIS dgDS0H0tHvHpQ== 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; Sat, 7 Oct 2023 20:28:47 +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; Sat, 7 Oct 2023 20:28:47 +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 v3 06/12] vsock/virtio: support MSG_ZEROCOPY for transport Date: Sat, 7 Oct 2023 20:21:33 +0300 Message-ID: <20231007172139.1338644-7-avkrasnov@salutedevices.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20231007172139.1338644-1-avkrasnov@salutedevices.com> References: <20231007172139.1338644-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-m01.sberdevices.ru (172.16.192.107) 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: 180453 [Oct 07 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: 535 535 da804c0ea8918f802fc60e7a20ba49783d957ba2, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;100.64.160.123:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2, 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/07 16:48:00 #22085983 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 autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Sat, 07 Oct 2023 10:29:15 -0700 (PDT) X-Spam-Level: ** Add 'msgzerocopy_allow()' callback for virtio transport. Signed-off-by: Arseniy Krasnov Reviewed-by: Stefano Garzarella --- 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 09ba3128e759..d324ae13e2f5 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -486,6 +486,11 @@ static bool virtio_transport_can_msgzerocopy(int bufs_num) return res; } +static bool virtio_transport_msgzerocopy_allow(void) +{ + return true; +} + static bool virtio_transport_seqpacket_allow(u32 remote_cid); static struct virtio_transport virtio_transport = { @@ -519,6 +524,8 @@ static struct virtio_transport virtio_transport = { .seqpacket_allow = virtio_transport_seqpacket_allow, .seqpacket_has_data = virtio_transport_seqpacket_has_data, + .msgzerocopy_allow = virtio_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