From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@kernel.org>
Cc: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me
Subject: Re: [PATCHv2] nvme: implement non-mdts command limits
Date: Thu, 18 Mar 2021 05:42:45 +0100 [thread overview]
Message-ID: <20210318044245.GC26988@lst.de> (raw)
In-Reply-To: <20210317212606.110919-1-kbusch@kernel.org>
> static void nvme_config_write_zeroes(struct request_queue *q,
> struct nvme_ctrl *ctrl)
> {
> + blk_queue_max_write_zeroes_sectors(q, ctrl->max_zeroes_sectors);
I think at this point we can kill nvme_config_write_zeroes :)
> +static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
> +{
> + struct nvme_command c = { };
> + struct nvme_id_ctrl_nvm *id;
> + int ret;
> +
> + if (!(ctrl->oncs & NVME_CTRL_ONCS_DSM)) {
> + ctrl->max_discard_sectors = 0;
> + ctrl->max_discard_segments = 0;
> + } else {
> + ctrl->max_discard_sectors = UINT_MAX;
> + ctrl->max_discard_segments = NVME_DSM_MAX_RANGES;
> + }
Can you switch the polarity here, that is avoid the pointless
negation in the if?
> + if (ctrl->vs < NVME_VS(1, 2, 0))
> + return 0;
This check doesn't make much sense to me, as new TPs can always apply
to older spec versions as well. Instead this probably should be a
nvme_ctrl_limited_cns() check.
_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
prev parent reply other threads:[~2021-03-18 4:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-17 21:26 [PATCHv2] nvme: implement non-mdts command limits Keith Busch
2021-03-18 4:42 ` Christoph Hellwig [this message]
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=20210318044245.GC26988@lst.de \
--to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.