Skip to content

Commit 2f5e639

Browse files
committed
Merge branch 'net-pse-pd-add-new-pse-c33-features'
Kory Maincent says: ==================== net: pse-pd: Add new PSE c33 features This patch series adds new c33 features to the PSE API. - Expand the PSE PI informations status with power, class and failure reason - Add the possibility to get and set the PSE PIs power limit v5: https://lore.kernel.org/r/[email protected] v4: https://lore.kernel.org/r/[email protected] v3: https://lore.kernel.org/r/[email protected] v2: https://lore.kernel.org/r/[email protected] v1: https://lore.kernel.org/r/[email protected] ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 73d4d64 + a87e699 commit 2f5e639

File tree

9 files changed

+997
-30
lines changed

9 files changed

+997
-30
lines changed

Documentation/netlink/specs/ethtool.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ definitions:
2424
name: module-fw-flash-status
2525
type: enum
2626
entries: [ started, in_progress, completed, error ]
27+
-
28+
name: c33-pse-ext-state
29+
enum-name:
30+
type: enum
31+
name-prefix: ethtool-c33-pse-ext-state-
32+
entries:
33+
- none
34+
- error-condition
35+
- mr-mps-valid
36+
- mr-pse-enable
37+
- option-detect-ted
38+
- option-vport-lim
39+
- ovld-detected
40+
- power-not-available
41+
- short-detected
2742

2843
attribute-sets:
2944
-
@@ -924,6 +939,15 @@ attribute-sets:
924939
-
925940
name: power-mode
926941
type: u8
942+
-
943+
name: c33-pse-pw-limit
944+
attributes:
945+
-
946+
name: min
947+
type: u32
948+
-
949+
name: max
950+
type: u32
927951
-
928952
name: pse
929953
attributes:
@@ -955,6 +979,33 @@ attribute-sets:
955979
name: c33-pse-pw-d-status
956980
type: u32
957981
name-prefix: ethtool-a-
982+
-
983+
name: c33-pse-pw-class
984+
type: u32
985+
name-prefix: ethtool-a-
986+
-
987+
name: c33-pse-actual-pw
988+
type: u32
989+
name-prefix: ethtool-a-
990+
-
991+
name: c33-pse-ext-state
992+
type: u32
993+
name-prefix: ethtool-a-
994+
enum: c33-pse-ext-state
995+
-
996+
name: c33-pse-ext-substate
997+
type: u32
998+
name-prefix: ethtool-a-
999+
-
1000+
name: c33-pse-avail-pw-limit
1001+
type: u32
1002+
name-prefix: ethtool-a-
1003+
-
1004+
name: c33-pse-pw-limit-ranges
1005+
name-prefix: ethtool-a-
1006+
type: nest
1007+
multi-attr: true
1008+
nested-attributes: c33-pse-pw-limit
9581009
-
9591010
name: rss
9601011
attributes:
@@ -1672,6 +1723,12 @@ operations:
16721723
- c33-pse-admin-state
16731724
- c33-pse-admin-control
16741725
- c33-pse-pw-d-status
1726+
- c33-pse-pw-class
1727+
- c33-pse-actual-pw
1728+
- c33-pse-ext-state
1729+
- c33-pse-ext-substate
1730+
- c33-pse-avail-pw-limit
1731+
- c33-pse-pw-limit-ranges
16751732
dump: *pse-get-op
16761733
-
16771734
name: pse-set
@@ -1685,6 +1742,7 @@ operations:
16851742
- header
16861743
- podl-pse-admin-control
16871744
- c33-pse-admin-control
1745+
- c33-pse-avail-pw-limit
16881746
-
16891747
name: rss-get
16901748
doc: Get RSS params.

Documentation/networking/ethtool-netlink.rst

Lines changed: 76 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,17 +1730,28 @@ Request contents:
17301730

17311731
Kernel response contents:
17321732

1733-
====================================== ====== =============================
1734-
``ETHTOOL_A_PSE_HEADER`` nested reply header
1735-
``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` u32 Operational state of the PoDL
1736-
PSE functions
1737-
``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` u32 power detection status of the
1738-
PoDL PSE.
1739-
``ETHTOOL_A_C33_PSE_ADMIN_STATE`` u32 Operational state of the PoE
1740-
PSE functions.
1741-
``ETHTOOL_A_C33_PSE_PW_D_STATUS`` u32 power detection status of the
1742-
PoE PSE.
1743-
====================================== ====== =============================
1733+
========================================== ====== =============================
1734+
``ETHTOOL_A_PSE_HEADER`` nested reply header
1735+
``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` u32 Operational state of the PoDL
1736+
PSE functions
1737+
``ETHTOOL_A_PODL_PSE_PW_D_STATUS`` u32 power detection status of the
1738+
PoDL PSE.
1739+
``ETHTOOL_A_C33_PSE_ADMIN_STATE`` u32 Operational state of the PoE
1740+
PSE functions.
1741+
``ETHTOOL_A_C33_PSE_PW_D_STATUS`` u32 power detection status of the
1742+
PoE PSE.
1743+
``ETHTOOL_A_C33_PSE_PW_CLASS`` u32 power class of the PoE PSE.
1744+
``ETHTOOL_A_C33_PSE_ACTUAL_PW`` u32 actual power drawn on the
1745+
PoE PSE.
1746+
``ETHTOOL_A_C33_PSE_EXT_STATE`` u32 power extended state of the
1747+
PoE PSE.
1748+
``ETHTOOL_A_C33_PSE_EXT_SUBSTATE`` u32 power extended substatus of
1749+
the PoE PSE.
1750+
``ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT`` u32 currently configured power
1751+
limit of the PoE PSE.
1752+
``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES`` nested Supported power limit
1753+
configuration ranges.
1754+
========================================== ====== =============================
17441755

17451756
When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` attribute identifies
17461757
the operational state of the PoDL PSE functions. The operational state of the
@@ -1772,6 +1783,46 @@ The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_PW_D_STATUS`` implementing
17721783
.. kernel-doc:: include/uapi/linux/ethtool.h
17731784
:identifiers: ethtool_c33_pse_pw_d_status
17741785

