Skip to content

Test: Cover mt_mbuf_time_stamp RX offload dynfield path#1644

Open
DawidWesierski4 wants to merge 1 commit into
OpenVisualCloud:mainfrom
DawidWesierski4:test/unit-ptp-dynfield-timestamp
Open

Test: Cover mt_mbuf_time_stamp RX offload dynfield path#1644
DawidWesierski4 wants to merge 1 commit into
OpenVisualCloud:mainfrom
DawidWesierski4:test/unit-ptp-dynfield-timestamp

Conversation

@DawidWesierski4

Copy link
Copy Markdown
Collaborator

What

Adds a unit gtest covering the generic RTE_ETH_RX_OFFLOAD_TIMESTAMP mbuf
dynfield path in mt_mbuf_time_stamp(), independent of ice's
IEEE1588-specific packet_type/ol_flag markers (mb->timesync,
RTE_MBUF_F_RX_IEEE1588_PTP/_TMST).

Why

While reviewing an upstream DPDK net/ice patch that removes the
packet_type == RTE_PTYPE_L2_ETHER_TIMESYNC gate around ice's
IEEE1588-specific RX timestamp path (because ice's ptype table never
actually produces that value, making the gate dead code), it became
useful to confirm MTL doesn't strictly depend on that ice-specific
mechanism for RX hardware timestamps: mt_mbuf_time_stamp() already
has a separate, unconditional path via the generic
RTE_ETH_RX_OFFLOAD_TIMESTAMP mbuf dynfield.

Two cases:

  • CorrectWithoutIeee1588Markers — with MT_IF_FEATURE_RX_OFFLOAD_TIMESTAMP
    set, mt_mbuf_time_stamp() returns the injected dynfield timestamp
    exactly, even when the mbuf carries none of the ice IEEE1588 markers
    (i.e. the state produced by unpatched upstream ice).
  • ZeroWithoutOffloadTimestampFeature — with the feature flag absent,
    the same dynfield value is ignored (falls back to
    mtl_ptp_read_time()), proving the first case isn't vacuous.

No lib/ changes — this is test-only, new coverage of existing,
already-correct behavior.

Testing

meson setup build_unit -Denable_unit_tests=true
ninja -C build_unit
./build_unit/tests/unit/UnitTest --gtest_filter='PtpDynfieldTimestamp.*'

Both cases pass across repeated runs.

Adds a unit gtest for the generic RTE_ETH_RX_OFFLOAD_TIMESTAMP mbuf
dynfield path in mt_mbuf_time_stamp(), independent of ice's
IEEE1588-specific packet_type/ol_flag markers.

One case proves the dynfield value is returned correctly when
MT_IF_FEATURE_RX_OFFLOAD_TIMESTAMP is set, even with none of the ice
IEEE1588 markers present. A second proves the dynfield is ignored
(falls back to mtl_ptp_read_time()) when the feature flag is absent,
so the first case isn't vacuous.

Signed-off-by: Dawid Wesierski <dawid.wesierski@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant