-
Notifications
You must be signed in to change notification settings - Fork 103
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
timestamp: support multiple trailer timestamp formats #181
timestamp: support multiple trailer timestamp formats #181
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. It would be nice to refactor ci_rx_pk_timestamp_cpacket
as described.
df5f3a2
to
3364e68
Compare
Thanks for the review! I pushed a new versions with the suggestions incorporated. And a few other changes. Added a changelog to the bottom of the commit message (below the ---) |
Make packet trailer timestamp format configurable. EF_RX_TIMESTAMPING_ORDERING allows selecting timestamps embedded in packet trailers for ordering and SO_TIMESTAMPING. The current implementation assumes a single fixed trailer format, cPacket. Make the format selectable, with EF_RX_TIMESTAMPING_TRAILER_FORMAT. Introduce initially two new formats to demonstrate the feature. Implementation: - expand ci_rx_pkt_timestamp_cpacket into ci_rx_pkt_timestamp_trailer, to demultiplex type. Minimal refactoring of the existing function to avoid code duplication. Cpacket func can be simplified further, but with more churn, so left for a v2 revision. - expand src/tests/unit/header/ci/internal/ip_timestamp.c with basic unit tests for the new types. For more information on cpacket and ttag trailer formats, also see - https://github.com/wireshark/wireshark/blob/master/epan/dissectors/packet-metamako.c - https://github.com/wireshark/wireshark/blob/master/epan/dissectors/packet-cisco-ttag.c Tested: scripts/run_unit_tests.sh --- Changes v1->v2 - add nsec_frac initialization to ci_rx_pkt_timestamp_ttag and nsec_frac validation to test_rx_pkt_timestamp_trailer_ttag - rename Type3 to Broadcom, after getting approval - update origin field and document FCS behavior - convert ci_rx_pkt_timestamp_ttag to common ci_rx_pkt_.. arg fmt: - now remove duplicative tests - remove two levels of indentation - (unfortunately) have to update all direct callers in tests - no other changes to the logic (hard to spot without --word-diff) - tighten ttag and brcm tests: encode largest supported value - avoid ISO C90 forbids mixed declarations and code warnings
3364e68
to
433a1d7
Compare
Just a note that I pushed a commit to my own repo two tools with which I tested this end-to-end.
|
Thanks for the contribution, @wdebruij ! |
Thanks for accepting it! |
Make packet trailer timestamp format configurable.
EF_RX_TIMESTAMPING_ORDERING allows selecting timestamps embedded in packet trailers for ordering and SO_TIMESTAMPING. The current implementation assumes a single fixed trailer format, cPacket.
Make the format selectable, with EF_RX_TIMESTAMPING_TRAILER_FORMAT. Introduce initially two new formats to demonstrate the feature.
Implementation:
For more information on cpacket and ttag trailer formats, also see
Tested: scripts/run_unit_tests.sh