IB/rdmavt, IB/hfi1, IB/qib: Correct ack count for passive (RTR) QPs
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 8 Feb 2017 13:27:49 +0000 (05:27 -0800)
committerDoug Ledford <dledford@redhat.com>
Sun, 19 Feb 2017 14:18:42 +0000 (09:18 -0500)
The send complete for RC QPs mismanages the ack count when the
responder side is only in RTR.

A QP in that state cannot send requests, but it can be the target
for operations that elicit responses.

Adjust the RC completion logic to correct the count maintenance
by reflecting RECV_OK in a new state test.

Reviewed-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/rc.c
drivers/infiniband/hw/qib/qib_rc.c
include/rdma/rdmavt_qp.h

index 85e7bf6dcc11d45fe9d5347bc1c5af8843492ba4..3cddf7d03e70f4743e34d1316f07b3bed04cb9b7 100644 (file)
@@ -990,7 +990,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
        u32 psn;
 
        lockdep_assert_held(&qp->s_lock);
-       if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND))
+       if (!(ib_rvt_state_ops[qp->state] & RVT_SEND_OR_FLUSH_OR_RECV_OK))
                return;
 
        /* Find out where the BTH is */
index d712043cbccc090453c5b842a6042bd0282b7c7a..2a495fbc6508bac2da284b32f15a4d60ac1471d0 100644 (file)
@@ -895,7 +895,7 @@ void qib_rc_send_complete(struct rvt_qp *qp, struct ib_header *hdr)
        u32 opcode;
        u32 psn;
 
-       if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND))
+       if (!(ib_rvt_state_ops[qp->state] & RVT_SEND_OR_FLUSH_OR_RECV_OK))
                return;
 
        /* Find out where the BTH is */
index 561b6c87608625cfe13b6ef41612947d3e957f1e..2f91fae8d23f1c7bb8a283db6e2fa45c13492e49 100644 (file)
 #define RVT_FLUSH_RECV                 0x40
 #define RVT_PROCESS_OR_FLUSH_SEND \
        (RVT_PROCESS_SEND_OK | RVT_FLUSH_SEND)
+#define RVT_SEND_OR_FLUSH_OR_RECV_OK \
+       (RVT_PROCESS_SEND_OK | RVT_FLUSH_SEND | RVT_PROCESS_RECV_OK)
 
 /*
  * Internal send flags