diff options
Diffstat (limited to 'drivers/staging/rdma/hfi1/qp.h')
-rw-r--r-- | drivers/staging/rdma/hfi1/qp.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/qp.h b/drivers/staging/rdma/hfi1/qp.h index 6b505859b59c..b9c1575990aa 100644 --- a/drivers/staging/rdma/hfi1/qp.h +++ b/drivers/staging/rdma/hfi1/qp.h @@ -52,6 +52,7 @@ #include <linux/hash.h> #include "verbs.h" +#include "sdma.h" #define QPN_MAX (1 << 24) #define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE) @@ -117,6 +118,20 @@ static inline struct hfi1_qp *hfi1_lookup_qpn(struct hfi1_ibport *ibp, } /** + * clear_ahg - reset ahg status in qp + * @qp - qp pointer + */ +static inline void clear_ahg(struct hfi1_qp *qp) +{ + qp->s_hdr->ahgcount = 0; + qp->s_flags &= ~(HFI1_S_AHG_VALID | HFI1_S_AHG_CLEAR); + if (qp->s_sde && qp->s_ahgidx >= 0) + sdma_ahg_free(qp->s_sde, qp->s_ahgidx); + qp->s_ahgidx = -1; + qp->s_sde = NULL; +} + +/** * hfi1_error_qp - put a QP into the error state * @qp: the QP to put into the error state * @err: the receive completion error to signal if a RWQE is active |