Skip to content

Commit e7d80c8

Browse files
mmarcinidledford
authored andcommitted
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: Thomas Rosenstein <[email protected]> Fixes: Commit df749cd ("IB/iser: Support up to 8MB data transfer in a single command") Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Acked-by: Sagi Grimberg <[email protected]> Tested-by: Thomas Rosenstein <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent 8e95960 commit e7d80c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/infiniband/ulp/iser/iser_verbs.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,14 @@ iser_calc_scsi_params(struct iser_conn *iser_conn,
708708
unsigned short sg_tablesize, sup_sg_tablesize;
709709

710710
sg_tablesize = DIV_ROUND_UP(max_sectors * 512, SIZE_4K);
711-
sup_sg_tablesize = min_t(unsigned, ISCSI_ISER_MAX_SG_TABLESIZE,
712-
device->ib_device->attrs.max_fast_reg_page_list_len);
711+
if (device->ib_device->attrs.device_cap_flags &
712+
IB_DEVICE_MEM_MGT_EXTENSIONS)
713+
sup_sg_tablesize =
714+
min_t(
715+
uint, ISCSI_ISER_MAX_SG_TABLESIZE,
716+
device->ib_device->attrs.max_fast_reg_page_list_len);
717+
else
718+
sup_sg_tablesize = ISCSI_ISER_MAX_SG_TABLESIZE;
713719

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

0 commit comments

Comments
 (0)