From: Don Hiatt Date: Wed, 8 Feb 2017 13:28:19 +0000 (-0800) Subject: IB/hfi1: Add rvt_rnr_tbl_to_usec function X-Git-Tag: MMI-PSA29.97-13-9~6131^2~21 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=881fccb8640bdd3533f5a98a99991aae23a5106b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git IB/hfi1: Add rvt_rnr_tbl_to_usec function Return usec from an index into ib_rvt_rnr_table. Reviewed-by: Mike Marciniszyn Signed-off-by: Don Hiatt Signed-off-by: Dennis Dalessandro Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index db4315f8f0c8..0b97598136b4 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c @@ -1954,6 +1954,17 @@ void rvt_rc_error(struct rvt_qp *qp, enum ib_wc_status err) } EXPORT_SYMBOL(rvt_rc_error); +/* + * rvt_rnr_tbl_to_usec - return index into ib_rvt_rnr_table + * @index - the index + * return usec from an index into ib_rvt_rnr_table + */ +unsigned long rvt_rnr_tbl_to_usec(u32 index) +{ + return ib_rvt_rnr_table[(index & RVT_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) & diff --git a/include/rdma/rdmavt_qp.h b/include/rdma/rdmavt_qp.h index 2f91fae8d23f..9767549ab42c 100644 --- a/include/rdma/rdmavt_qp.h +++ b/include/rdma/rdmavt_qp.h @@ -653,6 +653,7 @@ struct rvt_dev_info; void rvt_comm_est(struct rvt_qp *qp); int rvt_error_qp(struct rvt_qp *qp, enum ib_wc_status err); void rvt_rc_error(struct rvt_qp *qp, enum ib_wc_status err); +unsigned long rvt_rnr_tbl_to_usec(u32 index); enum hrtimer_restart rvt_rc_rnr_retry(struct hrtimer *t); void rvt_add_rnr_timer(struct rvt_qp *qp, u32 aeth); void rvt_del_timers_sync(struct rvt_qp *qp);