Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Smart <jsmart2021@gmail.com>
To: linux-nvme@lists.infradead.org
Subject: Re: [PATCH v2] nvme: Add ctrl attributes for queue_count and sqsize
Date: Wed, 25 Sep 2019 21:18:51 -0700	[thread overview]
Message-ID: <DF784B7A-C76E-40A9-8840-F38F5F80C570@gmail.com> (raw)
In-Reply-To: <20190926002023.14033-1-jsmart2021@gmail.com>



> On Sep 25, 2019, at 5:20 PM, James Smart <jsmart2021@gmail.com> wrote:
> 
> Current controller interrogation requires a lot of guesswork
> on how many io queues were created and what the io sq size is.
> The numbers are dependent upon core/fabric defaults, connect
> arguments, and target responses.
> 
> Add sysfs attributes for queue_count and sqsize.
> 
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> 
> ---
> v2:
>  Updated is_visible to not show sqsize attribute on pcie controllers
> ---
> drivers/nvme/host/core.c | 6 ++++++
> 1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index e0e2dcbfd05e..d3c85c6d9230 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -3040,6 +3040,8 @@ static DEVICE_ATTR(field, S_IRUGO, field##_show, NULL);
> 
> nvme_show_int_function(cntlid);
> nvme_show_int_function(numa_node);
> +nvme_show_int_function(queue_count);
> +nvme_show_int_function(sqsize);
> 
> static ssize_t nvme_sysfs_delete(struct device *dev,
> 				struct device_attribute *attr, const char *buf,
> @@ -3120,6 +3122,8 @@ static struct attribute *nvme_dev_attrs[] = {
> 	&dev_attr_address.attr,
> 	&dev_attr_state.attr,
> 	&dev_attr_numa_node.attr,
> +	&dev_attr_queue_count.attr,
> +	&dev_attr_sqsize.attr,
> 	NULL
> };
> 
> @@ -3133,6 +3137,8 @@ static umode_t nvme_dev_attrs_are_visible(struct kobject *kobj,
> 		return 0;
> 	if (a == &dev_attr_address.attr && !ctrl->ops->get_address)
> 		return 0;
> +	if (!strncmp(ctrl->ops->name, "pcie", 4) && a == &dev_attr_sqsize.attr)
> +		return 0;
> 
> 	return a->mode;
> }
> -- 
> 2.13.7
> 

Ok scratch the v2 - original patch was fine.

Thanks

— james


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

      parent reply	other threads:[~2019-09-26  4:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26  0:20 [PATCH v2] nvme: Add ctrl attributes for queue_count and sqsize James Smart
2019-09-26  0:28 ` Sagi Grimberg
2019-09-26  3:28   ` Keith Busch
2019-09-26  4:18 ` James Smart [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=DF784B7A-C76E-40A9-8840-F38F5F80C570@gmail.com \
    --to=jsmart2021@gmail.com \
    --cc=linux-nvme@lists.infradead.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