hv_netvsc: add ethtool support for set and get of settings
Subsystems (3)
PATCH 1/1 hv_netvsc: add ethtool support for set and get of settings
This patch allows the user to set and retrieve speed and duplex of the hv_netvsc device via ethtool.
Example:
$ ethtool eth0
Settings for eth0:
...
Speed: Unknown!
Duplex: Unknown! (255)
...
$ ethtool -s eth0 speed 1000 duplex full
$ ethtool eth0
Settings for eth0:
...
Speed: 1000Mb/s
Duplex: Full
...This is based on patches by Roopa Prabhu and Nikolay Aleksandrov.
--- drivers/net/hyperv/hyperv_net.h | 4 +++ drivers/net/hyperv/netvsc_drv.c | 56 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+)
drivers/net/hyperv/hyperv_net.h +4 -0
@@ -658,6 +658,10 @@ struct net_device_context {struct netvsc_stats __percpu *tx_stats;struct netvsc_stats __percpu *rx_stats; + +/* Ethtool settings */ +u8 duplex; +u32 speed; };/* Per netvsc device */
drivers/net/hyperv/netvsc_drv.c +56 -0
74 lines not on this page · raw message
Signature · 1 line
2.5.0
From: Simon Xiao <[email protected]>
Date: Thu, 25 Feb 2016 15:24:08 -0800
Quoted 18 lines
This patch allows the user to set and retrieve speed and duplex of the
hv_netvscdevice via ethtool.Example:
$ ethtool eth0 Settings for eth0: ... Speed: Unknown! Duplex: Unknown! (255) ... $ ethtool -s eth0 speed 1000 duplex full $ ethtool eth0 Settings for eth0: ... Speed: 1000Mb/s Duplex: Full ...
Quoted 3 lines
This is based on patches by Roopa Prabhu and Nikolay Aleksandrov.
Signed-off-by Simon Xiao <[email protected]>
Applied, thanks.
Quoted 25 lines · David Miller
From: Simon Xiao <[email protected]>
Date: Thu, 25 Feb 2016 15:24:08 -0800Quoted 13 lines
This patch allows the user to set and retrieve speed and duplex of the
hv_netvscdevice via ethtool.
Example:$ ethtool eth0 Settings for eth0: ... Speed: Unknown! Duplex: Unknown! (255) ... $ ethtool -s eth0 speed 1000 duplex full $ ethtool eth0 Settings for eth0:Quoted 8 lines
... Speed: 1000Mb/s Duplex: Full ... This is based on patches by Roopa Prabhu and Nikolay Aleksandrov. Signed-off-by: Simon Xiao <[email protected]>
Quoted 1 line
Applied, thanks.
I missed this due to flu, but now I look at it - I don't see the point. Link speed isn't meaingful for a memory-based transport, so "unknown" is correct. The link is effectively full duplex though.
If the issue is that ethtool is a bit shouty about unknowns, let's consider changing that in ethtool, not teaching drivers to lie.
Ben.
Signature · 3 lines
Ben Hutchings If God had intended Man to program, we'd have been born with serial I/O ports.
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
David Miller
maintainerFrom: Ben Hutchings <[email protected]>
Date: Mon, 29 Feb 2016 22:34:38 +0000
Quoted 26 lines · David Miller
Quoted 25 lines
From: Simon Xiao <[email protected]>
Date: Thu, 25 Feb 2016 15:24:08 -0800Quoted 21 lines
This patch allows the user to set and retrieve speed and duplex of the
hv_netvscdevice via ethtool.
Example:$ ethtool eth0 Settings for eth0: ... Speed: Unknown! Duplex: Unknown! (255) ... $ ethtool -s eth0 speed 1000 duplex full $ ethtool eth0 Settings for eth0: ... Speed: 1000Mb/s Duplex: Full ... This is based on patches by Roopa Prabhu and Nikolay Aleksandrov. Signed-off-by: Simon Xiao <[email protected]>
Quoted 8 lines
Quoted 1 line
Applied, thanks.
I missed this due to flu, but now I look at it - I don't see the point. Link speed isn't meaingful for a memory-based transport, so "unknown" is correct. The link is effectively full duplex though.
If the issue is that ethtool is a bit shouty about unknowns, let's consider changing that in ethtool, not teaching drivers to lie.
The issue is that certain bonding modes do not work properly without a speed being reported by a device.
We're doing this for other "virtual" devices already thanks to changes that went in last week, so there is precedence.
Quoted 38 lines · David Miller
From: Ben Hutchings <[email protected]>
Date: Mon, 29 Feb 2016 22:34:38 +0000Quoted 27 lines · David Miller
Quoted 24 lines
From: Simon Xiao <[email protected]>
Date: Thu, 25 Feb 2016 15:24:08 -0800Quoted 13 lines
This patch allows the user to set and retrieve speed and duplex of the
hv_netvscdevice via ethtool.
Example:$ ethtool eth0 Settings for eth0: ... Speed: Unknown! Duplex: Unknown! (255) ... $ ethtool -s eth0 speed 1000 duplex full $ ethtool eth0 Settings for eth0:Quoted 8 lines
... Speed: 1000Mb/s Duplex: Full ... This is based on patches by Roopa Prabhu and Nikolay Aleksandrov. Signed-off-by: Simon Xiao <[email protected]>Quoted 2 lines
Applied, thanks.Quoted 7 lines
I missed this due to flu, but now I look at it - I don't see the point. Link speed isn't meaingful for a memory-based transport, so "unknown" is correct. The link is effectively full duplex though.
If the issue is that ethtool is a bit shouty about unknowns, let's consider changing that in ethtool, not teaching drivers to lie.
Quoted 2 lines
The issue is that certain bonding modes do not work properly without a speed being reported by a device.
Ah, of course.
Quoted 2 lines
We're doing this for other "virtual" devices already thanks to changes that went in last week, so there is precedence.
I know, just wasn't convinced it was a good precedent.
Ben.
Signature · 3 lines
Ben Hutchings If God had intended Man to program, we'd have been born with serial I/O ports.