From patchwork Tue Jun 19 14:59:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 10474653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EB71603B5 for ; Tue, 19 Jun 2018 14:59:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4F828A9C for ; Tue, 19 Jun 2018 14:59:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12D4D28AAE; Tue, 19 Jun 2018 14:59:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A184628A9C for ; Tue, 19 Jun 2018 14:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757293AbeFSO7M (ORCPT ); Tue, 19 Jun 2018 10:59:12 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36756 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757276AbeFSO7M (ORCPT ); Tue, 19 Jun 2018 10:59:12 -0400 Received: by mail-wm0-f65.google.com with SMTP id v131-v6so1053364wma.1 for ; Tue, 19 Jun 2018 07:59:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aO/NGoJQttHaUKa31DoXwn2d6GlujRe8j7xzb1A5Knw=; b=TAVU6EW9dB2v7IHpmmQFjISg+JTzdh/fiYXd+w/i1X1Uxqz0eO8TFgnA+Ik4Jgkawd VQN9Kfp80pCbGxs8QJVmA5YhFvfYMuaagcpQGQuSEAWE2u0a/fSCm82g236J2LKcEm8U fXEtQ2uARbE4cwHF8BjC3gUlDVAel5IzP02Kd93j6M+q5+x7CmLB4nRXC/qX1iHwqoLz EBGy+dFyVx08TyTa5HWWqmfwklzvtJGADyBeZwFomuQg68Cq4O4Kiw5mgTs/KeuspDib XBcLjudoma2yZ3rhYCS6QN7pjWNITddgZ7xWOjfoSyHuBV2yc7iatLp7NQoDlLVKlfZg jKMw== X-Gm-Message-State: APt69E06x7PKaGfHcd9LdQhGFbsySzz8DkOyDNFdScNLNVlKCIQL7hiQ kfUwh8rF4bVoqbOArX5QUbXQsY3p X-Google-Smtp-Source: ADUXVKKsoGXnRw3HAguEiWDzIi7iIkwod8m8r8yH7eRCnSW2EBhS+KyGzXM6W9sdj9zdxclr9JcoSQ== X-Received: by 2002:a1c:8bc3:: with SMTP id n186-v6mr11834993wmd.34.1529420350879; Tue, 19 Jun 2018 07:59:10 -0700 (PDT) Received: from [192.168.64.169] (bzq-219-42-90.isdn.bezeqint.net. [62.219.42.90]) by smtp.gmail.com with ESMTPSA id o12-v6sm35572817wrf.30.2018.06.19.07.59.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 07:59:10 -0700 (PDT) Subject: Re: ISER blk-mq tags To: Karandeep Chahal , linux-rdma@vger.kernel.org References: <00aaee188786a0523ddc9937e076f74e1d37fa0f.camel@gmail.com> From: Sagi Grimberg Message-ID: Date: Tue, 19 Jun 2018 17:59:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <00aaee188786a0523ddc9937e076f74e1d37fa0f.camel@gmail.com> Content-Language: en-US Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP > Hi, Hi Karan, > I have run in to a problem where it seems like an ISER initiator cannot > submit more than 128 commands to the target (per scsi host). I tried to > debug this and found that when iscsi_host_add() is called, > Scsi_Host>can_queue is unset. This causes iscsi_host_add() to use the > default qdepth (128) when creating the scsi host's blk-mq in > scsi_add_host(). After the call to iscsi_host_add() shost->can_queue is > set to the correct value, however by then the blk-mq is already created > with the wrong nuber of tags. > > This causes the queue depth not to exceed 128. > > Please advise if this is the expected behaviour. Have I missed > something? It appears that other drivers that call scsi_add_host() set > can_queue before the function call. Thanks for reporting, you are correct, this can be easily fixed, does the below patch fix your issue: --- if (iser_conn->state != ISER_CONN_UP) { @@ -660,6 +660,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, } mutex_unlock(&iser_conn->state_mutex); } else { + shost->can_queue = min_t(u16, cmds_max, ISER_DEF_XMIT_CMDS_MAX); max_cmds = ISER_DEF_XMIT_CMDS_MAX; if (iscsi_host_add(shost, NULL)) goto free_host; @@ -678,12 +679,6 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, iser_conn, shost->sg_tablesize, shost->max_sectors); - if (cmds_max > max_cmds) { - iser_info("cmds_max changed from %u to %u\n", - cmds_max, max_cmds); - cmds_max = max_cmds; - } - cls_session = iscsi_session_setup(&iscsi_iser_transport, shost, cmds_max, 0, sizeof(struct iscsi_iser_task), @@ -692,7 +687,6 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, goto remove_host; session = cls_session->dd_data; - shost->can_queue = session->scsi_cmds_max; return cls_session; remove_host: -- -- 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 --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 0336643c2ed6..434ae88ff623 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -633,8 +633,8 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, */ if (ep) { iser_conn = ep->dd_data; - max_cmds = iser_conn->max_cmds; shost->sg_tablesize = iser_conn->scsi_sg_tablesize; + shost->can_queue = min_t(u16, cmds_max, iser_conn->max_cmds); mutex_lock(&iser_conn->state_mutex);