Skip to contentSkip to conversation

Case-sensitive host NQN

DISCUSSION Hannes Reinecke 3 participants 7 messages Feb 12, 2020 – Feb 13, 2020 NVMe

lore
Share & tools
lore
#0 lore raw

Hi all,

I've stumbled across a slight weirdness for our handling of host NQNs. We do format them like

# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:36343050-3834-584D-5138-33313030344E

as this is a UUID, one would expect that it's identical to

# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:36343050-3834-584d-5138-33313030344e

(Note the lowercase letters).
As it turns out, this is _not_ the case, causing the connection not to be established.

Which is slightly weird, and not what one would expect. The NVMe spec only has this vague statement
"Upon entry NVM host software may process an NVMe qualified name..." so we would be spec-compatible when setting the fields to lowercase when reading the nqn.

Thoughts?

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke		           Kernel Storage Architect
[email protected]			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#1 lore raw
Quoted 17 lines · Hannes Reinecke

Hi all,

I've stumbled across a slight weirdness for our handling of host NQNs. We do format them like

# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:36343050-3834-584D-5138-33313030344E

as this is a UUID, one would expect that it's identical to

# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:36343050-3834-584d-5138-33313030344e

(Note the lowercase letters).
As it turns out, this is _not_ the case, causing the connection not to be established.

Quoted 5 lines

Which is slightly weird, and not what one would expect. The NVMe spec only has this vague statement
"Upon entry NVM host software may process an NVMe qualified name..." so we would be spec-compatible when setting the fields to lowercase when reading the nqn.

Check section 7.9 of NVMe 1.4:

"NVMe hosts, controllers and NVM subsystems compare (e.g., for equality) NVMe Qualified Names used by NVMe as binary strings without any text processing or text comparison logic that is specific to the Unicode character set or locale (e.g., case folding or conversion to lower case, Unicode normalization)."

so no, they are case sensitive and the above is by design.

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#2 lore raw
Quoted 26 lines · Christoph Hellwig
Quoted 17 lines · Hannes Reinecke

Hi all,

I've stumbled across a slight weirdness for our handling of host NQNs. We do format them like

# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:36343050-3834-584D-5138-33313030344E

as this is a UUID, one would expect that it's identical to

# cat /etc/nvme/hostnqn
nqn.2014-08.org.nvmexpress:uuid:36343050-3834-584d-5138-33313030344e

(Note the lowercase letters).
As it turns out, this is _not_ the case, causing the connection not to be established.

Quoted 5 lines

Which is slightly weird, and not what one would expect. The NVMe spec only has this vague statement
"Upon entry NVM host software may process an NVMe qualified name..." so we would be spec-compatible when setting the fields to lowercase when reading the nqn.

Check section 7.9 of NVMe 1.4:

Quoted 8 lines

"NVMe hosts, controllers and NVM subsystems compare (e.g., for equality) NVMe Qualified Names used by NVMe as binary strings without any text processing or text comparison logic that is specific to the Unicode character set or locale (e.g., case folding or conversion to lower case, Unicode normalization)."

so no, they are case sensitive and the above is by design.

(I knew I would be getting this answer :-)
But if you read the very next sentence it says:

Any such text processing:
a) may occur as part of entry of NVMe Qualified Names into NVMe hosts and NVM subsystems; and
b) should not occur as part of receiving NVMe Qualified Names via an NVMe connection, as shown in Figure 436.

IE we would be perfectly within the spec to convert the nqn to eg lowercase when reading it from /etc/nvme/hostnqn.

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke            Teamlead Storage & Networking
[email protected]                               +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
maintainer
#4 lore raw
Quoted 7 lines · Hannes Reinecke
Quoted 2 lines

IE we would be perfectly within the spec to convert the nqn to eg lowercase when reading it from /etc/nvme/hostnqn.

We could, but why would we? Case sensitivity is a complete pain and avoiding it wherever we can is a good thing.

I agree here, why should we make that effort? what is the benefit?

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#5 lore raw
In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Hannes Reinecke

IE we would be perfectly within the spec to convert the nqn to eg lowercase when reading it from /etc/nvme/hostnqn.

We could, but why would we? Case sensitivity is a complete pain and avoiding it wherever we can is a good thing.

Because the UUID really is a number, and hence one would assume that it wouldn't be affected from case sensitivty.

But if the consensus is that we do not twiddle with it we should be documenting it somewhere (maybe in a comment in the auto-generated /etc/nvme/hostnqn) so as to avoid surprises or support calls later on.

Cheers,

Hannes

Signature · 9 lines
Dr. Hannes Reinecke		           Kernel Storage Architect
[email protected]			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
maintainer
#6 lore raw
Quoted 8 lines
Quoted 8 lines · Hannes Reinecke
Quoted 2 lines

IE we would be perfectly within the spec to convert the nqn to eg lowercase when reading it from /etc/nvme/hostnqn.

We could, but why would we? Case sensitivity is a complete pain and avoiding it wherever we can is a good thing.

Quoted 6 lines

Because the UUID really is a number, and hence one would assume that it wouldn't be affected from case sensitivty.

But if the consensus is that we do not twiddle with it we should be documenting it somewhere (maybe in a comment in the auto-generated /etc/nvme/hostnqn) so as to avoid surprises or support calls later on.

We can comment. But given that I do see people leverage non-standard hostnqns for their own comfortable use, I don't think it would be a good idea to take any permutations of it (that may also generate support calls).

_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme