All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cris Forno <cforno12@linux.ibm.com>
To: netdev@vger.kernel.org
Cc: mst@redhat.com, jasowang@redhat.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, sashal@kernel.org,
	tlfalcon@linux.ibm.com, davem@davemloft.net, mkubecek@suse.cz,
	willemdebruijn.kernel@gmail.com, kuba@kernel.org,
	Cris Forno <cforno12@linux.vnet.ibm.com>
Subject: [PATCH, net-next, v7, 0/2] net/ethtool: Introduce link_ksettings API for virtual network devices
Date: Fri, 28 Feb 2020 14:12:03 -0600	[thread overview]
Message-ID: <20200228201205.15846-1-cforno12@linux.ibm.com> (raw)

From: Cris Forno <cforno12@linux.vnet.ibm.com>

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
a helper function ethtool_virtdev_set_link_ksettings, which is used to
retrieve alterable link settings. In addition, there is a new ethtool
function defined to validate those settings. 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.

---
v7:  - removed ethtool_validate_cmd function pointer parameter from
      ethtool_virtdev_set_link_ksettings since none of the virtual drivers
      pass in a custom validate function as suggested by Michal Kubecek.

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    | 41 ++++++++-------------
 drivers/net/virtio_net.c           | 39 ++------------------
 include/linux/ethtool.h            |  6 ++++
 net/ethtool/ioctl.c                | 39 ++++++++++++++++++++
 6 files changed, 98 insertions(+), 87 deletions(-)

-- 
2.25.0


             reply	other threads:[~2020-02-28 20:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 20:12 Cris Forno [this message]
2020-02-28 20:12 ` [PATCH, net-next, v7, 1/2] ethtool: Factored out similar ethtool link settings for virtual devices to core Cris Forno
2020-02-28 20:12 ` [PATCH, net-next, v7, 2/2] net/ethtool: Introduce link_ksettings API for virtual network devices Cris Forno
2020-03-01  5:49 ` [PATCH, net-next, v7, 0/2] " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200228201205.15846-1-cforno12@linux.ibm.com \
    --to=cforno12@linux.ibm.com \
    --cc=cforno12@linux.vnet.ibm.com \
    --cc=davem@davemloft.net \
    --cc=haiyangz@microsoft.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=tlfalcon@linux.ibm.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.