File 0022-fabrics-decode-current-discovery-subsystem.patch of Package nvme-cli.24266

From: Hannes Reinecke <hare@suse.de>
Date: Tue, 24 May 2022 09:59:13 +0200
Subject: fabrics: decode 'current' discovery subsystem
Git-commit: b1943d9651aa4bfffe3afa793d105f05ca3209ab
References: bsc#1199865 bsc#1192761

TP8014 added a new discovery log page entry type '3' for the
'current discovery subsystem'; decode it accordingly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 fabrics.c    |    4 +++-
 linux/nvme.h |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

--- a/fabrics.c
+++ b/fabrics.c
@@ -160,8 +160,9 @@ static inline const char *adrfam_str(__u
 }
 
 static const char * const subtypes[] = {
-	[NVME_NQN_DISC]		= "discovery subsystem",
+	[NVME_NQN_DISC]		= "discovery subsystem referral",
 	[NVME_NQN_NVME]		= "nvme subsystem",
+	[NVME_NQN_CURR]		= "current subsystem",
 };
 
 static inline const char *subtype_str(__u8 subtype)
@@ -1050,6 +1051,7 @@ static int connect_ctrl(struct nvmf_disc
 
 	switch (e->subtype) {
 	case NVME_NQN_DISC:
+	case NVME_NQN_CURR:
 		discover = true;
 	case NVME_NQN_NVME:
 		break;
--- a/linux/nvme.h
+++ b/linux/nvme.h
@@ -75,8 +75,9 @@ static inline uint64_t le64_to_cpu(__le6
 #define NVME_NSID_ALL		0xffffffff
 
 enum nvme_subsys_type {
-	NVME_NQN_DISC	= 1,		/* Discovery type target subsystem */
+	NVME_NQN_DISC	= 1,		/* Referral Discovery type target subsystem */
 	NVME_NQN_NVME	= 2,		/* NVME type target subsystem */
+	NVME_NQN_CURR	= 3,		/* Current Discovery type target subsystem */
 };
 
 /* Address Family codes for Discovery Log Page entry ADRFAM field */
openSUSE Build Service is sponsored by