]> git.baikalelectronics.ru Git - kernel.git/commit
IB/qib: Prevent double completions after a timeout or RNR error
authorMike Marciniszyn <mike.marciniszyn@qlogic.com>
Wed, 16 Feb 2011 15:48:25 +0000 (15:48 +0000)
committerRoland Dreier <roland@purestorage.com>
Thu, 17 Feb 2011 22:04:50 +0000 (14:04 -0800)
commit7274d6401a4e3835b51826218aad321778fff713
tree30b59bf396145825d5b005dcc8f6fa1abf5c2b1f
parent51d6a35198204aa52f9e50192cef3b8ce9f87ed5
IB/qib: Prevent double completions after a timeout or RNR error

There is a double completion associated with error handling for RC QPs.

The sequence is:

 - The do_rc_ack() routine fields an RNR nack and there are 0
   rnr_retries configured on the QP.
 - qib_error_qp() stops the pending timer
 - qib_rc_send_complete() is called from sdma_complete()
 - qib_rc_send_complete() starts the timer because the msb of the psn
   just completed says an ack is needed.
 - a bunch of flushes occur as ipoib posts WQEs to an error'ed QP
 - rc_timeout() calls qib_restart_rc()
 - qib_restart_rc() calls qib_send_complete() with a
   IB_WC_RETRY_EXC_ERR on a wqe that has already been completed in the
   past

The fix avoids starting the timer since another packet will never
arrive.

Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/qib/qib_rc.c