netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danielle Ratson <danieller@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>, <jiri@nvidia.com>,
	<andrew@lunn.ch>, <f.fainelli@gmail.com>, <mkubecek@suse.cz>,
	<mlxsw@nvidia.com>, <idosch@nvidia.com>,
	Danielle Ratson <danieller@nvidia.com>
Subject: [PATCH net-next v3 0/7] Support setting lanes via ethtool
Date: Wed, 20 Jan 2021 11:37:06 +0200	[thread overview]
Message-ID: <20210120093713.4000363-1-danieller@nvidia.com> (raw)

Some speeds can be achieved with different number of lanes. For example,
100Gbps can be achieved using two lanes of 50Gbps or four lanes of
25Gbps. This patchset adds a new selector that allows ethtool to
advertise link modes according to their number of lanes and also force a
specific number of lanes when autonegotiation is off.

Advertising all link modes with a speed of 100Gbps that use two lanes:

$ ethtool -s swp1 speed 100000 lanes 2 autoneg on

Forcing a speed of 100Gbps using four lanes:

$ ethtool -s swp1 speed 100000 lanes 4 autoneg off

Patchset overview:

Patch #1 allows user space to configure the desired number of lanes.

Patch #2-#3 adjusts ethtool to dump to user space the number of lanes
currently in use.

Patches #4-#6 add support for lanes configuration in mlxsw.

Patch #7 adds a selftest.

v3:
	* Patch #1: Change ethtool_ops.capabilities to be a bitfield,
	  and set min and max for the lanes policy.
	* Patch #2: Remove LINK_MODE_UNKNOWN and move the speed, duplex
	  and lanes derivation to the wrapper
	  __ethtool_get_link_ksettings().
	* Patch #5: Set the bitfield of supporting lanes in the driver to 'true'.
	* Patch #7: Move the test to drivers/net/mlxsw.

v2:
	* Patch #1: Remove ETHTOOL_LANES defines and simply use a number
	  instead.
	* Patches #2,#6: Pass link mode from driver to ethtool instead
	* of the parameters themselves.
	* Patch #5: Add an actual width field for spectrum-2 link modes
	  in order to set the suitable link mode when lanes parameter is
	  passed.
	* Patch #6: Changed lanes to be unsigned in
	  'struct link_mode_info'.
	* Patch #7: Remove the test for recieving max_width when lanes
	* is not set by user. When not setting lanes, we don't promise
	  anything regarding what number of lanes will be chosen.

Danielle Ratson (7):
  ethtool: Extend link modes settings uAPI with lanes
  ethtool: Get link mode in use instead of speed and duplex parameters
  ethtool: Expose the number of lanes in use
  mlxsw: ethtool: Remove max lanes filtering
  mlxsw: ethtool: Add support for setting lanes when autoneg is off
  mlxsw: ethtool: Pass link mode in use to ethtool
  net: selftests: Add lanes setting test

 Documentation/networking/ethtool-netlink.rst  |  11 +-
 .../net/ethernet/mellanox/mlxsw/spectrum.h    |  13 +-
 .../mellanox/mlxsw/spectrum_ethtool.c         | 196 +++++++++++-------
 include/linux/ethtool.h                       |   5 +
 include/uapi/linux/ethtool.h                  |   2 +
 include/uapi/linux/ethtool_netlink.h          |   1 +
 net/ethtool/common.c                          | 114 ++++++++++
 net/ethtool/common.h                          |   7 +
 net/ethtool/ioctl.c                           |  18 +-
 net/ethtool/linkmodes.c                       | 179 +++++-----------
 net/ethtool/netlink.h                         |   2 +-
 .../drivers/net/mlxsw/ethtool_lanes.sh        | 188 +++++++++++++++++
 .../selftests/net/forwarding/ethtool_lib.sh   |  34 +++
 tools/testing/selftests/net/forwarding/lib.sh |  28 +++
 14 files changed, 576 insertions(+), 222 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/ethtool_lanes.sh

-- 
2.26.2


             reply	other threads:[~2021-01-20 11:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  9:37 Danielle Ratson [this message]
2021-01-20  9:37 ` [PATCH net-next v3 1/7] ethtool: Extend link modes settings uAPI with lanes Danielle Ratson
2021-01-20 22:35   ` Edwin Peer
2021-02-02 18:08     ` Danielle Ratson
2021-01-22  3:44   ` Jakub Kicinski
2021-01-25 15:53     ` Danielle Ratson
2021-01-25 19:02       ` Jakub Kicinski
2021-01-20  9:37 ` [PATCH net-next v3 2/7] ethtool: Get link mode in use instead of speed and duplex parameters Danielle Ratson
2021-01-20 23:39   ` Edwin Peer
2021-01-24  8:36     ` Danielle Ratson
2021-01-25 18:03       ` Edwin Peer
2021-01-26 17:06         ` Danielle Ratson
2021-01-26 17:14           ` Edwin Peer
2021-01-27 13:22             ` Danielle Ratson
2021-01-28 20:26               ` Michal Kubecek
2021-01-31 15:33                 ` Danielle Ratson
2021-01-31 17:39                   ` Edwin Peer
2021-02-01 13:49                     ` Danielle Ratson
2021-02-01 18:14                       ` Edwin Peer
2021-02-01 20:29                         ` Jakub Kicinski
2021-02-01 21:05                           ` Edwin Peer
2021-02-01 21:41                             ` Jakub Kicinski
2021-02-01 21:59                               ` Edwin Peer
2021-02-01 22:20                                 ` Jakub Kicinski
2021-02-02  0:14                                   ` Edwin Peer
2021-02-02  1:08                                     ` Jakub Kicinski
2021-01-20  9:37 ` [PATCH net-next v3 3/7] ethtool: Expose the number of lanes in use Danielle Ratson
2021-01-20  9:37 ` [PATCH net-next v3 4/7] mlxsw: ethtool: Remove max lanes filtering Danielle Ratson
2021-01-20  9:37 ` [PATCH net-next v3 5/7] mlxsw: ethtool: Add support for setting lanes when autoneg is off Danielle Ratson
2021-01-20  9:37 ` [PATCH net-next v3 6/7] mlxsw: ethtool: Pass link mode in use to ethtool Danielle Ratson
2021-01-20  9:37 ` [PATCH net-next v3 7/7] net: selftests: Add lanes setting test Danielle Ratson

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=20210120093713.4000363-1-danieller@nvidia.com \
    --to=danieller@nvidia.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    /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 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).