• C
    nvmet: align addrfam list to spec · d02abd19
    Chaitanya Kulkarni 提交于
    With reference to the NVMeOF Specification (page 44, Figure 38)
    discovery log page entry provides address family field. We do set the
    transport type field but the adrfam field is not set when using loop
    transport and also it doesn't have support in the nvme-cli. So when
    reading discovery log page with a loop transport it leads to confusing
    output.
    
    As per the spec for adrfam value 254 is reserved for Intra Host
    Transport i.e. loopback), we add a required macro in the protocol
    header file, set default port disc addr entry's adrfam to
    NVMF_ADDR_FAMILY_MAX, and update nvmet_addr_family configfs array for
    show/store attribute.
    
    Without this patch, setting adrfam to (ipv4/ipv6/ib/fc/loop/" ") we get
    following output for nvme discover command from nvme-cli which is
    confusing.
    trtype:  loop
    adrfam:  ipv4
    trtype:  loop
    adrfam:  ipv6
    trtype:  loop
    adrfam:  infiniband
    trtype:  loop
    adrfam:  fibre-channel
    trtype:  loop		# ${CFGFS_HOME}/nvmet/ports/1/addr_adrfam = loop
    adrfam:  pci            # <----- pci for loop
    trtype:  loop		# ${CFGFS_HOME}/nvmet/ports/1/addr_adrfam = " "
    adrfam:  pci            # <----- pci for unrecognized
    
    This patch fixes above output :-
    trtype:  loop
    adrfam:  ipv4
    trtype:  loop
    adrfam:  ipv6
    trtype:  loop
    adrfam:  infiniband
    trtype:  loop
    adrfam:  fibre-channel
    trtype:  loop           # ${CFGFS_HOME}/nvmet/ports/1/addr_adrfam = loop
    adrfam:  loop           # <----- loop for loop
    trtype:  loop		# ${CFGFS_HOME}/config/nvmet/ports/adrfam = " "
    adrfam:  unrecognized   # <----- unrecognized when invalid value
    Signed-off-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
    Signed-off-by: NChristoph Hellwig <hch@lst.de>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    d02abd19
nvme.h 33.4 KB