Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7d80c83 authored by Mike Marciniszyn's avatar Mike Marciniszyn Committed by Doug Ledford
Browse files

IB/iser: Handle lack of memory management extentions correctly



max_fast_reg_page_list_len is only valid when the
memory management extentions are signaled by the underlying
driver.

Fix by adjusting iser_calc_scsi_params() to use
ISCSI_ISER_MAX_SG_TABLESIZE when the extentions are not indicated.

Reported-by: default avatarThomas Rosenstein <thomas.rosenstein@creamfinance.com>
Fixes: Commit df749cdc ("IB/iser: Support up to 8MB data transfer in a single command")
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Acked-by: default avatarSagi Grimberg <sagi@grimberg.me>
Tested-by: default avatarThomas Rosenstein <thomas.rosenstein@creamfinance.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 8e959601
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -708,8 +708,14 @@ iser_calc_scsi_params(struct iser_conn *iser_conn,
	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,
	if (device->ib_device->attrs.device_cap_flags &
			IB_DEVICE_MEM_MGT_EXTENSIONS)
		sup_sg_tablesize =
			min_t(
			 uint, ISCSI_ISER_MAX_SG_TABLESIZE,
			 device->ib_device->attrs.max_fast_reg_page_list_len);
	else
		sup_sg_tablesize = ISCSI_ISER_MAX_SG_TABLESIZE;

	iser_conn->scsi_sg_tablesize = min(sg_tablesize, sup_sg_tablesize);
}