Commit 42632896 authored by Steve Wise's avatar Steve Wise Committed by Roland Dreier

RDMA/cxgb3: Remove modulo math from build_rdma_recv()

Remove modulo usage to avoid a divide in the fast path (not all
gcc versions do strength reduction here).
Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 42fb61f0
...@@ -263,8 +263,8 @@ static int build_rdma_recv(struct iwch_qp *qhp, union t3_wr *wqe, ...@@ -263,8 +263,8 @@ static int build_rdma_recv(struct iwch_qp *qhp, union t3_wr *wqe,
wqe->recv.sgl[i].len = cpu_to_be32(wr->sg_list[i].length); wqe->recv.sgl[i].len = cpu_to_be32(wr->sg_list[i].length);
/* to in the WQE == the offset into the page */ /* to in the WQE == the offset into the page */
wqe->recv.sgl[i].to = cpu_to_be64(((u32) wr->sg_list[i].addr) % wqe->recv.sgl[i].to = cpu_to_be64(((u32)wr->sg_list[i].addr) &
(1UL << (12 + page_size[i]))); ((1UL << (12 + page_size[i])) - 1));
/* pbl_addr is the adapters address in the PBL */ /* pbl_addr is the adapters address in the PBL */
wqe->recv.pbl_addr[i] = cpu_to_be32(pbl_addr[i]); wqe->recv.pbl_addr[i] = cpu_to_be32(pbl_addr[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment