• Nikolay Aleksandrov's avatar
    virtio_net: add ethtool support for set and get of settings · 16032be5
    Nikolay Aleksandrov authored
    This patch allows the user to set and retrieve speed and duplex of the
    virtio_net device via ethtool. Having this functionality is very helpful
    for simulating different environments and also enables the virtio_net
    device to participate in operations where proper speed and duplex are
    required (e.g. currently bonding lacp mode requires full duplex). Custom
    speed and duplex are not allowed, the user-supplied settings are validated
    before applying.
    
    Example:
    $ ethtool eth1
    Settings for eth1:
    ...
    	Speed: Unknown!
    	Duplex: Unknown! (255)
    $ ethtool -s eth1 speed 1000 duplex full
    $ ethtool eth1
    Settings for eth1:
    ...
    	Speed: 1000Mb/s
    	Duplex: Full
    
    Based on a patch by Roopa Prabhu.
    Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    16032be5
virtio_net.c 53.5 KB