netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC net-next v3 00/27] Add support for PSE port priority
@ 2024-11-21 14:42 Kory Maincent
  2024-11-21 14:42 ` [PATCH RFC net-next v3 01/27] net: pse-pd: Remove unused pse_ethtool_get_pw_limit function declaration Kory Maincent
                   ` (27 more replies)
  0 siblings, 28 replies; 60+ messages in thread
From: Kory Maincent @ 2024-11-21 14:42 UTC (permalink / raw)
  To: Andrew Lunn, Oleksij Rempel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Jonathan Corbet, Donald Hunter,
	Rob Herring, Andrew Lunn, Simon Horman, Heiner Kallweit,
	Russell King, Liam Girdwood, Mark Brown
  Cc: Thomas Petazzoni, linux-kernel, netdev, linux-doc, Kyle Swenson,
	Dent Project, kernel, Maxime Chevallier, Kory Maincent, Kalesh AP

From: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>

This series brings support for port priority in the PSE subsystem.
PSE controllers can set priorities to decide which ports should be
turned off in case of special events like over-current.

I have added regulator maintainers to have their opinion on adding power
budget regulator constraint see patches 16 and 17.
There are also a few core regulator change along the way, patch 3 and 15.
Not sure if they have to be sent with the Fixes tag.
Also, I suppose I will need to merge them through the regulator tree.
Will it be possible to create an immutable tag to have this PSE series
based on them?

This patch series adds support for two mode port priority modes.
1. Static Method:

   This method involves distributing power based on PD classification.
   It’s straightforward and stable, the PSE core keeping track of the
   budget and subtracting the power requested by each PD’s class.

   Advantages: Every PD gets its promised power at any time, which
   guarantees reliability.

   Disadvantages: PD classification steps are large, meaning devices
   request much more power than they actually need. As a result, the power
   supply may only operate at, say, 50% capacity, which is inefficient and
   wastes money.

2. Dynamic Method:

   To address the inefficiencies of the static method, vendors like
   Microchip have introduced dynamic power budgeting, as seen in the
   PD692x0 firmware. This method monitors the current consumption per port
   and subtracts it from the available power budget. When the budget is
   exceeded, lower-priority ports are shut down.

   Advantages: This method optimizes resource utilization, saving costs.

   Disadvantages: Low-priority devices may experience instability.

The UAPI allows adding support for software port priority mode managed from
userspace later if needed.

This patch series is currently not fully tested. I would appreciate your
feedback on the current implementation of port priority in the PSE core.

Several Reviewed-by have been removed due to the changes.

Thanks Oleksij for your pointers.

Patches 1-7: Cosmetics.
Patch 8: Adds support for last supported features in the TPS23881 drivers.
Patches 9,10: Add support for PSE index in PSE core and ethtool.
Patches 11-13: Add support for interrupt event report in PSE core, ethtool
	     and ethtool specs.
Patch 14: Adds support for interrupt and event report in TPS23881 driver.
Patch 15: Fix regulator resolve supply
Patches 16,17: Add support for power budget in regulator framework.
Patch 18: Cosmetic.
Patches 19,20: Add support for PSE power domain in PSE core and ethtool.
Patches 21-23: Add support for port priority in PSE core, ethtool and
	       ethtool specs.
Patches 24,25: Add support for port priority in PD692x0 drivers.
Patches 26,27: Add support for port priority in TPS23881 drivers.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
Changes in v3:
- Move power budget to regulator core.
- Add disconnection policies with PIs using the same priority.
- Several fixes on the TPS23881 drivers.
- Several new cosmetic patches.
- Link to v2: https://lore.kernel.org/r/20241030-feature_poe_port_prio-v2-0-9559622ee47a@bootlin.com

Changes in v2:
- Rethink the port priority management.
- Add PSE id.
- Add support for PSE power domains.
- Add get power budget regulator constraint.
- Link to v1: https://lore.kernel.org/r/20241002-feature_poe_port_prio-v1-0-787054f74ed5@bootlin.com

