User Manual

Driver FeaturesRev 2.1-1.0.6
Mellanox Technologies
80
4.6.2.4 Querying the Hardware Time
Querying the hardware for time is done via the
ibv_query_values_ex verb.
For example:
To change the queried time in nanoseconds resolution, use the
IBV_VALUES_HW_CLOCK_NS flag
along with the
hwclock_ns field.
4.7 Atomic Operations
Atomic Operations are applicable to the mlx4 driver only.
4.7.1 Enhanced Atomic Operations
ConnectX® implements a set of Extended Atomic Operations beyond those defined by the IB
spec. Atomicity guarantees, Atomic Ack generation, ordering rules and error behavior for this set
of extended Atomic operations is the same as that for IB standard Atomic operations (as defined
in section 9.4.5 of the IB spec).
4.7.1.1 Masked Compare and Swap (MskCmpSwap)
The MskCmpSwap atomic operation is an extension to the CmpSwap operation defined in the IB
spec. MskCmpSwap allows the user to select a portion of the 64 bit target data for the "compare"
check as well as to restrict the swap to a (possibly different) portion. The pseudocode below
describes the operation:
CQs that are opened with the ibv_create_cq_ex versb should be always be polled with
the ibv_poll_cq_ex verb.
ret = ibv_query_values_ex(context, IBV_VALUES_HW_CLOCK, &queried_values);
if (!ret && queried_values.comp_mask & IBV_VALUES_HW_CLOCK)
queried_time = queried_values.hwclock;
ret = ibv_query_values_ex(context, IBV_VALUES_HW_CLOCK_NS, &queried_values);
if (!ret && queried_values.comp_mask & IBV_VALUES_HW_CLOCK_NS)
queried_time_ns = queried_values.hwclock_ns;
Querying the Hardware Time is available only on physical functions / native machines.
| atomic_response = *va
| if (!((compare_add ^ *va) & compare_add_mask)) then