Re: [PATCH 20/22] IB/iser: Support up to 8MB data transfer in a single command

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

 




+static void
+iser_calc_scsi_params(struct iser_conn *iser_conn,
+              unsigned int max_sectors)
+{
+    struct iser_device *device = iser_conn->ib_conn.device;
+    unsigned short sg_tablesize, sup_sg_tablesize;
+
+    sg_tablesize = DIV_ROUND_UP(max_sectors * 512, SIZE_4K);
+    sup_sg_tablesize = min_t(unsigned, ISCSI_ISER_MAX_SG_TABLESIZE,
+                 device->dev_attr.max_fast_reg_page_list_len);
+
+    if (sg_tablesize > sup_sg_tablesize) {
+        sg_tablesize = sup_sg_tablesize;
+        iser_conn->scsi_max_sectors = sg_tablesize * SIZE_4K / 512;
+    } else {
+        iser_conn->scsi_max_sectors = max_sectors;
+    }
+

Why SIZE_4K and not PAGE_SIZE?

Yes, I'll change that to PAGE_SIZE.

Thanks.
--
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