mbox series

[net-next,v4,0/6] ethtool: switch EEE netlink interface to use EEE linkmode bitmaps

Message ID 7d82de21-9bde-4f66-99ce-f03ff994ef34@gmail.com (mailing list archive)
Headers show
Series ethtool: switch EEE netlink interface to use EEE linkmode bitmaps | expand

Message

Heiner Kallweit Jan. 27, 2024, 1:24 p.m. UTC
So far only 32bit legacy bitmaps are passed to userspace. This makes
it impossible to manage EEE linkmodes beyond bit 32, e.g. manage EEE
for 2500BaseT and 5000BaseT. This series adds support for passing
full linkmode bitmaps between kernel and userspace.

Fortunately the netlink-based part of ethtool is quite smart and no
changes are needed in ethtool. However this applies to the netlink
interface only, the ioctl interface for now remains restricted to
legacy bitmaps.

Next step will be adding support for the c45 EEE2 standard registers
(3.21, 7.62, 7.63) to the genphy_c45 functions dealing with EEE.
I have a follow-up series for this ready to be submitted.

v2:
- now as RFC
- adopt suggestion from Andrew to start with struct ethtool_keee
  being an identical copy of ethtool_eee, and switch all users
v3:
- switch from RFC to net-next
- add patch 4, and reuse old names in patch 5
- rebase patch 1
v4:
- fix missing replacement in patch 4

Heiner Kallweit (6):
  ethtool: replace struct ethtool_eee with a new struct ethtool_keee on
    kernel side
  ethtool: switch back from ethtool_keee to ethtool_eee for ioctl
  ethtool: adjust struct ethtool_keee to kernel needs
  ethtool: add suffix _u32 to legacy bitmap members of struct
    ethtool_keee
  ethtool: add linkmode bitmap support to struct ethtool_keee
  net: phy: c45: change genphy_c45_ethtool_[get|set]_eee to use EEE
    linkmode bitmaps

 drivers/net/dsa/b53/b53_common.c              | 10 +--
 drivers/net/dsa/b53/b53_priv.h                |  6 +-
 drivers/net/dsa/bcm_sf2.c                     |  2 +-
 drivers/net/dsa/microchip/ksz_common.c        |  4 +-
 drivers/net/dsa/mt7530.c                      |  4 +-
 drivers/net/dsa/mv88e6xxx/chip.c              |  4 +-
 drivers/net/dsa/qca/qca8k-common.c            |  4 +-
 drivers/net/dsa/qca/qca8k.h                   |  4 +-
 .../ethernet/aquantia/atlantic/aq_ethtool.c   | 12 +--
 drivers/net/ethernet/broadcom/asp2/bcmasp.h   |  2 +-
 .../ethernet/broadcom/asp2/bcmasp_ethtool.c   |  8 +-
 .../ethernet/broadcom/bnx2x/bnx2x_ethtool.c   | 12 +--
 drivers/net/ethernet/broadcom/bnxt/bnxt.c     | 20 ++---
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |  2 +-
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 20 ++---
 .../net/ethernet/broadcom/genet/bcmgenet.c    |  8 +-
 .../net/ethernet/broadcom/genet/bcmgenet.h    |  2 +-
 drivers/net/ethernet/broadcom/tg3.c           | 32 ++++----
 drivers/net/ethernet/broadcom/tg3.h           |  2 +-
 drivers/net/ethernet/engleder/tsnep_main.c    |  6 +-
 drivers/net/ethernet/freescale/enetc/enetc.c  |  4 +-
 drivers/net/ethernet/freescale/fec.h          |  2 +-
 drivers/net/ethernet/freescale/fec_main.c     | 10 +--
 drivers/net/ethernet/freescale/gianfar.c      |  4 +-
 drivers/net/ethernet/intel/e1000e/ethtool.c   | 16 ++--
 .../net/ethernet/intel/i40e/i40e_ethtool.c    | 16 ++--
 drivers/net/ethernet/intel/igb/igb_ethtool.c  | 28 +++----
 drivers/net/ethernet/intel/igc/igc.h          |  2 +-
 drivers/net/ethernet/intel/igc/igc_ethtool.c  | 20 ++---
 .../net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 28 +++----
 drivers/net/ethernet/marvell/mvneta.c         |  4 +-
 .../net/ethernet/microchip/lan743x_ethtool.c  |  4 +-
 .../net/ethernet/qlogic/qede/qede_ethtool.c   | 32 ++++----
 drivers/net/ethernet/realtek/r8169_main.c     |  4 +-
 .../ethernet/samsung/sxgbe/sxgbe_ethtool.c    |  4 +-
 .../ethernet/stmicro/stmmac/stmmac_ethtool.c  |  4 +-
 drivers/net/ethernet/ti/am65-cpsw-ethtool.c   |  4 +-
 drivers/net/ethernet/ti/cpsw_ethtool.c        |  4 +-
 drivers/net/ethernet/ti/cpsw_priv.h           |  4 +-
 drivers/net/ethernet/ti/icssg/icssg_ethtool.c |  4 +-
 drivers/net/phy/marvell.c                     |  2 +-
 drivers/net/phy/phy-c45.c                     | 44 +++++------
 drivers/net/phy/phy.c                         |  8 +-
 drivers/net/phy/phylink.c                     |  8 +-
 drivers/net/usb/ax88179_178a.c                | 20 ++---
 drivers/net/usb/lan78xx.c                     |  4 +-
 drivers/net/usb/r8152.c                       | 28 +++----
 include/linux/ethtool.h                       | 17 ++++-
 include/linux/phy.h                           |  8 +-
 include/linux/phylink.h                       |  4 +-
 include/net/dsa.h                             |  4 +-
 net/dsa/user.c                                |  4 +-
 net/ethtool/common.c                          |  5 ++
 net/ethtool/common.h                          |  1 +
 net/ethtool/eee.c                             | 75 ++++++++++++-------
 net/ethtool/ioctl.c                           | 69 ++++++++++++++---
 56 files changed, 372 insertions(+), 291 deletions(-)

