The num_hfis field only reflected the number of Secondary HFI
Associations, resulting in the last parsed HFI being ignored
by users (nvme-cli).
According to the NVM Express Boot Specification, Revision 1.0,
the Primary HFI Descriptor Index in the Subsystem Namespace
(SSNS) Descriptor contains this note:
"If multiple HFIs are associated with this record, subsequent
interfaces should be populated in the Secondary HFI
Associations field."
As both the primary and secondary HFIs are parsed into a single
array, it makes sense to reflect the proper number of elements.
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
ret = -EINVAL;
goto fail;
}
+ ssns->num_hfis = 1;
for (i = 0; i < le16_to_cpu(raw_ssns->secondary_hfi_assoc_obj.length); i++) {
ssns->hfis[i + 1] = hfi_from_index(nbft, ss_hfi_indexes[i]);
if (ss_hfi_indexes[i] && !ssns->hfis[i + 1])