diff options
Diffstat (limited to 'include/rdma/rdmavt_qp.h')
-rw-r--r-- | include/rdma/rdmavt_qp.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/rdma/rdmavt_qp.h b/include/rdma/rdmavt_qp.h index be6472e5b06b..d664d2e76280 100644 --- a/include/rdma/rdmavt_qp.h +++ b/include/rdma/rdmavt_qp.h | |||
@@ -647,6 +647,20 @@ static inline u32 rvt_div_mtu(struct rvt_qp *qp, u32 len) | |||
647 | return len >> qp->log_pmtu; | 647 | return len >> qp->log_pmtu; |
648 | } | 648 | } |
649 | 649 | ||
650 | /** | ||
651 | * rvt_timeout_to_jiffies - Convert a ULP timeout input into jiffies | ||
652 | * @timeout - timeout input(0 - 31). | ||
653 | * | ||
654 | * Return a timeout value in jiffies. | ||
655 | */ | ||
656 | static inline unsigned long rvt_timeout_to_jiffies(u8 timeout) | ||
657 | { | ||
658 | if (timeout > 31) | ||
659 | timeout = 31; | ||
660 | |||
661 | return usecs_to_jiffies(1U << timeout) * 4096UL / 1000UL; | ||
662 | } | ||
663 | |||
650 | extern const int ib_rvt_state_ops[]; | 664 | extern const int ib_rvt_state_ops[]; |
651 | 665 | ||
652 | struct rvt_dev_info; | 666 | struct rvt_dev_info; |