aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib_rc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/qib/qib_rc.c')
-rw-r--r--drivers/infiniband/hw/qib/qib_rc.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c
index eca0c41f122..5c1c49b299f 100644
--- a/drivers/infiniband/hw/qib/qib_rc.c
+++ b/drivers/infiniband/hw/qib/qib_rc.c
@@ -1955,8 +1955,6 @@ void qib_rc_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
1955 break; 1955 break;
1956 } 1956 }
1957 1957
1958 memset(&wc, 0, sizeof wc);
1959
1960 if (qp->state == IB_QPS_RTR && !(qp->r_flags & QIB_R_COMM_EST)) { 1958 if (qp->state == IB_QPS_RTR && !(qp->r_flags & QIB_R_COMM_EST)) {
1961 qp->r_flags |= QIB_R_COMM_EST; 1959 qp->r_flags |= QIB_R_COMM_EST;
1962 if (qp->ibqp.event_handler) { 1960 if (qp->ibqp.event_handler) {
@@ -2009,16 +2007,19 @@ send_middle:
2009 goto rnr_nak; 2007 goto rnr_nak;
2010 qp->r_rcv_len = 0; 2008 qp->r_rcv_len = 0;
2011 if (opcode == OP(SEND_ONLY)) 2009 if (opcode == OP(SEND_ONLY))
2012 goto send_last; 2010 goto no_immediate_data;
2013 /* FALLTHROUGH */ 2011 /* FALLTHROUGH for SEND_ONLY_WITH_IMMEDIATE */
2014 case OP(SEND_LAST_WITH_IMMEDIATE): 2012 case OP(SEND_LAST_WITH_IMMEDIATE):
2015send_last_imm: 2013send_last_imm:
2016 wc.ex.imm_data = ohdr->u.imm_data; 2014 wc.ex.imm_data = ohdr->u.imm_data;
2017 hdrsize += 4; 2015 hdrsize += 4;
2018 wc.wc_flags = IB_WC_WITH_IMM; 2016 wc.wc_flags = IB_WC_WITH_IMM;
2019 /* FALLTHROUGH */ 2017 goto send_last;
2020 case OP(SEND_LAST): 2018 case OP(SEND_LAST):
2021 case OP(RDMA_WRITE_LAST): 2019 case OP(RDMA_WRITE_LAST):
2020no_immediate_data:
2021 wc.wc_flags = 0;
2022 wc.ex.imm_data = 0;
2022send_last: 2023send_last:
2023 /* Get the number of bytes the message was padded by. */ 2024 /* Get the number of bytes the message was padded by. */
2024 pad = (be32_to_cpu(ohdr->bth[0]) >> 20) & 3; 2025 pad = (be32_to_cpu(ohdr->bth[0]) >> 20) & 3;
@@ -2051,6 +2052,12 @@ send_last:
2051 wc.src_qp = qp->remote_qpn; 2052 wc.src_qp = qp->remote_qpn;
2052 wc.slid = qp->remote_ah_attr.dlid; 2053 wc.slid = qp->remote_ah_attr.dlid;
2053 wc.sl = qp->remote_ah_attr.sl; 2054 wc.sl = qp->remote_ah_attr.sl;
2055 /* zero fields that are N/A */
2056 wc.vendor_err = 0;
2057 wc.pkey_index = 0;
2058 wc.dlid_path_bits = 0;
2059 wc.port_num = 0;
2060 wc.csum_ok = 0;
2054 /* Signal completion event if the solicited bit is set. */ 2061 /* Signal completion event if the solicited bit is set. */
2055 qib_cq_enter(to_icq(qp->ibqp.recv_cq), &wc, 2062 qib_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
2056 (ohdr->bth[0] & 2063 (ohdr->bth[0] &
@@ -2089,7 +2096,7 @@ send_last:
2089 if (opcode == OP(RDMA_WRITE_FIRST)) 2096 if (opcode == OP(RDMA_WRITE_FIRST))
2090 goto send_middle; 2097 goto send_middle;
2091 else if (opcode == OP(RDMA_WRITE_ONLY)) 2098 else if (opcode == OP(RDMA_WRITE_ONLY))
2092 goto send_last; 2099 goto no_immediate_data;
2093 ret = qib_get_rwqe(qp, 1); 2100 ret = qib_get_rwqe(qp, 1);
2094 if (ret < 0) 2101 if (ret < 0)
2095 goto nack_op_err; 2102 goto nack_op_err;