public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Daniel Wagner <dwagner@suse.de>, linux-nvme@lists.infradead.org
Cc: Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH v2 1/3] nvmet: Expose max queues to sysfs
Date: Thu, 25 Aug 2022 18:20:12 +0200	[thread overview]
Message-ID: <ea632332-d26b-6d1f-b45d-9971902a2ebb@suse.de> (raw)
In-Reply-To: <20220823074451.12170-2-dwagner@suse.de>

On 8/23/22 09:44, Daniel Wagner wrote:
> Allow to set the max queues the target supports. This is useful for
> testing the reconnect attempt of the host with chaning numbers of
> supported queues.
> 
> Signed-off-by: Daniel Wagner <dwagner@suse.de>
> ---
>   drivers/nvme/target/configfs.c | 25 +++++++++++++++++++++++++
>   1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
> index 2bcd60758919..ba9f3209f848 100644
> --- a/drivers/nvme/target/configfs.c
> +++ b/drivers/nvme/target/configfs.c
> @@ -1281,6 +1281,30 @@ static ssize_t nvmet_subsys_attr_pi_enable_store(struct config_item *item,
>   CONFIGFS_ATTR(nvmet_subsys_, attr_pi_enable);
>   #endif
>   
> +static ssize_t nvmet_subsys_attr_qid_max_show(struct config_item *item,
> +					      char *page)
> +{
> +	return snprintf(page, PAGE_SIZE, "%u\n", to_subsys(item)->max_qid);
> +}
> +
> +static ssize_t nvmet_subsys_attr_qid_max_store(struct config_item *item,
> +					       const char *page, size_t cnt)
> +{
> +	u16 qid_max;
> +
> +	if (sscanf(page, "%hu\n", &qid_max) != 1)
> +		return -EINVAL;
> +
> +	if (qid_max == 0)
> +		return -EINVAL;
> +
> +	down_write(&nvmet_config_sem);
> +	to_subsys(item)->max_qid = qid_max;
> +	up_write(&nvmet_config_sem);

I would have expected this to trigger a reconnect; as it stands it 
requires the user to explicitly do a reconnect via nvme-cli, and there's 
a fair chance the number of queues will be specified there.
Hmm?

> +	return cnt;
> +}
> +CONFIGFS_ATTR(nvmet_subsys_, attr_qid_max);
> +
>   static struct configfs_attribute *nvmet_subsys_attrs[] = {
>   	&nvmet_subsys_attr_attr_allow_any_host,
>   	&nvmet_subsys_attr_attr_version,
> @@ -1291,6 +1315,7 @@ static struct configfs_attribute *nvmet_subsys_attrs[] = {
>   #ifdef CONFIG_BLK_DEV_INTEGRITY
>   	&nvmet_subsys_attr_attr_pi_enable,
>   #endif
> +	&nvmet_subsys_attr_attr_qid_max,
>   	NULL,
>   };
>   

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman


  reply	other threads:[~2022-08-25 16:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23  7:44 [PATCH v2 0/3] Handle number of queue changes Daniel Wagner
2022-08-23  7:44 ` [PATCH v2 1/3] nvmet: Expose max queues to sysfs Daniel Wagner
2022-08-25 16:20   ` Hannes Reinecke [this message]
2022-08-29  7:57     ` Daniel Wagner
2022-08-28 12:12   ` Sagi Grimberg
2022-08-23  7:44 ` [PATCH v2 2/3] nvme-tcp: Handle number of queue changes Daniel Wagner
2022-08-28 12:25   ` Sagi Grimberg
2022-08-29  7:46     ` Daniel Wagner
2022-08-23  7:44 ` [PATCH v2 3/3] nvme-rdma: " Daniel Wagner
2022-08-25 10:08   ` Chao Leng
2022-08-25 10:55     ` Daniel Wagner
2022-08-26  1:10       ` Chao Leng
2022-08-26  6:30         ` Daniel Wagner
2022-08-26  7:02           ` Chao Leng
2022-08-26  7:31           ` Chao Leng
2022-08-26 11:33             ` Daniel Wagner
2022-08-27  1:02               ` Chao Leng
2022-08-28 12:20                 ` Sagi Grimberg
2022-08-29  8:02                   ` Chao Leng

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=ea632332-d26b-6d1f-b45d-9971902a2ebb@suse.de \
    --to=hare@suse.de \
    --cc=dwagner@suse.de \
    --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