Commit aa0ad411 authored by Jianxin Xiong's avatar Jianxin Xiong Committed by Doug Ledford

staging/rdma/hfi1: Fix header size calculation for RC/UC QPs with GRH enabled

There is a header size counter in both the QP struture and the txreq
structure. The counter in the txreq structure is not updated properly
for RC and UC queue pairs with GRH enabled, and thus causing SDMA
send to fail. This patch fixes the RC and UC path.
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarDean Luick <dean.luick@intel.com>
Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarJianxin Xiong <jianxin.xiong@intel.com>
Signed-off-by: default avatarJubin John <jubin.john@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent ade30240
...@@ -358,11 +358,11 @@ static int make_rc_ack(struct hfi1_ibdev *dev, struct rvt_qp *qp, ...@@ -358,11 +358,11 @@ static int make_rc_ack(struct hfi1_ibdev *dev, struct rvt_qp *qp,
} }
qp->s_rdma_ack_cnt++; qp->s_rdma_ack_cnt++;
qp->s_hdrwords = hwords; qp->s_hdrwords = hwords;
/* pbc */
ps->s_txreq->hdr_dwords = hwords + 2;
ps->s_txreq->sde = priv->s_sde; ps->s_txreq->sde = priv->s_sde;
qp->s_cur_size = len; qp->s_cur_size = len;
hfi1_make_ruc_header(qp, ohdr, bth0, bth2, middle, ps); hfi1_make_ruc_header(qp, ohdr, bth0, bth2, middle, ps);
/* pbc */
ps->s_txreq->hdr_dwords = qp->s_hdrwords + 2;
return 1; return 1;
bail: bail:
...@@ -763,8 +763,6 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) ...@@ -763,8 +763,6 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
} }
qp->s_len -= len; qp->s_len -= len;
qp->s_hdrwords = hwords; qp->s_hdrwords = hwords;
/* pbc */
ps->s_txreq->hdr_dwords = hwords + 2;
ps->s_txreq->sde = priv->s_sde; ps->s_txreq->sde = priv->s_sde;
qp->s_cur_sge = ss; qp->s_cur_sge = ss;
qp->s_cur_size = len; qp->s_cur_size = len;
...@@ -775,6 +773,8 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) ...@@ -775,6 +773,8 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
bth2, bth2,
middle, middle,
ps); ps);
/* pbc */
ps->s_txreq->hdr_dwords = qp->s_hdrwords + 2;
return 1; return 1;
done_free_tx: done_free_tx:
......
...@@ -239,13 +239,13 @@ int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) ...@@ -239,13 +239,13 @@ int hfi1_make_uc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
} }
qp->s_len -= len; qp->s_len -= len;
qp->s_hdrwords = hwords; qp->s_hdrwords = hwords;
/* pbc */
ps->s_txreq->hdr_dwords = qp->s_hdrwords + 2;
ps->s_txreq->sde = priv->s_sde; ps->s_txreq->sde = priv->s_sde;
qp->s_cur_sge = &qp->s_sge; qp->s_cur_sge = &qp->s_sge;
qp->s_cur_size = len; qp->s_cur_size = len;
hfi1_make_ruc_header(qp, ohdr, bth0 | (qp->s_state << 24), hfi1_make_ruc_header(qp, ohdr, bth0 | (qp->s_state << 24),
mask_psn(qp->s_psn++), middle, ps); mask_psn(qp->s_psn++), middle, ps);
/* pbc */
ps->s_txreq->hdr_dwords = qp->s_hdrwords + 2;
return 1; return 1;
done_free_tx: done_free_tx:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment