mbox series

[v8,net-next,0/9] ethtool: track custom RSS contexts in the core

Message ID cover.1719502239.git.ecree.xilinx@gmail.com (mailing list archive)
Headers show
Series ethtool: track custom RSS contexts in the core | expand

Message

edward.cree@amd.com June 27, 2024, 3:33 p.m. UTC
From: Edward Cree <ecree.xilinx@gmail.com>

Make the core responsible for tracking the set of custom RSS contexts,
 their IDs, indirection tables, hash keys, and hash functions; this
 lets us get rid of duplicative code in drivers, and will allow us to
 support netlink dumps later.

This series only moves the sfc EF10 & EF100 driver over to the new API;
 other drivers (mvpp2, octeontx2, mlx5, sfc/siena, bnxt_en) can be converted
 afterwards and the legacy API removed.

Changes in v8:
* use struct_size_t in patch 3 (Przemek)

Changes in v7:
* ensure 'ret' is initialised in ethtool_get_rxfh (horms)

Changes in v6:
* fixed kdoc for renamed fields
* always call setter in netdev_rss_contexts_free()
* document that 'create' method should populate ctx for driver-chosen defaults
* on 'ethtool -x', get info from the tracking xarray rather than calling the
  driver's get_rxfh method.  This makes it easier to test that the tracking is
  correct, in the absence of future code like netlink dumps to use it.

Changes in v5:
* Rebased on top of Ahmed Zaki's struct ethtool_rxfh_param API
* Moved rxfh_max_context_id to the ethtool ops struct

Changes in v4:
* replaced IDR with XArray
* grouped initialisations together in patch 6
* dropped RFC tags

Changes in v3:
* Added WangXun ngbe to patch #1, not sure if they've added WoL support since
  v2 or if I just missed it last time around
* Re-ordered struct ethtool_netdev_state to avoid hole (Andrew Lunn)
* Fixed some resource leaks in error handling paths (kuba)
* Added maintainers of other context-using drivers to CC

Edward Cree (9):
  net: move ethtool-related netdev state into its own struct
  net: ethtool: attach an XArray of custom RSS contexts to a netdevice
  net: ethtool: record custom RSS contexts in the XArray
  net: ethtool: let the core choose RSS context IDs
  net: ethtool: add an extack parameter to new rxfh_context APIs
  net: ethtool: add a mutex protecting RSS contexts
  sfc: use new rxfh_context API
  net: ethtool: use the tracking array for get_rxfh on custom RSS
    contexts
  sfc: remove get_rxfh_context dead code

 drivers/net/ethernet/realtek/r8169_main.c     |   4 +-
 drivers/net/ethernet/sfc/ef10.c               |   2 +-
 drivers/net/ethernet/sfc/ef100_ethtool.c      |   4 +
 drivers/net/ethernet/sfc/efx.c                |   2 +-
 drivers/net/ethernet/sfc/efx.h                |   2 +-
 drivers/net/ethernet/sfc/efx_common.c         |  10 +-
 drivers/net/ethernet/sfc/ethtool.c            |   4 +
 drivers/net/ethernet/sfc/ethtool_common.c     | 168 ++++++++----------
 drivers/net/ethernet/sfc/ethtool_common.h     |  12 ++
 drivers/net/ethernet/sfc/mcdi_filters.c       | 135 +++++++-------
 drivers/net/ethernet/sfc/mcdi_filters.h       |   8 +-
 drivers/net/ethernet/sfc/net_driver.h         |  28 +--
 drivers/net/ethernet/sfc/rx_common.c          |  64 ++-----
 drivers/net/ethernet/sfc/rx_common.h          |   8 +-
 .../net/ethernet/wangxun/ngbe/ngbe_ethtool.c  |   4 +-
 drivers/net/ethernet/wangxun/ngbe/ngbe_main.c |   2 +-
 drivers/net/phy/phy.c                         |   2 +-
 drivers/net/phy/phy_device.c                  |   5 +-
 drivers/net/phy/phylink.c                     |   2 +-
 include/linux/ethtool.h                       | 110 ++++++++++++
 include/linux/netdevice.h                     |   7 +-
 net/core/dev.c                                |  40 +++++
 net/ethtool/ioctl.c                           | 136 +++++++++++++-
 net/ethtool/wol.c                             |   2 +-
 24 files changed, 496 insertions(+), 265 deletions(-)

Comments

Przemek Kitszel June 28, 2024, 12:19 p.m. UTC | #1
On 6/27/24 17:33, edward.cree@amd.com wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Make the core responsible for tracking the set of custom RSS contexts,
>   their IDs, indirection tables, hash keys, and hash functions; this
>   lets us get rid of duplicative code in drivers, and will allow us to
>   support netlink dumps later.
> 
> This series only moves the sfc EF10 & EF100 driver over to the new API;
>   other drivers (mvpp2, octeontx2, mlx5, sfc/siena, bnxt_en) can be converted
>   afterwards and the legacy API removed.
> 
> Changes in v8:
> * use struct_size_t in patch 3 (Przemek)

Thanks! Also for the additional explanations!
For the series:
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