1786+
When set, the optional ``ETHTOOL_A_C33_PSE_PW_CLASS`` attribute identifies
1787+
the power class of the C33 PSE. It depends on the class negotiated between
1788+
the PSE and the PD. This option is corresponding to ``IEEE 802.3-2022``
1789+
30.9.1.1.8 aPSEPowerClassification.
1790+
1791+
When set, the optional ``ETHTOOL_A_C33_PSE_ACTUAL_PW`` attribute identifies
1792+
This option is corresponding to ``IEEE 802.3-2022`` 30.9.1.1.23 aPSEActualPower.
1793+
Actual power is reported in mW.
1794+
1795+
When set, the optional ``ETHTOOL_A_C33_PSE_EXT_STATE`` attribute identifies
1796+
the extended error state of the C33 PSE. Possible values are:
1797+
1798+
.. kernel-doc:: include/uapi/linux/ethtool.h
1799+
:identifiers: ethtool_c33_pse_ext_state
1800+
1801+
When set, the optional ``ETHTOOL_A_C33_PSE_EXT_SUBSTATE`` attribute identifies
1802+
the extended error state of the C33 PSE. Possible values are:
1803+
Possible values are:
1804+
1805+
.. kernel-doc:: include/uapi/linux/ethtool.h
1806+
:identifiers: ethtool_c33_pse_ext_substate_class_num_events
1807+
ethtool_c33_pse_ext_substate_error_condition
1808+
ethtool_c33_pse_ext_substate_mr_pse_enable
1809+
ethtool_c33_pse_ext_substate_option_detect_ted
1810+
ethtool_c33_pse_ext_substate_option_vport_lim
1811+
ethtool_c33_pse_ext_substate_ovld_detected
1812+
ethtool_c33_pse_ext_substate_pd_dll_power_type
1813+
ethtool_c33_pse_ext_substate_power_not_available
1814+
ethtool_c33_pse_ext_substate_short_detected
1815+
1816+
When set, the optional ``ETHTOOL_A_C33_PSE_AVAIL_PW_LIMIT`` attribute
1817+
identifies the C33 PSE power limit in mW.
1818+
1819+
When set the optional ``ETHTOOL_A_C33_PSE_PW_LIMIT_RANGES`` nested attribute
1820+
identifies the C33 PSE power limit ranges through
1821+
``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MIN`` and
1822+
``ETHTOOL_A_C33_PSE_PWR_VAL_LIMIT_RANGE_MAX``.
1823+
If the controller works with fixed classes, the min and max values will be
1824+
equal.
1825+
17751826
PSE_SET
17761827
=======
17771828

@@ -1783,6 +1834,8 @@ Request contents:
17831834
``ETHTOOL_A_PSE_HEADER`` nested request header
17841835
``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` u32 Control PoDL PSE Admin state
17851836
``ETHTOOL_A_C33_PSE_ADMIN_CONTROL`` u32 Control PSE Admin state
1837+
``ETHTOOL_A_C33_PSE_AVAIL_PWR_LIMIT`` u32 Control PoE PSE available
1838+
power limit
17861839
====================================== ====== =============================
17871840

17881841
When set, the optional ``ETHTOOL_A_PODL_PSE_ADMIN_CONTROL`` attribute is used
@@ -1793,6 +1846,18 @@ to control PoDL PSE Admin functions. This option is implementing
17931846
The same goes for ``ETHTOOL_A_C33_PSE_ADMIN_CONTROL`` implementing
17941847
``IEEE 802.3-2022`` 30.9.1.2.1 acPSEAdminControl.
17951848

1849+
When set, the optional ``ETHTOOL_A_C33_PSE_AVAIL_PWR_LIMIT`` attribute is
1850+
used to control the available power value limit for C33 PSE in milliwatts.
1851+
This attribute corresponds to the `pse_available_power` variable described in
1852+
``IEEE 802.3-2022`` 33.2.4.4 Variables and `pse_avail_pwr` in 145.2.5.4
1853+
Variables, which are described in power classes.
1854+
1855+
It was decided to use milliwatts for this interface to unify it with other
1856+
power monitoring interfaces, which also use milliwatts, and to align with
1857+
various existing products that document power consumption in watts rather than
1858+
classes. If power limit configuration based on classes is needed, the
1859+
conversion can be done in user space, for example by ethtool.
1860+
17961861
RSS_GET
17971862
=======
17981863

0 commit comments

Comments
 (0)