From: Selva Jove <selvajove@gmail.com>
To: Keith Busch <kbusch@kernel.org>
Cc: axboe@kernel.dk, Damien Le Moal <damien.lemoal@wdc.com>,
SelvaKumar S <selvakuma.s1@samsung.com>,
sagi@grimberg.me, joshi.k@samsung.com,
linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org,
nj.shetty@samsung.com, linux-block@vger.kernel.org,
javier.gonz@samsung.com, hch@lst.de
Subject: Re: [RFC PATCH 2/2] nvme: add simple copy support
Date: Wed, 2 Dec 2020 13:59:57 +0530 [thread overview]
Message-ID: <CAHqX9vYLtpjWKu1otDWnSTM=MF+oMpFxSqLZvTZRcmp68LgCcQ@mail.gmail.com> (raw)
In-Reply-To: <20201201151628.GA27728@redsun51.ssa.fujisawa.hgst.com>
On Tue, Dec 1, 2020 at 8:46 PM Keith Busch <kbusch@kernel.org> 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.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2020-12-02 8:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20201201054049epcas5p2e0118abda14aaf8d8bdcfb543bc330fc@epcas5p2.samsung.com>
2020-12-01 5:39 ` [RFC PATCH 0/2] add simple copy support SelvaKumar S
[not found] ` <CGME20201201054057epcas5p1d5bd2813146d2cb57eb66b7cedce1f63@epcas5p1.samsung.com>
2020-12-01 5:39 ` [RFC PATCH 1/2] block: " SelvaKumar S
2020-12-01 9:57 ` Johannes Thumshirn
2020-12-01 10:28 ` Aleksei Marov
2020-12-01 13:22 ` Selva Jove
[not found] ` <CGME20201201054106epcas5p486fa3f85f6ba5568f6df85c2660b2e3e@epcas5p4.samsung.com>
2020-12-01 5:39 ` [RFC PATCH 2/2] nvme: " SelvaKumar S
2020-12-01 15:16 ` Keith Busch
2020-12-02 8:29 ` Selva Jove [this message]
2020-12-01 11:22 ` [RFC PATCH 0/2] " Damien Le Moal
2020-12-01 12:20 ` javier.gonz@samsung.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHqX9vYLtpjWKu1otDWnSTM=MF+oMpFxSqLZvTZRcmp68LgCcQ@mail.gmail.com' \
--to=selvajove@gmail.com \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=hch@lst.de \
--cc=javier.gonz@samsung.com \
--cc=joshi.k@samsung.com \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=nj.shetty@samsung.com \
--cc=sagi@grimberg.me \
--cc=selvakuma.s1@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).