netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] Fix link_mode derived params functionality
@ 2021-04-07 10:06 Danielle Ratson
  2021-04-07 10:06 ` [PATCH net v3 1/2] ethtool: Remove link_mode param and derive link params from driver Danielle Ratson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Danielle Ratson @ 2021-04-07 10:06 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, eric.dumazet, andrew, mkubecek, f.fainelli,
	acardace, irusskikh, gustavo, magnus.karlsson, ecree, idosch,
	jiri, mlxsw, Danielle Ratson

Currently, link_mode parameter derives 3 other link parameters, speed,
lanes and duplex, and the derived information is sent to user space.

Few bugs were found in that functionality.
First, some drivers clear the 'ethtool_link_ksettings' struct in their
get_link_ksettings() callback and cause receiving wrong link mode
information in user space. And also, some drivers can report random
values in the 'link_mode' field and cause general protection fault.

Second, the link parameters are only derived in netlink path so in ioctl
path, we don't any reasonable values.

Third, setting 'speed 10000 lanes 1' fails since the lanes parameter
wasn't set for ETHTOOL_LINK_MODE_10000baseR_FEC_BIT.

Patch #1 solves the first two problems by removing link_mode parameter
and deriving the link parameters in driver instead of ethtool.
Patch #2 solves the third one, by setting the lanes parameter for the
link_mode.

v3:
	* Remove the link_mode parameter in the first patch to solve
	  both two issues from patch#1 and patch#2.
	* Add the second patch to solve the third issue.

v2:
	* Add patch #2.
	* Introduce 'cap_link_mode_supported' instead of adding a
	  validity field to 'ethtool_link_ksettings' struct in patch #1.

Danielle Ratson (2):
  ethtool: Remove link_mode param and derive link params from driver
  ethtool: Add lanes parameter for ETHTOOL_LINK_MODE_10000baseR_FEC_BIT

 .../mellanox/mlxsw/spectrum_ethtool.c         | 19 ++++++++++++++-----
 include/linux/ethtool.h                       |  9 ++++++++-
 net/ethtool/common.c                          | 17 +++++++++++++++++
 net/ethtool/ioctl.c                           | 18 +-----------------
 4 files changed, 40 insertions(+), 23 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-07 22:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 10:06 [PATCH net v3 0/2] Fix link_mode derived params functionality Danielle Ratson
2021-04-07 10:06 ` [PATCH net v3 1/2] ethtool: Remove link_mode param and derive link params from driver Danielle Ratson
2021-04-07 10:06 ` [PATCH net v3 2/2] ethtool: Add lanes parameter for ETHTOOL_LINK_MODE_10000baseR_FEC_BIT Danielle Ratson
2021-04-07 22:10 ` [PATCH net v3 0/2] Fix link_mode derived params functionality patchwork-bot+netdevbpf

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).