diff options
author | Don Hiatt <don.hiatt@intel.com> | 2017-02-08 05:28:25 -0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-02-19 09:18:44 -0500 |
commit | 832666c163f04306fa6823b8974bccf7bb5e5ad3 (patch) | |
tree | a3d5bd844a108dd816c778aede658d1da923b82f /drivers/infiniband/sw | |
parent | 881fccb8640bdd3533f5a98a99991aae23a5106b (diff) |
IB/hfi1, qib, rdmavt: Move AETH defines to rdma/ib_hdrs.h
Rename RVT AETH defines and export in rdma/ib_hdrs.h
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Don Hiatt <don.hiatt@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/sw')
-rw-r--r-- | drivers/infiniband/sw/rdmavt/qp.c | 7 | ||||
-rw-r--r-- | drivers/infiniband/sw/rdmavt/rc.c | 15 |
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index 0b97598136b4..f5ad8d4bfb39 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -51,6 +51,7 @@ #include <linux/vmalloc.h> #include <linux/slab.h> #include <rdma/ib_verbs.h> +#include <rdma/ib_hdrs.h> #include "qp.h" #include "vt.h" #include "trace.h" @@ -1961,14 +1962,14 @@ EXPORT_SYMBOL(rvt_rc_error); */ unsigned long rvt_rnr_tbl_to_usec(u32 index) { - return ib_rvt_rnr_table[(index & RVT_AETH_CREDIT_MASK)]; + return ib_rvt_rnr_table[(index & IB_AETH_CREDIT_MASK)]; } EXPORT_SYMBOL(rvt_rnr_tbl_to_usec); static inline unsigned long rvt_aeth_to_usec(u32 aeth) { - return ib_rvt_rnr_table[(aeth >> RVT_AETH_CREDIT_SHIFT) & - RVT_AETH_CREDIT_MASK]; + return ib_rvt_rnr_table[(aeth >> IB_AETH_CREDIT_SHIFT) & + IB_AETH_CREDIT_MASK]; } /* diff --git a/drivers/infiniband/sw/rdmavt/rc.c b/drivers/infiniband/sw/rdmavt/rc.c index b32b5a3853ac..6131cc558bdb 100644 --- a/drivers/infiniband/sw/rdmavt/rc.c +++ b/drivers/infiniband/sw/rdmavt/rc.c @@ -46,8 +46,7 @@ */ #include <rdma/rdma_vt.h> - -#define RVT_AETH_CREDIT_INVAL RVT_AETH_CREDIT_MASK +#include <rdma/ib_hdrs.h> /* * Convert the AETH credit code into the number of credits. @@ -94,14 +93,14 @@ static const u16 credit_table[31] = { */ __be32 rvt_compute_aeth(struct rvt_qp *qp) { - u32 aeth = qp->r_msn & RVT_MSN_MASK; + u32 aeth = qp->r_msn & IB_MSN_MASK; if (qp->ibqp.srq) { /* * Shared receive queues don't generate credits. * Set the credit field to the invalid value. */ - aeth |= RVT_AETH_CREDIT_INVAL << RVT_AETH_CREDIT_SHIFT; + aeth |= IB_AETH_CREDIT_INVAL << IB_AETH_CREDIT_SHIFT; } else { u32 min, max, x; u32 credits; @@ -143,7 +142,7 @@ __be32 rvt_compute_aeth(struct rvt_qp *qp) min = x; } } - aeth |= x << RVT_AETH_CREDIT_SHIFT; + aeth |= x << IB_AETH_CREDIT_SHIFT; } return cpu_to_be32(aeth); } @@ -159,7 +158,7 @@ EXPORT_SYMBOL(rvt_compute_aeth); void rvt_get_credit(struct rvt_qp *qp, u32 aeth) { struct rvt_dev_info *rdi = ib_to_rvt(qp->ibqp.device); - u32 credit = (aeth >> RVT_AETH_CREDIT_SHIFT) & RVT_AETH_CREDIT_MASK; + u32 credit = (aeth >> IB_AETH_CREDIT_SHIFT) & IB_AETH_CREDIT_MASK; lockdep_assert_held(&qp->s_lock); /* @@ -167,7 +166,7 @@ void rvt_get_credit(struct rvt_qp *qp, u32 aeth) * as many packets as we like. Otherwise, we have to * honor the credit field. */ - if (credit == RVT_AETH_CREDIT_INVAL) { + if (credit == IB_AETH_CREDIT_INVAL) { if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT)) { qp->s_flags |= RVT_S_UNLIMITED_CREDIT; if (qp->s_flags & RVT_S_WAIT_SSN_CREDIT) { @@ -177,7 +176,7 @@ void rvt_get_credit(struct rvt_qp *qp, u32 aeth) } } else if (!(qp->s_flags & RVT_S_UNLIMITED_CREDIT)) { /* Compute new LSN (i.e., MSN + credit) */ - credit = (aeth + credit_table[credit]) & RVT_MSN_MASK; + credit = (aeth + credit_table[credit]) & IB_MSN_MASK; if (rvt_cmp_msn(credit, qp->s_lsn) > 0) { qp->s_lsn = credit; if (qp->s_flags & RVT_S_WAIT_SSN_CREDIT) { |