From: Maciej Machnikowski <hidden> Date: 2021-12-01 18:17:08
Synchronous Ethernet networks use a physical layer clock to syntonize
the frequency across different network elements.
Basic SyncE node defined in the ITU-T G.8264 consist of an Ethernet
Equipment Clock (EEC) and have the ability to recover synchronization
from the synchronization inputs - either traffic interfaces or external
frequency sources.
The EEC can synchronize its frequency (syntonize) to any of those sources.
It is also able to select synchronization source through priority tables
and synchronization status messaging. It also provides neccessary
filtering and holdover capabilities
This patch series introduces basic interface for reading and configuring
recover clocks on a SyncE capable device
v4:
- Dropped EEC_STATE reporting (TBD: DPLL subsystem)
- moved recovered clock configuration to ethtool netlink
v3:
- remove RTM_GETRCLKRANGE
- return state of all possible pins in the RTM_GETRCLKSTATE
- clarify documentation
v2:
- improved documentation
- fixed kdoc warning
RFC history:
v2:
- removed whitespace changes
- fix issues reported by test robot
v3:
- Changed naming from SyncE to EEC
- Clarify cover letter and commit message for patch 1
v4:
- Removed sync_source and pin_idx info
- Changed one structure to attributes
- Added EEC_SRC_PORT flag to indicate that the EEC is synchronized
to the recovered clock of a port that returns the state
v5:
- add EEC source as an optiona attribute
- implement support for recovered clocks
- align states returned by EEC to ITU-T G.781
v6:
- fix EEC clock state reporting
- add documentation
- fix descriptions in code comments
Maciej Machnikowski (4):
ice: add support detecting features based on netlist
ethtool: Add ability to configure recovered clock for SyncE feature
ice: add support for monitoring SyncE DPLL state
ice: add support for SyncE recovered clocks
Documentation/networking/ethtool-netlink.rst | 67 +++++
drivers/net/ethernet/intel/ice/ice.h | 7 +
.../net/ethernet/intel/ice/ice_adminq_cmd.h | 70 ++++-
drivers/net/ethernet/intel/ice/ice_common.c | 224 +++++++++++++++
drivers/net/ethernet/intel/ice/ice_common.h | 20 +-
drivers/net/ethernet/intel/ice/ice_devids.h | 3 +
drivers/net/ethernet/intel/ice/ice_ethtool.c | 97 +++++++
drivers/net/ethernet/intel/ice/ice_lib.c | 6 +-
drivers/net/ethernet/intel/ice/ice_ptp.c | 35 +++
drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 49 ++++
drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 36 +++
drivers/net/ethernet/intel/ice/ice_type.h | 1 +
include/linux/ethtool.h | 9 +
include/uapi/linux/ethtool_netlink.h | 21 ++
net/ethtool/Makefile | 3 +-
net/ethtool/netlink.c | 20 ++
net/ethtool/netlink.h | 4 +
net/ethtool/synce.c | 267 ++++++++++++++++++
18 files changed, 935 insertions(+), 4 deletions(-)
create mode 100644 net/ethtool/synce.c
--
2.26.3
@@ -220,6 +220,8 @@ Userspace to kernel:``ETHTOOL_MSG_PHC_VCLOCKS_GET`` get PHC virtual clocks info``ETHTOOL_MSG_MODULE_SET`` set transceiver module parameters``ETHTOOL_MSG_MODULE_GET`` get transceiver module parameters+``ETHTOOL_RCLK_GET`` get recovered clock parameters+``ETHTOOL_RCLK_SET`` set recovered clock parameters ===================================== ================================= Kernel to userspace:
@@ -260,6 +262,8 @@ Kernel to userspace:``ETHTOOL_MSG_STATS_GET_REPLY`` standard statistics``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY`` PHC virtual clocks info``ETHTOOL_MSG_MODULE_GET_REPLY`` transceiver module parameters+``ETHTOOL_MSG_RCLK_GET_REPLY`` reference recovered clock config+``ETHTOOL_MSG_RCLK_NTF`` reference recovered clock config ======================================== =================================``GET`` requests are sent by userspace applications to retrieve device
@@ -1598,6 +1602,67 @@ For SFF-8636 modules, low power mode is forced by the host according to table For CMIS modules, low power mode is forced by the host according to table 6-12 in revision 5.0 of the specification.+RCLK_GET+========++Get status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ====== ==========================+``ETHTOOL_A_RCLK_HEADER`` nested request header+``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ====================================== ====== ==========================++Kernel response contents:++ ====================================== ====== ==========================+``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 state of a pin+``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` u32 min index of RCLK pins+``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` u32 max index of RCLK pins+ ====================================== ====== ==========================++Supported device can have mulitple reference recover clock pins available+to be used as source of frequency for a DPLL.+Once a pin on given port is enabled. The PHY recovered frequency is being+fed onto that pin, and can be used by DPLL to synchonize with its signal.+Pins don't have to start with index equal 0 - device can also have different+external sources pins.++The ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is optional parameter. If present in+the RCLK_GET request, the ``ETHTOOL_A_RCLK_PIN_ENABLED`` is provided in a+response, it contatins state of the pin pointed by the index. Values are:++..kernel-doc:: include/uapi/linux/ethtool.h+:identifiers: ethtool_rclk_pin_state++If ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is not present in the RCLK_GET request,+the range of available pins is returned:+``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` is lowest possible index of a pin available+for recovering frequency from PHY.+``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` is highest possible index of a pin available+for recovering frequency from PHY.++RCLK_SET+==========++Set status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ====== ========================+``ETHTOOL_A_RCLK_HEADER`` nested request header+``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 requested state+ ====================================== ====== ========================++``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is a index of a pin for which the change of+state is requested. Values of ``ETHTOOL_A_RCLK_PIN_ENABLED`` are:++..kernel-doc:: include/uapi/linux/ethtool.h+:identifiers: ethtool_rclk_pin_state+ Request translation ===================
@@ -0,0 +1,267 @@+// SPDX-License-Identifier: GPL-2.0-only++#include<linux/ethtool.h>+#include"netlink.h"++structrclk_out_pin_info{+u32idx;+boolvalid;+};++structrclk_request_data{+structethnl_req_infobase;+structrclk_out_pin_infoout_pin;+};++structrclk_pin_state_info{+u32range_min;+u32range_max;+u32flags;+u32idx;+};++structrclk_reply_data{+structethnl_reply_database;+structrclk_pin_state_infopin_state;+};++#define RCLK_REPDATA(__reply_base) \+container_of(__reply_base,structrclk_reply_data,base)++#define RCLK_REQDATA(__req_base) \+container_of(__req_base,structrclk_request_data,base)++/* RCLK_GET */++conststructnla_policy+ethnl_rclk_get_policy[ETHTOOL_A_RCLK_OUT_PIN_IDX+1]={+[ETHTOOL_A_RCLK_HEADER]=NLA_POLICY_NESTED(ethnl_header_policy),+[ETHTOOL_A_RCLK_OUT_PIN_IDX]={.type=NLA_U32},+};++staticintrclk_parse_request(structethnl_req_info*req_base,+structnlattr**tb,+structnetlink_ext_ack*extack)+{+structrclk_request_data*req=RCLK_REQDATA(req_base);++if(tb[ETHTOOL_A_RCLK_OUT_PIN_IDX]){+req->out_pin.idx=nla_get_u32(tb[ETHTOOL_A_RCLK_OUT_PIN_IDX]);+req->out_pin.valid=true;+}++return0;+}++staticintrclk_state_get(structnet_device*dev,+structrclk_reply_data*data,+structnetlink_ext_ack*extack,+u32out_idx)+{+conststructethtool_ops*ops=dev->ethtool_ops;+boolpin_state;+intret;++if(!ops->get_rclk_state)+return-EOPNOTSUPP;++ret=ops->get_rclk_state(dev,out_idx,&pin_state,extack);+if(ret)+returnret;++data->pin_state.flags=pin_state?ETHTOOL_RCLK_PIN_FLAGS_ENA:0;+data->pin_state.idx=out_idx;++returnret;+}++staticintrclk_range_get(structnet_device*dev,+structrclk_reply_data*data,+structnetlink_ext_ack*extack)+{+conststructethtool_ops*ops=dev->ethtool_ops;+u32min_idx,max_idx;+intret;++if(!ops->get_rclk_range)+return-EOPNOTSUPP;++ret=ops->get_rclk_range(dev,&min_idx,&max_idx,extack);+if(ret)+returnret;++data->pin_state.range_min=min_idx;+data->pin_state.range_max=max_idx;++returnret;+}++staticintrclk_prepare_data(conststructethnl_req_info*req_base,+structethnl_reply_data*reply_base,+structgenl_info*info)+{+structrclk_reply_data*reply=RCLK_REPDATA(reply_base);+structrclk_request_data*request=RCLK_REQDATA(req_base);+structnetlink_ext_ack*extack=info?info->extack:NULL;+structnet_device*dev=reply_base->dev;+intret;++memset(&reply->pin_state,0,sizeof(reply->pin_state));+ret=ethnl_ops_begin(dev);+if(ret<0)+returnret;++if(request->out_pin.valid)+ret=rclk_state_get(dev,reply,extack,+request->out_pin.idx);+else+ret=rclk_range_get(dev,reply,extack);++ethnl_ops_complete(dev);++returnret;+}++staticintrclk_fill_reply(structsk_buff*skb,+conststructethnl_req_info*req_base,+conststructethnl_reply_data*reply_base)+{+conststructrclk_reply_data*reply=RCLK_REPDATA(reply_base);+conststructrclk_request_data*request=RCLK_REQDATA(req_base);++if(request->out_pin.valid){+if(nla_put_u32(skb,ETHTOOL_A_RCLK_PIN_FLAGS,+reply->pin_state.flags))+return-EMSGSIZE;+if(nla_put_u32(skb,ETHTOOL_A_RCLK_OUT_PIN_IDX,+reply->pin_state.idx))+return-EMSGSIZE;+}else{+if(nla_put_u32(skb,ETHTOOL_A_RCLK_PIN_MIN,+reply->pin_state.range_min))+return-EMSGSIZE;+if(nla_put_u32(skb,ETHTOOL_A_RCLK_PIN_MAX,+reply->pin_state.range_max))+return-EMSGSIZE;+}++return0;+}++staticintrclk_reply_size(conststructethnl_req_info*req_base,+conststructethnl_reply_data*reply_base)+{+conststructrclk_request_data*request=RCLK_REQDATA(req_base);++if(request->out_pin.valid)+returnnla_total_size(sizeof(u32))+/* ETHTOOL_A_RCLK_PIN_FLAGS */+nla_total_size(sizeof(u32));/* ETHTOOL_A_RCLK_OUT_PIN_IDX */+else+returnnla_total_size(sizeof(u32))+/* ETHTOOL_A_RCLK_PIN_MIN */+nla_total_size(sizeof(u32));/* ETHTOOL_A_RCLK_PIN_MAX */+}++conststructethnl_request_opsethnl_rclk_request_ops={+.request_cmd=ETHTOOL_MSG_RCLK_GET,+.reply_cmd=ETHTOOL_MSG_RCLK_GET_REPLY,+.hdr_attr=ETHTOOL_A_RCLK_HEADER,+.req_info_size=sizeof(structrclk_request_data),+.reply_data_size=sizeof(structrclk_reply_data),++.parse_request=rclk_parse_request,+.prepare_data=rclk_prepare_data,+.reply_size=rclk_reply_size,+.fill_reply=rclk_fill_reply,+};++/* RCLK SET */++conststructnla_policy+ethnl_rclk_set_policy[ETHTOOL_A_RCLK_PIN_FLAGS+1]={+[ETHTOOL_A_RCLK_HEADER]=NLA_POLICY_NESTED(ethnl_header_policy),+[ETHTOOL_A_RCLK_OUT_PIN_IDX]={.type=NLA_U32},+[ETHTOOL_A_RCLK_PIN_FLAGS]={.type=NLA_U32},+};++staticintrclk_set_state(structnet_device*dev,structnlattr**tb,+bool*p_mod,structnetlink_ext_ack*extack)+{+conststructethtool_ops*ops=dev->ethtool_ops;+boolold_state,new_state;+u32min_idx,max_idx;+u32out_idx;+intret;++if(!tb[ETHTOOL_A_RCLK_PIN_FLAGS]&&+!tb[ETHTOOL_A_RCLK_OUT_PIN_IDX])+return0;++if(!ops->set_rclk_out||!ops->get_rclk_range){+NL_SET_ERR_MSG_ATTR(extack,+tb[ETHTOOL_A_RCLK_PIN_FLAGS],+"Setting recovered clock state is not supported by this device");+return-EOPNOTSUPP;+}++ret=ops->get_rclk_range(dev,&min_idx,&max_idx,extack);+if(ret)+returnret;++out_idx=nla_get_u32(tb[ETHTOOL_A_RCLK_OUT_PIN_IDX]);+if(out_idx<min_idx||out_idx>max_idx){+NL_SET_ERR_MSG_ATTR(extack,+tb[ETHTOOL_A_RCLK_OUT_PIN_IDX],+"Requested recovered clock pin index is out of range");+return-EINVAL;+}++ret=ops->get_rclk_state(dev,out_idx,&old_state,extack);+if(ret<0)+returnret;++new_state=!!(nla_get_u32(tb[ETHTOOL_A_RCLK_PIN_FLAGS])&+ETHTOOL_RCLK_PIN_FLAGS_ENA);++/* If state changed - flag need for sending the notification */+*p_mod=old_state!=new_state;++returnops->set_rclk_out(dev,out_idx,new_state,extack);+}++intethnl_set_rclk(structsk_buff*skb,structgenl_info*info)+{+structethnl_req_inforeq_info={};+structnlattr**tb=info->attrs;+structnet_device*dev;+boolmod=false;+intret;++ret=ethnl_parse_header_dev_get(&req_info,tb[ETHTOOL_A_RCLK_HEADER],+genl_info_net(info),info->extack,+true);+if(ret<0)+returnret;+dev=req_info.dev;++rtnl_lock();+ret=ethnl_ops_begin(dev);+if(ret<0)+gotoout_rtnl;++ret=rclk_set_state(dev,tb,&mod,info->extack);+if(ret<0)+gotoout_ops;++if(!mod)+gotoout_ops;++ethtool_notify(dev,ETHTOOL_MSG_RCLK_NTF,NULL);++out_ops:+ethnl_ops_complete(dev);+out_rtnl:+rtnl_unlock();+dev_put(dev);+returnret;+}+
From: Maciej Machnikowski <hidden> Date: 2021-12-01 18:17:27
Implement SyncE DPLL monitoring for E810-T devices.
Poll loop will periodically check the state of the DPLL and cache it
in the pf structure. State changes will be logged in the system log.
Signed-off-by: Maciej Machnikowski <redacted>
---
drivers/net/ethernet/intel/ice/ice.h | 5 ++
.../net/ethernet/intel/ice/ice_adminq_cmd.h | 34 +++++++++++++
drivers/net/ethernet/intel/ice/ice_common.c | 36 ++++++++++++++
drivers/net/ethernet/intel/ice/ice_common.h | 5 +-
drivers/net/ethernet/intel/ice/ice_devids.h | 3 ++
drivers/net/ethernet/intel/ice/ice_ptp.c | 35 ++++++++++++++
drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 48 +++++++++++++++++++
drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 34 +++++++++++++
8 files changed, 199 insertions(+), 1 deletion(-)
@@ -12,6 +12,18 @@ enum ice_ptp_tmr_cmd {READ_TIME};+enumice_eec_state{+ICE_EEC_STATE_INVALID=0,/* state is not valid */+ICE_EEC_STATE_FREERUN,/* clock is free-running */+ICE_EEC_STATE_LOCKED,/* clock is locked to the reference,+*buttheholdovermemoryisnotvalid+*/+ICE_EEC_STATE_LOCKED_HO_ACQ,/* clock is locked to the reference+*andholdovermemoryisvalid+*/+ICE_EEC_STATE_HOLDOVER,/* clock is in holdover mode */+};+/* Increment value to generate nanoseconds in the GLTSYN_TIME_L register for*theE810devices.BasedoffofaPLLwithan812.5MHzfrequency.*/
@@ -33,6 +45,8 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw);intice_read_sma_ctrl_e810t(structice_hw*hw,u8*data);intice_write_sma_ctrl_e810t(structice_hw*hw,u8data);boolice_is_pca9575_present(structice_hw*hw);+enumice_eec_state+ice_get_zl_dpll_state(structice_hw*hw,u8dpll_idx,u8*pin);#define PFTSYN_SEM_BYTES 4
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-12-02 01:56:21
On Wed, 1 Dec 2021 19:02:08 +0100 Maciej Machnikowski wrote:
Implement ethtool netlink functions for handling SyncE recovered clocks
configuration on ice driver:
- ETHTOOL_MSG_RCLK_SET
- ETHTOOL_MSG_RCLK_GET
Co-developed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Signed-off-by: Maciej Machnikowski <redacted>
drivers/net/ethernet/intel/ice/ice_ethtool.c:4090: warning: Excess function parameter 'ena_mask' description in 'ice_get_rclk_range'
drivers/net/ethernet/intel/ice/ice_dcb_nl.c:66:6: warning: variable 'bwcfg' set but not used [-Wunused-but-set-variable]
int bwcfg = 0, bwrec = 0;
^
From: kernel test robot <hidden> Date: 2021-12-02 11:49:36
Hi Maciej,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Maciej-Machnikowski/Add-ethtool-interface-for-SyncE/20211202-021915
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 23ea630f86c70cbe6691f9f839e7b6742f0e9ad3
reproduce: make htmldocs
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>
All warnings (new ones prefixed by >>):
include/uapi/linux/ethtool.h:1: warning: 'ethtool_rclk_pin_state' not found
vim +/ethtool_rclk_pin_state +1 include/uapi/linux/ethtool.h
6f52b16c5b29b8 Greg Kroah-Hartman 2017-11-01 @1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
607ca46e97a1b6 David Howells 2012-10-13 2 /*
607ca46e97a1b6 David Howells 2012-10-13 3 * ethtool.h: Defines for Linux ethtool.
607ca46e97a1b6 David Howells 2012-10-13 4 *
607ca46e97a1b6 David Howells 2012-10-13 5 * Copyright (C) 1998 David S. Miller (davem@redhat.com)
607ca46e97a1b6 David Howells 2012-10-13 6 * Copyright 2001 Jeff Garzik [off-list ref]
607ca46e97a1b6 David Howells 2012-10-13 7 * Portions Copyright 2001 Sun Microsystems (thockin@sun.com)
607ca46e97a1b6 David Howells 2012-10-13 8 * Portions Copyright 2002 Intel (eli.kupermann@intel.com,
607ca46e97a1b6 David Howells 2012-10-13 9 * christopher.leech@intel.com,
607ca46e97a1b6 David Howells 2012-10-13 10 * scott.feldman@intel.com)
607ca46e97a1b6 David Howells 2012-10-13 11 * Portions Copyright (C) Sun Microsystems 2008
607ca46e97a1b6 David Howells 2012-10-13 12 */
607ca46e97a1b6 David Howells 2012-10-13 13
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
quoted hunk
+RCLK_GET+========++Get status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ====== ==========================+ ``ETHTOOL_A_RCLK_HEADER`` nested request header+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ====================================== ====== ==========================++Kernel response contents:++ ====================================== ====== ==========================+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 state of a pin+ ``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` u32 min index of RCLK pins+ ``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` u32 max index of RCLK pins+ ====================================== ====== ==========================++Supported device can have mulitple reference recover clock pins available
s/mulitple/multiple/
quoted hunk
+to be used as source of frequency for a DPLL.+Once a pin on given port is enabled. The PHY recovered frequency is being+fed onto that pin, and can be used by DPLL to synchonize with its signal.
s/synchonize/synchronize/
Please run a spell checker on documentation
quoted hunk
+Pins don't have to start with index equal 0 - device can also have different+external sources pins.++The ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is optional parameter. If present in+the RCLK_GET request, the ``ETHTOOL_A_RCLK_PIN_ENABLED`` is provided in a
The `ETHTOOL_A_RCLK_PIN_ENABLED` attribute is no where to be found in
this submission
+response, it contatins state of the pin pointed by the index. Values are:
++If ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is not present in the RCLK_GET request,+the range of available pins is returned:+``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` is lowest possible index of a pin available+for recovering frequency from PHY.+``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` is highest possible index of a pin available+for recovering frequency from PHY.++RCLK_SET+==========++Set status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ====== ========================+ ``ETHTOOL_A_RCLK_HEADER`` nested request header+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 requested state+ ====================================== ====== ========================++``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is a index of a pin for which the change of+state is requested. Values of ``ETHTOOL_A_RCLK_PIN_ENABLED`` are:++.. kernel-doc:: include/uapi/linux/ethtool.h+ :identifiers: ethtool_rclk_pin_state
Same.
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message allows
me to redirect the frequency recovered from this netdev to the EEC via
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range of
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That is,
how does user space know that RCLK_SET message to redirect the frequency
recovered from netdev 1 to pin 1 will be overridden by the same message
but for netdev 2?
2. How does user space know the mapping between a netdev and an EEC?
That is, how does user space know that RCLK_SET message for netdev 1
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
3. If user space sends two RCLK_SET messages to redirect the frequency
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out 2,
how does it know which recovered frequency is actually used an input to
the EEC?
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output pins
of the PHY as opposed to input pins of the EEC?
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
[1] https://lore.kernel.org/netdev/20211110114448.2792314-1-maciej.machnikowski@intel.com/
From: Machnikowski, Maciej <hidden> Date: 2021-12-02 15:17:11
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
quoted
+RCLK_GET+========++Get status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ======
==========================
quoted
+ ``ETHTOOL_A_RCLK_HEADER`` nested request header+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ====================================== ======
+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 state of a pin+ ``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` u32 min index of RCLK pins+ ``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` u32 max index of RCLK
pins
quoted
+ ====================================== ======
==========================
quoted
+
+Supported device can have mulitple reference recover clock pins available
s/mulitple/multiple/
quoted
+to be used as source of frequency for a DPLL.+Once a pin on given port is enabled. The PHY recovered frequency is being+fed onto that pin, and can be used by DPLL to synchonize with its signal.
s/synchonize/synchronize/
Please run a spell checker on documentation
quoted
+Pins don't have to start with index equal 0 - device can also have different+external sources pins.++The ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is optional parameter. If present
in
quoted
+the RCLK_GET request, the ``ETHTOOL_A_RCLK_PIN_ENABLED`` is
provided in a
The `ETHTOOL_A_RCLK_PIN_ENABLED` attribute is no where to be found in
this submission
quoted
+response, it contatins state of the pin pointed by the index. Values are:
+
+If ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is not present in the RCLK_GET
request,
quoted
+the range of available pins is returned:
+``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` is lowest possible index of a pin
available
quoted
+for recovering frequency from PHY.
+``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` is highest possible index of a pin
available
quoted
+for recovering frequency from PHY.++RCLK_SET+==========++Set status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ======
========================
quoted
+ ``ETHTOOL_A_RCLK_HEADER`` nested request header+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 requested state+ ====================================== ======
========================
quoted
+
+``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is a index of a pin for which the
change of
quoted
+state is requested. Values of ``ETHTOOL_A_RCLK_PIN_ENABLED`` are:++.. kernel-doc:: include/uapi/linux/ethtool.h+ :identifiers: ethtool_rclk_pin_state
Same.
Done - rewritten the manual
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message allows
me to redirect the frequency recovered from this netdev to the EEC via
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range of
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That is,
how does user space know that RCLK_SET message to redirect the frequency
recovered from netdev 1 to pin 1 will be overridden by the same message
but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem in place
the right thing to do will be to add EEC input index and EEC index as additional
arguments
2. How does user space know the mapping between a netdev and an EEC?
That is, how does user space know that RCLK_SET message for netdev 1
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used now
3. If user space sends two RCLK_SET messages to redirect the frequency
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out 2,
how does it know which recovered frequency is actually used an input to
the EEC?
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output pins
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs. If we mix them it'll be hard to control everything
especially that a single EEC can support multiple devices.
Also if we make those pins attributes of the EEC it'll become extremally hard
to map them to netdevs and control them from the userspace app that will
receive the ESMC message with a given QL level on netdev X.
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
quoted
+RCLK_GET+========++Get status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ======
==========================
quoted
+ ``ETHTOOL_A_RCLK_HEADER`` nested request header+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ====================================== ======
+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 state of a pin+ ``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` u32 min index of RCLK pins+ ``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` u32 max index of RCLK
pins
quoted
+ ====================================== ======
==========================
quoted
+
+Supported device can have mulitple reference recover clock pins available
s/mulitple/multiple/
quoted
+to be used as source of frequency for a DPLL.+Once a pin on given port is enabled. The PHY recovered frequency is being+fed onto that pin, and can be used by DPLL to synchonize with its signal.
s/synchonize/synchronize/
Please run a spell checker on documentation
quoted
+Pins don't have to start with index equal 0 - device can also have different+external sources pins.++The ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is optional parameter. If present
in
quoted
+the RCLK_GET request, the ``ETHTOOL_A_RCLK_PIN_ENABLED`` is
provided in a
The `ETHTOOL_A_RCLK_PIN_ENABLED` attribute is no where to be found in
this submission
quoted
+response, it contatins state of the pin pointed by the index. Values are:
+
+If ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is not present in the RCLK_GET
request,
quoted
+the range of available pins is returned:
+``ETHTOOL_A_RCLK_RANGE_MIN_PIN`` is lowest possible index of a pin
available
quoted
+for recovering frequency from PHY.
+``ETHTOOL_A_RCLK_RANGE_MAX_PIN`` is highest possible index of a pin
available
quoted
+for recovering frequency from PHY.++RCLK_SET+==========++Set status of an output pin for PHY recovered frequency clock.++Request contents:++ ====================================== ======
========================
quoted
+ ``ETHTOOL_A_RCLK_HEADER`` nested request header+ ``ETHTOOL_A_RCLK_OUT_PIN_IDX`` u32 index of a pin+ ``ETHTOOL_A_RCLK_PIN_FLAGS`` u32 requested state+ ====================================== ======
========================
quoted
+
+``ETHTOOL_A_RCLK_OUT_PIN_IDX`` is a index of a pin for which the
change of
quoted
+state is requested. Values of ``ETHTOOL_A_RCLK_PIN_ENABLED`` are:++.. kernel-doc:: include/uapi/linux/ethtool.h+ :identifiers: ethtool_rclk_pin_state
Same.
Done - rewritten the manual
quoted
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message allows
me to redirect the frequency recovered from this netdev to the EEC via
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range of
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That is,
how does user space know that RCLK_SET message to redirect the frequency
recovered from netdev 1 to pin 1 will be overridden by the same message
but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem in place
the right thing to do will be to add EEC input index and EEC index as additional
arguments
quoted
2. How does user space know the mapping between a netdev and an EEC?
That is, how does user space know that RCLK_SET message for netdev 1
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used now
quoted
3. If user space sends two RCLK_SET messages to redirect the frequency
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out 2,
how does it know which recovered frequency is actually used an input to
the EEC?
User space doesn't know this as well?
quoted
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output pins
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Also if we make those pins attributes of the EEC it'll become extremally hard
to map them to netdevs and control them from the userspace app that will
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC driver.
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
From: Machnikowski, Maciej <hidden> Date: 2021-12-02 17:20:41
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 5:36 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message allows
me to redirect the frequency recovered from this netdev to the EEC via
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range of
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That is,
how does user space know that RCLK_SET message to redirect the
frequency
quoted
quoted
recovered from netdev 1 to pin 1 will be overridden by the same
message
quoted
quoted
but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem in
place
quoted
the right thing to do will be to add EEC input index and EEC index as
additional
quoted
arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC?
quoted
quoted
That is, how does user space know that RCLK_SET message for netdev 1
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used now
quoted
3. If user space sends two RCLK_SET messages to redirect the frequency
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out 2,
how does it know which recovered frequency is actually used an input to
the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they are
known.
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output pins
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input pin will serve
even 4,16,48 netdevs. I don't see easy way of starting from EEC input of EEC device
and figuring out which netdevs are connected to it to talk to the right one.
In current model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
Also if we make those pins attributes of the EEC it'll become extremally
hard
quoted
to map them to netdevs and control them from the userspace app that will
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC driver.
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as well :)
Regards
Maciek
From: Petr Machata <petrm@nvidia.com> Date: 2021-12-03 14:27:00
Machnikowski, Maciej [off-list ref] writes:
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message allows
me to redirect the frequency recovered from this netdev to the EEC via
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range of
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range
of pins. How does user space know that these are the same pins?
That is, how does user space know that RCLK_SET message to
redirect the frequency recovered from netdev 1 to pin 1 will be
overridden by the same message but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem
in place the right thing to do will be to add EEC input index and
EEC index as additional arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC? That is, how does user space know that RCLK_SET message for
netdev 1 will cause the Tx frequency of netdev 2 to change
according to the frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used
now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency recovered from netdev 1 to RCLK out 1 and from netdev 2
to RCLK out 2, how does it know which recovered frequency is
actually used an input to the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they are
known.
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output pins
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
What does ETHTOOL_MSG_RCLK_SET actually configure, physically? Say I
have this message:
ETHTOOL_MSG_RCLK_SET dev = eth0
- ETHTOOL_A_RCLK_OUT_PIN_IDX = n
- ETHTOOL_A_RCLK_PIN_FLAGS |= ETHTOOL_RCLK_PIN_FLAGS_ENA
Eventually this lands in ops->set_rclk_out(dev, out_idx, new_state).
What does the MAC driver do next?
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input pin will serve
even 4,16,48 netdevs. I don't see easy way of starting from EEC input of EEC device
and figuring out which netdevs are connected to it to talk to the right one.
In current model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
How do I know it's pin 0 though? Config file?
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
In the EEC-centric model this is what happens:
- QL-PRC packet is received on ens4f0
- Userspace consults a UAPI to figure out what EEC and pin ID this
netdevice corresponds to
- Userspace instructs through a UAPI the indicated EEC to use the
indicated pin as a source
- Userspace then monitors the indicated EEC through a UAPI. When the EEC
locks, QL-EEC is reported downstream
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become extremally hard
to map them to netdevs and control them from the userspace app that will
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC driver.
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
In that case the driver for the device that controls EEC would
instantiates the object. It doesn't have to be a MAC driver.
But if it is controlled by the MAC, the MAC driver instantiates it. And
can set up the connection between the MAC and the EEC, so that in the
shell snippet above "eec" knows how to get the EEC handle from the
netdevice.
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as
well :)
Why is that? Can you illustrate a case that breaks with the above model?
From: Machnikowski, Maciej <hidden> Date: 2021-12-03 14:55:11
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Friday, December 3, 2021 3:27 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski
wrote:
quoted
quoted
quoted
quoted
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message
allows
quoted
quoted
quoted
quoted
me to redirect the frequency recovered from this netdev to the EEC
via
quoted
quoted
quoted
quoted
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range
of
quoted
quoted
quoted
quoted
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range
of pins. How does user space know that these are the same pins?
That is, how does user space know that RCLK_SET message to
redirect the frequency recovered from netdev 1 to pin 1 will be
overridden by the same message but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem
in place the right thing to do will be to add EEC input index and
EEC index as additional arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC? That is, how does user space know that RCLK_SET message for
netdev 1 will cause the Tx frequency of netdev 2 to change
according to the frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used
now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency recovered from netdev 1 to RCLK out 1 and from netdev 2
to RCLK out 2, how does it know which recovered frequency is
actually used an input to the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they
are
quoted
known.
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output
pins
quoted
quoted
quoted
quoted
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
What does ETHTOOL_MSG_RCLK_SET actually configure, physically? Say I
have this message:
ETHTOOL_MSG_RCLK_SET dev = eth0
- ETHTOOL_A_RCLK_OUT_PIN_IDX = n
- ETHTOOL_A_RCLK_PIN_FLAGS |= ETHTOOL_RCLK_PIN_FLAGS_ENA
Eventually this lands in ops->set_rclk_out(dev, out_idx, new_state).
What does the MAC driver do next?
It goes to the PTY layer, enables the clock recovery from a given physical lane,
optionally configure the clock divider and pin output muxes. This will be
HW-specific though, but the general concept will look like that.
quoted
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input pin will
serve
quoted
even 4,16,48 netdevs. I don't see easy way of starting from EEC input of EEC
device
quoted
and figuring out which netdevs are connected to it to talk to the right one.
In current model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
How do I know it's pin 0 though? Config file?
You can find that by sending the ETHTOOL_MSG_RCLK_GET without any pin
index to get the acceptable/supported range.
quoted
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
In the EEC-centric model this is what happens:
- QL-PRC packet is received on ens4f0
- Userspace consults a UAPI to figure out what EEC and pin ID this
netdevice corresponds to
- Userspace instructs through a UAPI the indicated EEC to use the
indicated pin as a source
- Userspace then monitors the indicated EEC through a UAPI. When the EEC
locks, QL-EEC is reported downstream
This is still missing the port/lane->pin mapping. This is what will happen in
the EEC/DPLL subsystem.
quoted
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become extremally
hard
quoted
quoted
quoted
to map them to netdevs and control them from the userspace app that
will
quoted
quoted
quoted
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC driver.
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
In that case the driver for the device that controls EEC would
instantiates the object. It doesn't have to be a MAC driver.
But if it is controlled by the MAC, the MAC driver instantiates it. And
can set up the connection between the MAC and the EEC, so that in the
shell snippet above "eec" knows how to get the EEC handle from the
netdevice.
But it still needs to talk to MAC driver somehow to enable the clock
recovery on a given pin - that's where the API defined here is needed.
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as
well :)
Why is that? Can you illustrate a case that breaks with the above model?
If you have 32 port switch chip with 2 recovered clock outputs how will you
tell the chip to get the 18th port to pin 0 and from port 20 to pin 1? That's
the part those patches addresses. The further side of "which clock should the
EEC use" belongs to the DPLL subsystem and I agree with that.
Or to put it into different words:
This API will configure given quality level frequency reference outputs on chip's
Dedicated outputs. On a board you will connect those to the EEC's reference inputs.
The EEC's job is to validate the inputs and lock to them following certain rules,
The PHY/MAC (and this API) job is to deliver reference signals to the EEC.
On Thu, Dec 02, 2021 at 05:20:24PM +0000, Machnikowski, Maciej wrote:
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 5:36 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message allows
me to redirect the frequency recovered from this netdev to the EEC via
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range of
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That is,
how does user space know that RCLK_SET message to redirect the
frequency
quoted
quoted
recovered from netdev 1 to pin 1 will be overridden by the same
message
quoted
quoted
but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem in
place
quoted
the right thing to do will be to add EEC input index and EEC index as
additional
quoted
arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC?
quoted
quoted
That is, how does user space know that RCLK_SET message for netdev 1
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used now
quoted
3. If user space sends two RCLK_SET messages to redirect the frequency
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out 2,
how does it know which recovered frequency is actually used an input to
the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they are
known.
To be clear, no SyncE patches should be accepted before we have a DPLL
subsystem or however the subsystem that will model the EEC is going to
be called.
You are asking us to buy into a new uAPI that can never be removed. We
pointed out numerous problems with this uAPI and suggested a model that
solves them. When asked why it can't work we are answered with vague
arguments about this model being "hard".
In addition, without a representation of the EEC, these patches have no
value for user space. They basically allow user space to redirect the
recovered frequency from a netdev to an object that does not exist.
User space doesn't know if the object is successfully tracking the
frequency (the EEC state) and does not know which other components are
utilizing this recovered frequency as input (e.g., other netdevs, PHC).
BTW, what is the use case for enabling two EEC inputs simultaneously?
Some seamless failover?
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output pins
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
These are implementation details of a specific design and should not
influence the design of the uAPI. The uAPI should be influenced by the
logical task that it is trying to achieve.
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input pin will serve
even 4,16,48 netdevs. I don't see easy way of starting from EEC input of EEC device
and figuring out which netdevs are connected to it to talk to the right one.
In current model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
Petr already replied.
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become extremally
hard
quoted
to map them to netdevs and control them from the userspace app that will
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC driver.
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
Why wouldn't it work? Leave individual kernel modules alone and look at
the kernel. It is registering all the necessary logical objects such
netdevs, PHCs and EECs. There is no way user space knows better than the
kernel how these objects fit together as the purpose of the kernel is to
abstract the hardware to user space.
User space's request to use the Rx frequency recovered from netdev X as
an input to EEC Y will be processed by the DPLL subsystem. In turn, this
subsystem will invoke whichever kernel modules it needs to fulfill the
request.
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as well :)
The point that we are trying to make is that like the EEC state, the
source is also an EEC attribute and not a netdev attribute.
On Fri, Dec 03, 2021 at 02:55:05PM +0000, Machnikowski, Maciej wrote:
If you have 32 port switch chip with 2 recovered clock outputs how will you
tell the chip to get the 18th port to pin 0 and from port 20 to pin 1? That's
the part those patches addresses. The further side of "which clock should the
EEC use" belongs to the DPLL subsystem and I agree with that.
Or to put it into different words:
This API will configure given quality level frequency reference outputs on chip's
Dedicated outputs. On a board you will connect those to the EEC's reference inputs.
So these outputs are hardwired into the EEC's inputs and are therefore
only meaningful as EEC inputs? If so, why these outputs are not
configured via the EEC object?
The EEC's job is to validate the inputs and lock to them following certain rules,
The PHY/MAC (and this API) job is to deliver reference signals to the EEC.
From: Machnikowski, Maciej <hidden> Date: 2021-12-03 16:18:37
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Friday, December 3, 2021 4:46 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 05:20:24PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 5:36 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski
wrote:
quoted
quoted
quoted
quoted
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message
allows
quoted
quoted
quoted
quoted
me to redirect the frequency recovered from this netdev to the EEC
via
quoted
quoted
quoted
quoted
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range
of
quoted
quoted
quoted
quoted
pins (RCLK out 1-2 in the diagram) through which the frequency can
be
quoted
quoted
quoted
quoted
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That
is,
quoted
quoted
quoted
quoted
how does user space know that RCLK_SET message to redirect the
frequency
quoted
quoted
recovered from netdev 1 to pin 1 will be overridden by the same
message
quoted
quoted
but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem
in
quoted
quoted
place
quoted
the right thing to do will be to add EEC input index and EEC index as
additional
quoted
arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC?
quoted
quoted
That is, how does user space know that RCLK_SET message for netdev
1
quoted
quoted
quoted
quoted
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency
quoted
quoted
quoted
quoted
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out
2,
quoted
quoted
quoted
quoted
how does it know which recovered frequency is actually used an input
to
quoted
quoted
quoted
quoted
the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they
are
quoted
known.
To be clear, no SyncE patches should be accepted before we have a DPLL
subsystem or however the subsystem that will model the EEC is going to
be called.
You are asking us to buy into a new uAPI that can never be removed. We
pointed out numerous problems with this uAPI and suggested a model that
solves them. When asked why it can't work we are answered with vague
arguments about this model being "hard".
My argument was never "it's hard" - the answer is we need both APIs.
In addition, without a representation of the EEC, these patches have no
value for user space. They basically allow user space to redirect the
recovered frequency from a netdev to an object that does not exist.
User space doesn't know if the object is successfully tracking the
frequency (the EEC state) and does not know which other components are
utilizing this recovered frequency as input (e.g., other netdevs, PHC).
That's also not true - the proposed uAPI lets you enable recovered frequency
output pins and redirect the right clock to them. In some implementations
you may not have anything else.
BTW, what is the use case for enabling two EEC inputs simultaneously?
Some seamless failover?
Mainly - redundacy
quoted
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not
as
quoted
quoted
quoted
quoted
attributes of the EEC? That is, why are they represented as output
pins
quoted
quoted
quoted
quoted
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
These are implementation details of a specific design and should not
influence the design of the uAPI. The uAPI should be influenced by the
logical task that it is trying to achieve.
There are 2 logical tasks:
1. Enable clocks that are recovered from a specific netdev
2. Control the EEC
They are both needed to get to the full solution, but are independent from
each other. You can't put RCLK redirection to the EEC as it's one to many
relation and you will need to call the netdev to enable it anyway.
Also, when we tried to add EEC state to PTP subsystem the answer was
that we can't mix subsystems. The proposal to configure recovered
clocks through EEC would mix netdev with EEC.
quoted
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input pin will
serve
quoted
even 4,16,48 netdevs. I don't see easy way of starting from EEC input of EEC
device
quoted
and figuring out which netdevs are connected to it to talk to the right one.
In current model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
Petr already replied.
See my response there.
quoted
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become extremally
hard
quoted
to map them to netdevs and control them from the userspace app that
will
quoted
quoted
quoted
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC
driver.
quoted
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
Why wouldn't it work? Leave individual kernel modules alone and look at
the kernel. It is registering all the necessary logical objects such
netdevs, PHCs and EECs. There is no way user space knows better than the
kernel how these objects fit together as the purpose of the kernel is to
abstract the hardware to user space.
User space's request to use the Rx frequency recovered from netdev X as
an input to EEC Y will be processed by the DPLL subsystem. In turn, this
subsystem will invoke whichever kernel modules it needs to fulfill the
request.
But how would that call go through the kernel? What would you like to give
to the EEC object and how should it react. I'm fine with the changes, but
I don't see the solution in that proposal and this model would mix independent
subsystems.
The netdev -> EEC should be a downstream relation, just like the PTP is now
If a netdev wants to check what's the state of EEC driving it - it can do it, but
I don't see a way for the EEC subsystem to directly configure something in
Potentially couple different MAC chips without calling a kind of netdev API.
And that's what those patches address.
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as well :)
The point that we are trying to make is that like the EEC state, the
source is also an EEC attribute and not a netdev attribute.
From: Petr Machata <petrm@nvidia.com> Date: 2021-12-03 16:26:21
Machnikowski, Maciej [off-list ref] writes:
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Friday, December 3, 2021 3:27 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski
wrote:
quoted
quoted
quoted
quoted
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message
allows
quoted
quoted
quoted
quoted
me to redirect the frequency recovered from this netdev to the EEC
via
quoted
quoted
quoted
quoted
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range
of
quoted
quoted
quoted
quoted
pins (RCLK out 1-2 in the diagram) through which the frequency can be
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range
of pins. How does user space know that these are the same pins?
That is, how does user space know that RCLK_SET message to
redirect the frequency recovered from netdev 1 to pin 1 will be
overridden by the same message but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem
in place the right thing to do will be to add EEC input index and
EEC index as additional arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC? That is, how does user space know that RCLK_SET message for
netdev 1 will cause the Tx frequency of netdev 2 to change
according to the frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used
now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency recovered from netdev 1 to RCLK out 1 and from netdev 2
to RCLK out 2, how does it know which recovered frequency is
actually used an input to the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they
are
quoted
known.
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not as
attributes of the EEC? That is, why are they represented as output
pins
quoted
quoted
quoted
quoted
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
What does ETHTOOL_MSG_RCLK_SET actually configure, physically? Say I
have this message:
ETHTOOL_MSG_RCLK_SET dev = eth0
- ETHTOOL_A_RCLK_OUT_PIN_IDX = n
- ETHTOOL_A_RCLK_PIN_FLAGS |= ETHTOOL_RCLK_PIN_FLAGS_ENA
Eventually this lands in ops->set_rclk_out(dev, out_idx, new_state).
What does the MAC driver do next?
It goes to the PTY layer, enables the clock recovery from a given physical lane,
optionally configure the clock divider and pin output muxes. This will be
HW-specific though, but the general concept will look like that.
The reason I am asking is that I suspect that by exposing this
functionality through netdev, you assume that the NIC driver will do
whatever EEC configuration necessary _anyway_. So why couldn't it just
instantiate the EEC object as well?
quoted
quoted
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input
pin will serve even 4,16,48 netdevs. I don't see easy way of
starting from EEC input of EEC device and figuring out which
netdevs are connected to it to talk to the right one. In current
model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
How do I know it's pin 0 though? Config file?
You can find that by sending the ETHTOOL_MSG_RCLK_GET without any pin
index to get the acceptable/supported range.
Ha, OK, pin0 means the RCLK pin. OK.
quoted
quoted
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
In the EEC-centric model this is what happens:
- QL-PRC packet is received on ens4f0
- Userspace consults a UAPI to figure out what EEC and pin ID this
netdevice corresponds to
- Userspace instructs through a UAPI the indicated EEC to use the
indicated pin as a source
- Userspace then monitors the indicated EEC through a UAPI. When the EEC
locks, QL-EEC is reported downstream
This is still missing the port/lane->pin mapping. This is what will
happen in the EEC/DPLL subsystem.
You asked how the control looks in the ECC-centric model. So this is
how. That this stuff is missing is fairly obvious, we are talking about
a different model.
I don't buy the "extremely hard" argument. The set of steps to do might
be longer, but they are still just steps. No jumps, hoops, sommersaults.
On the flip side we get a proper UAPI that can stay useful for a while.
quoted
quoted
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become
extremally hard to map them to netdevs and control them from the
userspace app that will receive the ESMC message with a given QL
level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC driver.
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
In that case the driver for the device that controls EEC would
instantiates the object. It doesn't have to be a MAC driver.
But if it is controlled by the MAC, the MAC driver instantiates it. And
can set up the connection between the MAC and the EEC, so that in the
shell snippet above "eec" knows how to get the EEC handle from the
netdevice.
But it still needs to talk to MAC driver somehow to enable the clock
recovery on a given pin - that's where the API defined here is needed.
Yes, there needs to be an API between the EEC object and its owner. That
API can be internal though. E.g. a set of callbacks or a notifier chain.
This is how loose coupling is typically done in the kernel.
quoted
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as
well :)
Why is that? Can you illustrate a case that breaks with the above model?
If you have 32 port switch chip with 2 recovered clock outputs how will you
tell the chip to get the 18th port to pin 0 and from port 20 to pin 1? That's
the part those patches addresses. The further side of "which clock should the
EEC use" belongs to the DPLL subsystem and I agree with that.
So the claim is that in some cases the owner of the EEC does not know
about the netdevices?
If that is the case, how do netdevices know about the EEC, like the
netdev-centric model assumes?
Anyway, to answer the question, something like the following would
happen:
- Ask EEC to enumerate all input pins it knows about
- Find the one that references swp18
- Ask EEC to forward that input pin to output pin 0
- Repeat for swp20 and output pin 1
The switch driver (or multi-port NIC driver) just instantiates all of
netdevices, the EEC object, and pin objects, and therefore can set up
arbitrary linking between the three.
Or to put it into different words:
This API will configure given quality level frequency reference outputs on chip's
Dedicated outputs. On a board you will connect those to the EEC's reference inputs.
The EEC's job is to validate the inputs and lock to them following certain rules,
The PHY/MAC (and this API) job is to deliver reference signals to the EEC.
From: Machnikowski, Maciej <hidden> Date: 2021-12-03 16:50:40
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Friday, December 3, 2021 5:26 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Friday, December 3, 2021 3:27 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej
wrote:
quoted
quoted
quoted
quoted
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski
wrote:
quoted
quoted
quoted
quoted
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message
allows
quoted
quoted
quoted
quoted
me to redirect the frequency recovered from this netdev to the
EEC
quoted
quoted
via
quoted
quoted
quoted
quoted
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the
range
quoted
quoted
of
quoted
quoted
quoted
quoted
pins (RCLK out 1-2 in the diagram) through which the frequency can
be
quoted
quoted
quoted
quoted
quoted
quoted
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range
of pins. How does user space know that these are the same pins?
That is, how does user space know that RCLK_SET message to
redirect the frequency recovered from netdev 1 to pin 1 will be
overridden by the same message but for netdev 2?
We don't have a way to do so right now. When we have EEC
subsystem
quoted
quoted
quoted
quoted
quoted
in place the right thing to do will be to add EEC input index and
EEC index as additional arguments
quoted
2. How does user space know the mapping between a netdev and
an
quoted
quoted
quoted
quoted
quoted
quoted
EEC? That is, how does user space know that RCLK_SET message
for
quoted
quoted
quoted
quoted
quoted
quoted
netdev 1 will cause the Tx frequency of netdev 2 to change
according to the frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used
now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency recovered from netdev 1 to RCLK out 1 and from netdev
2
quoted
quoted
quoted
quoted
quoted
quoted
to RCLK out 2, how does it know which recovered frequency is
actually used an input to the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement
DPLL
quoted
quoted
quoted
subsystem we can implement connection between pins and DPLLs if
they
quoted
quoted
are
quoted
known.
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and
not as
quoted
quoted
quoted
quoted
quoted
quoted
attributes of the EEC? That is, why are they represented as output
pins
quoted
quoted
quoted
quoted
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately?
In
quoted
quoted
quoted
quoted
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC
inputs
quoted
quoted
quoted
quoted
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
What does ETHTOOL_MSG_RCLK_SET actually configure, physically? Say I
have this message:
ETHTOOL_MSG_RCLK_SET dev = eth0
- ETHTOOL_A_RCLK_OUT_PIN_IDX = n
- ETHTOOL_A_RCLK_PIN_FLAGS |= ETHTOOL_RCLK_PIN_FLAGS_ENA
Eventually this lands in ops->set_rclk_out(dev, out_idx, new_state).
What does the MAC driver do next?
It goes to the PTY layer, enables the clock recovery from a given physical
lane,
quoted
optionally configure the clock divider and pin output muxes. This will be
HW-specific though, but the general concept will look like that.
The reason I am asking is that I suspect that by exposing this
functionality through netdev, you assume that the NIC driver will do
whatever EEC configuration necessary _anyway_. So why couldn't it just
instantiate the EEC object as well?
Not necessarily. The EEC can be supported by totally different driver. I.e there
are Renesas DPLL drivers available now in the ptp subsystem. The DPLL
can be connected anywhere in the system.
quoted
quoted
quoted
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input
pin will serve even 4,16,48 netdevs. I don't see easy way of
starting from EEC input of EEC device and figuring out which
netdevs are connected to it to talk to the right one. In current
model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
How do I know it's pin 0 though? Config file?
You can find that by sending the ETHTOOL_MSG_RCLK_GET without any
pin
quoted
index to get the acceptable/supported range.
Ha, OK, pin0 means the RCLK pin. OK.
quoted
quoted
quoted
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation?
Maybe
quoted
quoted
quoted
I missed something.
In the EEC-centric model this is what happens:
- QL-PRC packet is received on ens4f0
- Userspace consults a UAPI to figure out what EEC and pin ID this
netdevice corresponds to
- Userspace instructs through a UAPI the indicated EEC to use the
indicated pin as a source
- Userspace then monitors the indicated EEC through a UAPI. When the
EEC
quoted
quoted
locks, QL-EEC is reported downstream
This is still missing the port/lane->pin mapping. This is what will
happen in the EEC/DPLL subsystem.
You asked how the control looks in the ECC-centric model. So this is
how. That this stuff is missing is fairly obvious, we are talking about
a different model.
I don't buy the "extremely hard" argument. The set of steps to do might
be longer, but they are still just steps. No jumps, hoops, sommersaults.
On the flip side we get a proper UAPI that can stay useful for a while.
quoted
quoted
quoted
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become
extremally hard to map them to netdevs and control them from the
userspace app that will receive the ESMC message with a given QL
level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC
driver.
quoted
quoted
quoted
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
In that case the driver for the device that controls EEC would
instantiates the object. It doesn't have to be a MAC driver.
But if it is controlled by the MAC, the MAC driver instantiates it. And
can set up the connection between the MAC and the EEC, so that in the
shell snippet above "eec" knows how to get the EEC handle from the
netdevice.
But it still needs to talk to MAC driver somehow to enable the clock
recovery on a given pin - that's where the API defined here is needed.
Yes, there needs to be an API between the EEC object and its owner. That
API can be internal though. E.g. a set of callbacks or a notifier chain.
This is how loose coupling is typically done in the kernel.
quoted
quoted
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as
well :)
Why is that? Can you illustrate a case that breaks with the above model?
If you have 32 port switch chip with 2 recovered clock outputs how will you
tell the chip to get the 18th port to pin 0 and from port 20 to pin 1? That's
the part those patches addresses. The further side of "which clock should
the
quoted
EEC use" belongs to the DPLL subsystem and I agree with that.
So the claim is that in some cases the owner of the EEC does not know
about the netdevices?
If that is the case, how do netdevices know about the EEC, like the
netdev-centric model assumes?
Anyway, to answer the question, something like the following would
happen:
- Ask EEC to enumerate all input pins it knows about
- Find the one that references swp18
- Ask EEC to forward that input pin to output pin 0
- Repeat for swp20 and output pin 1
The switch driver (or multi-port NIC driver) just instantiates all of
netdevices, the EEC object, and pin objects, and therefore can set up
arbitrary linking between the three.
This will end up with a model in which pin X of the EEC will link to dozens
ports - userspace tool would need to find out the relation between them and
EECs somehow. It's far more convenient if a given netdev knows where it is
connected to and which pin can it drive.
I.e. send the netdev swp20 ETHTOOL_MSG_RCLK_GET and get the pin indexes
of the EEC and send the future message to find which EEC that is (or even return
EEC index in RCLK_GET?). Set the recovered clock on that pin with the
ETHTOOL_MSG_RCLK_SET.
Then go to the given EEC and configure it to use the pin that was returned
before as a frequency source and monitor the EEC state.
Additionally, the EEC device may be instantiated by a totally different driver,
in which case the relation between its pins and netdevs may not even be known.
quoted
Or to put it into different words:
This API will configure given quality level frequency reference outputs on
chip's
quoted
Dedicated outputs. On a board you will connect those to the EEC's
reference inputs.
quoted
The EEC's job is to validate the inputs and lock to them following certain
rules,
quoted
The PHY/MAC (and this API) job is to deliver reference signals to the EEC.
From: Petr Machata <petrm@nvidia.com> Date: 2021-12-03 18:21:56
Machnikowski, Maciej [off-list ref] writes:
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Friday, December 3, 2021 4:46 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 05:20:24PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 5:36 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski wrote:
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET
message allows me to redirect the frequency recovered from
this netdev to the EEC via either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the
range of pins (RCLK out 1-2 in the diagram) through which the
frequency can be fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same
range of pins. How does user space know that these are the
same pins? That is, how does user space know that RCLK_SET
message to redirect the frequency recovered from netdev 1 to
pin 1 will be overridden by the same message but for netdev
2?
We don't have a way to do so right now. When we have EEC
subsystem in place the right thing to do will be to add EEC
input index and EEC index as additional arguments
quoted
2. How does user space know the mapping between a netdev and
an EEC? That is, how does user space know that RCLK_SET
message for netdev 1 will cause the Tx frequency of netdev 2
to change according to the frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to
ATM, but we can address that in userspace just like PTP pins
are used now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency recovered from netdev 1 to RCLK out 1 and from
netdev 2 to RCLK out 2, how does it know which recovered
frequency is actually used an input to the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we
implement DPLL subsystem we can implement connection between pins
and DPLLs if they are known.
To be clear, no SyncE patches should be accepted before we have a
DPLL subsystem or however the subsystem that will model the EEC is
going to be called.
You are asking us to buy into a new uAPI that can never be removed.
We pointed out numerous problems with this uAPI and suggested a model
that solves them. When asked why it can't work we are answered with
vague arguments about this model being "hard".
My argument was never "it's hard" - the answer is we need both APIs.
quoted
In addition, without a representation of the EEC, these patches have
no value for user space. They basically allow user space to redirect
the recovered frequency from a netdev to an object that does not
exist. User space doesn't know if the object is successfully tracking
the frequency (the EEC state) and does not know which other
components are utilizing this recovered frequency as input (e.g.,
other netdevs, PHC).
That's also not true - the proposed uAPI lets you enable recovered
frequency output pins and redirect the right clock to them. In some
implementations you may not have anything else.
Wait, are there EEC deployments where there is no way to determine the
EEC state?
quoted
BTW, what is the use case for enabling two EEC inputs simultaneously?
Some seamless failover?
Mainly - redundacy
quoted
quoted
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev
and not as attributes of the EEC? That is, why are they
represented as output pins of the PHY as opposed to input
pins of the EEC?
They are 2 separate beings. Recovered clock outputs are
controlled separately from EEC inputs.
Separate how? What does it mean that they are controlled
separately? In which sense? That redirection of recovered
frequency to pin is controlled via PHY registers whereas priority
setting between EEC inputs is controlled via EEC registers? If
so, this is an implementation detail of a specific design. It is
not of any importance to user space.
They belong to different devices. EEC registers are physically in
the DPLL hanging over I2C and recovered clocks are in the
PHY/integrated PHY in the MAC. Depending on system architecture you
may have control over one piece only
These are implementation details of a specific design and should not
influence the design of the uAPI. The uAPI should be influenced by
the logical task that it is trying to achieve.
There are 2 logical tasks:
1. Enable clocks that are recovered from a specific netdev
2. Control the EEC
They are both needed to get to the full solution, but are independent
from each other. You can't put RCLK redirection to the EEC as it's one
to many relation and you will need to call the netdev to enable it
anyway.
"Call the netdev"? When EEC decides a configuration needs to be done, it
will defer to a callback set up by whoever created the EEC object. EEC
doesn't care. If you have a disk that somehow contains an EEC to
syntonize disk spinning across the data center, go ahead and create the
object from a disk driver. Then the EEC object will invoke disk driver
code.
Also, when we tried to add EEC state to PTP subsystem the answer was
that we can't mix subsystems. The proposal to configure recovered
clocks through EEC would mix netdev with EEC.
Involving MAC driver through an abstract interface is not mixing
subsystems. It's just loose coupling.
quoted
quoted
quoted
What do you mean by "multiple devices"? A multi-port adapter with
a single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become
extremally hard to map them to netdevs and control them from
the userspace app that will receive the ESMC message with a
given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that
registers the netdevs whose Tx frequency is controlled by the
EEC, the MAC driver.
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
Why wouldn't it work? Leave individual kernel modules alone and look
at the kernel. It is registering all the necessary logical objects
such netdevs, PHCs and EECs. There is no way user space knows better
than the kernel how these objects fit together as the purpose of the
kernel is to abstract the hardware to user space.
User space's request to use the Rx frequency recovered from netdev X
as an input to EEC Y will be processed by the DPLL subsystem. In
turn, this subsystem will invoke whichever kernel modules it needs to
fulfill the request.
But how would that call go through the kernel? What would you like to
give to the EEC object and how should it react. I'm fine with the
changes, but I don't see the solution in that proposal
You will give EEC object handle, RCLK source handle, and a handle of the
output pin to configure. These are all objects in the EEC subsystem.
Some of the RCLK sources are pre-attached to a netdevice, so they carry
an ifindex reference. Some are external and do not have a netdevice
(that's for NIC-to-NIC frequency bridges, external GPS's and whatnot).
Eventually to implement the request, the EEC object would call its
creator through a callback appropriate for the request.
and this model would mix independent subsystems.
The only place where netdevices are tightly coupled to the EEC are those
pre-attached pins. But OK, EEC just happens to be very, very often part
of a NIC, and being able to say, this RCLK comes from swp1, is just
very, very handy. But it is not a requirement. The EEC model can just as
easily represent external pins, or weird stuff like boards that have
nothing _but_ external pins.
The netdev -> EEC should be a downstream relation, just like the PTP
is now If a netdev wants to check what's the state of EEC driving it -
it can do it, but I don't see a way for the EEC subsystem to directly
configure something in Potentially couple different MAC chips without
calling a kind of netdev API. And that's what those patches address.
Either the device packages everything, e.g. a switch, or an EEC-enabled
NIC. In that case, the NIC driver instantiates the EEC, and pins, and
RCLK sources, and netdevices. EEC configuration ends up getting handled
by this device driver, because that's the way it set things up.
Or we have a NIC separate from the EEC, but there is still an option to
hook those up somehow. That looks like something that should probably be
represented by an EEC with some external RCLK sources. (Or maybe they
are just inout pins or whatever, that is a detail.) Then the EEC driver
ends up instantiating the object, and implementing the requests. And the
admin needs to have external information to know that external pin such
and such is actually connected to PHY such and such.
From: Petr Machata <petrm@nvidia.com> Date: 2021-12-03 18:45:10
Machnikowski, Maciej [off-list ref] writes:
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
4. Why these pins are represented as attributes of a netdev
and not as attributes of the EEC? That is, why are they
represented as output pins of the PHY as opposed to input
pins of the EEC?
They are 2 separate beings. Recovered clock outputs are
controlled separately from EEC inputs.
Separate how? What does it mean that they are controlled
separately? In which sense? That redirection of recovered
frequency to pin is controlled via PHY registers whereas
priority setting between EEC inputs is controlled via EEC
registers? If so, this is an implementation detail of a
specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically
in the DPLL hanging over I2C and recovered clocks are in the
PHY/integrated PHY in the MAC. Depending on system architecture
you may have control over one piece only
What does ETHTOOL_MSG_RCLK_SET actually configure, physically? Say
I have this message:
ETHTOOL_MSG_RCLK_SET dev = eth0
- ETHTOOL_A_RCLK_OUT_PIN_IDX = n
- ETHTOOL_A_RCLK_PIN_FLAGS |= ETHTOOL_RCLK_PIN_FLAGS_ENA
Eventually this lands in ops->set_rclk_out(dev, out_idx,
new_state). What does the MAC driver do next?
It goes to the PTY layer, enables the clock recovery from a given
physical lane, optionally configure the clock divider and pin
output muxes. This will be HW-specific though, but the general
concept will look like that.
The reason I am asking is that I suspect that by exposing this
functionality through netdev, you assume that the NIC driver will do
whatever EEC configuration necessary _anyway_. So why couldn't it just
instantiate the EEC object as well?
Not necessarily. The EEC can be supported by totally different driver.
I.e there are Renesas DPLL drivers available now in the ptp subsystem.
The DPLL can be connected anywhere in the system.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of
the EEC changes. Drivers will either poll the state from
the device or get interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the
source as well :)
Why is that? Can you illustrate a case that breaks with the above
model?
If you have 32 port switch chip with 2 recovered clock outputs how
will you tell the chip to get the 18th port to pin 0 and from port
20 to pin 1? That's the part those patches addresses. The further
side of "which clock should the EEC use" belongs to the DPLL
subsystem and I agree with that.
So the claim is that in some cases the owner of the EEC does not know
about the netdevices?
If that is the case, how do netdevices know about the EEC, like the
netdev-centric model assumes?
Anyway, to answer the question, something like the following would
happen:
- Ask EEC to enumerate all input pins it knows about
- Find the one that references swp18
- Ask EEC to forward that input pin to output pin 0
- Repeat for swp20 and output pin 1
The switch driver (or multi-port NIC driver) just instantiates all of
netdevices, the EEC object, and pin objects, and therefore can set up
arbitrary linking between the three.
This will end up with a model in which pin X of the EEC will link to
dozens ports - userspace tool would need to find out the relation
between them and EECs somehow.
Indeed. If you have EEC connected to a bunch of ports, the EEC object is
related to a bunch of netdevices. The UAPI needs to have tools to dump
these objects so that it is possible to discover what is connected
where.
This configuration will also not change during the lifetime of the EEC
object, so tools can cache it.
It's far more convenient if a given netdev knows where it is connected
to and which pin can it drive.
Yeah, it is of course possible to add references from the netdevice to
the EEC object directly, so that the tool just needs to ask a netdevice
what EEC / RCLK source ID it maps to.
This has mostly nothing to do with the model itself.
I.e. send the netdev swp20 ETHTOOL_MSG_RCLK_GET and get the pin
indexes of the EEC and send the future message to find which EEC that
is (or even return EEC index in RCLK_GET?).
Since the pin index on its own is useless, it would make sense to return
both pieces of information at the same time.
Set the recovered clock on that pin with the ETHTOOL_MSG_RCLK_SET.
Nope.
Then go to the given EEC and configure it to use the pin that was
returned before as a frequency source and monitor the EEC state.
Yep.
EEC will invoke a callback to set up the tracking. If something special
needs to be done to "set the recovered clock on that pin", the handler
of that callback will do it.
Additionally, the EEC device may be instantiated by a totally
different driver, in which case the relation between its pins and
netdevs may not even be known.
Like an EEC, some PHYs, but the MAC driver does not know about both
pieces? Who sets up the connection between the two? The box admin
through some cabling? SoC designer?
Also, what does the external EEC actually do with the signal from the
PHY? Tune to it and forward to the other PHYs in the complex?
From: Machnikowski, Maciej <hidden> Date: 2021-12-03 19:07:48
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Friday, December 3, 2021 7:45 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej
wrote:
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
4. Why these pins are represented as attributes of a netdev
and not as attributes of the EEC? That is, why are they
represented as output pins of the PHY as opposed to input
pins of the EEC?
They are 2 separate beings. Recovered clock outputs are
controlled separately from EEC inputs.
Separate how? What does it mean that they are controlled
separately? In which sense? That redirection of recovered
frequency to pin is controlled via PHY registers whereas
priority setting between EEC inputs is controlled via EEC
registers? If so, this is an implementation detail of a
specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically
in the DPLL hanging over I2C and recovered clocks are in the
PHY/integrated PHY in the MAC. Depending on system architecture
you may have control over one piece only
What does ETHTOOL_MSG_RCLK_SET actually configure, physically?
Say
quoted
quoted
quoted
quoted
I have this message:
ETHTOOL_MSG_RCLK_SET dev = eth0
- ETHTOOL_A_RCLK_OUT_PIN_IDX = n
- ETHTOOL_A_RCLK_PIN_FLAGS |= ETHTOOL_RCLK_PIN_FLAGS_ENA
Eventually this lands in ops->set_rclk_out(dev, out_idx,
new_state). What does the MAC driver do next?
It goes to the PTY layer, enables the clock recovery from a given
physical lane, optionally configure the clock divider and pin
output muxes. This will be HW-specific though, but the general
concept will look like that.
The reason I am asking is that I suspect that by exposing this
functionality through netdev, you assume that the NIC driver will do
whatever EEC configuration necessary _anyway_. So why couldn't it just
instantiate the EEC object as well?
Not necessarily. The EEC can be supported by totally different driver.
I.e there are Renesas DPLL drivers available now in the ptp subsystem.
The DPLL can be connected anywhere in the system.
quoted
quoted
quoted
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of
the EEC changes. Drivers will either poll the state from
the device or get interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the
source as well :)
Why is that? Can you illustrate a case that breaks with the above
model?
If you have 32 port switch chip with 2 recovered clock outputs how
will you tell the chip to get the 18th port to pin 0 and from port
20 to pin 1? That's the part those patches addresses. The further
side of "which clock should the EEC use" belongs to the DPLL
subsystem and I agree with that.
So the claim is that in some cases the owner of the EEC does not know
about the netdevices?
If that is the case, how do netdevices know about the EEC, like the
netdev-centric model assumes?
Anyway, to answer the question, something like the following would
happen:
- Ask EEC to enumerate all input pins it knows about
- Find the one that references swp18
- Ask EEC to forward that input pin to output pin 0
- Repeat for swp20 and output pin 1
The switch driver (or multi-port NIC driver) just instantiates all of
netdevices, the EEC object, and pin objects, and therefore can set up
arbitrary linking between the three.
This will end up with a model in which pin X of the EEC will link to
dozens ports - userspace tool would need to find out the relation
between them and EECs somehow.
Indeed. If you have EEC connected to a bunch of ports, the EEC object is
related to a bunch of netdevices. The UAPI needs to have tools to dump
these objects so that it is possible to discover what is connected
where.
This configuration will also not change during the lifetime of the EEC
object, so tools can cache it.
quoted
It's far more convenient if a given netdev knows where it is connected
to and which pin can it drive.
Yeah, it is of course possible to add references from the netdevice to
the EEC object directly, so that the tool just needs to ask a netdevice
what EEC / RCLK source ID it maps to.
This has mostly nothing to do with the model itself.
quoted
I.e. send the netdev swp20 ETHTOOL_MSG_RCLK_GET and get the pin
indexes of the EEC and send the future message to find which EEC that
is (or even return EEC index in RCLK_GET?).
Since the pin index on its own is useless, it would make sense to return
both pieces of information at the same time.
quoted
Set the recovered clock on that pin with the ETHTOOL_MSG_RCLK_SET.
Nope.
quoted
Then go to the given EEC and configure it to use the pin that was
returned before as a frequency source and monitor the EEC state.
Yep.
EEC will invoke a callback to set up the tracking. If something special
needs to be done to "set the recovered clock on that pin", the handler
of that callback will do it.
quoted
Additionally, the EEC device may be instantiated by a totally
different driver, in which case the relation between its pins and
netdevs may not even be known.
Like an EEC, some PHYs, but the MAC driver does not know about both
pieces? Who sets up the connection between the two? The box admin
through some cabling? SoC designer?
Also, what does the external EEC actually do with the signal from the
PHY? Tune to it and forward to the other PHYs in the complex?
Yes - it can also apply HW filters to it.
The EEC model will not work when you have the following system:
SoC with some ethernet ports with driver A
Switch chip with N ports with driver B
EEC/DPLL with driver C
Both SoC and Switch ASIC can recover clock and use the cleaned
clock from the DPLL.
In that case you can't create any relation between EEC and recover
clock pins that would enable the EEC subsystem to control
recovered clocks, because you have 3 independent drivers.
The model you proposed assumes that the MAC/Switch is in
charge of the DPLL, but that's not always true. The model where
recovered clock outputs are controlled independently can support
both models and is more flexible. It can also address the mode where
you want to use the recovered clock as a source for RF part of your
system and don't have any EEC to control from the netdev side.
On Fri, Dec 03, 2021 at 04:18:18PM +0000, Machnikowski, Maciej wrote:
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Friday, December 3, 2021 4:46 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 05:20:24PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 5:36 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Thu, Dec 02, 2021 at 03:17:06PM +0000, Machnikowski, Maciej wrote:
quoted
quoted
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Thursday, December 2, 2021 1:44 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
On Wed, Dec 01, 2021 at 07:02:06PM +0100, Maciej Machnikowski
wrote:
quoted
quoted
quoted
quoted
Looking at the diagram from the previous submission [1]:
┌──────────┬──────────┐
│ RX │ TX │
1 │ ports │ ports │ 1
───►├─────┐ │ ├─────►
2 │ │ │ │ 2
───►├───┐ │ │ ├─────►
3 │ │ │ │ │ 3
───►├─┐ │ │ │ ├─────►
│ ▼ ▼ ▼ │ │
│ ────── │ │
│ \____/ │ │
└──┼──┼────┴──────────┘
1│ 2│ ▲
RCLK out│ │ │ TX CLK in
▼ ▼ │
┌─────────────┴───┐
│ │
│ SEC │
│ │
└─────────────────┘
Given a netdev (1, 2 or 3 in the diagram), the RCLK_SET message
allows
quoted
quoted
quoted
quoted
me to redirect the frequency recovered from this netdev to the EEC
via
quoted
quoted
quoted
quoted
either pin 1, pin 2 or both.
Given a netdev, the RCLK_GET message allows me to query the range
of
quoted
quoted
quoted
quoted
pins (RCLK out 1-2 in the diagram) through which the frequency can
be
quoted
quoted
quoted
quoted
fed into the EEC.
Questions:
1. The query for all the above netdevs will return the same range of
pins. How does user space know that these are the same pins? That
is,
quoted
quoted
quoted
quoted
how does user space know that RCLK_SET message to redirect the
frequency
quoted
quoted
recovered from netdev 1 to pin 1 will be overridden by the same
message
quoted
quoted
but for netdev 2?
We don't have a way to do so right now. When we have EEC subsystem
in
quoted
quoted
place
quoted
the right thing to do will be to add EEC input index and EEC index as
additional
quoted
arguments
quoted
2. How does user space know the mapping between a netdev and an
EEC?
quoted
quoted
That is, how does user space know that RCLK_SET message for netdev
1
quoted
quoted
quoted
quoted
will cause the Tx frequency of netdev 2 to change according to the
frequency recovered from netdev 1?
Ditto - currently we don't have any entity to link the pins to ATM,
but we can address that in userspace just like PTP pins are used now
quoted
3. If user space sends two RCLK_SET messages to redirect the
frequency
quoted
quoted
quoted
quoted
recovered from netdev 1 to RCLK out 1 and from netdev 2 to RCLK out
2,
quoted
quoted
quoted
quoted
how does it know which recovered frequency is actually used an input
to
quoted
quoted
quoted
quoted
the EEC?
User space doesn't know this as well?
In current model it can come from the config file. Once we implement DPLL
subsystem we can implement connection between pins and DPLLs if they
are
quoted
known.
To be clear, no SyncE patches should be accepted before we have a DPLL
subsystem or however the subsystem that will model the EEC is going to
be called.
You are asking us to buy into a new uAPI that can never be removed. We
pointed out numerous problems with this uAPI and suggested a model that
solves them. When asked why it can't work we are answered with vague
arguments about this model being "hard".
My argument was never "it's hard" - the answer is we need both APIs.
We are discussing whether two APIs are actually necessary or whether EEC
source configuration can be done via the EEC. The answer cannot be "the
answer is we need both APIs".
quoted
In addition, without a representation of the EEC, these patches have no
value for user space. They basically allow user space to redirect the
recovered frequency from a netdev to an object that does not exist.
User space doesn't know if the object is successfully tracking the
frequency (the EEC state) and does not know which other components are
utilizing this recovered frequency as input (e.g., other netdevs, PHC).
That's also not true - the proposed uAPI lets you enable recovered frequency
output pins and redirect the right clock to them. In some implementations
you may not have anything else.
What isn't true? That these patches have no value for user space? This
is 100% true. You admitted that this is incomplete work. There is no
reason to merge one API without the other. At the very least, we need to
see an explanation of how the two APIs work together. This is missing
from the patchset, which prompted these questions:
https://lore.kernel.org/netdev/Yai%2Fe5jz3NZAg0pm@shredder/
quoted
BTW, what is the use case for enabling two EEC inputs simultaneously?
Some seamless failover?
Mainly - redundacy
quoted
quoted
quoted
quoted
quoted
4. Why these pins are represented as attributes of a netdev and not
as
quoted
quoted
quoted
quoted
attributes of the EEC? That is, why are they represented as output
pins
quoted
quoted
quoted
quoted
of the PHY as opposed to input pins of the EEC?
They are 2 separate beings. Recovered clock outputs are controlled
separately from EEC inputs.
Separate how? What does it mean that they are controlled separately? In
which sense? That redirection of recovered frequency to pin is
controlled via PHY registers whereas priority setting between EEC inputs
is controlled via EEC registers? If so, this is an implementation detail
of a specific design. It is not of any importance to user space.
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
These are implementation details of a specific design and should not
influence the design of the uAPI. The uAPI should be influenced by the
logical task that it is trying to achieve.
There are 2 logical tasks:
1. Enable clocks that are recovered from a specific netdev
I already replied about this here:
https://lore.kernel.org/netdev/Yao+nK40D0+u8UKL@shredder/
If the recovered clock outputs are only meaningful as EEC inputs, then
there is no reason not to configure them through the EEC object. The
fact that you think that the *internal* kernel plumbing (that can be
improved over time) will be "hard" is not a reason to end up with a
*user* API (that cannot be changed) where the *Ethernet* Equipment Clock
is ignorant of its *Ethernet* ports.
With your proposal where the EEC is only aware of pins, how does user
space answer the question of what is the source of the EEC? It needs to
issue RCLK_GET dump? How does it even know that the source is a netdev
and not an external one? And if the EEC object knows that the source is
a netdev, how come it does not know which netdev?
2. Control the EEC
They are both needed to get to the full solution, but are independent from
each other. You can't put RCLK redirection to the EEC as it's one to many
relation and you will need to call the netdev to enable it anyway.
So what if I need to call the netdev? The EEC cannot be so disjoint from
the associated netdevs. After all, EEC stands for *Ethernet* Equipment
Clock. In the common case, the EEC will transfer the frequency from one
netdev to another. In the less common case, it will transfer the
frequency from an external source to a netdev.
Also, when we tried to add EEC state to PTP subsystem the answer was
that we can't mix subsystems.
SyncE doesn't belong in PTP because PTP can work without SyncE and SyncE
can work without PTP. The fact that the primary use case for SyncE might
be PTP doesn't mean that SyncE belongs in PTP subsystem.
The proposal to configure recovered clocks through EEC would mix
netdev with EEC.
I don't believe that *Ethernet* Equipment Clock and *Ethernet* ports
should be so disjoint so that the EEC doesn't know about:
a. The netdev from which it is recovering its frequency
b. The netdevs that it is controlling
If the netdevs are smart enough to report the EEC input pins and EEC
association to user space, then they are also smart enough to register
themselves internally in the kernel with the EEC. They can all appear as
virtual input/output pins of the EEC that can be enabled/disabled by
user space. In addition, you can have physical (named) pins for external
sources / outputs and another virtual output pin towards the PHC.
quoted
quoted
quoted
quoted
If we mix them it'll be hard to control everything especially that a
single EEC can support multiple devices.
Hard how? Please provide concrete examples.
From the EEC perspective it's one to many relation - one EEC input pin will
serve
quoted
even 4,16,48 netdevs. I don't see easy way of starting from EEC input of EEC
device
quoted
and figuring out which netdevs are connected to it to talk to the right one.
In current model it's as simple as:
- I received QL-PRC on netdev ens4f0
- I send back enable recovered clock on pin 0 of the ens4f0
- go to EEC that will be linked to it
- see the state of it - if its locked - report QL-EEC downsteam
How would you this control look in the EEC/DPLL implementation? Maybe
I missed something.
Petr already replied.
See my response there.
quoted
quoted
quoted
What do you mean by "multiple devices"? A multi-port adapter with a
single EEC or something else?
Multiple MACs that use a single EEC clock.
quoted
quoted
Also if we make those pins attributes of the EEC it'll become extremally
hard
quoted
to map them to netdevs and control them from the userspace app that
will
quoted
quoted
quoted
receive the ESMC message with a given QL level on netdev X.
Hard how? What is the problem with something like:
# eec set source 1 type netdev dev swp1
The EEC object should be registered by the same entity that registers
the netdevs whose Tx frequency is controlled by the EEC, the MAC
driver.
quoted
But the EEC object may not be controlled by the MAC - in which case
this model won't work.
Why wouldn't it work? Leave individual kernel modules alone and look at
the kernel. It is registering all the necessary logical objects such
netdevs, PHCs and EECs. There is no way user space knows better than the
kernel how these objects fit together as the purpose of the kernel is to
abstract the hardware to user space.
User space's request to use the Rx frequency recovered from netdev X as
an input to EEC Y will be processed by the DPLL subsystem. In turn, this
subsystem will invoke whichever kernel modules it needs to fulfill the
request.
But how would that call go through the kernel? What would you like to give
to the EEC object and how should it react. I'm fine with the changes, but
I don't see the solution in that proposal and this model would mix independent
subsystems.
The netdev -> EEC should be a downstream relation, just like the PTP is now
If a netdev wants to check what's the state of EEC driving it - it can do it, but
I don't see a way for the EEC subsystem to directly configure something in
Potentially couple different MAC chips without calling a kind of netdev API.
And that's what those patches address.
quoted
quoted
quoted
quoted
quoted
5. What is the problem with the following model?
- The EEC is a separate object with following attributes:
* State: Invalid / Freerun / Locked / etc
* Sources: Netdev / external / etc
* Potentially more
- Notifications are emitted to user space when the state of the EEC
changes. Drivers will either poll the state from the device or get
interrupts
- The mapping from netdev to EEC is queried via ethtool
Yep - that will be part of the EEC (DPLL) subsystem
This model avoids all the problems I pointed out in the current
proposal.
That's the go-to model, but first we need control over the source as well :)
The point that we are trying to make is that like the EEC state, the
source is also an EEC attribute and not a netdev attribute.
From: Machnikowski, Maciej <hidden> Date: 2021-12-06 09:15:35
-----Original Message-----
From: Ido Schimmel <redacted>
Sent: Sunday, December 5, 2021 1:24 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
OK I see where the misunderstanding comes from. The subsystem we'll
Develop will NOT be EEC subsystem, but the DPLL subsystem. The EEC is only
one potential use of the DPLL, but there are many more.
By principle all DPLL chips have configurable inputs, configurable PLL block,
and configurable outputs - that's what the new subsystem will configure
and expose. And the input block is shared between multiple DPLLs internally.
Unfortunately, we have no way of representing all connections to a given
DPLL and we have to rely on manual/labels anyway - just like we do with
PTP pins. We control them, but have no idea where they are connected
physically.
My assumption is that the DPLL block will follow the same principle and
will expose a set of inputs and set of outputs that uAPI will configure.
Now with that in mind:
quoted
My argument was never "it's hard" - the answer is we need both APIs.
We are discussing whether two APIs are actually necessary or whether EEC
source configuration can be done via the EEC. The answer cannot be "the
answer is we need both APIs".
We need both APIs because a single recovered clock can be connected to:
- Multiple DPLLs - either internal to the chip, or via fanouts to different chips
- a FPGA
- a RF HW that may not expose any DPLL
Given that - we cannot hook control over recovered clocks to a DPLL subsystem,
as it's not the only consumer of that output.
quoted
quoted
In addition, without a representation of the EEC, these patches have no
value for user space. They basically allow user space to redirect the
recovered frequency from a netdev to an object that does not exist.
User space doesn't know if the object is successfully tracking the
frequency (the EEC state) and does not know which other components
are
quoted
quoted
utilizing this recovered frequency as input (e.g., other netdevs, PHC).
That's also not true - the proposed uAPI lets you enable recovered
frequency
quoted
output pins and redirect the right clock to them. In some implementations
you may not have anything else.
What isn't true? That these patches have no value for user space? This
is 100% true. You admitted that this is incomplete work. There is no
reason to merge one API without the other. At the very least, we need to
see an explanation of how the two APIs work together. This is missing
from the patchset, which prompted these questions:
https://lore.kernel.org/netdev/Yai%2Fe5jz3NZAg0pm@shredder/
That's what I try to explain. A given DPLL will have multiple reference frequencies
to choose from, but the sources of them will be configured independently.
With the sources like:
- 1PPS/10MHz from the GNSS
- 1PPS/10MHz from external source
- 1PPS from the PTP block
- Recovered clock
Additionally, a given DPLL chip may have many (2, 4, 6, 8 +) DPLLs inside,
each one using the same reference signals for different purposes.
Also there is a reason to merge this without DPLL subsystem for all devices
that use recovered clocks for a purpose other than SyncE.
[...]
quoted
quoted
quoted
They belong to different devices. EEC registers are physically in the DPLL
hanging over I2C and recovered clocks are in the PHY/integrated PHY in
the MAC. Depending on system architecture you may have control over
one piece only
These are implementation details of a specific design and should not
influence the design of the uAPI. The uAPI should be influenced by the
logical task that it is trying to achieve.
There are 2 logical tasks:
1. Enable clocks that are recovered from a specific netdev
I already replied about this here:
https://lore.kernel.org/netdev/Yao+nK40D0+u8UKL@shredder/
If the recovered clock outputs are only meaningful as EEC inputs, then
there is no reason not to configure them through the EEC object. The
fact that you think that the *internal* kernel plumbing (that can be
improved over time) will be "hard" is not a reason to end up with a
*user* API (that cannot be changed) where the *Ethernet* Equipment Clock
is ignorant of its *Ethernet* ports.
Like I mentioned above - it won’t be EEC subsystem. Also the signal is relevant
to other devices - not only EEC and not even only to DPLLs.
With your proposal where the EEC is only aware of pins, how does user
space answer the question of what is the source of the EEC? It needs to
issue RCLK_GET dump? How does it even know that the source is a netdev
and not an external one? And if the EEC object knows that the source is
a netdev, how come it does not know which netdev?
This needs to be addressed by the DPLL subsystem - I'd say using labels would be
a good way to manage it - in the same way we use them in the PTP subsystem
quoted
2. Control the EEC
They are both needed to get to the full solution, but are independent from
each other. You can't put RCLK redirection to the EEC as it's one to many
relation and you will need to call the netdev to enable it anyway.
So what if I need to call the netdev? The EEC cannot be so disjoint from
the associated netdevs. After all, EEC stands for *Ethernet* Equipment
Clock. In the common case, the EEC will transfer the frequency from one
netdev to another. In the less common case, it will transfer the
frequency from an external source to a netdev.
Again - the DPLLs linked to the netdev is just one of many use cases. Other
DPLLs not linked to netdevs will also exist and use the PHY recovered clock.
quoted
Also, when we tried to add EEC state to PTP subsystem the answer was
that we can't mix subsystems.
SyncE doesn't belong in PTP because PTP can work without SyncE and SyncE
can work without PTP. The fact that the primary use case for SyncE might
be PTP doesn't mean that SyncE belongs in PTP subsystem.
quoted
The proposal to configure recovered clocks through EEC would mix
netdev with EEC.
I don't believe that *Ethernet* Equipment Clock and *Ethernet* ports
should be so disjoint so that the EEC doesn't know about:
a. The netdev from which it is recovering its frequency
b. The netdevs that it is controlling
If the netdevs are smart enough to report the EEC input pins and EEC
association to user space, then they are also smart enough to register
themselves internally in the kernel with the EEC. They can all appear as
virtual input/output pins of the EEC that can be enabled/disabled by
user space. In addition, you can have physical (named) pins for external
sources / outputs and another virtual output pin towards the PHC.
Netdevs needs to know which DPLL is used as its source.
If we want to make a DPLL aware of who's driving the signal we can create
internal plumbing between PHY output pins and some/all DPLL references
that are linked to it - if that connection is known.
If such plumbing is known we can add registration of a netdev that's using
the recovered clock output to the reference inputs. That way the DPLL would
see which netdev (or other device) is the source from its reference input
system.
Hope this clarifies why we need both uAPIs.
From: Petr Machata <petrm@nvidia.com> Date: 2021-12-06 14:40:57
Machnikowski, Maciej [off-list ref] writes:
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
Additionally, the EEC device may be instantiated by a totally
different driver, in which case the relation between its pins and
netdevs may not even be known.
Like an EEC, some PHYs, but the MAC driver does not know about both
pieces? Who sets up the connection between the two? The box admin
through some cabling? SoC designer?
Also, what does the external EEC actually do with the signal from the
PHY? Tune to it and forward to the other PHYs in the complex?
Yes - it can also apply HW filters to it.
Sounds like this device should have an EEC instance of its own then.
Maybe we need to call it something else than "EEC". PLL? Something that
does not have the standardization connotations, because several
instances would be present in a system with several NICs.
The EEC model will not work when you have the following system:
SoC with some ethernet ports with driver A
Switch chip with N ports with driver B
EEC/DPLL with driver C
Both SoC and Switch ASIC can recover clock and use the cleaned
clock from the DPLL.
In that case you can't create any relation between EEC and recover
clock pins that would enable the EEC subsystem to control
recovered clocks, because you have 3 independent drivers.
I think that in that case you have several EEC instances. Those are
connected by some wiring that is external to the devices themselves. I
am not sure who should be in charge of describing the wiring. Device
tree? Config file?
The model you proposed assumes that the MAC/Switch is in
charge of the DPLL, but that's not always true.
The EEC-centric model does not in fact assume that. It lets anyone to
set up an EEC object.
The netdev-centric UAPI assumes that the driver behind the netdev knows
about how many RCLK out pins there are. So it can certainly instantiate
a DPLL object instead, with those pins as external pins, and leave the
connection of the external pins to the EEC proper implicit.
That gives userspace exactly the same information as the netdev-centric
UAPI, but now userspace doesn't need to know about netdevs, and
synchronously-spinning drives, and GPS receivers, each of which is
handled through a dedicated set of netlink messages / sysctls / what
have you. The userspace needs to know about EEC subsystem, and that's
it.
The model where recovered clock outputs are controlled independently
can support both models and is more flexible. It can also address the
- Anyone can instantiate EEC objects
- Only things with ports instantiate netdevs
How is the latter one more flexible?
mode where you want to use the recovered clock as a source for RF part
of your system and don't have any EEC to control from the netdev side.
From: Machnikowski, Maciej <hidden> Date: 2021-12-06 15:14:18
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Monday, December 6, 2021 3:41 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
Additionally, the EEC device may be instantiated by a totally
different driver, in which case the relation between its pins and
netdevs may not even be known.
Like an EEC, some PHYs, but the MAC driver does not know about both
pieces? Who sets up the connection between the two? The box admin
through some cabling? SoC designer?
Also, what does the external EEC actually do with the signal from the
PHY? Tune to it and forward to the other PHYs in the complex?
Yes - it can also apply HW filters to it.
Sounds like this device should have an EEC instance of its own then.
Maybe we need to call it something else than "EEC". PLL? Something that
does not have the standardization connotations, because several
instances would be present in a system with several NICs.
There will be no EEC/EEC subsystem, but the DPLL. Every driver would
be able to create a DPLL object so that we can easily use it from
non-netdev devices as well. See the other mail for more details.
quoted
The EEC model will not work when you have the following system:
SoC with some ethernet ports with driver A
Switch chip with N ports with driver B
EEC/DPLL with driver C
Both SoC and Switch ASIC can recover clock and use the cleaned
clock from the DPLL.
In that case you can't create any relation between EEC and recover
clock pins that would enable the EEC subsystem to control
recovered clocks, because you have 3 independent drivers.
I think that in that case you have several EEC instances. Those are
connected by some wiring that is external to the devices themselves. I
am not sure who should be in charge of describing the wiring. Device
tree? Config file?
In some complex systems you'll need to create a relation between netdevs
and DPLLs in a config file, so it is the only way to describe all possible
scenarios.
We can't assume any connections between them, as that's design specific,
just like PTP pins are. They have labels, but it's up to the system
integrator to define how they are used.
We can consider creating some of them if they are known to the driver
and belong to the same driver.
quoted
The model you proposed assumes that the MAC/Switch is in
charge of the DPLL, but that's not always true.
The EEC-centric model does not in fact assume that. It lets anyone to
set up an EEC object.
The netdev-centric UAPI assumes that the driver behind the netdev knows
about how many RCLK out pins there are. So it can certainly instantiate
a DPLL object instead, with those pins as external pins, and leave the
connection of the external pins to the EEC proper implicit.
Netdev will know how many RCLK outputs are there, as that's the function
of a given MAC/PHY/Retimer.
That gives userspace exactly the same information as the netdev-centric
UAPI, but now userspace doesn't need to know about netdevs, and
synchronously-spinning drives, and GPS receivers, each of which is
handled through a dedicated set of netlink messages / sysctls / what
have you. The userspace needs to know about EEC subsystem, and that's
it.
I believe the direction is to make the connection between a netdev and
its related DPLL that's serving as EEC in a similar way the link to a PTP
device is created. Userspace app will need to go to DPLL subsystem
to understand what's the current frequency source for a given netdev.
That's still independent uAPI from the one defined by those patches.
quoted
The model where recovered clock outputs are controlled independently
can support both models and is more flexible. It can also address the
- Anyone can instantiate EEC objects
- Only things with ports instantiate netdevs
How is the latter one more flexible?
- Everything can instantiate DPLL object,
- Only a netdev can instantiate recovered clock outputs, which can be
connected to any other part of the system - not only a DPLL.
From: Petr Machata <petrm@nvidia.com> Date: 2021-12-06 16:02:50
Machnikowski, Maciej [off-list ref] writes:
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Monday, December 6, 2021 3:41 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
Additionally, the EEC device may be instantiated by a totally
different driver, in which case the relation between its pins
and netdevs may not even be known.
Like an EEC, some PHYs, but the MAC driver does not know about
both pieces? Who sets up the connection between the two? The box
admin through some cabling? SoC designer?
Also, what does the external EEC actually do with the signal from
the PHY? Tune to it and forward to the other PHYs in the complex?
Yes - it can also apply HW filters to it.
Sounds like this device should have an EEC instance of its own then.
Maybe we need to call it something else than "EEC". PLL? Something
that does not have the standardization connotations, because several
instances would be present in a system with several NICs.
There will be no EEC/EEC subsystem, but the DPLL. Every driver would
be able to create a DPLL object so that we can easily use it from
non-netdev devices as well. See the other mail for more details.
Yes, this makes sense to me.
quoted
quoted
The EEC model will not work when you have the following system:
SoC with some ethernet ports with driver A
Switch chip with N ports with driver B
EEC/DPLL with driver C
Both SoC and Switch ASIC can recover clock and use the cleaned
clock from the DPLL.
In that case you can't create any relation between EEC and recover
clock pins that would enable the EEC subsystem to control
recovered clocks, because you have 3 independent drivers.
I think that in that case you have several EEC instances. Those are
connected by some wiring that is external to the devices themselves. I
am not sure who should be in charge of describing the wiring. Device
tree? Config file?
In some complex systems you'll need to create a relation between
netdevs and DPLLs in a config file, so it is the only way to describe
all possible scenarios. We can't assume any connections between them,
as that's design specific, just like PTP pins are. They have labels,
but it's up to the system integrator to define how they are used. We
can consider creating some of them if they are known to the driver and
belong to the same driver.
Agreed.
quoted
quoted
The model you proposed assumes that the MAC/Switch is in
charge of the DPLL, but that's not always true.
The EEC-centric model does not in fact assume that. It lets anyone to
set up an EEC object.
The netdev-centric UAPI assumes that the driver behind the netdev
knows about how many RCLK out pins there are. So it can certainly
instantiate a DPLL object instead, with those pins as external pins,
and leave the connection of the external pins to the EEC proper
implicit.
Netdev will know how many RCLK outputs are there, as that's the
function of a given MAC/PHY/Retimer.
So... spawn a DPLL with that number of virtual pins?
quoted
That gives userspace exactly the same information as the
netdev-centric UAPI, but now userspace doesn't need to know about
netdevs, and synchronously-spinning drives, and GPS receivers, each
of which is handled through a dedicated set of netlink messages /
sysctls / what have you. The userspace needs to know about EEC
subsystem, and that's it.
I believe the direction is to make the connection between a netdev and
its related DPLL that's serving as EEC in a similar way the link to a
PTP device is created. Userspace app will need to go to DPLL subsystem
to understand what's the current frequency source for a given netdev.
But the way PTP and netdevs are linked is that PTP clock is instantiated
independently, and then this clock is referenced by the netdevice. I do
not object to that at all, in fact I believe I mentioned this a couple
times already.
I'm objecting to accessing the PTP clock _through_ the netdev UAPI.
Because, how will non-NIC-bound DPLLs be represented? Well, through some
other UAPI, obviously. So userspace will need to know about all classes
of devices that can carry frequency signal.
Alternatively, both NIC drivers and other drivers can instantiate some
common type of DPLL-related object. Then any userspace tool that knows
how to work with objects of that type automatically knows how to handle
NICs, and GPSs, and whatever craziness someone dreams up.
quoted hunk
That's still independent uAPI from the one defined by those patches.
quoted
quoted
The model where recovered clock outputs are controlled independently
can support both models and is more flexible. It can also address the
- Anyone can instantiate EEC objects
- Only things with ports instantiate netdevs
How is the latter one more flexible?
- Everything can instantiate DPLL object,- Only a netdev can instantiate recovered clock outputs, which can be connected to any other part of the system - not only a DPLL.
If the frequency source devices are truly so different from the general
DPLL circuits that thay cannot possibly be expressed as the same type of
object, then by all means, represent them as something else. DPLL
frequency source, whatever.
But don't hide the API behind netdevs just because some NICs carry
DPLLs. Non-NIC frequency sources do exist, and the subsystem should
support them _in the same way_ as the NIC ones.
From: Machnikowski, Maciej <hidden> Date: 2021-12-06 18:49:44
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Monday, December 6, 2021 5:00 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Sent: Monday, December 6, 2021 3:41 PM
To: Machnikowski, Maciej <redacted>
Subject: Re: [PATCH v4 net-next 2/4] ethtool: Add ability to configure
recovered clock for SyncE feature
Machnikowski, Maciej [off-list ref] writes:
quoted
quoted
-----Original Message-----
From: Petr Machata <petrm@nvidia.com>
Machnikowski, Maciej [off-list ref] writes:
quoted
Additionally, the EEC device may be instantiated by a totally
different driver, in which case the relation between its pins
and netdevs may not even be known.
Like an EEC, some PHYs, but the MAC driver does not know about
both pieces? Who sets up the connection between the two? The box
admin through some cabling? SoC designer?
Also, what does the external EEC actually do with the signal from
the PHY? Tune to it and forward to the other PHYs in the complex?
Yes - it can also apply HW filters to it.
Sounds like this device should have an EEC instance of its own then.
Maybe we need to call it something else than "EEC". PLL? Something
that does not have the standardization connotations, because several
instances would be present in a system with several NICs.
There will be no EEC/EEC subsystem, but the DPLL. Every driver would
be able to create a DPLL object so that we can easily use it from
non-netdev devices as well. See the other mail for more details.
Yes, this makes sense to me.
quoted
quoted
quoted
The EEC model will not work when you have the following system:
SoC with some ethernet ports with driver A
Switch chip with N ports with driver B
EEC/DPLL with driver C
Both SoC and Switch ASIC can recover clock and use the cleaned
clock from the DPLL.
In that case you can't create any relation between EEC and recover
clock pins that would enable the EEC subsystem to control
recovered clocks, because you have 3 independent drivers.
I think that in that case you have several EEC instances. Those are
connected by some wiring that is external to the devices themselves. I
am not sure who should be in charge of describing the wiring. Device
tree? Config file?
In some complex systems you'll need to create a relation between
netdevs and DPLLs in a config file, so it is the only way to describe
all possible scenarios. We can't assume any connections between them,
as that's design specific, just like PTP pins are. They have labels,
but it's up to the system integrator to define how they are used. We
can consider creating some of them if they are known to the driver and
belong to the same driver.
Agreed.
quoted
quoted
quoted
The model you proposed assumes that the MAC/Switch is in
charge of the DPLL, but that's not always true.
The EEC-centric model does not in fact assume that. It lets anyone to
set up an EEC object.
The netdev-centric UAPI assumes that the driver behind the netdev
knows about how many RCLK out pins there are. So it can certainly
instantiate a DPLL object instead, with those pins as external pins,
and leave the connection of the external pins to the EEC proper
implicit.
Netdev will know how many RCLK outputs are there, as that's the
function of a given MAC/PHY/Retimer.
So... spawn a DPLL with that number of virtual pins?
Recovered clock has different properties than a DPLL output.
Think of it as of a specific GPIO pin that sends the clock signal.
quoted
quoted
That gives userspace exactly the same information as the
netdev-centric UAPI, but now userspace doesn't need to know about
netdevs, and synchronously-spinning drives, and GPS receivers, each
of which is handled through a dedicated set of netlink messages /
sysctls / what have you. The userspace needs to know about EEC
subsystem, and that's it.
I believe the direction is to make the connection between a netdev and
its related DPLL that's serving as EEC in a similar way the link to a
PTP device is created. Userspace app will need to go to DPLL subsystem
to understand what's the current frequency source for a given netdev.
But the way PTP and netdevs are linked is that PTP clock is instantiated
independently, and then this clock is referenced by the netdevice. I do
not object to that at all, in fact I believe I mentioned this a couple
times already.
I'm objecting to accessing the PTP clock _through_ the netdev UAPI.
Because, how will non-NIC-bound DPLLs be represented? Well, through
some
other UAPI, obviously. So userspace will need to know about all classes
of devices that can carry frequency signal.
That's why we'll link to an instantiated DPLL like we do to PTP.
Those patches are only enabling recovered clock outputs - not DPLL.
Alternatively, both NIC drivers and other drivers can instantiate some
common type of DPLL-related object. Then any userspace tool that knows
how to work with objects of that type automatically knows how to handle
NICs, and GPSs, and whatever craziness someone dreams up.
I see no benefit in adding a new object like that - other subsystems
already have their own implementations of such GPIOs and they are
always implementation-specific.
quoted
That's still independent uAPI from the one defined by those patches.
quoted
quoted
The model where recovered clock outputs are controlled independently
can support both models and is more flexible. It can also address the
- Anyone can instantiate EEC objects
- Only things with ports instantiate netdevs
How is the latter one more flexible?
- Everything can instantiate DPLL object,- Only a netdev can instantiate recovered clock outputs, which can be connected to any other part of the system - not only a DPLL.
If the frequency source devices are truly so different from the general
DPLL circuits that thay cannot possibly be expressed as the same type of
object, then by all means, represent them as something else. DPLL
frequency source, whatever.
But don't hide the API behind netdevs just because some NICs carry
DPLLs. Non-NIC frequency sources do exist, and the subsystem should
support them _in the same way_ as the NIC ones.
That's not the goal. This API gives control over a simple logic that's inside the
netdev that allows outputting the clock signal to a given physical output.
Internally it controls muxes and dividers.
NIC frequency source is actually different to other sources. It's tightly
coupled to a given netdev port, depends on link speed and the link itself.
That's why it needs a separate API coupled with the netdev subsystem.
Also other subsystems have similar controls embedded in them - like PTP
has its pins subsystem. I don't see a reason to make yet another subsystem,
as all of them are custom.