Get packet timestamp in af_packet or other RTNET components
Hello,
working on a data recorder application, I would need to get access to each packet receive timestamp (populated during packet reception ISR generally in network drivers).
I figured out, the cleanest way to do it would be using the
"void __user *msg_control; /* ancillary data */" / "__kernel_size_t msg_controllen; /* ancillary data buffer length */"
members of the struct user_msghdr that is carried over when using the recvmsg call, plus possibly an ioctl to enable the timestamp retrieving
Did anybody already do something like this in xenomai/RTNET ? Any thought on the proposed vector ?
Any chance such modification could become mainline ?
Thanks
François
Quoted 4 lines · François Legal via Xenomai
Hello,
working on a data recorder application, I would need to get access to each packet receive timestamp (populated during packet reception ISR generally in network drivers).
Quoted 8 lines
I figured out, the cleanest way to do it would be using the
"void__user*msg_control; /* ancillary data */" / "__kernel_size_tmsg_controllen; /* ancillary data buffer length */"
members of the structuser_msghdrthat is carried over when using the recvmsg call, plus possibly an ioctl to enable the timestamp retrievingDid anybody already do something like this in xenomai/RTNET ? Any thought on the proposed vector ?
Any chance such modification could become mainline ?
I would add SO_RCVTIMEO support, like rtipc already has.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Quoted 14 lines · Jan Kiszka
Quoted 4 lines · François Legal via Xenomai
Hello,
working on a data recorder application, I would need to get access to each packet receive timestamp (populated during packet reception ISR generally in network drivers).
Quoted 8 lines
I figured out, the cleanest way to do it would be using the
"void__user*msg_control; /* ancillary data */" / "__kernel_size_tmsg_controllen; /* ancillary data buffer length */"
members of the structuser_msghdrthat is carried over when using the recvmsg call, plus possibly an ioctl to enable the timestamp retrievingDid anybody already do something like this in xenomai/RTNET ? Any thought on the proposed vector ?
Any chance such modification could become mainline ?
Quoted 7 lines
I would add
SO_RCVTIMEOsupport, like rtipc already has.Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
Hello,
Isn't SO_RCVTIMEO used to set receive timeout ?
What I intend to do is retrieve the receive time of the packet.
François
Quoted 24 lines · François Legal
Quoted 9 lines · Jan Kiszka
Quoted 8 lines · François Legal via Xenomai
Hello,
working on a data recorder application, I would need to get access to each packet receive timestamp (populated during packet reception ISR generally in network drivers).
I figured out, the cleanest way to do it would be using the
"void__user*msg_control; /* ancillary data */" / "__kernel_size_tmsg_controllen; /* ancillary data buffer length */"
members of the structuser_msghdrthat is carried over when using the recvmsg call, plus possibly an ioctl to enable the timestamp retrievingQuoted 12 lines
Quoted 4 lines
Did anybody already do something like this in xenomai/RTNET ? Any thought on the proposed vector ?
Any chance such modification could become mainline ?I would add
SO_RCVTIMEOsupport, like rtipc already has.Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Quoted 5 lines
Hello,
Isn't
SO_RCVTIMEOused to set receive timeout ?What I intend to do is retrieve the receive time of the packet.
Sorry, wrong option. But I suspect there is something official to obtain the time stamps as well.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Quoted 25 lines · Jan Kiszka via Xenomai
Quoted 24 lines · François Legal
Quoted 21 lines · Jan Kiszka
Quoted 4 lines · François Legal via Xenomai
Hello,
working on a data recorder application, I would need to get access to each packet receive timestamp (populated during packet reception ISR generally in network drivers).
Quoted 8 lines
I figured out, the cleanest way to do it would be using the
"void__user*msg_control; /* ancillary data */" / "__kernel_size_tmsg_controllen; /* ancillary data buffer length */"
members of the structuser_msghdrthat is carried over when using the recvmsg call, plus possibly an ioctl to enable the timestamp retrievingDid anybody already do something like this in xenomai/RTNET ? Any thought on the proposed vector ?
Any chance such modification could become mainline ?I would add
SO_RCVTIMEOsupport, like rtipc already has.Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Quoted 9 lines
Quoted 5 lines
Hello,
Isn't
SO_RCVTIMEOused to set receive timeout ?What I intend to do is retrieve the receive time of the packet.
Sorry, wrong option. But I suspect there is something official to obtain the time stamps as well.
SO_TIMESTAMP, and that takes you to those ancillary data.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux
Quoted 36 lines · Jan Kiszka
Quoted 25 lines · Jan Kiszka via Xenomai
Quoted 24 lines · François Legal
Quoted 21 lines · Jan Kiszka
Quoted 4 lines · François Legal via Xenomai
Hello,
working on a data recorder application, I would need to get access to each packet receive timestamp (populated during packet reception ISR generally in network drivers).
Quoted 8 lines
I figured out, the cleanest way to do it would be using the
"void__user*msg_control; /* ancillary data */" / "__kernel_size_tmsg_controllen; /* ancillary data buffer length */"
members of the structuser_msghdrthat is carried over when using the recvmsg call, plus possibly an ioctl to enable the timestamp retrievingDid anybody already do something like this in xenomai/RTNET ? Any thought on the proposed vector ?
Any chance such modification could become mainline ?I would add
SO_RCVTIMEOsupport, like rtipc already has.Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded LinuxQuoted 9 lines
Quoted 5 lines
Hello,
Isn't
SO_RCVTIMEOused to set receive timeout ?What I intend to do is retrieve the receive time of the packet.
Sorry, wrong option. But I suspect there is something official to obtain the time stamps as well.
Quoted 7 lines
SO_TIMESTAMP, and that takes you to those ancillary data.Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
That's what I just figured out.
I'll implement that then, and submit patch.
François