IB/ipath: Fix RDMA read response sequence checking

If an out of sequence RDMA read response middle or last packet is
received, we should only resend the RDMA read request on the first
out of sequence packet and drop subsequent out of sequence packets
otherwise, we get "too many retries".

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by Ralph Campbell and committed by Roland Dreier 74116f58 e509be89

+8
+7
drivers/infiniband/hw/ipath/ipath_rc.c
··· 1189 wqe = get_swqe_ptr(qp, qp->s_last); 1190 if (unlikely(wqe->wr.opcode != IB_WR_RDMA_READ)) 1191 goto ack_op_err; 1192 /* 1193 * If this is a response to a resent RDMA read, we 1194 * have to be careful to copy the data to the right ··· 1203 /* no AETH, no ACK */ 1204 if (unlikely(ipath_cmp24(psn, qp->s_last_psn + 1))) { 1205 dev->n_rdma_seq++; 1206 ipath_restart_rc(qp, qp->s_last_psn + 1); 1207 goto ack_done; 1208 } ··· 1267 /* ACKs READ req. */ 1268 if (unlikely(ipath_cmp24(psn, qp->s_last_psn + 1))) { 1269 dev->n_rdma_seq++; 1270 ipath_restart_rc(qp, qp->s_last_psn + 1); 1271 goto ack_done; 1272 }
··· 1189 wqe = get_swqe_ptr(qp, qp->s_last); 1190 if (unlikely(wqe->wr.opcode != IB_WR_RDMA_READ)) 1191 goto ack_op_err; 1192 + qp->r_flags &= ~IPATH_R_RDMAR_SEQ; 1193 /* 1194 * If this is a response to a resent RDMA read, we 1195 * have to be careful to copy the data to the right ··· 1202 /* no AETH, no ACK */ 1203 if (unlikely(ipath_cmp24(psn, qp->s_last_psn + 1))) { 1204 dev->n_rdma_seq++; 1205 + if (qp->r_flags & IPATH_R_RDMAR_SEQ) 1206 + goto ack_done; 1207 + qp->r_flags |= IPATH_R_RDMAR_SEQ; 1208 ipath_restart_rc(qp, qp->s_last_psn + 1); 1209 goto ack_done; 1210 } ··· 1263 /* ACKs READ req. */ 1264 if (unlikely(ipath_cmp24(psn, qp->s_last_psn + 1))) { 1265 dev->n_rdma_seq++; 1266 + if (qp->r_flags & IPATH_R_RDMAR_SEQ) 1267 + goto ack_done; 1268 + qp->r_flags |= IPATH_R_RDMAR_SEQ; 1269 ipath_restart_rc(qp, qp->s_last_psn + 1); 1270 goto ack_done; 1271 }
+1
drivers/infiniband/hw/ipath/ipath_verbs.h
··· 444 * Bit definitions for r_flags. 445 */ 446 #define IPATH_R_REUSE_SGE 0x01 447 448 /* 449 * Bit definitions for s_flags.
··· 444 * Bit definitions for r_flags. 445 */ 446 #define IPATH_R_REUSE_SGE 0x01 447 + #define IPATH_R_RDMAR_SEQ 0x02 448 449 /* 450 * Bit definitions for s_flags.