|
@@ -58,13 +58,6 @@ static inline bool rdma_rw_io_needs_mr(struct ib_device *dev, u8 port_num,
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-static inline u32 rdma_rw_max_sge(struct ib_device *dev,
|
|
|
- enum dma_data_direction dir)
|
|
|
-{
|
|
|
- return dir == DMA_TO_DEVICE ?
|
|
|
- dev->attrs.max_sge : dev->attrs.max_sge_rd;
|
|
|
-}
|
|
|
-
|
|
|
static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev)
|
|
|
{
|
|
|
/* 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,
|
|
|
u64 remote_addr, u32 rkey, enum dma_data_direction dir)
|
|
|
{
|
|
|
struct ib_device *dev = qp->pd->device;
|
|
|
- u32 max_sge = rdma_rw_max_sge(dev, dir);
|
|
|
+ u32 max_sge = dir == DMA_TO_DEVICE ? qp->max_write_sge :
|
|
|
+ qp->max_read_sge;
|
|
|
struct ib_sge *sge;
|
|
|
u32 total_len = 0, i, j;
|
|
|
|