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