diff mbox

[PATCHv2,1/2] IB/iser: Fix sg_tablesize calculation

Message ID 1484664446-15535-1-git-send-email-maxg@mellanox.com (mailing list archive)
State Superseded
Headers show

Commit Message

Max Gurtovoy Jan. 17, 2017, 2:47 p.m. UTC
For devices that can register page list that is bigger than
USHRT_MAX, we actually take the wrong value for sg_tablesize.
E.g: for CX4 max_fast_reg_page_list_len is 65536 (bigger than USHRT_MAX)
so we set sg_tablesize to 0 by mistake. Therefore, each IO that is
bigger than 4k splitted to "< 4k" chunks that cause performance degredation.
Remove wrong sg_tablesize assignment, and use the value that was set during
address resolution handler with the needed casting.

Fixes: 911f4331bc87 ("IB/mlx5: Expose correct max_fast_reg_page_list_len")
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
---
Changes since v1:
 - update "Fixes" statement
 - use sg_tablesize assignment from iser_calc_scsi_params()
 - add patch 2/2 to remove unneeded variable
---
 drivers/infiniband/ulp/iser/iscsi_iser.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

Comments

Sagi Grimberg Jan. 17, 2017, 3:54 p.m. UTC | #1
> For devices that can register page list that is bigger than
> USHRT_MAX, we actually take the wrong value for sg_tablesize.
> E.g: for CX4 max_fast_reg_page_list_len is 65536 (bigger than USHRT_MAX)
> so we set sg_tablesize to 0 by mistake. Therefore, each IO that is
> bigger than 4k splitted to "< 4k" chunks that cause performance degredation.
> Remove wrong sg_tablesize assignment, and use the value that was set during
> address resolution handler with the needed casting.
>
> Fixes: 911f4331bc87 ("IB/mlx5: Expose correct max_fast_reg_page_list_len")

That's not correct, the patch was a fix which exposed a bug in iser
that was broken anyway. Let's remove it.

Other than that, looks good,

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 9104e6b..1c91187 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -651,13 +651,6 @@  static void iscsi_iser_cleanup_task(struct iscsi_task *task)
 						   SHOST_DIX_GUARD_CRC);
 		}
 
-		/*
-		 * Limit the sg_tablesize and max_sectors based on the device
-		 * max fastreg page list length.
-		 */
-		shost->sg_tablesize = min_t(unsigned short, shost->sg_tablesize,
-			ib_conn->device->ib_device->attrs.max_fast_reg_page_list_len);
-
 		if (iscsi_host_add(shost,
 				   ib_conn->device->ib_device->dma_device)) {
 			mutex_unlock(&iser_conn->state_mutex);