User Manual
Rev 2.0-3.0.0
Mellanox Technologies
71
a pending bounced packet is ready for reading as far as select() is concerned. If the outgoing
packet has to be fragmented, then only the first fragment is time stamped and returned to the
sending socket.
4.7 Atomic Operations
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:
The additional operands are carried in the Extended Transport Header. Atomic response genera-
tion and packet format for MskCmpSwap is as for standard IB Atomic operations.
4.7.1.2 Masked Fetch and Add (MFetchAdd)
The MFetchAdd Atomic operation extends the functionality of the standard IB FetchAdd by
allowing the user to split the target into multiple fields of selectable length. The atomic add is
done independently on each one of this fields. A bit set in the field_boundary parameter specifies
the field boundaries. The pseudocode below describes the operation:
When time-stamping is enabled, VLAN stripping is disabled. For more info please
refer to Documentation/networking/timestamping.txt in kernel.org
Atomic Operations are applicable to the mlx4 driver only.
| atomic_response = *va
| if (!((compare_add ^ *va) & compare_add_mask)) then
| *va = (*va & ~(swap_mask)) | (swap & swap_mask)
|
| return atomic_response
| bit_adder(ci, b1, b2, *co)
| {
| value = ci + b1 + b2
| *co = !!(value & 2)
|