mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
IB/rdmavt, IB/hfi1, IB/qib: Add inlines for mtu division
Add rvt_div_round_up_mtu() and rvt_div_mtu() routines to do the computation based on the pmtu and the log_pmtu. Change divides in qib, hfi1 to use the new inlines. Reviewed-by: Kaike Wan <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
This commit is contained in:
parent
c64607aa8a
commit
5dc806052a
3 changed files with 25 additions and 5 deletions
|
|
@ -582,7 +582,29 @@ static inline void rvt_qp_swqe_complete(
|
|||
}
|
||||
}
|
||||
|
||||
extern const int ib_rvt_state_ops[];
|
||||
/**
|
||||
* @qp - the qp pair
|
||||
* @len - the length
|
||||
*
|
||||
* Perform a shift based mtu round up divide
|
||||
*/
|
||||
static inline u32 rvt_div_round_up_mtu(struct rvt_qp *qp, u32 len)
|
||||
{
|
||||
return (len + qp->pmtu - 1) >> qp->log_pmtu;
|
||||
}
|
||||
|
||||
/**
|
||||
* @qp - the qp pair
|
||||
* @len - the length
|
||||
*
|
||||
* Perform a shift based mtu divide
|
||||
*/
|
||||
static inline u32 rvt_div_mtu(struct rvt_qp *qp, u32 len)
|
||||
{
|
||||
return len >> qp->log_pmtu;
|
||||
}
|
||||
|
||||
extern const int ib_rvt_state_ops[];
|
||||
|
||||
struct rvt_dev_info;
|
||||
int rvt_error_qp(struct rvt_qp *qp, enum ib_wc_status err);
|
||||
|
|
|
|||
Loading…
Reference in a new issue