---
Kory Maincent (26):
      net: pse-pd: Remove unused pse_ethtool_get_pw_limit function declaration
      regulator: core: Ignore unset max_uA constraints in current limit check
      net: pse-pd: Avoid setting max_uA in regulator constraints
      net: pse-pd: Add power limit check
      net: pse-pd: tps23881: Simplify function returns by removing redundant checks
      net: pse-pd: tps23881: Add missing configuration register after disable
      net: pse-pd: tps23881: Add support for power limit and measurement features
      net: pse-pd: Add support for PSE device index
      net: ethtool: Add support for new PSE device index description
      net: ethtool: Add support for ethnl_info_init_ntf helper function
      net: pse-pd: Add support for reporting events
      netlink: specs: Add support for PSE netlink notifications
      net: pse-pd: tps23881: Add support for PSE events and interrupts
      regulator: core: Resolve supply using of_node from regulator_config
      regulator: Add support for power budget description
      regulator: dt-bindings: Add regulator-power-budget property
      net: pse-pd: Fix missing PI of_node description
      net: pse-pd: Add support for PSE power domains
      net: ethtool: Add support for new power domains index description
      net: pse-pd: Add support for getting and setting port priority
      net: ethtool: Add PSE new port priority support feature
      netlink: specs: Expand the PSE netlink command with newly supported features
      net: pse-pd: pd692x0: Add support for PSE PI priority feature
      dt-bindings: net: pse-pd: microchip,pd692x0: Add manager regulator supply
      net: pse-pd: tps23881: Add support for static port priority feature
      dt-bindings: net: pse-pd: ti,tps23881: Add interrupt description

Kory Maincent (Dent Project) (1):
      net: pse-pd: tps23881: Use helpers to calculate bit offset for a channel

 .../bindings/net/pse-pd/microchip,pd692x0.yaml     |  12 +-
 .../bindings/net/pse-pd/ti,tps23881.yaml           |   6 +
 .../devicetree/bindings/regulator/regulator.yaml   |   3 +
 Documentation/netlink/specs/ethtool.yaml           |  59 ++
 Documentation/networking/ethtool-netlink.rst       |  85 +++
 drivers/net/mdio/fwnode_mdio.c                     |  26 +-
 drivers/net/pse-pd/pd692x0.c                       | 183 +++++
 drivers/net/pse-pd/pse_core.c                      | 798 +++++++++++++++++++-
 drivers/net/pse-pd/tps23881.c                      | 833 +++++++++++++++++++--
 drivers/regulator/core.c                           | 134 +++-
 drivers/regulator/of_regulator.c                   |   3 +
 include/linux/ethtool_netlink.h                    |   9 +
 include/linux/pse-pd/pse.h                         |  91 ++-
 include/linux/regulator/consumer.h                 |  21 +
 include/linux/regulator/driver.h                   |   2 +
 include/linux/regulator/machine.h                  |   2 +
 include/uapi/linux/ethtool.h                       |  84 +++
 include/uapi/linux/ethtool_netlink.h               |  18 +
 net/ethtool/netlink.c                              |   5 +
 net/ethtool/netlink.h                              |   2 +
 net/ethtool/pse-pd.c                               | 123 +++
 21 files changed, 2391 insertions(+), 108 deletions(-)
---
base-commit: 057623b3f6568e5f5c23ae26f6bf3eb367597e03
change-id: 20240913-feature_poe_port_prio-a51aed7332ec

Best regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


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

