From patchwork Mon Oct 31 17:39:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 13363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2449024wru; Mon, 31 Oct 2022 10:42:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YhPMMBj4sNu1L3+3j6NOV+HRRs84yZrn0bKg3Z3ww9kGqbNw9WWZIb+hgs/waXpSkai5h X-Received: by 2002:a63:4f59:0:b0:46f:b2a4:e9d3 with SMTP id p25-20020a634f59000000b0046fb2a4e9d3mr7337742pgl.452.1667238137482; Mon, 31 Oct 2022 10:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667238137; cv=none; d=google.com; s=arc-20160816; b=XeNNW9Y7LifV8rAgK162nS0trCLdI8x06cub2vgsvotko1ii5M/B3o1liQNQdfQSfU ZfdrokmUi7ub/HSKIWuS9lo88VAduCF9gJu5lmhH/rDCVYYxglRL7EsYT3s2kDyCjs+d vgJSTjHCwZfic12UQ2G2gtaVsWp6XAPa2Ik8XRiqinOrmjxgO1LyR4c5Ca/Vsx/2bd2h m+0JBnnuw5rCOWR9PfIoPMhG9b1LpUSI1rzUQnuSn76GullLYAQKR83qXm1+TNlY2SsW RxEaxl7hJReEqtegMGDijb/urFwwYFkkBPBhW5B0Fht7+v3m36OOue0SXMGMnVs9HvSQ z5Tg== 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=DG5JdntW4DG7spgxfQoATsGzsA17zAiaHib5pRe7iO8=; b=OZErVz+1d67Gv001R/Wz9xlmHHdYKnb6r/sUbVIQwsvetGyZEAEUDVgjgpId6ejk7m UWB0iijMjtYHqQc+/mbu3clQZQUblvGwPN6WLBtdUknQ+cTe+UXLikPqHQVCVzTKUeZD 4wNzic+dbumq3n3JMC2vdE8DLNV2HKezYj9YOIbl0jEHnwWGhGl8f5J45ckbvRFosVD3 GKElC9ShHc4cnewPvkSnb/ZU1WZcBCXBF1UnUyUJinwbrPx0rrCt1csbAgKWMj/BjL0K zuaychF5A54QPMOkemqLbbXuGiivYWOmUIe7Asycdm02NOwgaEg8GjxcNF9ebyQpYGNH 1PMw== 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 198-20020a6217cf000000b005251a2f06bbsi8882275pfx.59.2022.10.31.10.42.04; Mon, 31 Oct 2022 10:42:17 -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 S231272AbiJaRkb (ORCPT + 99 others); Mon, 31 Oct 2022 13:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231224AbiJaRkN (ORCPT ); Mon, 31 Oct 2022 13:40:13 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D88113CD4; Mon, 31 Oct 2022 10:39:58 -0700 (PDT) Received: (Authenticated sender: i.maximets@ovn.org) by mail.gandi.net (Postfix) with ESMTPSA id AB716C0007; Mon, 31 Oct 2022 17:39:55 +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: [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps Date: Mon, 31 Oct 2022 18:39:53 +0100 Message-Id: <20221031173953.614577-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 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?1748225897553415835?= X-GMAIL-MSGID: =?utf-8?q?1748225897553415835?= 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. Alternative might be to explicitly report UNKNOWN and let the user decide on a right value for them. And it is indeed "the right way" of fixing the problem. However, that may cause issues with bonding or with some userspace applications that may rely on speed value to be reported (even though they should not). Just changing the speed value should be a safer option. Users can still override the speed with ethtool, if necessary. RFC discussion is linked below. Link: https://lore.kernel.org/lkml/20221021114921.3705550-1-i.maximets@ovn.org/ Link: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-July/051958.html Signed-off-by: Ilya Maximets Reviewed-by: Nicolas Dichtel --- 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;