On Fri, Jun 25, 2021 at 05:35:07PM +0800, Yangbo Lu wrote: > Add an interface for getting PHC (PTP Hardware Clock) > virtual clocks, which are based on PHC physical clock > providing hardware timestamp to network packets. > > Signed-off-by: Yangbo Lu Hello, do you plan to submit also an ethtool (userspace utility) patch using this interface? Michal > --- > Changes for v3: > - Added this patch. > Changes for v4: > - Updated doc. > - Removed ioctl command. > - Replied only the number of vclock index. > --- > Documentation/networking/ethtool-netlink.rst | 22 +++++ > include/linux/ethtool.h | 10 +++ > include/uapi/linux/ethtool_netlink.h | 15 ++++ > net/ethtool/Makefile | 2 +- > net/ethtool/common.c | 13 +++ > net/ethtool/netlink.c | 10 +++ > net/ethtool/netlink.h | 2 + > net/ethtool/phc_vclocks.c | 94 ++++++++++++++++++++ > 8 files changed, 167 insertions(+), 1 deletion(-) > create mode 100644 net/ethtool/phc_vclocks.c > > diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst > index 6ea91e41593f..c86628e6a235 100644 > --- a/Documentation/networking/ethtool-netlink.rst > +++ b/Documentation/networking/ethtool-netlink.rst > @@ -212,6 +212,7 @@ Userspace to kernel: > ``ETHTOOL_MSG_FEC_SET`` set FEC settings > ``ETHTOOL_MSG_MODULE_EEPROM_GET`` read SFP module EEPROM > ``ETHTOOL_MSG_STATS_GET`` get standard statistics > + ``ETHTOOL_MSG_PHC_VCLOCKS_GET`` get PHC virtual clocks info > ===================================== ================================ > > Kernel to userspace: > @@ -250,6 +251,7 @@ Kernel to userspace: > ``ETHTOOL_MSG_FEC_NTF`` FEC settings > ``ETHTOOL_MSG_MODULE_EEPROM_GET_REPLY`` read SFP module EEPROM > ``ETHTOOL_MSG_STATS_GET_REPLY`` standard statistics > + ``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY`` PHC virtual clocks info > ======================================== ================================= > > ``GET`` requests are sent by userspace applications to retrieve device > @@ -1477,6 +1479,25 @@ Low and high bounds are inclusive, for example: > etherStatsPkts512to1023Octets 512 1023 > ============================= ==== ==== > > +PHC_VCLOCKS_GET > +=============== > + > +Query device PHC virtual clocks information. > + > +Request contents: > + > + ==================================== ====== ========================== > + ``ETHTOOL_A_PHC_VCLOCKS_HEADER`` nested request header > + ==================================== ====== ========================== > + > +Kernel response contents: > + > + ==================================== ====== ========================== > + ``ETHTOOL_A_PHC_VCLOCKS_HEADER`` nested reply header > + ``ETHTOOL_A_PHC_VCLOCKS_NUM`` u32 PHC virtual clocks number > + ``ETHTOOL_A_PHC_VCLOCKS_INDEX`` s32 PHC index array > + ==================================== ====== ========================== [...]