Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7559508rwi; Mon, 24 Oct 2022 16:47:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4NggG5Bq0YN/gJxbIIC3SdazZG4vrA88JXDs0foUIIKGVKwnOpIJ0haAa8J56SyU0mnh7o X-Received: by 2002:aa7:810d:0:b0:563:1fa6:fecc with SMTP id b13-20020aa7810d000000b005631fa6feccmr36518887pfi.24.1666655273608; Mon, 24 Oct 2022 16:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666655273; cv=none; d=google.com; s=arc-20160816; b=oleV9KeYCSL5FaCN20ef8v7i3Fj4rV5BZ0Koj1Mf2l8DzXfKa7wtTKW/U+NBURy5ds fxzT6jUPnkv3433trouDuXL8poG14K5ncQT5Ivx/tx/o0UAnx2Dp9APlZEEuL0FTThqt jwSsNJdZ7HHnA9Pe9iXDZNruJm9q2b9/NbDYHa6QYBekvbwwKNytoxHlbvvvhu60Wj13 w/uME/lbLo969OU+1HLJlQw0fFgPVABKPDER/ytupahD3vBi9W+hxtt/oWZM/uHOFlDn FbJTSE1l8ShbQkfFUZyu1LNFd+ITAJ0xU7KIgyzhH24xZLxLo7fTtA66T49SHaogBYOB A7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=B2wwh5NgmuWFXu+sbSH3I7eDkSGgbsYO1jbFt8jdXh8=; b=o2/DwOCNSg97tO1tjBD5FQaPTLXfZmwu79fF8byUvJ4gSfrpcOcjqOktj+rxUI8gIB hw9lvBUc5IfI4xbgApmlJq54rwXmkNsYLDpCQbqNyqb2D3+gyWdSucm13wotz45balQ3 Vgjzx2YwQNEQeu98f/mSvw0HfpPfGlUvxTnk+rlOos1epKzxSxjAm3gpMI7K4Bbhp8by ZxwjfCLbILvkYjeA9mJSv+nbtV7JVRnrTWL5Ex8Fp1o0FA6lJPsIcsGVK9pqwxjyxGCX B6TykXw3EA/E0hwdD7dME85MXudk7EmWqnsiBUW7T4+vf+JNMsgG2DBPE45Rp+3XDg5P BEaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvpn.net header.s=20170822-45nk5nwl header.b=blXWXCXq; 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=NONE sp=NONE dis=NONE) header.from=openvpn.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a17090a408d00b00205ef38b646si1262390pjg.80.2022.10.24.16.47.41; Mon, 24 Oct 2022 16:47:53 -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=@openvpn.net header.s=20170822-45nk5nwl header.b=blXWXCXq; 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=NONE sp=NONE dis=NONE) header.from=openvpn.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbiJXXgz (ORCPT + 99 others); Mon, 24 Oct 2022 19:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbiJXXgU (ORCPT ); Mon, 24 Oct 2022 19:36:20 -0400 X-Greylist: delayed 12570 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 24 Oct 2022 14:56:58 PDT Received: from smtp126.iad3a.emailsrvr.com (smtp126.iad3a.emailsrvr.com [173.203.187.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEDF02D450B for ; Mon, 24 Oct 2022 14:56:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openvpn.net; s=20170822-45nk5nwl; t=1666627158; bh=btRk7swX7GdyOa27zjsvyKxH9I1WQ7w6KviW39ZTEjM=; h=Date:Subject:To:From:From; b=blXWXCXqvCfG2PGic4/7VMl3LwZfUC8IQYpr+XpvxgmdKQs0B45TKBoz5VnLiq7sz CWVCpj8G4h/KWDWnw8Kt/NygCmhEXmPQtb4XkwR6R4aI4A+V+ujXxXDTixzb6c1r6s Eqvxrr9WgHmu+1iG1wnMPfGxi9TwwJzx4y/Oe8Io= X-Auth-ID: antonio@openvpn.net Received: by smtp16.relay.iad3a.emailsrvr.com (Authenticated sender: antonio-AT-openvpn.net) with ESMTPSA id 8EF0B5C85; Mon, 24 Oct 2022 11:59:16 -0400 (EDT) Message-ID: Date: Mon, 24 Oct 2022 17:59:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [RFE net-next] net: tun: 1000x speed up To: nicolas.dichtel@6wind.com, Ilya Maximets , Jakub Kicinski Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org References: <20221021114921.3705550-1-i.maximets@ovn.org> <20221021090756.0ffa65ee@kernel.org> <5af190a8-ac35-82a6-b099-e9a817757676@6wind.com> Content-Language: en-US From: Antonio Quartulli In-Reply-To: <5af190a8-ac35-82a6-b099-e9a817757676@6wind.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Classification-ID: 0a266811-a982-4e0c-a42b-2cb7488dbf9b-1-1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 24/10/2022 14:27, Nicolas Dichtel wrote: > Le 24/10/2022 à 13:56, Ilya Maximets a écrit : >> On 10/24/22 11:44, Nicolas Dichtel wrote: >>> Le 21/10/2022 à 18:07, Jakub Kicinski a écrit : >>>> On Fri, 21 Oct 2022 13:49:21 +0200 Ilya Maximets wrote: >>>>> Bump the advertised speed to at least match the veth. 10Gbps also >>>>> seems like a more or less fair assumption these days, even though >>>>> CPUs can do more. Alternative might be to explicitly report UNKNOWN >>>>> and let the application/user decide on a right value for them. >>>> >>>> UNKOWN would seem more appropriate but at this point someone may depend >>>> on the speed being populated so it could cause regressions, I fear :S >>> If it is put in a bonding, it may cause some trouble. Maybe worth than >>> advertising 10M. >> >> My thoughts were that changing the number should have a minimal impact >> while changing it to not report any number may cause some issues in >> applications that doesn't expect that for some reason (not having a >> fallback in case reported speed is unknown isn't great, and the argument >> can be made that applications should check that, but it's hard to tell >> for every application if they actually do that today). >> >> Bonding is also a good point indeed, since it's even in-kernel user. >> >> >> The speed bump doesn't solve the problem per se. It kind of postpones >> the decision, since we will run into the same issue eventually again. >> That's why I wanted to discuss that first. >> >> Though I think that at least unification across virtual devices (tun and >> veth) should be a step in a right direction. > Just to make it clear, I'm not against aligning speed with veth, I'm only > against reporting UNKNOWN. > >> >>> >>> Note that this value could be configured with ethtool: >>> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4e24f2dd516ed >> >> This is interesting, but it's a bit hard to manage, because in order >> to make a decision to bump the speed, application should already know >> that this is a tun/tap device. So, there has to be a special case > But this should be done by the application which creates this tun interface. Not > by the application that uses this information. > >> implemented in the code that detects the driver and changes the speed >> (this is about application that is using the interface, but didn't >> create it), but if we already know the driver, then it doesn't make >> sense to actually change the speed in many cases as application can >> already act accordingly. >> >> Also, the application may not have permissions to do that (I didn't >> check the requirements, but my guess would be at least CAP_NET_ADMIN?). > Sure, but the one who creates it, has the right to configure it correctly. It's > part of the configuration of the interface. > > Setting an higher default speed seems to be a workaround to fix an incorrect > configuration. And as you said, it will probably be wrong again in a few years ;-) > What if the real throughput is in the order of 10Mbps? The tun driver can be used for many purposes and the throughput will depend on the specific case. Imagine an application using the reported speed for computing some kind of metric: having 10Gbps will corrupt the result entirely. OTOH it is true that 10Mbps may corrupt the metric as well, but the latter is closer to reality IMHO (when using tun to process and send traffic over the network). At the end I also agree that the speed should be set by whoever creates the interface. As they are the only one who knows what to expect for real. (Note: tun is used also to implement userspace VPNs, with throughput ranging from 10Mbps to 1Gbps). my 2 cents. Cheers, -- Antonio Quartulli OpenVPN Inc.