Lines Matching refs:sg
91 struct rdma_rw_reg_ctx *reg, struct scatterlist *sg, in rdma_rw_init_one_mr() argument
105 ret = ib_map_mr_sg(reg->mr, sg, nents, &offset, PAGE_SIZE); in rdma_rw_init_one_mr()
124 u32 port_num, struct scatterlist *sg, u32 sg_cnt, u32 offset, in rdma_rw_init_mr_wrs() argument
143 ret = rdma_rw_init_one_mr(qp, port_num, reg, sg, sg_cnt, in rdma_rw_init_mr_wrs()
175 sg = sg_next(sg); in rdma_rw_init_mr_wrs()
195 struct scatterlist *sg, u32 sg_cnt, u32 offset, in rdma_rw_init_map_wrs() argument
226 for (j = 0; j < nr_sge; j++, sg = sg_next(sg)) { in rdma_rw_init_map_wrs()
227 sge->addr = sg_dma_address(sg) + offset; in rdma_rw_init_map_wrs()
228 sge->length = sg_dma_len(sg) - offset; in rdma_rw_init_map_wrs()
251 struct scatterlist *sg, u32 offset, u64 remote_addr, u32 rkey, in rdma_rw_init_single_wr() argument
259 ctx->single.sge.addr = sg_dma_address(sg) + offset; in rdma_rw_init_single_wr()
260 ctx->single.sge.length = sg_dma_len(sg) - offset; in rdma_rw_init_single_wr()
276 static void rdma_rw_unmap_sg(struct ib_device *dev, struct scatterlist *sg, in rdma_rw_unmap_sg() argument
279 if (is_pci_p2pdma_page(sg_page(sg))) in rdma_rw_unmap_sg()
280 pci_p2pdma_unmap_sg(dev->dma_device, sg, sg_cnt, dir); in rdma_rw_unmap_sg()
282 ib_dma_unmap_sg(dev, sg, sg_cnt, dir); in rdma_rw_unmap_sg()
285 static int rdma_rw_map_sg(struct ib_device *dev, struct scatterlist *sg, in rdma_rw_map_sg() argument
288 if (is_pci_p2pdma_page(sg_page(sg))) { in rdma_rw_map_sg()
291 return pci_p2pdma_map_sg(dev->dma_device, sg, sg_cnt, dir); in rdma_rw_map_sg()
293 return ib_dma_map_sg(dev, sg, sg_cnt, dir); in rdma_rw_map_sg()
312 struct scatterlist *sg, u32 sg_cnt, u32 sg_offset, in rdma_rw_ctx_init() argument
318 ret = rdma_rw_map_sg(dev, sg, sg_cnt, dir); in rdma_rw_ctx_init()
327 u32 len = sg_dma_len(sg); in rdma_rw_ctx_init()
332 sg = sg_next(sg); in rdma_rw_ctx_init()
342 ret = rdma_rw_init_mr_wrs(ctx, qp, port_num, sg, sg_cnt, in rdma_rw_ctx_init()
345 ret = rdma_rw_init_map_wrs(ctx, qp, sg, sg_cnt, sg_offset, in rdma_rw_ctx_init()
348 ret = rdma_rw_init_single_wr(ctx, qp, sg, sg_offset, in rdma_rw_ctx_init()
357 rdma_rw_unmap_sg(dev, sg, sg_cnt, dir); in rdma_rw_ctx_init()
380 u32 port_num, struct scatterlist *sg, u32 sg_cnt, in rdma_rw_ctx_signature_init() argument
397 ret = rdma_rw_map_sg(dev, sg, sg_cnt, dir); in rdma_rw_ctx_signature_init()
429 ret = ib_map_mr_sg_pi(ctx->reg->mr, sg, sg_cnt, NULL, prot_sg, in rdma_rw_ctx_signature_init()
474 rdma_rw_unmap_sg(dev, sg, sg_cnt, dir); in rdma_rw_ctx_signature_init()
585 u32 port_num, struct scatterlist *sg, u32 sg_cnt, in rdma_rw_ctx_destroy() argument
607 rdma_rw_unmap_sg(qp->pd->device, sg, sg_cnt, dir); in rdma_rw_ctx_destroy()
624 u32 port_num, struct scatterlist *sg, u32 sg_cnt, in rdma_rw_ctx_destroy_signature() argument
636 rdma_rw_unmap_sg(qp->pd->device, sg, sg_cnt, dir); in rdma_rw_ctx_destroy_signature()