Skip to content

Commit 52a9d83

Browse files
tbzatekigaw
authored andcommitted
nbft: Add SSNS 'unavailable' flag
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]>
1 parent 724615e commit 52a9d83

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/nvme/nbft.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ static int read_ssns(struct nbft_info *nbft,
246246
ssns->nid_type = raw_ssns->nidt;
247247
ssns->nid = raw_ssns->nid;
248248

249+
/* flags */
250+
ssns->unavailable = !!(le16_to_cpu(raw_ssns->flags) &
251+
NBFT_SSNS_UNAVAIL_NAMESPACE_UNAVAIL);
252+
249253
/* security profile */
250254
if (raw_ssns->security_desc_index) {
251255
ssns->security = security_from_index(nbft, raw_ssns->security_desc_index);

src/nvme/nbft.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,8 @@ enum nbft_info_nid_type {
11801180
* Descriptor) or 0 if not supported.
11811181
* @dhcp_root_path_string: DHCP Root Path Override string (SSNS Extended
11821182
* Information Descriptor).
1183+
* @unavailable: Namespace is unavailable as indicated by
1184+
* the pre-OS driver.
11831185
*/
11841186
struct nbft_info_subsystem_ns {
11851187
int index;
@@ -1200,6 +1202,7 @@ struct nbft_info_subsystem_ns {
12001202
int controller_id;
12011203
int asqsz;
12021204
char *dhcp_root_path_string;
1205+
bool unavailable;
12031206
};
12041207

12051208
/**

0 commit comments

Comments
 (0)