linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps
@ 2022-10-31 17:39 Ilya Maximets
  2022-11-02 13:25 ` Nicolas Dichtel
  2022-11-03  8:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Ilya Maximets @ 2022-10-31 17:39 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.

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 <i.maximets@ovn.org>
---
 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] 3+ messages in thread

* Re: [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps
  2022-10-31 17:39 [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps Ilya Maximets
@ 2022-11-02 13:25 ` Nicolas Dichtel
  2022-11-03  8:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Nicolas Dichtel @ 2022-11-02 13:25 UTC (permalink / raw)
  To: Ilya Maximets, netdev
  Cc: Jakub Kicinski, David S. Miller, Eric Dumazet, Paolo Abeni, linux-kernel

Le 31/10/2022 à 18:39, Ilya Maximets a écrit :
> 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 <i.maximets@ovn.org>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>

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

* Re: [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps
  2022-10-31 17:39 [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps Ilya Maximets
  2022-11-02 13:25 ` Nicolas Dichtel
@ 2022-11-03  8:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-03  8:50 UTC (permalink / raw)
  To: Ilya Maximets; +Cc: netdev, kuba, davem, edumazet, pabeni, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (master)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 31 Oct 2022 18:39:53 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net: tun: bump the link speed from 10Mbps to 10Gbps
    https://git.kernel.org/netdev/net-next/c/598d2982b111

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-11-03  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 17:39 [PATCH net-next] net: tun: bump the link speed from 10Mbps to 10Gbps Ilya Maximets
2022-11-02 13:25 ` Nicolas Dichtel
2022-11-03  8:50 ` patchwork-bot+netdevbpf

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).