Re: [PATCH v4 2/5] IB/core, RDMA RW API: Do not exceed QP SGE send limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/27/2016 05:42 AM, Leon Romanovsky wrote:
On Thu, Jul 21, 2016 at 01:03:30PM -0700, Bart Van Assche wrote:
 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;

Bart,
I'm sure that I missed something.

Can "dir" be DMA_BIDIRECTIONAL?
If yes, mxa_sge will be min(max_write_sge, max_read_sge).

Hello Leon,

The RDMA R/W API is intended for target drivers. None of the upstream target drivers (ib_isert, ib_srpt, nvmet) that use the RDMA R/W API support bidi commands today. And even if such support would be added, these target drivers should perform RDMA READs and WRITEs in two phases. So I do not expect that "dir" will ever be equal to DMA_BIDIRECTIONAL in the above code.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux