public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Keith Busch <kbusch@kernel.org>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
	"dm-devel@redhat.com" <dm-devel@redhat.com>
Subject: Re: [RFC PATCH 3/8] nvme: add support for the Verify command
Date: Thu, 11 Nov 2021 08:09:07 +0000	[thread overview]
Message-ID: <c8283a02-32df-5268-7526-7f1dbf2a15b2@nvidia.com> (raw)
In-Reply-To: <20211104224459.GB2655721@dhcp-10-100-145-180.wdc.com>

On 11/4/2021 3:44 PM, Keith Busch wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Wed, Nov 03, 2021 at 11:46:29PM -0700, Chaitanya Kulkarni wrote:
>> +static inline blk_status_t nvme_setup_verify(struct nvme_ns *ns,
>> +             struct request *req, struct nvme_command *cmnd)
>> +{
> 
> Due to recent driver changes, you need a "memset(cmnd, 0, sizeof(*cmnd))"
> prior to setting up the rest of the command, or you need to set each
> command dword individually.

Agree, will fix that in V1.

> 
>> +     cmnd->verify.opcode = nvme_cmd_verify;
>> +     cmnd->verify.nsid = cpu_to_le32(ns->head->ns_id);
>> +     cmnd->verify.slba =
>> +             cpu_to_le64(nvme_sect_to_lba(ns, blk_rq_pos(req)));
>> +     cmnd->verify.length =
>> +             cpu_to_le16((blk_rq_bytes(req) >> ns->lba_shift) - 1);
>> +     cmnd->verify.control = 0;
>> +     return BLK_STS_OK;
>> +}
> 
>> +static void nvme_config_verify(struct gendisk *disk, struct nvme_ns *ns)
>> +{
>> +     u64 max_blocks;
>> +
>> +     if (!(ns->ctrl->oncs & NVME_CTRL_ONCS_VERIFY))
>> +             return;
>> +
>> +     if (ns->ctrl->max_hw_sectors == UINT_MAX)
>> +             max_blocks = (u64)USHRT_MAX + 1;
>> +     else
>> +             max_blocks = ns->ctrl->max_hw_sectors + 1;
> 
> If supported by the controller, this maximum is defined in the non-mdts
> command limits in NVM command set specific Identify Controller VSL field.
> 

I need take a closer look at this. I'll fix that in V1.

>> +
>> +     /* keep same as discard */
>> +     if (blk_queue_flag_test_and_set(QUEUE_FLAG_VERIFY, disk->queue))
>> +             return;
>> +
>> +     blk_queue_max_verify_sectors(disk->queue,
>> +                                  nvme_lba_to_sect(ns, max_blocks));
>> +
>> +}

Thanks for the comment Keith.



  reply	other threads:[~2021-11-11  8:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  6:46 [RFC PATCH 0/8] block: add support for REQ_OP_VERIFY Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 1/8] " Chaitanya Kulkarni
2021-11-04 17:25   ` Darrick J. Wong
2021-11-11  8:01     ` Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 2/8] scsi: add REQ_OP_VERIFY support Chaitanya Kulkarni
2021-11-04 12:33   ` Damien Le Moal
2021-11-11  8:07     ` Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 3/8] nvme: add support for the Verify command Chaitanya Kulkarni
2021-11-04 22:44   ` Keith Busch
2021-11-11  8:09     ` Chaitanya Kulkarni [this message]
2021-11-04  6:46 ` [PATCH 4/8] nvmet: add Verify command support for bdev-ns Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 5/8] nvmet: add Verify emulation " Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 6/8] nvmet: add verify emulation support for file-ns Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 7/8] null_blk: add REQ_OP_VERIFY support Chaitanya Kulkarni
2021-11-04  6:46 ` [RFC PATCH 8/8] md: add support for REQ_OP_VERIFY Chaitanya Kulkarni
2021-11-11  8:13   ` Chaitanya Kulkarni
2021-11-12 15:19     ` Mike Snitzer
2021-11-04  7:14 ` [RFC PATCH 0/8] block: " Christoph Hellwig
2021-11-04  9:27   ` Chaitanya Kulkarni
2021-11-04 17:32     ` Darrick J. Wong
2021-11-04 17:34       ` Christoph Hellwig
2021-11-04 22:37         ` Keith Busch
2021-11-05  8:25           ` javier
2021-11-11  8:18       ` Chaitanya Kulkarni
2021-11-04 15:16 ` Douglas Gilbert
2021-11-11  8:27   ` Chaitanya Kulkarni

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=c8283a02-32df-5268-7526-7f1dbf2a15b2@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=dm-devel@redhat.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=target-devel@vger.kernel.org \
    /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