end of thread, other threads:[~2024-12-03 10:44 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21 14:42 [PATCH RFC net-next v3 00/27] Add support for PSE port priority Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 01/27] net: pse-pd: Remove unused pse_ethtool_get_pw_limit function declaration Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 02/27] regulator: core: Ignore unset max_uA constraints in current limit check Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 03/27] net: pse-pd: Avoid setting max_uA in regulator constraints Kory Maincent
2024-11-23  6:29   ` Oleksij Rempel
2024-11-24 11:47     ` Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 04/27] net: pse-pd: Add power limit check Kory Maincent
2024-11-23  6:31   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 05/27] net: pse-pd: tps23881: Simplify function returns by removing redundant checks Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 06/27] net: pse-pd: tps23881: Use helpers to calculate bit offset for a channel Kory Maincent (Dent Project)
2024-11-21 14:42 ` [PATCH RFC net-next v3 07/27] net: pse-pd: tps23881: Add missing configuration register after disable Kory Maincent
2024-11-23  6:35   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 08/27] net: pse-pd: tps23881: Add support for power limit and measurement features Kory Maincent
2024-11-23  7:31   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 09/27] net: pse-pd: Add support for PSE device index Kory Maincent
2024-11-23  7:34   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 10/27] net: ethtool: Add support for new PSE device index description Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 11/27] net: ethtool: Add support for ethnl_info_init_ntf helper function Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 12/27] net: pse-pd: Add support for reporting events Kory Maincent
2024-11-24  9:26   ` Oleksij Rempel
2024-11-25 10:42     ` Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 13/27] netlink: specs: Add support for PSE netlink notifications Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 14/27] net: pse-pd: tps23881: Add support for PSE events and interrupts Kory Maincent
2024-11-24  9:34   ` Oleksij Rempel
2024-11-25 11:39     ` Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 15/27] regulator: core: Resolve supply using of_node from regulator_config Kory Maincent
2024-11-24  9:39   ` Oleksij Rempel
2024-11-24  9:44     ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 16/27] regulator: Add support for power budget description Kory Maincent
2024-11-24  9:46   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 17/27] regulator: dt-bindings: Add regulator-power-budget property Kory Maincent
2024-11-21 14:58   ` Mark Brown
2024-11-21 15:27     ` Kory Maincent
2024-11-22  6:57   ` Krzysztof Kozlowski
2024-11-21 14:42 ` [PATCH RFC net-next v3 18/27] net: pse-pd: Fix missing PI of_node description Kory Maincent
2024-11-24  9:49   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 19/27] net: pse-pd: Add support for PSE power domains Kory Maincent
2024-11-24 10:24   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 20/27] net: ethtool: Add support for new power domains index description Kory Maincent
2024-11-26  5:53   ` Oleksij Rempel
2024-11-21 14:42 ` [PATCH RFC net-next v3 21/27] net: pse-pd: Add support for getting and setting port priority Kory Maincent
2024-11-26  8:38   ` Oleksij Rempel
2024-11-26 15:31     ` Kory Maincent
2024-11-26 15:52       ` Kory Maincent
2024-11-27  9:30         ` Oleksij Rempel
2024-11-27 10:11           ` Kory Maincent
2024-11-27 10:31             ` Oleksij Rempel
2024-11-27 11:00               ` Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 22/27] net: ethtool: Add PSE new port priority support feature Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 23/27] netlink: specs: Expand the PSE netlink command with newly supported features Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 24/27] net: pse-pd: pd692x0: Add support for PSE PI priority feature Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 25/27] dt-bindings: net: pse-pd: microchip,pd692x0: Add manager regulator supply Kory Maincent
2024-11-22  6:58   ` Krzysztof Kozlowski
2024-11-22  8:42     ` Kory Maincent
2024-11-22  9:20       ` Krzysztof Kozlowski
2024-11-21 14:42 ` [PATCH RFC net-next v3 26/27] net: pse-pd: tps23881: Add support for static port priority feature Kory Maincent
2024-12-03 10:29   ` Simon Horman
2024-12-03 10:44     ` Kory Maincent
2024-11-21 14:42 ` [PATCH RFC net-next v3 27/27] dt-bindings: net: pse-pd: ti,tps23881: Add interrupt description Kory Maincent
2024-11-21 16:22 ` (subset) [PATCH RFC net-next v3 00/27] Add support for PSE port priority Mark Brown

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