Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ethtool: Add support for new power domains index description

Report the index of the newly introduced PSE power domain to the user,
enabling improved management of the power budget for PSE devices.

Signed-off-by: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://patch.msgid.link/20250617-feature_poe_port_prio-v14-5-78a1a645e2ee@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kory Maincent (Dent Project) and committed by
Jakub Kicinski
1176978e 50f8b341

+22
+5
Documentation/netlink/specs/ethtool.yaml
··· 1406 1406 type: nest 1407 1407 multi-attr: true 1408 1408 nested-attributes: c33-pse-pw-limit 1409 + - 1410 + name: pse-pw-d-id 1411 + type: u32 1412 + name-prefix: ethtool-a- 1409 1413 - 1410 1414 name: rss 1411 1415 attr-cnt-name: __ethtool-a-rss-cnt ··· 2233 2229 - c33-pse-ext-substate 2234 2230 - c33-pse-avail-pw-limit 2235 2231 - c33-pse-pw-limit-ranges 2232 + - pse-pw-d-id 2236 2233 dump: *pse-get-op 2237 2234 - 2238 2235 name: pse-set
+4
Documentation/networking/ethtool-netlink.rst
··· 1789 1789 limit of the PoE PSE. 1790 1790 ``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES`` nested Supported power limit 1791 1791 configuration ranges. 1792 + ``ETHTOOL_A_PSE_PW_D_ID`` u32 Index of the PSE power domain 1792 1793 ========================================== ====== ============================= 1793 1794 1794 1795 When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` attribute identifies ··· 1862 1861 ``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MAX``. 1863 1862 If the controller works with fixed classes, the min and max values will be 1864 1863 equal. 1864 + 1865 + The ``ETHTOOL_A_PSE_PW_D_ID`` attribute identifies the index of PSE power 1866 + domain. 1865 1867 1866 1868 PSE_SET 1867 1869 =======
+3
drivers/net/pse-pd/pse_core.c
··· 1098 1098 pcdev = psec->pcdev; 1099 1099 ops = pcdev->ops; 1100 1100 mutex_lock(&pcdev->lock); 1101 + if (pcdev->pi[psec->id].pw_d) 1102 + status->pw_d_id = pcdev->pi[psec->id].pw_d->id; 1103 + 1101 1104 ret = ops->pi_get_admin_state(pcdev, psec->id, &admin_state); 1102 1105 if (ret) 1103 1106 goto out;
+2
include/linux/pse-pd/pse.h
··· 114 114 /** 115 115 * struct ethtool_pse_control_status - PSE control/channel status. 116 116 * 117 + * @pw_d_id: PSE power domain index. 117 118 * @podl_admin_state: operational state of the PoDL PSE 118 119 * functions. IEEE 802.3-2018 30.15.1.1.2 aPoDLPSEAdminState 119 120 * @podl_pw_status: power detection status of the PoDL PSE. ··· 136 135 * ranges 137 136 */ 138 137 struct ethtool_pse_control_status { 138 + u32 pw_d_id; 139 139 enum ethtool_podl_pse_admin_state podl_admin_state; 140 140 enum ethtool_podl_pse_pw_d_status podl_pw_status; 141 141 enum ethtool_c33_pse_admin_state c33_admin_state;
+7
net/ethtool/pse-pd.c
··· 83 83 const struct ethtool_pse_control_status *st = &data->status; 84 84 int len = 0; 85 85 86 + if (st->pw_d_id) 87 + len += nla_total_size(sizeof(u32)); /* _PSE_PW_D_ID */ 86 88 if (st->podl_admin_state > 0) 87 89 len += nla_total_size(sizeof(u32)); /* _PODL_PSE_ADMIN_STATE */ 88 90 if (st->podl_pw_status > 0) ··· 149 147 { 150 148 const struct pse_reply_data *data = PSE_REPDATA(reply_base); 151 149 const struct ethtool_pse_control_status *st = &data->status; 150 + 151 + if (st->pw_d_id && 152 + nla_put_u32(skb, ETHTOOL_A_PSE_PW_D_ID, 153 + st->pw_d_id)) 154 + return -EMSGSIZE; 152 155 153 156 if (st->podl_admin_state > 0 && 154 157 nla_put_u32(skb, ETHTOOL_A_PODL_PSE_ADMIN_STATE,