[PATCH] nvmet: parametrize maximum number of namespaces

Hannes Reinecke hare at suse.de
Tue Feb 22 03:40:06 PST 2022


On 2/22/22 11:25, Alex Talker wrote:
>> Please no module param for this, right place is configfs subsys
>> attr.
> 
> That makes sense, I agree but I mainly aimed to start off with a simple
> change(replacing macro with load-time value, unchangeable at runtime).
> 
> So if I'd add this to /sys/kernel/configfs/nvmet/subsystems/<NQN> folder
> as, say attr_max_namespaces,
> what would you propose on:
> 1. Storing the value? Would it make sense to specify it directly as NN
> or MNAN value or the like?
> 2. What to do if set value is lower than the current value? Abort if
> there's greater number of enabled namespaces than the specified value?
> 
Relatively easy, and actually driven by the nvme controller model.
Turns out that the values in 'identify controller' are static, and
cannot be changed during the lifetime of a controller.
Consequently you can only modify them if there is no active controller
connected to the subsystem.
Similarly it doesn't make sense to have NN lower than the maximum ANA
grpid of the enabled namespaces, so I would inhibit that.
And yes, the 'attr_max_namespaces' should be set to the 'MNAN' value (as
we're supporting ANA in the target).

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		        Kernel Storage Architect
hare at suse.de			               +49 911 74053 688
SUSE Software Solutions Germany GmbH, 90409 Nürnberg
GF: F. Imendörffer, HRB 36809 (AG Nürnberg)



More information about the Linux-nvme mailing list