On 06.10.2023 01:29:38, Vincent Mailhol wrote: > > Yes. I have proof-of-concept patches for it laying around, but I want to > > get this mainline first. One limitation of the hardware is that the > > timer is only 16 bits wide and runs on CAN clock, which means a maximum > > of 1MHz. This causes the timer to overflow every 64ms, which in turn > > requires a worker every 30ms or so. > > ACK. > > > For this reason, I want hardware TS > > to be configurable and this is not yet implemented. Also $CUSTOMER > > doesn't need HW timestamps :) > > Actually, this is already available in the kernel. You just need to > implement the SIOCSHWTSTAMP and SIOCGHWTSTAMP ioctl in > net_device_ops->ndo_eth_ioctl(). > > More details in: > > https://git.kernel.org/torvalds/c/90f942c5a6d7 Oh nice, thanks for the pointer. I was talking about the implementation in the driver, though. > The caveat is in the userland: the can-utils currently do not follow > the conventions. It does not send those ioctls and instead expects > hardware timestamps to be unconditionally always on. > But at least, it should work with tcpdump or any other generic packet > capture utilities which follow the kernel conventions. IIRC tcpdump has a command line option to switch on HW timestamping. And there is the command line tool hwstamp_ctl that you can use. regards, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature