Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2074507rdb; Tue, 3 Oct 2023 09:25:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBUkGM9m2JrfU77IEjlJQAdYJs7UImzk7QNOESdS9wxCgQ3VM0yOltcFoZ+Fh62GGvDnGB X-Received: by 2002:a05:6871:606:b0:1d6:790e:ddf8 with SMTP id w6-20020a056871060600b001d6790eddf8mr94569oan.5.1696350305751; Tue, 03 Oct 2023 09:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696350305; cv=none; d=google.com; s=arc-20160816; b=Zn6X1uX7FKxjHQyCUxCca5rFQheNbzGOHWbpMSE+35PTDrT+R0G/gIMrIXEqSQtZ8q phfqKBFDmm5WXpS3+D4c4mPc4O1ndOWzuaw7CSFMEFCMzwbfhKaeAIy8y05bhcLdsvY4 37d6QgI8NxC28Jbb7QXdz7awDoIMITacl2UAyPCyQGjM0uRHApUJJasJUwTTPwBjDp3W 8xCqsuoqlf0p6dpXx+CqTRVXWUjSg6VsXs7AOH8rQXj8Fu5tpxPv+lVomnrtJfvT8/Sn EEX5S6vNJRPqenUyT1NoEj2zVPjjbVT1fF12d/CpQC/2EkKCXkTksHP725vo43XYLj+6 4sFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BApKczrxEPgLzQsQyB3wpnpVoMtABSfbJmV036In4jc=; fh=JEq7ZyqHwnKMAbPjHbEHIOO1u1YxTWxtQlCbJmwG+xw=; b=y+xhSA6Woz6jD0QK5r28tJynGc+ggshMkiKPUve7rZzMbOcwIUz6RUaVVcFuc0u4nA 9id6Jlt4KnQlMZ2lDhIZBhUVQ08WZLFmGnoX1WqsJsm5wrVSN0F342KZ2gIO2NpsitLA 5StOdEF0quq1KlxtEkTSyrngTd9ey0XCApjf41Sx4FvERGsZ1qRYospYu5t8h7zfE+li XY0/87xjvgEP6MpJt7oK5JoD0ZLlPr7EPeMm5lDdWpiNwbl/TuU+5sgzGH4KTfcZPFCS 7nhrjF1V6bBKcvMVLDlF701Vz7dNv5H8rI3CwBDjtYVqpKMyNmxRT1Zymt9kG7bTEgWu 20oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyaS2aEZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bt26-20020a63291a000000b005652bd3d3absi1743231pgb.43.2023.10.03.09.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:25:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hyaS2aEZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1E596815831D; Tue, 3 Oct 2023 09:25:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240393AbjJCQYu (ORCPT + 99 others); Tue, 3 Oct 2023 12:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240209AbjJCQYs (ORCPT ); Tue, 3 Oct 2023 12:24:48 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ADBEAF for ; Tue, 3 Oct 2023 09:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696350240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BApKczrxEPgLzQsQyB3wpnpVoMtABSfbJmV036In4jc=; b=hyaS2aEZeMxOpuScysmywA2Ijcg0blza9qbXf3RrPr//LW8rQD6h7hKNYnyNtPcRVVQQC7 ub5EbYRsU5V79r3hOl3V5iFgtZywadF5qqZl8ENpOXku0+d2o47T+m4FRwNNmqI/qCZXCf zOyMSnpA9bMQ5tRt8yMcqCLLHBUe0Yg= Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-335-Ee5zEWXOMKG96Wfq9zdwCw-1; Tue, 03 Oct 2023 12:23:53 -0400 X-MC-Unique: Ee5zEWXOMKG96Wfq9zdwCw-1 Received: by mail-yb1-f199.google.com with SMTP id 3f1490d57ef6-d8943298013so1255961276.2 for ; Tue, 03 Oct 2023 09:23:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696350233; x=1696955033; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BApKczrxEPgLzQsQyB3wpnpVoMtABSfbJmV036In4jc=; b=B2IrdOzftCCvNnQsYlkM1xl/BgDyxRKEIXfwjg++oF6hWeplY2e+MEZSifMhv58rZt /e8u9y6LWdN5taSG9lcmu/vxcAUbZorDHAkjtdqiJw0MlJs25vzcjUnz363Z6XbqwEHK ppljZZRrUgSEyiuJzcCLWV4VOD3Wk0jv/b3GHUF0jKIm7qgcsdStAj36Ga81QQFWcXz1 4CZup85Zm+Tt63YbTip/gKWDbnNOgP7/wbLsWbYoqJNhqPUbApNj8qlw1h+WcVTWgaJ7 tvdl1hBf3L3yoxtghxBhkhRkBExuEB7sVkLF2JzIZ9INaCzHUae4Al7lsk7XsV3YFxQ0 UPwA== X-Gm-Message-State: AOJu0YyJNhnvewiehJ888okEt4FDP2NZUhb44V+B76um+3pgx69A5b5W PV5zNHVv27CElo/B65vJFPUNhlTzZGldFN3W3jy7Q8ZsPOPtflZkmpohl9gHNlle/Rx3gn4ti6S nuNcSkfuepxofDfIFFm4anMwr X-Received: by 2002:a25:6fc1:0:b0:d74:62df:e802 with SMTP id k184-20020a256fc1000000b00d7462dfe802mr13099902ybc.0.1696350233389; Tue, 03 Oct 2023 09:23:53 -0700 (PDT) X-Received: by 2002:a25:6fc1:0:b0:d74:62df:e802 with SMTP id k184-20020a256fc1000000b00d7462dfe802mr13099882ybc.0.1696350233091; Tue, 03 Oct 2023 09:23:53 -0700 (PDT) Received: from sgarzare-redhat (host-82-57-51-114.retail.telecomitalia.it. [82.57.51.114]) by smtp.gmail.com with ESMTPSA id y6-20020a0ce046000000b0065823d20381sm596479qvk.8.2023.10.03.09.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:23:52 -0700 (PDT) Date: Tue, 3 Oct 2023 18:23:48 +0200 From: Stefano Garzarella To: Arseniy Krasnov Cc: Stefan Hajnoczi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@sberdevices.ru, oxffffaa@gmail.com Subject: Re: [PATCH net-next v2 09/12] docs: net: description of MSG_ZEROCOPY for AF_VSOCK Message-ID: References: <20230930210308.2394919-1-avkrasnov@salutedevices.com> <20230930210308.2394919-10-avkrasnov@salutedevices.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20230930210308.2394919-10-avkrasnov@salutedevices.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 03 Oct 2023 09:25:03 -0700 (PDT) On Sun, Oct 01, 2023 at 12:03:05AM +0300, Arseniy Krasnov wrote: >This adds description of MSG_ZEROCOPY flag support for AF_VSOCK type of >socket. > >Signed-off-by: Arseniy Krasnov >--- > Documentation/networking/msg_zerocopy.rst | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) Reviewed-by: Stefano Garzarella > >diff --git a/Documentation/networking/msg_zerocopy.rst b/Documentation/networking/msg_zerocopy.rst >index b3ea96af9b49..78fb70e748b7 100644 >--- a/Documentation/networking/msg_zerocopy.rst >+++ b/Documentation/networking/msg_zerocopy.rst >@@ -7,7 +7,8 @@ Intro > ===== > > The MSG_ZEROCOPY flag enables copy avoidance for socket send calls. >-The feature is currently implemented for TCP and UDP sockets. >+The feature is currently implemented for TCP, UDP and VSOCK (with >+virtio transport) sockets. > > > Opportunity and Caveats >@@ -174,7 +175,9 @@ read_notification() call in the previous snippet. A notification > is encoded in the standard error format, sock_extended_err. > > The level and type fields in the control data are protocol family >-specific, IP_RECVERR or IPV6_RECVERR. >+specific, IP_RECVERR or IPV6_RECVERR (for TCP or UDP socket). >+For VSOCK socket, cmsg_level will be SOL_VSOCK and cmsg_type will be >+VSOCK_RECVERR. > > Error origin is the new type SO_EE_ORIGIN_ZEROCOPY. ee_errno is zero, > as explained before, to avoid blocking read and write system calls on >@@ -235,12 +238,15 @@ Implementation > Loopback > -------- > >+For TCP and UDP: > Data sent to local sockets can be queued indefinitely if the receive > process does not read its socket. Unbound notification latency is not > acceptable. For this reason all packets generated with MSG_ZEROCOPY > that are looped to a local socket will incur a deferred copy. This > includes looping onto packet sockets (e.g., tcpdump) and tun devices. > >+For VSOCK: >+Data path sent to local sockets is the same as for non-local sockets. > > Testing > ======= >@@ -254,3 +260,6 @@ instance when run with msg_zerocopy.sh between a veth pair across > namespaces, the test will not show any improvement. For testing, the > loopback restriction can be temporarily relaxed by making > skb_orphan_frags_rx identical to skb_orphan_frags. >+ >+For VSOCK type of socket example can be found in >+tools/testing/vsock/vsock_test_zerocopy.c. >-- >2.25.1 >