[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200225214111.4135-1-cforno12@linux.vnet.ibm.com>
Date: Tue, 25 Feb 2020 15:41:09 -0600
From: Cris Forno <cforno12@...ux.vnet.ibm.com>
To: netdev@...r.kernel.org
Cc: mst@...hat.com, jasowang@...hat.com, haiyangz@...rosoft.com,
sthemmin@...rosoft.com, sashal@...nel.org, tlfalcon@...ux.ibm.com,
davem@...emloft.net, mkubecek@...e.cz,
willemdebruijn.kernel@...il.com, kuba@...nel.org,
Cris Forno <cforno12@...ux.vnet.ibm.com>
Subject: [PATCH, net-next, v6, 0/2] net/ethtool: Introduce link_ksettings API for virtual network devices
This series provides an API for drivers of virtual network devices that
allows users to alter initial device speed and duplex settings to reflect
the actual capabilities of underlying hardware. The changes made include
two helper functions ethtool_virtdev_set_link_ksettings, which is used to
retrieve alterable link settings. In addition, there is a new ethtool
operation defined to validate those settings provided by the user. This
operation can use either a generic validation function,
ethtool_virtdev_validate_cmd, or one defined by the driver. These changes
resolve code duplication for existing virtual network drivers that have
already implemented this behavior. In the case of the ibmveth driver,
this API is used to provide this capability for the first time.
---
v6: - removed netvsc_validate_ethtool_ss_cmd(). netvsc_drv now uses
ethtool_virtdev_validate_cmd() instead as suggested by Michal Kubecek
and approved by Haiyang Zhang.
- matched handler argument name of ethtool_virtdev_set_link_ksettings
in declaration and definition as suggested by Michal Kubecek.
- shortened validate variable assignment in
ethtool_virtdev_set_link_ksettings as suggested by Michal Kubecek.
v5: - virtdev_validate_link_ksettings is taken out of the ethtool global
structure and is instead added as an argument to
ethtool_virtdev_set_link_ksettings as suggested by Jakub Kicinski.
v4: - Cleaned up return statement in ethtool_virtdev_validate_cmd based
off of Michal Kubecek's and Thomas Falcon's suggestion.
- If the netvsc driver is using the VF device in order to get
accelerated networking, the real speed and duplex is reported by using
the VF device as suggested by Stephen Hemminger.
- The speed and duplex variables are now passed by value rather than
passed by pointer as suggested by Willem de Bruijin and Michal
Kubecek.
- Removed ethtool_virtdev_get_link_ksettings since it was too simple
to warrant a helper function.
v3: - Factored out duplicated code to core/ethtool to provide API to
virtual drivers
v2: - Updated default driver speed/duplex settings to avoid breaking
existing setups
---
Cris Forno (2):
ethtool: Factored out similar ethtool link settings for virtual
devices to core
net/ethtool: Introduce link_ksettings API for virtual network devices
drivers/net/ethernet/ibm/ibmveth.c | 57 +++++++++++++++++-------------
drivers/net/ethernet/ibm/ibmveth.h | 3 ++
drivers/net/hyperv/netvsc_drv.c | 42 +++++++++-------------
drivers/net/virtio_net.c | 40 ++-------------------
include/linux/ethtool.h | 8 +++++
net/ethtool/ioctl.c | 44 +++++++++++++++++++++++
6 files changed, 107 insertions(+), 87 deletions(-)
--
2.25.0
Powered by blists - more mailing lists