A method and apparatus for manipulating work queue elements via a hardware
adapter and a software driver. The software driver is configured to cause
a plurality of work queue elements to be stored in a queue pair including
a plurality of storage locations. Each of the plurality of storage
locations includes an indicator indicating whether a corresponding work
queue element has been completed. The hardware adapter is configured to
select one of the plurality of storage locations and to service a
corresponding one of the plurality of work queue elements, and in response
to completion of a task associated with the corresponding work queue
element, to cause the indicator to indicate that the corresponding work
queue element has been completed. Additionally, the software driver is
configured to cause a new work queue element to be stored in the selected
storage location in response to detecting that the indicator indicates
that the corresponding work queue element has been completed.