[PATCH v3] nvmet: force reconnect when number of queue changes

Hannes Reinecke hare at suse.de
Tue Oct 11 23:57:36 PDT 2022


On 10/7/22 09:29, Daniel Wagner wrote:
> In order to test queue number changes we need to make sure that the
> host reconnects. Because only when the host disconnects from the
> target the number of queues are allowed to change according the spec.
> 
> The initial idea was to disable and re-enable the ports and have the
> host wait until the KATO timer expires, triggering error
> recovery. Though the host would see a DNR reply when trying to
> reconnect. Because of the DNR bit the connection is dropped
> completely. There is no point in trying to reconnect with the same
> parameters according the spec.
> 
> We can force to reconnect the host is by deleting all controllers. The
> host will observe any newly posted request to fail and thus starts the
> error recovery but this time without the DNR bit set.
> 
> Also, the item passed into nvmet_subsys_attr_qid_max_show is not a
> member of struct nvmet_port, it is part of nvmet_subsys. Hence,
> don't try to dereference it as struct nvme_ctrl pointer.
> 
> Fixes: 3e980f5995e0 ("nvmet: Expose max queues to configfs")
> Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki at wdc.com>
> Link: https://lore.kernel.org/r/20220913064203.133536-1-dwagner@suse.de
> Signed-off-by: Daniel Wagner <dwagner at suse.de>
> ---
> v3:
>    - Updated Fixes tag
>    - Updated commit message with some additional information
>      from the v2 discussion
> 
> v2:
>    - instead preventing changes, force reconnect by delete ctrls
>    - renamed patch
>    - https://lore.kernel.org/linux-nvme/20220927143157.3659-1-dwagner@suse.de/
> 
> v1:
>    - initial verison
>    - https://lore.kernel.org/linux-nvme/20220913064203.133536-1-dwagner@suse.de/
> 
>   drivers/nvme/target/configfs.c | 13 ++++++++-----
>   1 file changed, 8 insertions(+), 5 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at 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




More information about the Linux-nvme mailing list