linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFE net-next] net: tun: 1000x speed up
@ 2022-10-21 11:49 Ilya Maximets
  2022-10-21 11:50 ` Ilya Maximets
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Ilya Maximets @ 2022-10-21 11:49 UTC (permalink / raw)
  To: netdev
  Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni,
	linux-kernel, Ilya Maximets

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 <i.maximets@ovn.org>
---

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;
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-10-31 17:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 11:49 [RFE net-next] net: tun: 1000x speed up Ilya Maximets
2022-10-21 11:50 ` Ilya Maximets
2022-10-21 16:07 ` Jakub Kicinski
2022-10-24  9:44   ` Nicolas Dichtel
2022-10-24 11:56     ` Ilya Maximets
2022-10-24 12:27       ` Nicolas Dichtel
2022-10-24 15:39         ` Ilya Maximets
2022-10-24 15:59         ` Antonio Quartulli
2022-10-24 17:48           ` Ilya Maximets
2022-10-25 22:16             ` Antonio Quartulli
2022-10-26 12:56               ` Ilya Maximets
2022-10-24 11:08 ` Pavel Machek
2022-10-24 11:14   ` Ilya Maximets
2022-10-31 17:09 ` Ilya Maximets

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).