Comments

Andrew Lunn Jan. 29, 2024, 12:10 a.m. UTC | #1
On Sat, Jan 27, 2024 at 02:24:05PM +0100, Heiner Kallweit wrote:
> So far only 32bit legacy bitmaps are passed to userspace. This makes
> it impossible to manage EEE linkmodes beyond bit 32, e.g. manage EEE
> for 2500BaseT and 5000BaseT. This series adds support for passing
> full linkmode bitmaps between kernel and userspace.
> 
> Fortunately the netlink-based part of ethtool is quite smart and no
> changes are needed in ethtool. However this applies to the netlink
> interface only, the ioctl interface for now remains restricted to
> legacy bitmaps.
> 
> Next step will be adding support for the c45 EEE2 standard registers
> (3.21, 7.62, 7.63) to the genphy_c45 functions dealing with EEE.
> I have a follow-up series for this ready to be submitted.

I tend to disagree. The next step should be to work on each driver
still using supported_32 etc and convert them to use plain supported.

What i don't want is this conversion left half done. I said i'm happy
to help convert the remaining drivers, so lets work on that.

My happy to merge this patchset, its a good intermediary step which
allows each driver to be converted on its own. But i'm likely to NACK
EEE2 until the _32 are gone.

     Andrew
Heiner Kallweit Jan. 29, 2024, 10:13 a.m. UTC | #2
On 29.01.2024 01:10, Andrew Lunn wrote:
> On Sat, Jan 27, 2024 at 02:24:05PM +0100, Heiner Kallweit wrote:
>> So far only 32bit legacy bitmaps are passed to userspace. This makes
>> it impossible to manage EEE linkmodes beyond bit 32, e.g. manage EEE
>> for 2500BaseT and 5000BaseT. This series adds support for passing
>> full linkmode bitmaps between kernel and userspace.
>>
>> Fortunately the netlink-based part of ethtool is quite smart and no
>> changes are needed in ethtool. However this applies to the netlink
>> interface only, the ioctl interface for now remains restricted to
>> legacy bitmaps.
>>
>> Next step will be adding support for the c45 EEE2 standard registers
>> (3.21, 7.62, 7.63) to the genphy_c45 functions dealing with EEE.
>> I have a follow-up series for this ready to be submitted.
> 
> I tend to disagree. The next step should be to work on each driver
> still using supported_32 etc and convert them to use plain supported.
> 
> What i don't want is this conversion left half done. I said i'm happy
> to help convert the remaining drivers, so lets work on that.
> 
Fine with me, EEE2 can wait until this is done.

> My happy to merge this patchset, its a good intermediary step which
> allows each driver to be converted on its own. But i'm likely to NACK
> EEE2 until the _32 are gone.
> 
>      Andrew
Heiner
patchwork-bot+netdevbpf@kernel.org Jan. 31, 2024, 12:40 p.m. UTC | #3
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Sat, 27 Jan 2024 14:24:05 +0100 you wrote:
> So far only 32bit legacy bitmaps are passed to userspace. This makes
> it impossible to manage EEE linkmodes beyond bit 32, e.g. manage EEE
> for 2500BaseT and 5000BaseT. This series adds support for passing
> full linkmode bitmaps between kernel and userspace.
> 
> Fortunately the netlink-based part of ethtool is quite smart and no
> changes are needed in ethtool. However this applies to the netlink
> interface only, the ioctl interface for now remains restricted to
> legacy bitmaps.
> 
> [...]

Here is the summary with links:
  - [net-next,v4,1/6] ethtool: replace struct ethtool_eee with a new struct ethtool_keee on kernel side
    https://git.kernel.org/netdev/net-next/c/d80a52335374
  - [net-next,v4,2/6] ethtool: switch back from ethtool_keee to ethtool_eee for ioctl
    https://git.kernel.org/netdev/net-next/c/0b3100bc8fa7
  - [net-next,v4,3/6] ethtool: adjust struct ethtool_keee to kernel needs
    https://git.kernel.org/netdev/net-next/c/285cc15cc555
  - [net-next,v4,4/6] ethtool: add suffix _u32 to legacy bitmap members of struct ethtool_keee
    https://git.kernel.org/netdev/net-next/c/1d756ff13da6
  - [net-next,v4,5/6] ethtool: add linkmode bitmap support to struct ethtool_keee
    https://git.kernel.org/netdev/net-next/c/1f069de63602
  - [net-next,v4,6/6] net: phy: c45: change genphy_c45_ethtool_[get|set]_eee to use EEE linkmode bitmaps
    https://git.kernel.org/netdev/net-next/c/2bb052612959

You are awesome, thank you!