[PATCH net-next v2 0/4] dpll: add all inputs phase offset monitor
From: Arkadiusz Kubalewski
Date: Tue Apr 15 2025 - 14:22:55 EST
Add simple dpll device level feature and capabilties infrastructure over
netlink dpll interface.
Using new infrastructure add new feature: ALL_INPUTS_PHASE_OFFSET_MONITOR.
Allow users control with two new attributes:
- DPLL_A_CAPABILITIES - for checking if dpll device is capable,
- DPLL_A_FEATURES - for enable/disable a features.
Implement feature in ice driver for dpll-enabled devices.
Verify capability:
$ ./tools/net/ynl/pyynl/cli.py \
--spec Documentation/netlink/specs/dpll.yaml \
--dump device-get
[{'capabilities': set(),
'clock-id': 4658613174691613800,
'features': set(),
'id': 0,
'lock-status': 'locked-ho-acq',
'mode': 'automatic',
'mode-supported': ['automatic'],
'module-name': 'ice',
'type': 'eec'},
{'capabilities': {'all-inputs-phase-offset-monitor'},
'clock-id': 4658613174691613800,
'features': set(),
'id': 1,
'lock-status': 'locked-ho-acq',
'mode': 'automatic',
'mode-supported': ['automatic'],
'module-name': 'ice',
'type': 'pps'}]
Enable the feature:
$ ./tools/net/ynl/pyynl/cli.py \
--spec Documentation/netlink/specs/dpll.yaml \
--do device-set --json '{"id":1, \
"features":"all-inputs-phase-offset-monitor"}'
Verify feature is enabled:
$ ./tools/net/ynl/pyynl/cli.py \
--spec Documentation/netlink/specs/dpll.yaml \
--dump device-get
[
[...]
{'capabilities': {'all-inputs-phase-offset-monitor'},
'clock-id': 4658613174691613800,
'features': {'all-inputs-phase-offset-monitor'},
'id': 1,
[...]
]
Disable the feature:
$ ./tools/net/ynl/pyynl/cli.py \
--spec Documentation/netlink/specs/dpll.yaml \
--do device-set --json '{"id":1, \
"features":0}'
Arkadiusz Kubalewski (4):
dpll: use struct dpll_device_info for dpll registration
dpll: add features and capabilities to dpll device spec
dpll: features_get/set callbacks
ice: add phase offset monitor for all PPS dpll inputs
Documentation/netlink/specs/dpll.yaml | 25 +++
drivers/dpll/dpll_core.c | 34 +--
drivers/dpll/dpll_core.h | 2 +-
drivers/dpll/dpll_netlink.c | 86 +++++++-
drivers/dpll/dpll_nl.c | 5 +-
.../net/ethernet/intel/ice/ice_adminq_cmd.h | 20 ++
drivers/net/ethernet/intel/ice/ice_common.c | 26 +++
drivers/net/ethernet/intel/ice/ice_common.h | 3 +
drivers/net/ethernet/intel/ice/ice_dpll.c | 195 +++++++++++++++++-
drivers/net/ethernet/intel/ice/ice_dpll.h | 7 +
drivers/net/ethernet/intel/ice/ice_main.c | 4 +
.../net/ethernet/mellanox/mlx5/core/dpll.c | 10 +-
drivers/ptp/ptp_ocp.c | 7 +-
include/linux/dpll.h | 16 +-
include/uapi/linux/dpll.h | 13 ++
15 files changed, 417 insertions(+), 36 deletions(-)
base-commit: bbfc077d457272bcea4f14b3a28247ade99b196d
--
2.38.1