From patchwork Fri Oct 21 11:49:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 6662 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp653156wrr; Fri, 21 Oct 2022 04:54:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ca8m/85XnT/fFvUIeJWWCn8XRnGwFzMX9XpfSCc/qWaKhuM5z9YTOy9/quTVlQlEJ8n3v X-Received: by 2002:a17:902:eb89:b0:185:33d:cb34 with SMTP id q9-20020a170902eb8900b00185033dcb34mr18995969plg.55.1666353298878; Fri, 21 Oct 2022 04:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666353298; cv=none; d=google.com; s=arc-20160816; b=X+gnthGRtXMzUQ3PBREVMHFcXegDrp7dUbjxGqMKJSWsnXqmZ9zzwT+FzIobU0wqb7 k8pqmKIpP6I9Q5XLEYpMnJQhuZi9Aasm9+shLrrj9IUwDzxVbru29iXP69ciEbqkp/dQ wV8Z3zPf1VcM41O4wmvXT/3A3W8Lq5N8VchYV6rM6HiJLSDe4WW+mjlYv00ZEI0YMxj3 TzMiIe0ys7nW4g6Xn2HkygdD7qkTZtEHgZlKB2XH9Q0AsC4+SmSKHIKSkuYmV2tfgHPi ky5tvlVHIxO8Lnt2C129+ZZ6r6hRInsdB4VkuNaje/bmrbz/1Nenjo037Q6J2EQCr8ha ArTw== 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 :message-id:date:subject:cc:to:from; bh=tSfXWIUWhdZ94bq7P5AqDSgCltruf041bzbL12DL6p0=; b=sGPLHFMr9pEpV852RXnrGcrXrbrdBSh80TFZcCkXJcegPaqrrN1XCydy8OWUEVRZ5Z 3FeYHb2kLeeoIGgkQ3VzYppMrEQzeEOnUAI2kmfs3Umt7VlwNc2F8VVylTHdzsybtVcV Cgci0iHachuK62a6wS2VwjxRldKYM9tEzq645pT0gLiGDzYCD6kcckbLUXu3dCD1kwH1 wxRQuPafaCo66dkrc7JtVY7pAZSUes8D1WC0mEjX5whtCuedPmWO2E4q2k/zt1jLjeCH IFUHaXANM30WtD/Iz+BLqAF7SYBHtK7rBZ8t5cFjGHXK3QZe4EXOWJ57dumOuTZslYO0 dP8g== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e128-20020a636986000000b00460a5961827si25049988pgc.651.2022.10.21.04.54.46; Fri, 21 Oct 2022 04:54:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbiJULtd (ORCPT + 99 others); Fri, 21 Oct 2022 07:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbiJULtc (ORCPT ); Fri, 21 Oct 2022 07:49:32 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 592311E716; Fri, 21 Oct 2022 04:49:29 -0700 (PDT) Received: (Authenticated sender: i.maximets@ovn.org) by mail.gandi.net (Postfix) with ESMTPSA id D57E71BF20E; Fri, 21 Oct 2022 11:49:26 +0000 (UTC) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, Ilya Maximets Subject: [RFE net-next] net: tun: 1000x speed up Date: Fri, 21 Oct 2022 13:49:21 +0200 Message-Id: <20221021114921.3705550-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NEUTRAL,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?1747298076341672497?= X-GMAIL-MSGID: =?utf-8?q?1747298076341672497?= The 10Mbps link speed was set in 2004 when the ethtool interface was initially added to the tun driver. It might have been a good assumption 18 years ago, but CPUs and network stack came a long way since then. Other virtual ports typically report much higher speeds. For example, veth reports 10Gbps since its introduction in 2007. Some userspace applications rely on the current link speed in certain situations. For example, Open vSwitch is using link speed as an upper bound for QoS configuration if user didn't specify the maximum rate. Advertised 10Mbps doesn't match reality in a modern world, so users have to always manually override the value with something more sensible to avoid configuration issues, e.g. limiting the traffic too much. This also creates additional confusion among users. 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. Link: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-July/051958.html Signed-off-by: Ilya Maximets --- Sorry for the clickbait subject line. Can change it to something more sensible while posting non-RFE patch. Something like: 'net: tun: bump the link speed from 10Mbps to 10Gbps' This patch is RFE just to start a conversation. drivers/net/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 27c6d235cbda..48bb4a166ad4 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -3514,7 +3514,7 @@ static void tun_default_link_ksettings(struct net_device *dev, { ethtool_link_ksettings_zero_link_mode(cmd, supported); ethtool_link_ksettings_zero_link_mode(cmd, advertising); - cmd->base.speed = SPEED_10; + cmd->base.speed = SPEED_10000; cmd->base.duplex = DUPLEX_FULL; cmd->base.port = PORT_TP; cmd->base.phy_address = 0;