summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/ud.c
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2016-02-14 12:45:18 -0800
committerDoug Ledford <dledford@redhat.com>2016-03-10 20:38:13 -0500
commit711e104ddca7b609889e1edf0a8482673ea4a7cc (patch)
tree5bac16a93873498a38717733056fd85b105cd051 /drivers/staging/rdma/hfi1/ud.c
parent1235bef8f04bf020b03f32e083e34bc91fc51343 (diff)
downloadlinux-stable-711e104ddca7b609889e1edf0a8482673ea4a7cc.tar.gz
linux-stable-711e104ddca7b609889e1edf0a8482673ea4a7cc.tar.bz2
linux-stable-711e104ddca7b609889e1edf0a8482673ea4a7cc.zip
staging/rdma/hfi1: fix panic in send engine
The send engine wasn't correctly handling pre-built packets, and worse, the pointer to a packet state's txreq wasn't initialized correctly. To fix: - all waiters need to save any prebuilt packets (smda waits already did) - the progress routine needs to handle a QPs prebuilt packet and initialize the txreq pointer properly To keep SDMA working, the dma send code needs to see if a packet has been built already. If not the code will build it. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/ud.c')
-rw-r--r--drivers/staging/rdma/hfi1/ud.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/ud.c b/drivers/staging/rdma/hfi1/ud.c
index 1b4b191ced99..bae5ccdfa7f4 100644
--- a/drivers/staging/rdma/hfi1/ud.c
+++ b/drivers/staging/rdma/hfi1/ud.c
@@ -53,8 +53,8 @@
#include "hfi.h"
#include "mad.h"
-#include "qp.h"
#include "verbs_txreq.h"
+#include "qp.h"
/**
* ud_loopback - handle send on loopback QPs
@@ -394,7 +394,9 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
priv->s_sc = sc5;
}
priv->s_sde = qp_to_sdma_engine(qp, priv->s_sc);
+ ps->s_txreq->sde = priv->s_sde;
priv->s_sendcontext = qp_to_send_context(qp, priv->s_sc);
+ ps->s_txreq->psc = priv->s_sendcontext;
ps->s_txreq->phdr.hdr.lrh[0] = cpu_to_be16(lrh0);
ps->s_txreq->phdr.hdr.lrh[1] = cpu_to_be16(ah_attr->dlid);
ps->s_txreq->phdr.hdr.lrh[2] =
@@ -432,6 +434,8 @@ int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
priv->s_hdr->ahgidx = 0;
priv->s_hdr->tx_flags = 0;
priv->s_hdr->sde = NULL;
+ /* pbc */
+ ps->s_txreq->hdr_dwords = qp->s_hdrwords + 2;
return 1;