IB/hfi1: Fix ordering of trace for accuracy
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Mon, 7 Mar 2016 19:35:24 +0000 (11:35 -0800)
committerDoug Ledford <dledford@redhat.com>
Thu, 17 Mar 2016 19:55:20 +0000 (15:55 -0400)
The postitioning of the sdma ibhdr trace was
causing an extra trace message when the tx send
returned -EBUSY.

Move the trace to just before the return
and handle negative return values to avoid
any trace.

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>
drivers/staging/rdma/hfi1/verbs.c

index e605e09d80840097671283817169af11fc7bd6ad..467e6c349c68535ddea3efa875e755e870ed6134 100644 (file)
@@ -891,11 +891,14 @@ int hfi1_verbs_send_dma(struct rvt_qp *qp, struct hfi1_pkt_state *ps,
                if (unlikely(ret))
                        goto bail_build;
        }
+       ret =  sdma_send_txreq(tx->sde, &priv->s_iowait, &tx->txreq);
+       if (unlikely(ret < 0)) {
+               if (ret == -ECOMM)
+                       goto bail_ecomm;
+               return ret;
+       }
        trace_sdma_output_ibhdr(dd_from_ibdev(qp->ibqp.device),
                                &ps->s_txreq->phdr.hdr);
-       ret =  sdma_send_txreq(tx->sde, &priv->s_iowait, &tx->txreq);
-       if (unlikely(ret == -ECOMM))
-               goto bail_ecomm;
        return ret;
 
 bail_ecomm: