Thread (124 messages) 124 messages, 18 authors, 2018-03-09

Re: [PATCH v2 06/10] IB/core: Add optional PCI P2P flag to rdma_rw_ctx_[init|destroy]()

From: Logan Gunthorpe <hidden>
Date: 2018-03-01 17:16:55
Also in: linux-block, linux-nvme, linux-pci, lkml, nvdimm

Hey Sagi,

Thanks for the review!


On 01/03/18 03:32 AM, Sagi Grimberg wrote:
quoted
  int rdma_rw_ctx_init(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8 
port_num,
          struct scatterlist *sg, u32 sg_cnt, u32 sg_offset,
-        u64 remote_addr, u32 rkey, enum dma_data_direction dir)
+        u64 remote_addr, u32 rkey, enum dma_data_direction dir,
+        unsigned int flags)
  {
      struct ib_device *dev = qp->pd->device;
      int ret;
-    ret = ib_dma_map_sg(dev, sg, sg_cnt, dir);
+    if (flags & RDMA_RW_CTX_FLAG_PCI_P2PDMA)
+        ret = pci_p2pdma_map_sg(dev->dma_device, sg, sg_cnt, dir);
+    else
+        ret = ib_dma_map_sg(dev, sg, sg_cnt, dir);
+
Why not use is_pci_p2pdma_page(sg) instead of a flag? It would be so
much cleaner...
Yes, that sounds like a good idea. We can make that change for v3.

Logan
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help