Skip to content

Commit 598d298

Browse files
igsilyaPaolo Abeni
authored and
Paolo Abeni
committed
net: tun: bump the link speed from 10Mbps to 10Gbps
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/[email protected]/ Link: https://mail.openvswitch.org/pipermail/ovs-discuss/2022-July/051958.html Signed-off-by: Ilya Maximets <[email protected]> Reviewed-by: Nicolas Dichtel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent d3a4706 commit 598d298

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/tun.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3514,7 +3514,7 @@ static void tun_default_link_ksettings(struct net_device *dev,
35143514
{
35153515
ethtool_link_ksettings_zero_link_mode(cmd, supported);
35163516
ethtool_link_ksettings_zero_link_mode(cmd, advertising);
3517-
cmd->base.speed = SPEED_10;
3517+
cmd->base.speed = SPEED_10000;
35183518
cmd->base.duplex = DUPLEX_FULL;
35193519
cmd->base.port = PORT_TP;
35203520
cmd->base.phy_address = 0;

0 commit comments

Comments
 (0)