diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-12-08 06:34:37 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-11 23:29:42 +0300 |
commit | 5dc806052a9fc8c44e111646f9a9f436877749d0 (patch) | |
tree | 05d841ed7bcd9c4ffbbe51dddd9f63574bad09fb /drivers/infiniband/hw/hfi1/rc.c | |
parent | c64607aa8abd16ba584523bdf83a708fae91986a (diff) | |
download | linux-5dc806052a9fc8c44e111646f9a9f436877749d0.tar.xz |
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 <kaike.wan@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/rc.c')
-rw-r--r-- | drivers/infiniband/hw/hfi1/rc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c index ddc02237e5f6..9db260fe782a 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c @@ -2377,8 +2377,7 @@ send_last: * Update the next expected PSN. We add 1 later * below, so only add the remainder here. */ - if (len > pmtu) - qp->r_psn += (len - 1) / pmtu; + qp->r_psn += rvt_div_mtu(qp, len - 1); } else { e->rdma_sge.mr = NULL; e->rdma_sge.vaddr = NULL; |