aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/rw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/rw.c')
-rw-r--r--drivers/infiniband/core/rw.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
index 1ad2baaa6c8c..dbfd854c32c9 100644
--- a/drivers/infiniband/core/rw.c
+++ b/drivers/infiniband/core/rw.c
@@ -58,13 +58,6 @@ static inline bool rdma_rw_io_needs_mr(struct ib_device *dev, u8 port_num,
58 return false; 58 return false;
59} 59}
60 60
61static inline u32 rdma_rw_max_sge(struct ib_device *dev,
62 enum dma_data_direction dir)
63{
64 return dir == DMA_TO_DEVICE ?
65 dev->attrs.max_sge : dev->attrs.max_sge_rd;
66}
67
68static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev) 61static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev)
69{ 62{
70 /* arbitrary limit to avoid allocating gigantic resources */ 63 /* arbitrary limit to avoid allocating gigantic resources */
@@ -186,7 +179,8 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
186 u64 remote_addr, u32 rkey, enum dma_data_direction dir) 179 u64 remote_addr, u32 rkey, enum dma_data_direction dir)
187{ 180{
188 struct ib_device *dev = qp->pd->device; 181 struct ib_device *dev = qp->pd->device;
189 u32 max_sge = rdma_rw_max_sge(dev, dir); 182 u32 max_sge = dir == DMA_TO_DEVICE ? qp->max_write_sge :
183 qp->max_read_sge;
190 struct ib_sge *sge; 184 struct ib_sge *sge;
191 u32 total_len = 0, i, j; 185 u32 total_len = 0, i, j;
192 186