Hi, When we would use multiple PHC per interface (or per bridge/switch). How can we defer a real PHC from virtual PHC? Would not it be easier to simply call then multiple PHC and use the index regardless if it is virtual or not.
As for the PORT_PROPERTIES_NP. It is a port TLV not a clock TLV. I think it is better to add a new TLV and not break backward compatible of PORT_PROPERTIES_NP. A patch like that was rejected 2 month ago. Erez -----Original Message----- From: Miroslav Lichvar <mlich...@redhat.com> Sent: Thursday, 13 January 2022 16:55 To: linuxptp-devel@lists.sourceforge.net Subject: [Linuxptp-devel] [PATCH RFC 0/7] Support for virtual clocks With recent kernels it is possible to create virtual PHCs running on top of a free-running PHC by writing to /sys/class/ptp/ptp?/n_vclocks. If supported in linuxptp, it would allow users to run multiple ptp4l instance with hardware timestamping on one interface, e.g. in different domains for better resiliency, or separate instances for different unicast servers. The kernel support was added in 5.14, but there were some bugs fixed recently, so 5.17-rc1 or later is recommended for testing. The 1st patch is a bug fix required by the second patch. The 2nd patch adds detection of virtual clocks via ethtool netlink. The 3rd-5th patch add support to ptp4l. The PHC index of the virtual clock needs to be specified in the configuration. The 6th and 7th patch add support to phc2sys. The PORT_PROPERTIES_NP message is extended with the PHC index. The command is available only on the UDS port, but I'm not sure if an incompatible change like this is acceptable. The alternative would be to add a new command specifically for the index. My plan is to add support also to timemaster to detect the kernel support, automatically create virtual clocks for interfaces specified in multiple domains (where previously some instances had to use SW timestamping), and pass the correct PHC indexes to the ptp4l instances. Miroslav Lichvar (7): rtnl: Fix rtnl_rtattr_parse() to process max attribute. rtnl: Add function to detect virtual clocks. Add support for binding sockets to virtual clocks. config: Add port-specific phc_index option. port: Check for virtual clocks. tlv: Add PHC index to PORT_PROPERTIES_NP. phc2sys: Use PHC index from PORT_PROPERTIES_NP. clock.c | 6 +++- config.c | 1 + incdefs.sh | 4 +++ interface.c | 12 ++++++++ interface.h | 14 +++++++++ missing.h | 11 +++++++ phc2sys.c | 42 +++++++++++++++----------- pmc_agent.c | 3 +- pmc_agent.h | 4 ++- port.c | 16 +++++++--- ptp4l.8 | 8 +++++ raw.c | 3 +- rtnl.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++-- rtnl.h | 9 ++++++ sk.c | 11 +++++-- sk.h | 3 +- tlv.c | 2 ++ tlv.h | 1 + udp.c | 3 +- udp6.c | 3 +- 20 files changed, 211 insertions(+), 32 deletions(-) -- 2.33.1 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Flinuxptp-devel&data=04%7C01%7Cerez.geva.ext%40siemens.com%7Ccf6f6ea49816434c66dd08d9d6ade80f%7C38ae3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637776864684717246%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=yt2%2FX%2BRyNF2oiO80Jxy8cGQ%2Fezs3AVpMmFQUWmSEuB4%3D&reserved=0 _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel