[PATCH net-next 6/9] netlink: specs: Expand the pse netlink command with PoE interface

Kory Maincent posted 9 patches 2 years, 1 month ago
There is a newer version of this series
[PATCH net-next 6/9] netlink: specs: Expand the pse netlink command with PoE interface
Posted by Kory Maincent 2 years, 1 month ago
Add the PoE pse attributes prefix to be able to use PoE interface.

Example usage:
./ynl/cli.py --spec netlink/specs/ethtool.yaml --no-schema --do pse-get \
             --json '{"header":{"dev-name":"eth0"}}'
{'header': {'dev-index': 4, 'dev-name': 'eth0'},
 'pse-admin-state': 3,
 'pse-pw-d-status': 4}

./ynl/cli.py --spec netlink/specs/ethtool.yaml --no-schema --do pse-set \
             --json '{"header":{"dev-name":"eth0"}, "pse-admin-control":3}'

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 Documentation/netlink/specs/ethtool.yaml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Documentation/netlink/specs/ethtool.yaml b/Documentation/netlink/specs/ethtool.yaml
index e1bf75099264..6e1525106a9e 100644
--- a/Documentation/netlink/specs/ethtool.yaml
+++ b/Documentation/netlink/specs/ethtool.yaml
@@ -889,6 +889,18 @@ attribute-sets:
         name: podl-pse-pw-d-status
         type: u32
         name-prefix: ethtool-a-
+      -
+        name: pse-admin-state
+        type: u32
+        name-prefix: ethtool-a-
+      -
+        name: pse-admin-control
+        type: u32
+        name-prefix: ethtool-a-
+      -
+        name: pse-pw-d-status
+        type: u32
+        name-prefix: ethtool-a-
   -
     name: rss
     attributes:
@@ -1571,6 +1583,9 @@ operations:
             - podl-pse-admin-state
             - podl-pse-admin-control
             - podl-pse-pw-d-status
+            - pse-admin-state
+            - pse-admin-control
+            - pse-pw-d-status
       dump: *pse-get-op
     -
       name: pse-set

-- 
2.25.1
Re: [PATCH net-next 6/9] netlink: specs: Expand the pse netlink command with PoE interface
Posted by Jakub Kicinski 2 years, 1 month ago
On Thu, 16 Nov 2023 15:01:38 +0100 Kory Maincent wrote:
> +        name: pse-admin-state
> +        type: u32
> +        name-prefix: ethtool-a-
> +      -
> +        name: pse-admin-control
> +        type: u32
> +        name-prefix: ethtool-a-
> +      -
> +        name: pse-pw-d-status
> +        type: u32
> +        name-prefix: ethtool-a-

The default prefix is ethtool-a-pse-
Why don't you leave that be and drop the pse- from the names?
Re: [PATCH net-next 6/9] netlink: specs: Expand the pse netlink command with PoE interface
Posted by Köry Maincent 2 years, 1 month ago
On Sat, 18 Nov 2023 16:01:31 -0800
Jakub Kicinski <kuba@kernel.org> wrote:

> On Thu, 16 Nov 2023 15:01:38 +0100 Kory Maincent wrote:
> > +        name: pse-admin-state
> > +        type: u32
> > +        name-prefix: ethtool-a-
> > +      -
> > +        name: pse-admin-control
> > +        type: u32
> > +        name-prefix: ethtool-a-
> > +      -
> > +        name: pse-pw-d-status
> > +        type: u32
> > +        name-prefix: ethtool-a-  
> 
> The default prefix is ethtool-a-pse-
> Why don't you leave that be and drop the pse- from the names?

Oh right, thanks, I copied blindly the PoDL lines.

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