Skip to contentSkip to conversation

dpll: add client-side filtering

PATCH New Petr Oros 2 participants 6 messages Feb 24 – Mar 2

Subsystems (2)
lore
Share & tools
lore

Petr Oros

author
#0 lore raw

cover dpll: add client-side filtering

This series fixes a parsing bug in dpll pin id-get and adds client-side filtering support for dpll device show and pin show commands.

Patch 1 fixes a bug where "dpll pin id-get type gnss" would read the keyword "type" as the enum value instead of the actual type.

Patches 2-3 add client-side filtering for device show and pin show. Users can filter output by various attributes (module-name, clock-id, type, etc.) with AND semantics. Kernel-side dump filtering for dpll is not yet available, so all filtering is done in userspace.

Patch 4 replaces the non-functional server-side "device" filter in pin show (kernel ignores DPLL_A_ID in pin dump requests) with client-side parent-device and parent-pin filtering that checks nested multi-attrs. The argument is renamed from "device" to "parent-device" to reflect the actual semantics.

Each patch includes corresponding man page and bash completion updates.

Petr Oros (4):
dpll: fix pin id-get type filter parsing
dpll: add client-side filtering for device show
dpll: add client-side filtering for pin show
dpll: add pin filtering by parent-device and parent-pin

 bash-completion/dpll |  55 +++++-
 dpll/dpll.c          | 387 ++++++++++++++++++++++++++++++++++++++++---
 man/man8/dpll.8      |  80 ++++++++-
 3 files changed, 488 insertions(+), 34 deletions(-)

--
2.52.0

author
#1 lore raw

PATCH 1/4 dpll: fix pin id-get type filter parsing

dpll_parse_attr_enum() expects the keyword to be already consumed, but cmd_pin_id_get() used dpll_argv_match() which does not advance the argument pointer. This caused the parser to read the keyword "type" as the enum value instead of the actual type (e.g. "gnss").

Use dpll_argv_match_inc() to properly consume the keyword before parsing the value.

Fixes 656cfc3ce05b ("dpll: Add dpll command")
---
 dpll/dpll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dpll/dpll.c +1 -1
index 624567c2a826fd..0effa5a9c67e72 100644
@@ -1768,7 +1768,7 @@ static int cmd_pin_id_get(struct dpll *dpll)
 			if (dpll_parse_attr_str(dpll, nlh, "package-label",
 						DPLL_A_PIN_PACKAGE_LABEL))
 				return -EINVAL;
-		} else if (dpll_argv_match(dpll, "type")) {
+		} else if (dpll_argv_match_inc(dpll, "type")) {
 			if (dpll_parse_attr_enum(dpll, nlh, "type",
 						 DPLL_A_PIN_TYPE,
 						 dpll_parse_pin_type))
Signature · 1 line
2.52.0
author
#2 lore raw

PATCH 2/4 dpll: add client-side filtering for device show

In reply to Petr Oros

Add client-side filtering support for dpll device show command. Users can filter devices by module-name, clock-id, type, mode, and lock-status. Multiple filters use AND semantics. Filters work with both dump (all devices) and single GET (by id) operations.

---
 bash-completion/dpll |  25 +++++-
 dpll/dpll.c          | 191 +++++++++++++++++++++++++++++++++++++++++--
 man/man8/dpll.8      |  35 +++++++-
 3 files changed, 243 insertions(+), 8 deletions(-)
bash-completion/dpll +24 -1
index caf86a36f2adf3..a614b3eb6ab355 100644
@@ -60,8 +60,31 @@ _dpll_device()
                         "$(_dpll_direct_complete device_id)" -- "$cur" ) )
                     return 0
                     ;;
+                module-name)
+                    COMPREPLY=( $( compgen -W \
+                        "$(_dpll_direct_complete module_name)" -- "$cur" ) )
+                    return 0
+                    ;;
+                clock-id)
+                    # numeric value, no completion
+                    return 0
+                    ;;
+                type)
+                    COMPREPLY=( $( compgen -W "pps eec" -- "$cur" ) )
+                    return 0
+                    ;;
+                mode)
+                    COMPREPLY=( $( compgen -W "manual automatic" -- "$cur" ) )
+                    return 0
+                    ;;
+                lock-status)
+                    COMPREPLY=( $( compgen -W \
+                        "unlocked locked locked-ho-acq holdover" -- "$cur" ) )
+                    return 0
+                    ;;
                 *)
-                    COMPREPLY=( $( compgen -W "id" -- "$cur" ) )
+                    COMPREPLY=( $( compgen -W "id module-name clock-id \
+                        type mode lock-status" -- "$cur" ) )
                     return 0
                     ;;
             esac
dpll/dpll.c +185 -6

271 lines not on this page · raw message

man/man8/dpll.8 +34 -1
index e82f083feac64b..1407ca9793c96c 100644
@@ -60,7 +60,7 @@ and newlines for better human readability.
 
 .SH DEVICE COMMANDS
 
