mbox series

[net-next,0/3] ethtool: support FEC configuration over netlink

Message ID 20210330035954.1206441-1-kuba@kernel.org (mailing list archive)
Headers show
Series ethtool: support FEC configuration over netlink | expand

Message

Jakub Kicinski March 30, 2021, 3:59 a.m. UTC
This series adds support for the equivalents of ETHTOOL_GFECPARAM
and ETHTOOL_SFECPARAM over netlink.

As a reminder - this is an API which allows user to query current
FEC mode, as well as set FEC manually if autoneg is disabled.
It does not configure anything if autoneg is enabled (that said
few/no drivers currently reject .set_fecparam calls while autoneg
is disabled, hopefully FW will just ignore the settings).

The existing functionality is mostly preserved in the new API.
The ioctl interface uses a set of flags, and link modes to tell
user which modes are supported. Here is how the flags translate
to the new interface (skipping descriptions for actual FEC modes):

  ioctl flag      |   description         |  new API
================================================================
ETHTOOL_FEC_OFF   | disabled (supported)  | \
ETHTOOL_FEC_RS    |                       |  ` link mode bitset
ETHTOOL_FEC_BASER |                       |  / .._A_FEC_MODES
ETHTOOL_FEC_LLRS  |                       | /  
ETHTOOL_FEC_AUTO  | pick based on cable   | bool .._A_FEC_AUTO
ETHTOOL_FEC_NONE  | not supported         | no bit, no AUTO reported

Since link modes are already depended on (although somewhat implicitly)
for expressing supported modes - the new interface uses them for
the manual configuration, as well as uses link mode bit number
to communicate the active mode.

Use of link modes allows us to define any number of FEC modes we want,
and reuse the strset we already have defined.

Separating AUTO as its own attribute is the biggest changed compared
to the ioctl. It means drivers can no longer report AUTO as the
active FEC mode because there is no link mode for AUTO.
active_fec == AUTO makes little sense in the first place IMHO,
active_fec should be the actual mode, so hopefully this is fine.

The other minor departure is that None is no longer explicitly
expressed in the API. But drivers are reasonable in handling of
this somewhat pointless bit, so I'm not expecting any issues there.


One extension which could be considered would be moving active FEC
to ETHTOOL_MSG_LINKMODE_*, but then why not move all of FEC into
link modes? I don't know where to draw the line.

netdevsim support and a simple self test are included.

Next step is adding stats similar to the ones added for pause.

Jakub Kicinski (3):
  ethtool: support FEC settings over netlink
  netdevsim: add FEC settings support
  selftests: ethtool: add a netdevsim FEC test

 Documentation/networking/ethtool-netlink.rst  |  62 ++++-
 drivers/net/netdevsim/ethtool.c               |  36 +++
 drivers/net/netdevsim/netdevsim.h             |   3 +
 include/uapi/linux/ethtool_netlink.h          |  17 ++
 net/ethtool/Makefile                          |   2 +-
 net/ethtool/fec.c                             | 238 ++++++++++++++++++
 net/ethtool/netlink.c                         |  19 ++
 net/ethtool/netlink.h                         |   4 +
 .../drivers/net/netdevsim/ethtool-common.sh   |   5 +-
 .../drivers/net/netdevsim/ethtool-fec.sh      | 110 ++++++++
 10 files changed, 492 insertions(+), 4 deletions(-)
 create mode 100644 net/ethtool/fec.c
 create mode 100755 tools/testing/selftests/drivers/net/netdevsim/ethtool-fec.sh

Comments

patchwork-bot+netdevbpf@kernel.org March 31, 2021, 9:30 p.m. UTC | #1
Hello:

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

On Mon, 29 Mar 2021 20:59:51 -0700 you wrote:
> This series adds support for the equivalents of ETHTOOL_GFECPARAM
> and ETHTOOL_SFECPARAM over netlink.
> 
> As a reminder - this is an API which allows user to query current
> FEC mode, as well as set FEC manually if autoneg is disabled.
> It does not configure anything if autoneg is enabled (that said
> few/no drivers currently reject .set_fecparam calls while autoneg
> is disabled, hopefully FW will just ignore the settings).
> 
> [...]

Here is the summary with links:
  - [net-next,1/3] ethtool: support FEC settings over netlink
    https://git.kernel.org/netdev/net-next/c/1e5d1f69d9fb
  - [net-next,2/3] netdevsim: add FEC settings support
    https://git.kernel.org/netdev/net-next/c/0d7f76dc11e6
  - [net-next,3/3] selftests: ethtool: add a netdevsim FEC test
    https://git.kernel.org/netdev/net-next/c/1da07e5db356

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