Patent ID: 8346975

Claim:
A computer implemented method of enqueuing one or more packets in a device driver for an I/O adapter, the computer implemented method comprising: receiving, by a processor executing the device driver, a reference to a first list of transmit packets; atomically fetching and setting a transmit active flag, wherein atomically fetching and setting comprises determining a former status of the transmit active flag, wherein atomically fetching and setting the transmit active flag comprises executing a fetch and a set to the transmit active flag without a second process executing an instruction to change the transmit active flag during an interval of the atomically fetching and setting; responsive to a determination that a former status of the transmit active flag is different than a current status of the transmit active flag, atomically removing, by a processor executing the device driver, any packets referenced by a host machine transmit queue reference; pre-pending transmit packets referenced by the host machine transmit queue reference to the list of transmit packets to form an augmented list of transmit packets; building a work request based on the augmented list of transmit packets; notifying the I/O adapter of the work request; and atomically resetting the transmit active flag.