public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Keith Busch <kbusch@kernel.org>
Cc: "hch@lst.de" <hch@lst.de>, "sagi@grimberg.me" <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>
Subject: Re: [PATCH 2/3] nvme-core: move gencounter check into nvme_cid()
Date: Fri, 10 Dec 2021 17:46:59 +0000	[thread overview]
Message-ID: <d0ce0b57-211a-5e04-9528-a99a83f22600@nvidia.com> (raw)
In-Reply-To: <20211210154324.GA3856533@dhcp-10-100-145-180.wdc.com>

On 12/10/21 7:43 AM, Keith Busch wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Fri, Dec 10, 2021 at 03:21:15AM -0800, Chaitanya Kulkarni wrote:
>> -     if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN))
>> -             nvme_req(req)->genctr++;
>>        cmd->common.command_id = nvme_cid(req);
>>        trace_nvme_setup_cmd(req, cmd);
>>        return ret;
>> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
>> index 98d7627cfdce..2be0191e1a1f 100644
>> --- a/drivers/nvme/host/nvme.h
>> +++ b/drivers/nvme/host/nvme.h
>> @@ -511,6 +511,8 @@ struct nvme_ctrl_ops {
>>
>>   static inline u16 nvme_cid(struct request *rq)
>>   {
>> +     if (!(nvme_req(rq)->ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN))
>> +             nvme_req(rq)->genctr++;
>>        return nvme_cid_install_genctr(nvme_req(rq)->genctr) | rq->tag;
>>   }
> 
> No, this will incrememnt the counter every time someone queries the
> command id for this request, which happens in multiple places. The
> counter can't be modified for the lifetime of the request.
> 

Yes, the right thing to do here is to create a new stub for
CONFIG_NVME_DEBUG_USE_GENCTR and !CONFIG_NVME_DEBUG_USE_GENCTR
case and move the quick check in there, will send out V2.


  reply	other threads:[~2021-12-10 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 11:21 [PATCH 0/3] nvme-core: make gencounter feature tunable Chaitanya Kulkarni
2021-12-10 11:21 ` [PATCH 1/3] nvme-core: make cid gencounter configurable Chaitanya Kulkarni
2021-12-10 11:21 ` [PATCH 2/3] nvme-core: move gencounter check into nvme_cid() Chaitanya Kulkarni
2021-12-10 15:43   ` Keith Busch
2021-12-10 17:46     ` Chaitanya Kulkarni [this message]
2021-12-12  9:19       ` Sagi Grimberg
2021-12-13  7:07         ` Chaitanya Kulkarni
2021-12-10 11:21 ` [PATCH 3/3] nvme: add KConfig options for debug features Chaitanya Kulkarni
2021-12-12  9:22   ` Sagi Grimberg
2021-12-13  7:39     ` Chaitanya Kulkarni
2021-12-13  9:27       ` Sagi Grimberg
2021-12-14  7:54         ` Chaitanya Kulkarni
2021-12-14 11:03           ` Sagi Grimberg
2021-12-17  6:52             ` 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=d0ce0b57-211a-5e04-9528-a99a83f22600@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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