OSDN Git Service

staging/rdma/hfi1: Properly determine error status of SDMA slots
authorMitko Haralanov <mitko.haralanov@intel.com>
Wed, 3 Feb 2016 22:35:23 +0000 (14:35 -0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 11 Mar 2016 01:37:55 +0000 (20:37 -0500)
commitc7cbf2fabbe6e7cbf4f82b6f79bc8e499761c4d2
tree7a82af08e72d1941e930f7bf43273f38d1268456
parentecd42f8df2b9a0a77f2638c7780cda96de2b489b
staging/rdma/hfi1: Properly determine error status of SDMA slots

To ensure correct operation between the driver and PSM
with respect to managing the SDMA request ring, it is
important that the status for a particular request slot
is set at the correct time. Otherwise, PSM can get out
of sync with the driver, which could lead to hangs or
errors on new requests.

Properly determining of when to set the error status of
a SDMA slot depends on knowing exactly when the last txreq
for that request has been completed. This in turn requires
that the driver knows exactly how many requests have been
generated and how many of those requests have been successfully
submitted to the SDMA queue.

The previous implementation of the mid-layer SDMA API did not
provide a way for the caller of sdma_send_txlist() to know how
many of the txreqs in the input list have actually been submitted
without traversing the list and counting. Since sdma_send_txlist()
already traverses the list in order to process it, requiring
such traversal in the caller is completely unnecessary. Therefore,
it is much easier to enhance sdma_send_txlist() to return the
number of successfully submitted txreqs.

This, in turn, allows the caller to accurately determine the
progress of the SDMA request and, therefore, correctly set the
error status at the right time.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/sdma.c
drivers/staging/rdma/hfi1/user_sdma.c