From patchwork Tue Mar 4 10:18:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 14000356 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAE301FCD11; Tue, 4 Mar 2025 10:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741083645; cv=none; b=pZ4sLWYtJ5W9X+zBmivww45Q9pyFCajYvb1nHA9CxI2f1HdiXtM5LOr1Nvi0zQuxbVzL+8vhXzFPRb8CUnD5FyeEWz/Y/o89c2zYVG+3kUcBRENiCVqY5l0xzGy0Y+s8BrBdIsS+kJJjx5d1DxjRqh0G9mVcnBWNV3fwHJx2ass= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741083645; c=relaxed/simple; bh=pf+zd9eJSyjhAlIOjhLr+Q2nF6dk18iacDcYoB2pPyY=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=YSZfZOaJDktXJ9BvwCKbZdyEfv9Q4wmZlf9wbTjiilLKGcZRmWvu6WyGx3IKR/ez4FNjn4crxrGQ3r7OdSTEIwfVCQGfCPGpnctG/DO3jThjZCyx7u1MQEBufGAhxhFjS7w08NXaAAikNgEtipWsDNBo6e1vHRi1WBQScAtVcfE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=SlX//mvY; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="SlX//mvY" Received: by mail.gandi.net (Postfix) with ESMTPSA id 4C9F24326A; Tue, 4 Mar 2025 10:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1741083639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FDpq6q6jzFFUOTpJZL2OgVJZD48jISpM6vW29U65xjA=; b=SlX//mvYcZtdM+F8ewaPG8u6rjBHT4gnyZlSnA1moJHk7s4as+ty/cBExToazWaJHLfrhm gJ5z31E0/oBpqOGJvgQ7KGr7dz12ET0+2QM0CvoujD8iiKT34bZswUiw2kTdBa229PwZgm vGV7ZRAtMxIfqf3JIxMIluDQPxPV2D+Klf/aNG/SrVkIQAYi33Bc/O5sDIR+dt7rk2uJfa baS8+cDsAlUfH8W2FwxGubDIlrnjYYG8akvUDR0s3kFXuZJ2dJSIuDiX4YRlCj7vjhVU0L 1BRI49Dp1o6xwvYC1KO+9X2NxKhWOoTALop54fhEFaefTp4ni17Gww+jQokzzQ== From: Kory Maincent Subject: [PATCH net-next v6 00/12] Add support for PSE budget evaluation strategy Date: Tue, 04 Mar 2025 11:18:49 +0100 Message-Id: <20250304-feature_poe_port_prio-v6-0-3dc0c5ebaf32@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAIrTxmcC/3XOTWrDMBAF4KsErasijf676j1KCKo0bgStZWTVJ ATfvYqhpMVoMYvHY76ZG5mxJJzJy+FGCi5pTnlsQT8dSDj78QNpii0TYCCZ44IO6Ot3wdOU71P qaSopU6+4x2iEAAyk7U4Fh3TZ3DcyYqUjXio5tuac5prLdTu48K2/25wx6NgLp4waa5iSg5EY1 et7zvUzjc8hf23mAn8cwXoONMcp5TQAojR+74iHw4H3HNEcK8C5wWunTdg78tdRrD3Uc2RzYnD ci8ACt2bvqIcD3PYc1RwRvbQa1RC1/O+s6/oDfe0xNeYBAAA= 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 , Krzysztof Kozlowski , Conor Dooley Cc: Liam Girdwood , Mark Brown , Thomas Petazzoni , netdev@vger.kernel.org, linux-doc@vger.kernel.org, Kyle Swenson , Dent Project , kernel@pengutronix.de, Maxime Chevallier , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Kory Maincent (Dent Project)" , Krzysztof Kozlowski X-Mailer: b4 0.15-dev-8cb71 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutddujeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhufffkfggtgfgvfevofesthekredtredtjeenucfhrhhomhepmfhorhihucforghinhgtvghnthcuoehkohhrhidrmhgrihhntggvnhhtsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeduhfevudetfffgkedvhfevheeghedtleeghfffudeiffefvdehfeegieeivdekteenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdgsohhothhlihhnrdgtohhmnecukfhppeeltddrkeelrdduieefrdduvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledtrdekledrudeifedruddvjedphhgvlhhopegluddvjedrtddruddrudgnpdhmrghilhhfrhhomhepkhhorhihrdhmrghinhgtvghnthessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhmpdhrtghpthhtohepmhgrgihimhgvrdgthhgvvhgrlhhlihgvrhessghoohhtlhhinhdrtghomhdprhgtphhtthhopegtohhrsggvtheslhifnhdrnhgvthdprhgtphhtthhopehlghhirhgufihoohgusehgmhgrihhlr dgtohhmpdhrtghpthhtohepuggvnhhtphhrohhjvggttheslhhinhhugihfohhunhgurghtihhonhdrohhrghdprhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehkrhiihihsiihtohhfrdhkohiilhhofihskhhisehlihhnrghrohdrohhrghdprhgtphhtthhopehkvghrnhgvlhesphgvnhhguhhtrhhonhhigidruggv X-GND-Sasl: kory.maincent@bootlin.com X-Patchwork-Delegate: kuba@kernel.org From: Kory Maincent (Dent Project) This series brings support for budget evaluation strategy 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. This patch series adds support for two budget evaluation strategy. 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. Patches 1-2: Add support for interrupt event report in PSE core, ethtool and ethtool specs. Patch 3: Adds support for interrupt and event report in TPS23881 driver. Patches 4,5: Add support for PSE power domain in PSE core and ethtool. Patches 6,7: Add support for budget evaluation strategy in PSE core, ethtool and ethtool specs. Patches 8-10: Add support for port priority and power supplies in PD692x0 drivers. Patches 11,12: Add support for port priority in TPS23881 drivers. Signed-off-by: Kory Maincent (Dent Project) --- Changes in v6: - Few typos. - Use uint instead of bitset for PSE_EVENT. - Remove report of budget evaluation strategy in the uAPI. - Link to v5: https://lore.kernel.org/r/20250218-feature_poe_port_prio-v5-0-3da486e5fd64@bootlin.com Changes in v5: - Remove the first part of the patch series which tackled PSE improvement and already gets merged: https://lore.kernel.org/netdev/20250110-b4-feature_poe_arrange-v3-0-142279aedb94@bootlin.com/ - Remove the PSE index support which is useless for now. The PSE power domain ID is sufficient. - Add support for PD692x0 power supplies other than Vmain which was already in the patch series. - Few other small fixes. - Link to v4: https://lore.kernel.org/r/20250103-feature_poe_port_prio-v4-0-dc91a3c0c187@bootlin.com Changes in v4: - Remove disconnection policy. - Rename port priority mode to budget evaluation strategy. - Add cosmetic changes in PSE core. - Add support for port priority in PD692x0 driver. - Link to v3: https://lore.kernel.org/r/20241121-feature_poe_port_prio-v3-0-83299fa6967c@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 (12): net: ethtool: Add support for ethnl_info_init_ntf helper function net: pse-pd: Add support for reporting events net: pse-pd: tps23881: Add support for PSE events and interrupts 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 budget evaluation strategies net: ethtool: Add PSE new budget evaluation strategy support feature net: pse-pd: pd692x0: Add support for PSE PI priority feature net: pse-pd: pd692x0: Add support for controller and manager power supplies 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 .../bindings/net/pse-pd/microchip,pd692x0.yaml | 22 +- .../bindings/net/pse-pd/ti,tps23881.yaml | 8 + Documentation/netlink/specs/ethtool.yaml | 37 + Documentation/networking/ethtool-netlink.rst | 49 ++ drivers/net/mdio/fwnode_mdio.c | 26 +- drivers/net/pse-pd/pd692x0.c | 225 ++++++ drivers/net/pse-pd/pse_core.c | 863 ++++++++++++++++++++- drivers/net/pse-pd/tps23881.c | 364 ++++++++- include/linux/ethtool_netlink.h | 9 + include/linux/pse-pd/pse.h | 72 +- include/uapi/linux/ethtool.h | 52 ++ include/uapi/linux/ethtool_netlink_generated.h | 12 + net/ethtool/netlink.c | 7 +- net/ethtool/netlink.h | 2 + net/ethtool/pse-pd.c | 67 ++ 15 files changed, 1763 insertions(+), 52 deletions(-) --- base-commit: bae1b23c77b97000d99afe38cbd7fb5778a2ea6d change-id: 20240913-feature_poe_port_prio-a51aed7332ec Best regards,