> 
> Changes in v7:
> * ensure 'ret' is initialised in ethtool_get_rxfh (horms)
> 
> Changes in v6:
> * fixed kdoc for renamed fields
> * always call setter in netdev_rss_contexts_free()
> * document that 'create' method should populate ctx for driver-chosen defaults
> * on 'ethtool -x', get info from the tracking xarray rather than calling the
>    driver's get_rxfh method.  This makes it easier to test that the tracking is
>    correct, in the absence of future code like netlink dumps to use it.
> 
> Changes in v5:
> * Rebased on top of Ahmed Zaki's struct ethtool_rxfh_param API
> * Moved rxfh_max_context_id to the ethtool ops struct
> 
> Changes in v4:
> * replaced IDR with XArray
> * grouped initialisations together in patch 6
> * dropped RFC tags
> 
> Changes in v3:
> * Added WangXun ngbe to patch #1, not sure if they've added WoL support since
>    v2 or if I just missed it last time around
> * Re-ordered struct ethtool_netdev_state to avoid hole (Andrew Lunn)
> * Fixed some resource leaks in error handling paths (kuba)
> * Added maintainers of other context-using drivers to CC
> 
> Edward Cree (9):
>    net: move ethtool-related netdev state into its own struct
>    net: ethtool: attach an XArray of custom RSS contexts to a netdevice
>    net: ethtool: record custom RSS contexts in the XArray
>    net: ethtool: let the core choose RSS context IDs
>    net: ethtool: add an extack parameter to new rxfh_context APIs
>    net: ethtool: add a mutex protecting RSS contexts
>    sfc: use new rxfh_context API
>    net: ethtool: use the tracking array for get_rxfh on custom RSS
>      contexts
>    sfc: remove get_rxfh_context dead code
> 
>   drivers/net/ethernet/realtek/r8169_main.c     |   4 +-
>   drivers/net/ethernet/sfc/ef10.c               |   2 +-
>   drivers/net/ethernet/sfc/ef100_ethtool.c      |   4 +
>   drivers/net/ethernet/sfc/efx.c                |   2 +-
>   drivers/net/ethernet/sfc/efx.h                |   2 +-
>   drivers/net/ethernet/sfc/efx_common.c         |  10 +-
>   drivers/net/ethernet/sfc/ethtool.c            |   4 +
>   drivers/net/ethernet/sfc/ethtool_common.c     | 168 ++++++++----------
>   drivers/net/ethernet/sfc/ethtool_common.h     |  12 ++
>   drivers/net/ethernet/sfc/mcdi_filters.c       | 135 +++++++-------
>   drivers/net/ethernet/sfc/mcdi_filters.h       |   8 +-
>   drivers/net/ethernet/sfc/net_driver.h         |  28 +--
>   drivers/net/ethernet/sfc/rx_common.c          |  64 ++-----
>   drivers/net/ethernet/sfc/rx_common.h          |   8 +-
>   .../net/ethernet/wangxun/ngbe/ngbe_ethtool.c  |   4 +-
>   drivers/net/ethernet/wangxun/ngbe/ngbe_main.c |   2 +-
>   drivers/net/phy/phy.c                         |   2 +-
>   drivers/net/phy/phy_device.c                  |   5 +-
>   drivers/net/phy/phylink.c                     |   2 +-
>   include/linux/ethtool.h                       | 110 ++++++++++++
>   include/linux/netdevice.h                     |   7 +-
>   net/core/dev.c                                |  40 +++++
>   net/ethtool/ioctl.c                           | 136 +++++++++++++-
>   net/ethtool/wol.c                             |   2 +-
>   24 files changed, 496 insertions(+), 265 deletions(-)
> 
>
patchwork-bot+netdevbpf@kernel.org June 29, 2024, 2:20 a.m. UTC | #2
Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 27 Jun 2024 16:33:45 +0100 you wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Make the core responsible for tracking the set of custom RSS contexts,
>  their IDs, indirection tables, hash keys, and hash functions; this
>  lets us get rid of duplicative code in drivers, and will allow us to
>  support netlink dumps later.
> 
> [...]

Here is the summary with links:
  - [v8,net-next,1/9] net: move ethtool-related netdev state into its own struct
    (no matching commit)
  - [v8,net-next,2/9] net: ethtool: attach an XArray of custom RSS contexts to a netdevice
    https://git.kernel.org/netdev/net-next/c/6ad2962f8adf
  - [v8,net-next,3/9] net: ethtool: record custom RSS contexts in the XArray
    https://git.kernel.org/netdev/net-next/c/eac9122f0c41
  - [v8,net-next,4/9] net: ethtool: let the core choose RSS context IDs
    https://git.kernel.org/netdev/net-next/c/847a8ab18676
  - [v8,net-next,5/9] net: ethtool: add an extack parameter to new rxfh_context APIs
    https://git.kernel.org/netdev/net-next/c/30a32cdf6b13
  - [v8,net-next,6/9] net: ethtool: add a mutex protecting RSS contexts
    https://git.kernel.org/netdev/net-next/c/87925151191b
  - [v8,net-next,7/9] sfc: use new rxfh_context API
    https://git.kernel.org/netdev/net-next/c/a9ee8d4a97d8
  - [v8,net-next,8/9] net: ethtool: use the tracking array for get_rxfh on custom RSS contexts
    https://git.kernel.org/netdev/net-next/c/7964e7884643
  - [v8,net-next,9/9] sfc: remove get_rxfh_context dead code
    https://git.kernel.org/netdev/net-next/c/b859316e8218

You are awesome, thank you!