Skip to content

Commit 6834844

Browse files
sagigrimbergjgunthorpe
authored andcommitted
IB/iser: set can_queue earlier to allow setting higher queue depth
We need to set can_queue earlier than when enabling the scsi host. in a blk-mq enabled environment, the tagset allocation is taken from can_queue which cannot be modified later. Also, pass an updated .can_queue to iscsi_session_setup to have enough iscsi tasks allocated in the session kfifo. Reported-by: Karandeep Chahal <[email protected]> Signed-off-by: Sagi Grimberg <[email protected]> Reviewed-by: Max Gurtovoy <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 24c937b commit 6834844

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/infiniband/ulp/iser/iscsi_iser.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
633633
*/
634634
if (ep) {
635635
iser_conn = ep->dd_data;
636-
max_cmds = iser_conn->max_cmds;
637636
shost->sg_tablesize = iser_conn->scsi_sg_tablesize;
637+
shost->can_queue = min_t(u16, cmds_max, iser_conn->max_cmds);
638638

639639
mutex_lock(&iser_conn->state_mutex);
640640
if (iser_conn->state != ISER_CONN_UP) {
@@ -660,6 +660,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
660660
}
661661
mutex_unlock(&iser_conn->state_mutex);
662662
} else {
663+
shost->can_queue = min_t(u16, cmds_max, ISER_DEF_XMIT_CMDS_MAX);
663664
max_cmds = ISER_DEF_XMIT_CMDS_MAX;
664665
if (iscsi_host_add(shost, NULL))
665666
goto free_host;
@@ -676,21 +677,14 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
676677
iser_warn("max_sectors was reduced from %u to %u\n",
677678
iser_max_sectors, shost->max_sectors);
678679

679-
if (cmds_max > max_cmds) {
680-
iser_info("cmds_max changed from %u to %u\n",
681-
cmds_max, max_cmds);
682-
cmds_max = max_cmds;
683-
}
684-
685680
cls_session = iscsi_session_setup(&iscsi_iser_transport, shost,
686-
cmds_max, 0,
681+
shost->can_queue, 0,
687682
sizeof(struct iscsi_iser_task),
688683
initial_cmdsn, 0);
689684
if (!cls_session)
690685
goto remove_host;
691686
session = cls_session->dd_data;
692687

693-
shost->can_queue = session->scsi_cmds_max;
694688
return cls_session;
695689

696690
remove_host:

0 commit comments

Comments
 (0)