|WARNING| [v1,2/2] examples/ptpclient: support vector Rx paths
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Thu Nov 19 16:20:17 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173040
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-19
**Patch 2/2: examples/ptpclient: support vector Rx paths**
**Warning: the mbuf Rx timestamp is assumed to be PHC time in nanoseconds, but its unit is device-defined.**
`port_init()` enables `RTE_ETH_RX_OFFLOAD_TIMESTAMP` on any port whose `rx_offload_capa` advertises it:
```
if (dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
port_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_TIMESTAMP;
```
`parse_sync()` then overwrites the value from `rte_eth_timesync_read_rx_timestamp()` with the raw dynfield value, read as nanoseconds:
```
ptp->tstamp2 = rte_ns_to_timespec(
*RTE_MBUF_DYNFIELD(ptp->m, rx_tstamp_offset,
rte_mbuf_timestamp_t *));
```
The ethdev Rx timestamp dynfield does not have to be nanoseconds on the PTP clock. Some PMDs report free-running device clock ticks, which need `rte_eth_read_clock()` to correlate.
On such a NIC, T2 would be replaced with a value in different units or a different time base. The resulting offset/delay would be wrong, and the app would apply that bogus correction to the PHC.
Suggested fix:
- Restrict this override to devices known to report PHC nanoseconds, or
- Fall back to the timesync API unless the PMD's timestamp semantics are known, and
- Document the assumption in `ptpclient.rst`.
Review-Result: WARNING
More information about the test-report
mailing list