-.SS dpll device show [ id ID ]
+.SS dpll device show [ id ID ] [ module-name NAME ] [ clock-id ID ] [ type TYPE ] [ mode MODE ] [ lock-status STATUS ]
 
 Display information about DPLL devices. If no arguments are specified,
 shows all devices in the system.
@@ -69,6 +69,29 @@ shows all devices in the system.
 .BI id " ID"
 Show only the device with the specified numeric identifier.
 
+.TP
+.BI module-name " NAME"
+Show only devices provided by the specified kernel module.
+
+.TP
+.BI clock-id " ID"
+Show only devices with the specified 64-bit clock identifier.
+
+.TP
+.BI type " TYPE"
+Show only devices of the specified type:
+.BR pps " or " eec .
+
+.TP
+.BI mode " MODE"
+Show only devices in the specified operating mode:
+.BR manual " or " automatic .
+
+.TP
+.BI lock-status " STATUS"
+Show only devices with the specified lock status:
+.BR unlocked ", " locked ", " locked-ho-acq ", " holdover .
+
 .PP
 Output includes:
 .RS
@@ -304,6 +327,16 @@ Press Ctrl+C to stop monitoring.
 .B dpll device set id 0 phase-offset-monitor enable
 .fi
 
+.SS Show all EEC devices
+.nf
+.B dpll device show type eec
+.fi
+
+.SS Show devices from specific module in JSON
+.nf
+.B dpll -jp device show module-name ice
+.fi
+
 .SS Show all pins
 .nf
 .B dpll pin show
Signature · 1 line
2.52.0
author
#3 lore raw

PATCH 3/4 dpll: add client-side filtering for pin show

In reply to Petr Oros

Add client-side filtering support for dpll pin show command. Users can filter pins by module-name, clock-id, board-label, panel-label, package-label, and type. Multiple filters use AND semantics. Filters work with both dump and single GET operations.

---
 bash-completion/dpll |  22 +++++++-
 dpll/dpll.c          | 120 ++++++++++++++++++++++++++++++++++++++++---
 man/man8/dpll.8      |  37 ++++++++++++-
 3 files changed, 169 insertions(+), 10 deletions(-)
bash-completion/dpll +21 -1
index a614b3eb6ab355..f81a2d2caa1012 100644
@@ -158,8 +158,28 @@ _dpll_pin()
                         "$(_dpll_direct_complete device_id)" -- "$cur" ) )
                     return 0
                     ;;
+                module-name)
+                    COMPREPLY=( $( compgen -W \
+                        "$(_dpll_direct_complete module_name)" -- "$cur" ) )
+                    return 0
+                    ;;
+                clock-id)
+                    # numeric value, no completion
+                    return 0
+                    ;;
+                board-label|panel-label|package-label)
+                    # string value, no completion
+                    return 0
+                    ;;
+                type)
+                    COMPREPLY=( $( compgen -W "mux ext synce-eth-port \
+                        int-oscillator gnss" -- "$cur" ) )
+                    return 0
+                    ;;
                 *)
-                    COMPREPLY=( $( compgen -W "id device" -- "$cur" ) )
+                    COMPREPLY=( $( compgen -W "id device module-name clock-id \
+                        board-label panel-label package-label type" \
+                        -- "$cur" ) )
                     return 0
                     ;;
             esac
dpll/dpll.c +112 -8

194 lines not on this page · raw message

man/man8/dpll.8 +36 -1
index 1407ca9793c96c..a4280153b4d67b 100644
@@ -161,7 +161,7 @@ Device type:
 
 .SH PIN COMMANDS
 
-.SS dpll pin show [ id ID ] [ device ID ]
+.SS dpll pin show [ id ID ] [ device ID ] [ module-name NAME ] [ clock-id ID ] [ board-label LABEL ] [ panel-label LABEL ] [ package-label LABEL ] [ type TYPE ]
 
 Display information about DPLL pins. If no arguments are specified,
 shows all pins in the system.
@@ -174,6 +174,31 @@ Show only the pin with the specified numeric identifier.
 .BI device " ID"
 Show only pins associated with the specified device ID.
 
+.TP
+.BI module-name " NAME"
+Show only pins provided by the specified kernel module.
+
+.TP
+.BI clock-id " ID"
+Show only pins with the specified 64-bit clock identifier.
+
+.TP
+.BI board-label " LABEL"
+Show only pins with the specified board label.
+
+.TP
+.BI panel-label " LABEL"
+Show only pins with the specified panel label.
+
+.TP
+.BI package-label " LABEL"
+Show only pins with the specified package label.
+
+.TP
+.BI type " TYPE"
+Show only pins of the specified type:
+.BR mux ", " ext ", " synce-eth-port ", " int-oscillator ", " gnss .
+
 .PP
 Output includes:
 .RS
