Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp510251yba; Thu, 18 Apr 2019 05:15:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgJhkjQ7H02u0wgvW4TsK0dS3qIv4t7E4TXkoOzaL5ww4kDg5nj5gzC8HcYzLB/IJrB9Ei X-Received: by 2002:aa7:960c:: with SMTP id q12mr5966331pfg.258.1555589712744; Thu, 18 Apr 2019 05:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555589712; cv=none; d=google.com; s=arc-20160816; b=0GuXiL9++EocjBUV+3XMGVZUGTvn9eZBbxOgMikKqIZrfvKY7M2XEggQeeltCS1f7D nsdmq1QSItlGqpBb4LdNwqTw4Jhhys5vAznAn1LaRc7zgHL6kqxCJhgmINv4Jj19EvF5 zNyfuDV2ar+/9e9aPR3f8a2hn3MMGyQcbRrmjjwGscslj9SqJBAPiLSttqpuSFQCYR3M GjKbZtzQxGvOiynXReykS/d0mLXizbQofxU4UpYsW/L+j4Gx7jKr8vy8OUiU/uXEPgA5 pebsNX53o8uCwzdbFiMsd6vgRbhv5rk0ysT+Djhn4eFY2rBoLKANBCjKKtjCffvIsQow BvLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=VVWbBy4grUnMdIPtpRFfpRTHvYGJcNOcN44fXPxQV6Q=; b=pkHFXcdo4lUpYJJ5TrwAGWtvOJpQzTpdRxU18uuTgCfj4ROSakx39STpcbBWdomdOY B5FV48kRXfmdeZGkcmhinTELiiJHicks55lPKrghubgHhmWspptF1knwQpr/eUl5JmNv syv5Zo04u1dNSy7FhMRX1crPEUNQfjaD/U+YhSveeYOmGmsoB6utomqC2tiF4VveORQN 3GKVJ0s+bEeiX2OGIbvaK7pGtkyRcSe7LQOOhfYMGp+fEoddVm6sNgSLKPBG3ULyY7ew Ber+ht8RqB+wCFfRIisAh/HLgq7k1MSNfrc2cCRwKIi2jCX1zxw1UYlSUucpxaMfwRHa Njqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YX6hIvRl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c71si2304401pfb.138.2019.04.18.05.14.56; Thu, 18 Apr 2019 05:15:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YX6hIvRl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388864AbfDRMNk (ORCPT + 99 others); Thu, 18 Apr 2019 08:13:40 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37661 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387519AbfDRMNk (ORCPT ); Thu, 18 Apr 2019 08:13:40 -0400 Received: by mail-pf1-f193.google.com with SMTP id 8so1038953pfr.4 for ; Thu, 18 Apr 2019 05:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=VVWbBy4grUnMdIPtpRFfpRTHvYGJcNOcN44fXPxQV6Q=; b=YX6hIvRlUGn2fx9qlCF8+4JlhEmDssqvUvbjYxjVlHsfBTWkrcnaSaIRgOYi3XPo/7 jMYyiA/aJS42mjmec2L6jJzwVIL06HdQOljYvxOIXujI27xSFCzsy9gzVWteWic6M6eQ NFZI/6/3FJgQeQtnb1CjOTZ7iuj8qNORmdvhBqnrLvAATr35ktvQSieJJ0pXsUVQCGUp VUz5yXZgqNNKBGXSK8ZQfDxl1pFyJTosmoi6CY7aHjw688/T+39Ub8U3OyFL0ASi/tc+ b2vltukpFlTx/z3Fx1GTZNQCgRSyUGtcZgoXYWuEyHevClqBDEjyyQhfdRHYzMf21EL5 Esxw== 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=VVWbBy4grUnMdIPtpRFfpRTHvYGJcNOcN44fXPxQV6Q=; b=n/+ZV/veoPo0lz5LvJP35g4BsmTuFzCmskeE4qwOI4eYramU+Kx1wGGbujM8V3LtJh BTO3OhK1r0sZL5WUgqeN3B2e8+ou0ARrGrDS0dNY9Tw5hqOCjV4n1/lM4b9lJQsN2Tyw GvaBs707NrVIK4V+uguluQKelC8GVGf/5HF9ZwI5oBDZh2ytfKJ6OW58fcNEVTbtQePg 5CHjYHkZ2/+9vr7Vq8wTqHIlwJewOj6d+LD2CggM4tQRwGDr+54MBo7v4CCK5myLBuH8 wSPTIaYJepxRzUdMlBPl32aI+QsShB1FHKIpRt/Bfm2HUxfjkeuWJq8S4VlJ2MeB9gGw 4dZA== X-Gm-Message-State: APjAAAUfU4MWkx452yrVPE/VpmBofvNlAcvYqFvitbJAXLXxCaZ5DKJO Nnqo12dOvUjIrfU3SAkyINk= X-Received: by 2002:aa7:9465:: with SMTP id t5mr5961827pfq.247.1555589619616; Thu, 18 Apr 2019 05:13:39 -0700 (PDT) Received: from [192.168.0.6] ([123.213.206.190]) by smtp.gmail.com with ESMTPSA id s79sm4073986pfa.31.2019.04.18.05.13.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 05:13:38 -0700 (PDT) Subject: Re: [PATCH] nvme: determine the number of IO queues To: Aaron Ma , Maxim Levitsky , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, keith.busch@intel.com, axboe@fb.com References: <1555510379-20199-1-git-send-email-aaron.ma@canonical.com> <096935354b16662eb481aeda1f48001ba489463c.camel@redhat.com> From: Minwoo Im Message-ID: <99ab1942-9c38-695d-03dc-ea6eecb31217@gmail.com> Date: Thu, 18 Apr 2019 21:13:35 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/18/19 3:21 PM, Aaron Ma wrote: > On 4/18/19 1:33 AM, Maxim Levitsky wrote: >> On Wed, 2019-04-17 at 20:32 +0300, Maxim Levitsky wrote: >>> On Wed, 2019-04-17 at 22:12 +0800, Aaron Ma wrote: >>>> Some controllers support limited IO queues, when over set >>>> the number, it will return invalid field error. >>>> Then NVME will be removed by driver. >>>> >>>> Find the max number of IO queues that controller supports. >>>> When it still got invalid result, set 1 IO queue at least to >>>> bring NVME online. >>> To be honest a spec compliant device should not need this. >>> The spec states: >>> >>> "Number of I/O Completion Queues Requested (NCQR): Indicates the number of I/O >>> Completion >>> Queues requested by software. This number does not include the Admin >>> Completion >>> Queue. A >>> minimum of one queue shall be requested, reflecting that the minimum support >>> is >>> for one I/O >>> Completion Queue. This is a 0’s based value. The maximum value that may be >>> specified is 65,534 >>> (i.e., 65,535 I/O Completion Queues). If the value specified is 65,535, the >>> controller should return >>> an error of Invalid Field in Command." >>> >>> >>> This implies that you can ask for any value and the controller must not >>> respond >>> with an error, but rather indicate how many queues it supports. >>> >>> Maybe its better to add a quirk for the broken device, which needs this? > > Adding quirk only makes the code more complicated. > This patch doesn't change the default behavior. > Only handle the NVME error code. > > Yes the IO queues number is 0's based, but driver would return error and > remove the nvme device as dead. IMHO, if a controller indicates an error with this set_feature command, then we need to figure out why the controller was returning the error to host. If you really want to use at least a single queue to see an alive I/O queue, controller should not return the error because as you mentioned above, NCQA, NSQA will be returned as 0-based. If an error is there, that could mean that controller may not able to provide even a single queue for I/O. Thanks, Minwoo Im > > So set it as 1 at least the NVME can be probed properly. > > Regards, > Aaron > >> I forgot to add the relevant paragraph: >> >> "Note: The value allocated may be smaller or larger than the number of queues >> requested, often in virtualized >> implementations. The controller may not have as many queues to allocate as are >> requested. Alternatively, >> the controller may have an allocation unit of queues (e.g. power of two) and may >> supply more queues to >> host software to satisfy its allocation unit." >> >> >> Best regards, >> Maxim Levitsky >> > > _______________________________________________ > Linux-nvme mailing list > Linux-nvme@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-nvme >