InnoRoute / RealtimeHAT

Documentation and source for InnoRoutes Raspberry TSN addon HAT
GNU General Public License v3.0
45 stars 7 forks source link

Tx hardware timestamping #3

Closed LaumiH closed 1 year ago

LaumiH commented 1 year ago

Hi,

I am a student and currently investigating into using the HAT as a TSN packet generator for a lab. While configuring and using ETF, MQPRIO and TAPRIO qdiscs works reasonably fine for me, I have problems with outgoing hardware timestamping.

The Pi/HAT successfully tags incoming packets with hardware timestamps, but outgoing packets do not receive timestamps (or so it seems). Let me explain my setup and code:

If run as talker, the code should print the sent packets with their HW timestamps. The packets are sent, but no timestamps are printed, because the packet does not seem to be looped back to the socket's error queue, as described here.

The code configures various socket options to enable HW timestamping, and I also enabled it for the interface via SIOCSHWTSTAMP.

Is there any experience on your side in HW tx timestamping on the HAT? The website says "Hardware-timestamping of all incoming and all marked outgoing frames" should be possible. Does marking frames mean anything different than what I did?

Many thanks! Laura

ulbricht-inr commented 1 year ago

Hi, sorry for the late response... in the past we discovered some missbehavior with to manny requested timestamps by the ptp4l settings. So we limit the timestamping additionally in the driver: https://github.com/InnoRoute/linux/blob/57e9c89947b071f2887337e5bdd6b208bbaf2839/net/dsa/tag_innoroute.c#L143 you can either send your packets with the ptpl2 ethertype, or register an other type in the driver.