@@ -342,6 +367,16 @@ Press Ctrl+C to stop monitoring.
 .B dpll pin show
 .fi
 
+.SS Show all GNSS pins
+.nf
+.B dpll pin show type gnss
+.fi
+
+.SS Show GNSS pins from specific module
+.nf
+.B dpll pin show type gnss module-name ice
+.fi
+
 .SS Show pin with pretty JSON output
 .nf
 .B dpll -jp pin show id 5
Signature · 1 line
2.52.0
author
#4 lore raw

PATCH 4/4 dpll: add pin filtering by parent-device and parent-pin

In reply to Petr Oros

The existing "device" argument in "dpll pin show" sent DPLL_A_ID in the pin dump request, but the kernel does not use this attribute for pin dump filtering. Replace it with client-side parent-device filtering that checks DPLL_A_PIN_PARENT_ID inside nested DPLL_A_PIN_PARENT_DEVICE attributes.

Also add parent-pin filtering for mux pin hierarchies using the same approach with DPLL_A_PIN_PARENT_PIN nested attributes.

Rename the "device" argument to "parent-device" to better reflect the actual semantics.

---
 bash-completion/dpll | 12 ++++--
 dpll/dpll.c          | 88 ++++++++++++++++++++++++++++++++++----------
 man/man8/dpll.8      | 10 +++--
 3 files changed, 85 insertions(+), 25 deletions(-)
bash-completion/dpll +9 -3
index f81a2d2caa1012..b3ba0d306183ac 100644
@@ -153,11 +153,16 @@ _dpll_pin()
                         "$(_dpll_direct_complete pin_id)" -- "$cur" ) )
                     return 0
                     ;;
-                device)
+                parent-device)
                     COMPREPLY=( $( compgen -W \
                         "$(_dpll_direct_complete device_id)" -- "$cur" ) )
                     return 0
                     ;;
+                parent-pin)
+                    COMPREPLY=( $( compgen -W \
+                        "$(_dpll_direct_complete pin_id)" -- "$cur" ) )
+                    return 0
+                    ;;
                 module-name)
                     COMPREPLY=( $( compgen -W \
                         "$(_dpll_direct_complete module_name)" -- "$cur" ) )
@@ -177,8 +182,9 @@ _dpll_pin()
                     return 0
                     ;;
                 *)
-                    COMPREPLY=( $( compgen -W "id device module-name clock-id \
-                        board-label panel-label package-label type" \
+                    COMPREPLY=( $( compgen -W "id parent-device parent-pin \
+                        module-name clock-id board-label panel-label \
+                        package-label type" \
                         -- "$cur" ) )
                     return 0
                     ;;
dpll/dpll.c +69 -19

167 lines not on this page · raw message

man/man8/dpll.8 +7 -3
index a4280153b4d67b..86bc1a7e56d9f8 100644
@@ -161,7 +161,7 @@ Device type:
 
 .SH PIN COMMANDS
 
-.SS dpll pin show [ id ID ] [ device ID ] [ module-name NAME ] [ clock-id ID ] [ board-label LABEL ] [ panel-label LABEL ] [ package-label LABEL ] [ type TYPE ]
+.SS dpll pin show [ id ID ] [ parent-device DEVICE_ID ] [ parent-pin PIN_ID ] [ module-name NAME ] [ clock-id ID ] [ board-label LABEL ] [ panel-label LABEL ] [ package-label LABEL ] [ type TYPE ]
 
 Display information about DPLL pins. If no arguments are specified,
 shows all pins in the system.
@@ -171,8 +171,12 @@ shows all pins in the system.
 Show only the pin with the specified numeric identifier.
 
 .TP
-.BI device " ID"
-Show only pins associated with the specified device ID.
+.BI parent-device " DEVICE_ID"
+Show only pins that have the specified DPLL device as a parent.
+
+.TP
+.BI parent-pin " PIN_ID"
+Show only pins that have the specified pin as a parent (mux pins).
 
 .TP
 .BI module-name " NAME"
Signature · 1 line
2.52.0
#5 lore raw
In reply to Petr Oros
This series was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This series was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 8 lines · On Tue, 24 Feb 2026 10:12:39 +0100 you wrote:

This series fixes a parsing bug in dpll pin id-get and adds client-side filtering support for dpll device show and pin show commands.

Patch 1 fixes a bug where "dpll pin id-get type gnss" would read the keyword "type" as the enum value instead of the actual type.

[...]

Here is the summary with links:
- [iproute2-next,1/4] dpll: fix pin id-get type filter parsing (no matching commit)
- [iproute2-next,2/4] dpll: add client-side filtering for device show

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=4c4dfe5b4a38
  - [iproute2-next,3/4] dpll: add client-side filtering for pin show
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=0a0fe9c8390d
  - [iproute2-next,4/4] dpll: add pin filtering by parent-device and parent-pin
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=5d9d0ae4d7e5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html