Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1721968ybb; Fri, 29 Mar 2019 09:59:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxx6tnQcRIyB2CAkODdGnIxQfCRabnxWZOzccNYikxKpC1iWM0tiXxyxZaNaf1mMyo2u7hW X-Received: by 2002:a63:d709:: with SMTP id d9mr30366443pgg.38.1553878760484; Fri, 29 Mar 2019 09:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553878760; cv=none; d=google.com; s=arc-20160816; b=a0Emi17OcOyYRWhYeZiBXEutYABdAsGjd6nxtWJM/dpUZ6uoPTNknEscNKmhp8UGaH zX4OAIL4b71iEIR0/aUtflfDofHgGcH90wJDS0Qv6JVCrtT9tmJNpBbBaP8qWum8ieEL vFlItX1SX9yPwhw+9Ll0LGE91P5POe57MPNc/zO4SdlTALe1trO5ZVQ9pksifH9N1sUx +AtRARwgAkVGMpWy7XU0yP6VLjmTyPG/mjNjz1LXHMoskKjHlNYlbZvcc6UGyoawewzm 2sJ8IAGSFHe1SPIY8UI9a4Nh5137V8KrckUeZ86WahiXIHmywY+yRmEvwx/HbtqFRkt7 HeuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=7R5884PCI5jNZdgHo3YbdClvhTOU7xN0A0l8PVSUv5s=; b=sCJVtryjFzJCs147LG2yWYq28+ip0la2zjxb7F6NaJy/afLequvhRVL+FR6gJpbuo4 dF9nG/ZrzcjHJlboJXfjoW51qgPvw4byvYY3gJzLmz1qRjrng+Go0Vikl1wdFGFO9gyY Hfb0ir1gOyqW6Y+iw5rp7pYLJFq7yI2GZSl3nyasdauOuXJLG+KC4VUwMzVFtZkIib8I jWRqSDT0q9YYI6Aky55bVZhQHH0sdB5ISX09xycv3jmgg2HHVLC8+vFf4EOX2cItUAQu zWg7yOwbzQ6P4cqQ+LBwkD7ONVsjxkPdqGqXwtU4RNKmtDnYYIy/MHqvu58i7WDAGd7w 3T2w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si2258789plo.202.2019.03.29.09.59.04; Fri, 29 Mar 2019 09:59:20 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729780AbfC2Q62 (ORCPT + 99 others); Fri, 29 Mar 2019 12:58:28 -0400 Received: from mga03.intel.com ([134.134.136.65]:1393 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729480AbfC2Q61 (ORCPT ); Fri, 29 Mar 2019 12:58:27 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 09:58:27 -0700 X-IronPort-AV: E=Sophos;i="5.60,285,1549958400"; d="scan'208";a="129815367" Received: from unknown (HELO [10.232.112.178]) ([10.232.112.178]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/AES128-SHA; 29 Mar 2019 09:58:26 -0700 Subject: Re: [PATCH v3 4/7] nvme: register stream info with block layer To: Kanchan Joshi , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Cc: axboe@fb.com, joshiiitr@gmail.com, prakash.v@samsung.com, anshul@samsung.com References: <1553846032-4451-1-git-send-email-joshi.k@samsung.com> <1553846032-4451-5-git-send-email-joshi.k@samsung.com> From: "Heitke, Kenneth" Message-ID: <87e172d4-dcc2-d0db-9bd1-b76afc7a9d01@intel.com> Date: Fri, 29 Mar 2019 10:58:25 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1553846032-4451-5-git-send-email-joshi.k@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/29/2019 1:53 AM, Kanchan Joshi wrote: > nvme registes number of streams with block layer, which will use that s/registes/registers/ ?? > for write-hint to streamid conversion. Registration is done for each > namespace. Since NVMe spec allow all available streams (within subsystem) > to be used by all namespaces, no attempt has been made to add reservation > at namespace level. > > Signed-off-by: Kanchan Joshi > --- > drivers/nvme/host/core.c | 19 ++++++------------- > 1 file changed, 6 insertions(+), 13 deletions(-) > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 150e497..e34386b 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -513,14 +513,7 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl) > return ret; > > ctrl->nssa = le16_to_cpu(s.nssa); > - if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) { > - dev_info(ctrl->device, "too few streams (%u) available\n", > - ctrl->nssa); > - nvme_disable_streams(ctrl); > - return 0; > - } > - > - ctrl->nr_streams = min_t(unsigned, ctrl->nssa, BLK_MAX_WRITE_HINTS - 1); > + ctrl->nr_streams = ctrl->nssa; > dev_info(ctrl->device, "Using %u streams\n", ctrl->nr_streams); > return 0; > } > @@ -533,12 +526,9 @@ static void nvme_assign_write_stream(struct nvme_ctrl *ctrl, > struct request *req, u16 *control, > u32 *dsmgmt) > { > - enum rw_hint streamid = req->write_hint; > + enum rw_hint streamid = req->streamid; > > - if (streamid == WRITE_LIFE_NOT_SET || streamid == WRITE_LIFE_NONE) > - streamid = 0; > - else { > - streamid--; > + if (streamid != 0) { > if (WARN_ON_ONCE(streamid > ctrl->nr_streams)) > return; > > @@ -3138,6 +3128,7 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns) > { > struct streams_directive_params s; > int ret; > + u16 nr_streams; > > if (!ctrl->nr_streams) > return 0; > @@ -3149,6 +3140,8 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns) > ns->sws = le32_to_cpu(s.sws); > ns->sgs = le16_to_cpu(s.sgs); > > + nr_streams = min_t(unsigned, ctrl->nr_streams, BLK_MAX_WRITE_HINTS - 1); > + blk_queue_stream_limits(ns->queue, nr_streams); > if (ns->sws) { > unsigned int bs = 1 << ns->lba_shift; >