By default, a feed engine assigns the timestamp to the incoming multicast packet as soon as it is received. The application code can use this timestamp to measure the latency of market data processing by the handler.
The handler also supports timestamps assigned by the network adapter (so-called hardware timestamps). Hardware timestamps allow measuring the time the network packet spent in the kernel/adapter before the Handle received and processed it. Hardware timestamps also allow evaluating the benefits of using kernel-bypass solutions like Solarflare `ef_vi` and OpenOnload ones.
Hardware timestamps are enabled by assigning an OnixS::CME::MDH::NicWatch instance.
For example:
The hardware timestamps must also be enabled for the network interface. Otherwise, a feed engine will raise a warning or report an error, depending on the implementation.
Enabling hardware timestamps on a NIC affects all applications and requires additional (root) privileges.
Also, a network adapter may require clock synchronization manipulations before using the hardware timestamping feature.
The Benchmark Sample from the distribution packet has the --hardwareTimestamps
parameter to enable hardware timestamping.
Before running the sample, it's necessary to enable hardware timestamps for a network interface and to synchronise both adapter and system clocks.
The best way to complete both preparation steps is to run the Solarflare PTP daemon. Please follow the Solarflare documentation on configuring and running the daemon.
Once the Solarflare PTP daemon is started, use the Benchmarking sample to measure latency.
OnixS::CME::MDH::SocketFeedEngine can also be used in combination with the Solarflare OpenOnload tools. The EF_RX_TIMESTAMPING
environment variable must be set to 1
before benchmarking under the Solarflare OpenOnload. This environment variable activates hardware timestamping for the Solarflare OpenOnload tools.
ioctl
function has no effect when the Solarflare OpenOnload is used.