mbox series

[net-next,v4,0/8] Support setting lanes via ethtool

Message ID 20210202180612.325099-1-danieller@nvidia.com
Headers show
Series Support setting lanes via ethtool | expand

Message

Danielle Ratson Feb. 2, 2021, 6:06 p.m. UTC
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-#2 allows user space to configure the desired number of lanes.

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

Patches #5-#7 add support for lanes configuration in mlxsw.

Patch #8 adds a selftest.

v4:
	* Add patch #1 for validating parameters before rtnl_lock().

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 (8):
  ethtool: Validate master slave configuration before rtnl_lock()
  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_netlink.h          |   1 +
 net/ethtool/common.c                          | 147 +++++++++++++
 net/ethtool/common.h                          |   7 +
 net/ethtool/ioctl.c                           |  18 +-
 net/ethtool/linkmodes.c                       | 208 ++++++------------
 net/ethtool/netlink.h                         |   2 +-
 .../drivers/net/mlxsw/ethtool_lanes.sh        | 187 ++++++++++++++++
 .../selftests/net/forwarding/ethtool_lib.sh   |  34 +++
 tools/testing/selftests/net/forwarding/lib.sh |  28 +++
 13 files changed, 626 insertions(+), 231 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/ethtool_lanes.sh

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 4, 2021, 4 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Tue, 2 Feb 2021 20:06:04 +0200 you wrote:
> 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:

> 

> [...]


Here is the summary with links:
  - [net-next,v4,1/8] ethtool: Validate master slave configuration before rtnl_lock()
    https://git.kernel.org/netdev/net-next/c/189e7a8d9420
  - [net-next,v4,2/8] ethtool: Extend link modes settings uAPI with lanes
    https://git.kernel.org/netdev/net-next/c/012ce4dd3102
  - [net-next,v4,3/8] ethtool: Get link mode in use instead of speed and duplex parameters
    https://git.kernel.org/netdev/net-next/c/c8907043c6ac
  - [net-next,v4,4/8] ethtool: Expose the number of lanes in use
    https://git.kernel.org/netdev/net-next/c/7dc33f0914a9
  - [net-next,v4,5/8] mlxsw: ethtool: Remove max lanes filtering
    https://git.kernel.org/netdev/net-next/c/5fc4053df3d9
  - [net-next,v4,6/8] mlxsw: ethtool: Add support for setting lanes when autoneg is off
    https://git.kernel.org/netdev/net-next/c/763ece86f0c2
  - [net-next,v4,7/8] mlxsw: ethtool: Pass link mode in use to ethtool
    https://git.kernel.org/netdev/net-next/c/25a96f057a0f
  - [net-next,v4,8/8] net: selftests: Add lanes setting test
    https://git.kernel.org/netdev/net-next/c/f72e2f48c710

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html