-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement HW/SW TX timestamp feature #37
Conversation
Even if failed to set HW TX timestamp, SW TX timestamp is still can be used.
I wonder how much time difference will occur between HW and SW(Kernel) timestamp roughly? |
I never seen that both HW and SW timestamping support in one NIC. Kontron NIC and the NIC used on NXP switch(IDK what vendor used on this) has HW timestamping support without SW timestamping |
* Implement HW TX timestamp Even if failed to set HW TX timestamp, SW TX timestamp is still can be used. * Cargo fmt, Clippy * Remove perror * Remove print, fix typo
* get rx, tx timestamp * no more call SystemTime::now() on oneway mode * fix cargo fmt * Fix sock_open to return created vlan name instead of interface name (#32) * Get rx timestamp from HW on latency app (#33) * get rx, tx timestamp * no more call SystemTime::now() on oneway mode * fix cargo fmt * print only rx timestamp * fix fmt * Revert "Fix sock_open to return created vlan name instead of interface name (#32)" (#35) This reverts commit 2cec046. * Implement HW/SW TX timestamp feature (#37) * Implement HW TX timestamp Even if failed to set HW TX timestamp, SW TX timestamp is still can be used. * Cargo fmt, Clippy * Remove perror * Remove print, fix typo * change latency protocol (#36) * change protocol * fix fmt, clippy * change server get rx by packet, clean code * server identifies act as opcode * store ts only last one and server don't get oneway parameter * get SW timestamp immediately after receive the message * clean code * change opcode match in server * error handling about negative elapsed time * fix fmt, clippy * server prints negative elapsed time * simplify get tx_timestamp at packet * fix fmt * get HW tx_timestamp that apply to latency * get rx, tx timestamp * no more call SystemTime::now() on oneway mode * merge hw_tx_timestamp * Consume tx timestamp after sending SYNC packet * Warn if SW TX timestamp is used --------- Co-authored-by: Jeong Arm <kjwonmail@gmail.com>
Even if failed to set HW TX timestamp, SW TX timestamp is still can be used.
This PR produces these functions:
TsnSocket.enable_tx_timestamp()
Enables TX timestamp feature
Even if failed to set HW TX timestamp, SW(kernel) TX timestamp is still can be used on
get_tx_timestamp()
which is better than application level SW timestampTsnSocket.get_tx_timestamp()
Use this function right after
TsnSock.send()
on TX timestamp enabled socket. It returnstsn::time::Timespec
example code: