Skip to content

Commit

Permalink
nbft: Add SSNS 'unavailable' flag
Browse files Browse the repository at this point in the history
Certain pre-OS driver implementations (i.e. UEFI) may opt
to include SSNS records that failed to connect, caused either
by a temporary target inaccessibility or an invalid
configuration. Such reason is further indicated by TP8029
extended information.

This commit adds a flag indicating namespace availability
so that clients (nvme-cli) may either decide to skip such
record or make another connection attempt.

Signed-off-by: Tomas Bzatek <[email protected]>
  • Loading branch information
tbzatek committed Feb 19, 2024
1 parent 631a13d commit d25b0e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nvme/nbft.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,10 @@ static int read_ssns(struct nbft_info *nbft,
ssns->nid_type = raw_ssns->nidt;
ssns->nid = raw_ssns->nid;

/* flags */
ssns->unavailable = !!(le16_to_cpu(raw_ssns->flags) &
NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL);

/* security profile */
if (raw_ssns->security_desc_index) {
ssns->security = security_from_index(nbft, raw_ssns->security_desc_index);
Expand Down
3 changes: 3 additions & 0 deletions src/nvme/nbft.h
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,8 @@ enum nbft_info_nid_type {
* Descriptor) or 0 if not supported.
* @dhcp_root_path_string: DHCP Root Path Override string (SSNS Extended
* Information Descriptor).
* @unavailable: Namespace is unavailable as indicated by
* the pre-OS driver.
*/
struct nbft_info_subsystem_ns {
int index;
Expand All @@ -1200,6 +1202,7 @@ struct nbft_info_subsystem_ns {
int controller_id;
int asqsz;
char *dhcp_root_path_string;
bool unavailable;
};

/**
Expand Down

0 comments on commit d25b0e8

Please sign in to comment.