From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B16EC04A68 for ; Thu, 28 Jul 2022 21:07:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232064AbiG1VH2 (ORCPT ); Thu, 28 Jul 2022 17:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233025AbiG1VHX (ORCPT ); Thu, 28 Jul 2022 17:07:23 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 625906D2D1; Thu, 28 Jul 2022 14:07:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1659042441; x=1690578441; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=mDjr9pk15K3HDo23mFhJv0WTCFDPNDJy6bT+G7ZkmPg=; b=HuXtV6E9CFuFK+MWnKCg2SaZN87ydRnc2GTwODYFr7GU1wtoozup+fL4 Wu2Tcn1xFHj3VLXY3AuuV74bOOjYlMR8dMjJBmtS1EMtkQJ0H7z8CLNRr ONIQ9E84UUlogSy8OcLjWdQ2mx1Q9VLjSgPJCUYh/Jdv2C8yjAPz0+K/i U=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 28 Jul 2022 14:07:21 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 14:07:20 -0700 Received: from [10.110.38.152] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 28 Jul 2022 14:07:19 -0700 Message-ID: <6da1447d-01d6-222e-fc98-7e96b154d2d0@quicinc.com> Date: Thu, 28 Jul 2022 14:07:19 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH 1/2] scsi: ufs: Add Multi-Circular Queue support To: Bart Van Assche , John Garry , Can Guo , , , , , , , , , CC: "James E.J. Bottomley" , "Martin K. Petersen" , Daejun Park , Jinyoung Choi , Kiwoong Kim , open list References: <1658214120-22772-1-git-send-email-quic_cang@quicinc.com> <1658214120-22772-2-git-send-email-quic_cang@quicinc.com> <10288041-8c3d-7e3a-9049-10b9fcd8baed@acm.org> From: "Asutosh Das (asd)" In-Reply-To: <10288041-8c3d-7e3a-9049-10b9fcd8baed@acm.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/28/2022 1:29 PM, Bart Van Assche wrote: > On 7/28/22 12:15, Asutosh Das (asd) wrote: >> Hello John, >> >> On 7/28/2022 12:10 PM, John Garry wrote: >>> On 19/07/2022 08:01, Can Guo wrote: >>>> + >>>> +    hba->nr_queues[HCTX_TYPE_DEFAULT] = num_possible_cpus(); >>>> +    hba->nr_queues[HCTX_TYPE_READ] = 0; >>>> +    hba->nr_queues[HCTX_TYPE_POLL] = 1; >>>> + >>>> +    for (i = 0; i < HCTX_MAX_TYPES; i++) >>>> +        host->nr_hw_queues += hba->nr_queues[i]; >>>> + >>>> +    host->can_queue = hba->nutrs; >>>> +    host->cmd_per_lun = hba->nutrs; >>>> + >>>> +    /* One more reserved for dev_cmd_queue */ >>>> +    hba->nr_hw_queues = host->nr_hw_queues + 1; >>>> + >>> >>> So this would mean that the host can accept .can_queue * >>> .nr_hw_queues numbers of requests simultaneously - is that true? >> >> That would mean that .can_queue * .nr_hw_queues numbers of request may >> be queued to the host. >> Please can you elaborate if you see an issue. > > Hi Asutosh, > > The `host_tagset` flag has been introduced by John and Hannes some time > ago. See also commit bdb01301f3ea ("scsi: Add host and host template > flag 'host_tagset'"). This flag supports sharing tags across hardware > queues and could be used to support UFSHCI 4.0 controllers that do not > support the EXT_IID feature. > > In order not to complicate the implementation further, I propose to fall > back to the UFSHCI 3.0 compatibility mode for UFSHCI 4.0 controllers > that do not support the EXT_IID feature. > > To answer John's question: the maximum number of outstanding commands is > 16 * hba->nutrs if EXT_IID is supported (EXT_IID is a four bits field). > If the hardware queue index is encoded in the EXT_IID field, hba->nutrs > is the number of commands per hardware queue. > > Thanks, > > Bart. Thanks Bart, I wasn't aware of the background of John's Q. I will consider your proposal and get back. -asd