Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp695535pxu; Wed, 2 Dec 2020 00:32:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwcPQ4oiGmI8TzQQ/jROWzQ7jcmhUIr99ToGtIcw2SlDTchYzdsmpNoOFpJLuc1h1PgP+6i X-Received: by 2002:a17:906:13d2:: with SMTP id g18mr1326246ejc.76.1606897968776; Wed, 02 Dec 2020 00:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606897968; cv=none; d=google.com; s=arc-20160816; b=ar2W9UXu3FYg9WQmOcS5dwzN2DSiJwabof4Cqe1BXkiMA3Xqwktv69bKZjxb7uHIDI /2MBSlISwzU6A1dLNGbBiZnj2wMEL+lA7VV7yT+VW7sdh0a9uu39ZJnpHOsmp2ImzjWY rysnbwWIg8q0QphIQiVAbpg0mAfSz72Wo6PI8CRHYQUGG8BPBMJAe6mz4DVcUBlqNB0d 00EoG5dTUENE5r6QJITu+FlFkIasJSsIa1BG7ivz4KQDbh/4Z4ibOJ4qwrDru5IVP8yy NuSiMjoJZwqIeZQreJtikmwBElnkWYW4+qs0LalQ1eNZyiiyLKkx1evhN+DhPYOSM69z WLQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MOr64WR7JFh8O6zNoSvDJ/dxwL5S48zFZviyd6WC91U=; b=lCzM6xKPdRAqpZMX0UgURT2uHP/CnaMP5FSPh8/a2pj+z8Z88BcgUIomkFAL9CIqxQ tAbEe9TkORHxEssajKnBQYN/WYWZhmYe8sGYJ3iVfrfCmo9JaEPdhYH6jC5idBAAwfT0 p+VTV9UxThyVYuiXfWtZqBER4nrsyutzqI9JvVISZ8G/0HyC95+4mxOBuPpBgQyz8EY5 bqwocZzcLNHxSm/YXOMNxR17t2rYc2caEVyinncsOIcM7uh+aNhUQVjykVNmFULDXoQj SA7SE0RSmlSlLckhYIPe+Sy33Y/ZTgDPaZ5cTAST60fDvxKW3ls5BzZWM0Me1/QxNlNO NwoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IdFVuOEz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id p24si618260edm.242.2020.12.02.00.32.24; Wed, 02 Dec 2020 00:32:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IdFVuOEz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2387875AbgLBIav (ORCPT + 99 others); Wed, 2 Dec 2020 03:30:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387526AbgLBIau (ORCPT ); Wed, 2 Dec 2020 03:30:50 -0500 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ACFBC0613D4; Wed, 2 Dec 2020 00:30:10 -0800 (PST) Received: by mail-ej1-x641.google.com with SMTP id 7so2399040ejm.0; Wed, 02 Dec 2020 00:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MOr64WR7JFh8O6zNoSvDJ/dxwL5S48zFZviyd6WC91U=; b=IdFVuOEzP1UAX1qbacan+RDDK2HPWdWW+uKPz5xMiXD8BrBdZyaBWurby6ulSX3FSM Sd2D2MZ+RJyzLsf59s1tTiJ7GgHpZsIJT2aqiZzENw5+NzLIKsvTvEu63yi60hSdL7iH jJRuoQ1tzzsAHfEq9jfcT/p9H0Qj1Ps69GZpNCOzWqO9bmxivYwkjZEZDPeXZhiPCW1X sG5F1TQF+MZuiw7kxeGNrD5ctg8U7N91rLjY/LXOn5Yyl9jADe/JZAsi5HFcA7rFIDSb gykybnUCwp2zkHSpuBd8tmgHGMSXQ1VWblo65+PwYk0eWMIg8vOhnGtVVU4onE1jFMBe GfEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MOr64WR7JFh8O6zNoSvDJ/dxwL5S48zFZviyd6WC91U=; b=lkqqHAzMeKh//yZSqm1AcghkpL2gusaVaf73gmIn9Y31zb/8tqUzwZHAG9239Hb1it 5Q/DuQWeJTpxN1TnsWYTBCh7xw/gYnZnXgCRmtPVZbSmybwRFALmD0WLdUibR2jgSkNO ntJedunzsfJF7cvpKflztHshidrKF3qeG+43mn2eKaS8VMaopaT41nMw5frxLU4KW31O v4DNR9GbMC8CBfycJo0jVaPZqEzExF15d8YMIQpzj0bC6jjVzaivffvgFuZpQ+OjrL7F OCQ+jxeYKeiO4aTqDNi6ycdcxbB6javX6mPeCRcFyvAuD2UUrgxv0pZyfWETQAMQzNrJ czEA== X-Gm-Message-State: AOAM532qJr7RG/6WCuw2rflNwECsbMmEPeaiP42NzN0d02NLXouzjMe8 1/aZSrUEaQMUehUbnr1eltuIsW2Nz5PnUc1cWAE= X-Received: by 2002:a17:906:6693:: with SMTP id z19mr1249325ejo.376.1606897808576; Wed, 02 Dec 2020 00:30:08 -0800 (PST) MIME-Version: 1.0 References: <20201201053949.143175-1-selvakuma.s1@samsung.com> <20201201053949.143175-3-selvakuma.s1@samsung.com> <20201201151628.GA27728@redsun51.ssa.fujisawa.hgst.com> In-Reply-To: <20201201151628.GA27728@redsun51.ssa.fujisawa.hgst.com> From: Selva Jove Date: Wed, 2 Dec 2020 13:59:57 +0530 Message-ID: Subject: Re: [RFC PATCH 2/2] nvme: add simple copy support To: Keith Busch Cc: SelvaKumar S , linux-nvme@lists.infradead.org, axboe@kernel.dk, Damien Le Moal , hch@lst.de, sagi@grimberg.me, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nj.shetty@samsung.com, joshi.k@samsung.com, javier.gonz@samsung.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 1, 2020 at 8:46 PM Keith Busch wrote: > > On Tue, Dec 01, 2020 at 11:09:49AM +0530, SelvaKumar S wrote: > > +static void nvme_config_copy(struct gendisk *disk, struct nvme_ns *ns, > > + struct nvme_id_ns *id) > > +{ > > + struct nvme_ctrl *ctrl = ns->ctrl; > > + struct request_queue *queue = disk->queue; > > + > > + if (!(ctrl->oncs & NVME_CTRL_ONCS_COPY)) { > > + queue->limits.max_copy_sectors = 0; > > + blk_queue_flag_clear(QUEUE_FLAG_COPY, queue); > > + return; > > + } > > + > > + /* setting copy limits */ > > + ns->mcl = le64_to_cpu(id->mcl); > > + ns->mssrl = le32_to_cpu(id->mssrl); > > + ns->msrc = id->msrc; > > These are not used anywhere outside this function, so there's no need to > add members to the struct. Sure. Will remove these entries from nvme_ns. > > > + if (blk_queue_flag_test_and_set(QUEUE_FLAG_COPY, queue)) > > + return; > > The queue limits are not necessarily the same each time we're called to > update the disk info, so this return shouldn't be here. > Makes sense. > > + > > + queue->limits.max_copy_sectors = ns->mcl * (1 << (ns->lba_shift - 9)); > > + queue->limits.max_copy_range_sectors = ns->mssrl * > > + (1 << (ns->lba_shift - 9)); > > + queue->limits.max_copy_nr_ranges = ns->msrc + 1; > > +} > > <> > > > @@ -2045,6 +2133,7 @@ static void nvme_update_disk_info(struct gendisk *disk, > > set_capacity_and_notify(disk, capacity); > > > > nvme_config_discard(disk, ns); > > + nvme_config_copy(disk, ns, id); > > nvme_config_write_zeroes(disk, ns); > > > > if (id->nsattr & NVME_NS_ATTR_RO) > > @@ -3014,6 +3103,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl) > > ctrl->oaes = le32_to_cpu(id->oaes); > > ctrl->wctemp = le16_to_cpu(id->wctemp); > > ctrl->cctemp = le16_to_cpu(id->cctemp); > > + ctrl->ocfs = le32_to_cpu(id->ocfs); > > ocfs is not used anywhere.