* Fri Feb 09 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.7.1-4
- nbft: Fix SSNS HFI indexes parsing - cleanup: Explicitly initialize auto-cleanup variables
This commit is contained in:
		
							parent
							
								
									57d7d790f1
								
							
						
					
					
						commit
						2f6b05f4a7
					
				
							
								
								
									
										37
									
								
								libnvme-1.8.0-initialize_autoclean_vars-2.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								libnvme-1.8.0-initialize_autoclean_vars-2.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,37 @@ | ||||
| From 74324a4120a44120556af41eb9480c5b2492d1fb Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 9 Feb 2024 17:38:45 +0100 | ||||
| Subject: [PATCH] linux: Explicitly initialize auto-cleanup variables | ||||
| 
 | ||||
| gcc complains about potentially	uninitialized variables. | ||||
| 
 | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  src/nvme/linux.c | 4 ++-- | ||||
|  1 file changed, 2 insertions(+), 2 deletions(-) | ||||
| 
 | ||||
| diff --git a/src/nvme/linux.c b/src/nvme/linux.c
 | ||||
| index f0723193..e29d9e72 100644
 | ||||
| --- a/src/nvme/linux.c
 | ||||
| +++ b/src/nvme/linux.c
 | ||||
| @@ -725,7 +725,7 @@ int nvme_gen_dhchap_key(char *hostnqn, enum nvme_hmac_alg hmac,
 | ||||
|  			unsigned char *key) | ||||
|  { | ||||
|  	const char hmac_seed[] = "NVMe-over-Fabrics"; | ||||
| -	_cleanup_hmac_ctx_ HMAC_CTX *hmac_ctx;
 | ||||
| +	_cleanup_hmac_ctx_ HMAC_CTX *hmac_ctx = NULL;
 | ||||
|  	const EVP_MD *md; | ||||
|   | ||||
|  	ENGINE_load_builtin_engines(); | ||||
| @@ -881,7 +881,7 @@ int nvme_gen_dhchap_key(char *hostnqn, enum nvme_hmac_alg hmac,
 | ||||
|  { | ||||
|  	const char hmac_seed[] = "NVMe-over-Fabrics"; | ||||
|  	OSSL_PARAM params[2], *p = params; | ||||
| -	_cleanup_ossl_lib_ctx_ OSSL_LIB_CTX *lib_ctx;
 | ||||
| +	_cleanup_ossl_lib_ctx_ OSSL_LIB_CTX *lib_ctx = NULL;
 | ||||
|  	_cleanup_evp_mac_ctx_ EVP_MAC_CTX *mac_ctx = NULL; | ||||
|  	_cleanup_evp_mac_ EVP_MAC *mac = NULL; | ||||
|  	char *progq = NULL; | ||||
| -- 
 | ||||
| 2.43.0 | ||||
| 
 | ||||
							
								
								
									
										222
									
								
								libnvme-1.8.0-initialize_autoclean_vars.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										222
									
								
								libnvme-1.8.0-initialize_autoclean_vars.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,222 @@ | ||||
| From ca3193cf4d2a756512007d2c23202d6844e1840d Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 29 Dec 2023 18:37:41 +0100 | ||||
| Subject: [PATCH 1/4] fabrics: Explicitly initialize auto-cleanup variables | ||||
| MIME-Version: 1.0 | ||||
| Content-Type: text/plain; charset=UTF-8 | ||||
| Content-Transfer-Encoding: 8bit | ||||
| 
 | ||||
| gcc complains about potentially	uninitialized variables used | ||||
| in the cleanup function even though such scenario is unlikely | ||||
| to happen. Still, an explicit initializer makes the warnings | ||||
| go away. | ||||
| 
 | ||||
| E.g. | ||||
| 
 | ||||
| ../src/nvme/fabrics.c: In function ‘nvmf_hostnqn_generate’: | ||||
| ../src/nvme/fabrics.c:1297:30: note: ‘stream’ was declared here | ||||
|  1297 |         _cleanup_file_ FILE *stream; | ||||
|       |                              ^~~~~~ | ||||
| In function ‘cleanup_fd’, | ||||
|     inlined from ‘uuid_from_device_tree’ at ../src/nvme/fabrics.c:1189:19, | ||||
|     inlined from ‘nvmf_hostnqn_generate’ at ../src/nvme/fabrics.c:1350:9: | ||||
| ../src/nvme/cleanup.h:37:17: warning: ‘f’ may be used uninitialized [-Wmaybe-uninitialized] | ||||
|    37 |                 close(*fd); | ||||
|       |                 ^~~~~~~~~~ | ||||
| 
 | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  src/nvme/fabrics.c | 12 ++++++------ | ||||
|  1 file changed, 6 insertions(+), 6 deletions(-) | ||||
| 
 | ||||
| diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c
 | ||||
| index 4e042d84..20142116 100644
 | ||||
| --- a/src/nvme/fabrics.c
 | ||||
| +++ b/src/nvme/fabrics.c
 | ||||
| @@ -740,7 +740,7 @@ static  int __nvmf_supported_options(nvme_root_t r)
 | ||||
|   | ||||
|  static int __nvmf_add_ctrl(nvme_root_t r, const char *argstr) | ||||
|  { | ||||
| -	_cleanup_fd_ int fd;
 | ||||
| +	_cleanup_fd_ int fd = -1;
 | ||||
|  	int ret, len = strlen(argstr); | ||||
|  	char buf[0x1000], *options, *p; | ||||
|   | ||||
| @@ -1186,7 +1186,7 @@ struct nvmf_discovery_log *nvmf_get_discovery_wargs(struct nvme_get_discovery_ar
 | ||||
|  static int uuid_from_device_tree(char *system_uuid) | ||||
|  { | ||||
|  	ssize_t len; | ||||
| -	_cleanup_fd_ int f;
 | ||||
| +	_cleanup_fd_ int f = -1;
 | ||||
|   | ||||
|  	f = open(PATH_UUID_IBM, O_RDONLY); | ||||
|  	if (f < 0) | ||||
| @@ -1230,7 +1230,7 @@ static bool is_dmi_uuid_valid(const char *buf, size_t len)
 | ||||
|  static int uuid_from_dmi_entries(char *system_uuid) | ||||
|  { | ||||
|  	int f; | ||||
| -	_cleanup_dir_ DIR *d;
 | ||||
| +	_cleanup_dir_ DIR *d = NULL;
 | ||||
|  	struct dirent *de; | ||||
|  	char buf[512] = {0}; | ||||
|   | ||||
| @@ -1294,7 +1294,7 @@ static int uuid_from_dmi_entries(char *system_uuid)
 | ||||
|   */ | ||||
|  static int uuid_from_product_uuid(char *system_uuid) | ||||
|  { | ||||
| -	_cleanup_file_ FILE *stream;
 | ||||
| +	_cleanup_file_ FILE *stream = NULL;
 | ||||
|  	ssize_t nread; | ||||
|  	_cleanup_free_ char *line = NULL; | ||||
|  	size_t len = 0; | ||||
| @@ -1364,7 +1364,7 @@ char *nvmf_hostnqn_generate()
 | ||||
|  static char *nvmf_read_file(const char *f, int len) | ||||
|  { | ||||
|  	char buf[len]; | ||||
| -	_cleanup_fd_ int fd;
 | ||||
| +	_cleanup_fd_ int fd = -1;
 | ||||
|  	int ret; | ||||
|   | ||||
|  	fd = open(f, O_RDONLY); | ||||
| @@ -1637,7 +1637,7 @@ static const char *dctype_str[] = {
 | ||||
|   */ | ||||
|  static int nvme_fetch_cntrltype_dctype_from_id(nvme_ctrl_t c) | ||||
|  { | ||||
| -	_cleanup_free_ struct nvme_id_ctrl *id;
 | ||||
| +	_cleanup_free_ struct nvme_id_ctrl *id = NULL;
 | ||||
|  	int ret; | ||||
|   | ||||
|  	id = __nvme_alloc(sizeof(*id)); | ||||
| 
 | ||||
| From fdb6415f5e9f7a18380633a1c797aca00d9daccb Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 29 Dec 2023 18:49:25 +0100 | ||||
| Subject: [PATCH 2/4] linux: Explicitly initialize auto-cleanup variables | ||||
| 
 | ||||
| gcc complains about potentially	uninitialized variables. | ||||
| 
 | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  src/nvme/linux.c | 8 ++++---- | ||||
|  1 file changed, 4 insertions(+), 4 deletions(-) | ||||
| 
 | ||||
| diff --git a/src/nvme/linux.c b/src/nvme/linux.c
 | ||||
| index 163086ea..074c27e0 100644
 | ||||
| --- a/src/nvme/linux.c
 | ||||
| +++ b/src/nvme/linux.c
 | ||||
| @@ -124,7 +124,7 @@ int nvme_fw_download_seq(int fd, __u32 size, __u32 xfer, __u32 offset,
 | ||||
|   | ||||
|  int nvme_get_telemetry_max(int fd, enum nvme_telemetry_da *da, size_t *data_tx) | ||||
|  { | ||||
| -	_cleanup_free_ struct nvme_id_ctrl *id_ctrl;
 | ||||
| +	_cleanup_free_ struct nvme_id_ctrl *id_ctrl = NULL;
 | ||||
|  	int err; | ||||
|   | ||||
|  	id_ctrl = __nvme_alloc(sizeof(*id_ctrl)); | ||||
| @@ -385,7 +385,7 @@ int nvme_namespace_detach_ctrls(int fd, __u32 nsid, __u16 num_ctrls,
 | ||||
|   | ||||
|  int nvme_get_ana_log_len(int fd, size_t *analen) | ||||
|  { | ||||
| -	_cleanup_free_ struct nvme_id_ctrl *ctrl;
 | ||||
| +	_cleanup_free_ struct nvme_id_ctrl *ctrl = NULL;
 | ||||
|  	int ret; | ||||
|   | ||||
|  	ctrl = __nvme_alloc(sizeof(*ctrl)); | ||||
| @@ -405,7 +405,7 @@ int nvme_get_ana_log_len(int fd, size_t *analen)
 | ||||
|   | ||||
|  int nvme_get_logical_block_size(int fd, __u32 nsid, int *blksize) | ||||
|  { | ||||
| -	_cleanup_free_ struct nvme_id_ns *ns;
 | ||||
| +	_cleanup_free_ struct nvme_id_ns *ns = NULL;
 | ||||
|  	__u8 flbas; | ||||
|  	int ret; | ||||
|   | ||||
| @@ -426,7 +426,7 @@ int nvme_get_logical_block_size(int fd, __u32 nsid, int *blksize)
 | ||||
|   | ||||
|  static int __nvme_set_attr(const char *path, const char *value) | ||||
|  { | ||||
| -	_cleanup_fd_ int fd;
 | ||||
| +	_cleanup_fd_ int fd = -1;
 | ||||
|   | ||||
|  	fd = open(path, O_WRONLY); | ||||
|  	if (fd < 0) { | ||||
| 
 | ||||
| From 533edeb32027c43895c878149117173bba785dff Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 29 Dec 2023 18:49:36 +0100 | ||||
| Subject: [PATCH 3/4] tree: Explicitly initialize auto-cleanup variables | ||||
| 
 | ||||
| gcc complains about potentially uninitialized variables. | ||||
| 
 | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  src/nvme/tree.c | 5 +++-- | ||||
|  1 file changed, 3 insertions(+), 2 deletions(-) | ||||
| 
 | ||||
| diff --git a/src/nvme/tree.c b/src/nvme/tree.c
 | ||||
| index 07a3c532..97bd3ef4 100644
 | ||||
| --- a/src/nvme/tree.c
 | ||||
| +++ b/src/nvme/tree.c
 | ||||
| @@ -122,7 +122,8 @@ static void cleanup_dirents(struct dirents *ents)
 | ||||
|  nvme_host_t nvme_default_host(nvme_root_t r) | ||||
|  { | ||||
|  	struct nvme_host *h; | ||||
| -	_cleanup_free_ char *hostnqn, *hostid;
 | ||||
| +	_cleanup_free_ char *hostnqn = NULL;
 | ||||
| +	_cleanup_free_ char *hostid = NULL;
 | ||||
|   | ||||
|  	hostnqn = nvmf_hostnqn_from_file(); | ||||
|  	if (!hostnqn) | ||||
| @@ -1853,7 +1854,7 @@ static nvme_ctrl_t nvme_ctrl_alloc(nvme_root_t r, nvme_subsystem_t s,
 | ||||
|  	nvme_ctrl_t c, p; | ||||
|  	_cleanup_free_ char *addr = NULL, *address = NULL; | ||||
|  	char *a, *e; | ||||
| -	_cleanup_free_ char *transport;
 | ||||
| +	_cleanup_free_ char *transport = NULL;
 | ||||
|  	char *traddr = NULL, *trsvcid = NULL; | ||||
|  	char *host_traddr = NULL, *host_iface = NULL; | ||||
|  	int ret; | ||||
| 
 | ||||
| From aa072f89c8a163780250fa1a2dd507de6b45ab49 Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 29 Dec 2023 18:49:44 +0100 | ||||
| Subject: [PATCH 4/4] util: Explicitly initialize auto-cleanup variables | ||||
| 
 | ||||
| gcc complains about potentially uninitialized variables. | ||||
| 
 | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  src/nvme/util.c | 6 +++--- | ||||
|  1 file changed, 3 insertions(+), 3 deletions(-) | ||||
| 
 | ||||
| diff --git a/src/nvme/util.c b/src/nvme/util.c
 | ||||
| index 45512ff9..3861c1ab 100644
 | ||||
| --- a/src/nvme/util.c
 | ||||
| +++ b/src/nvme/util.c
 | ||||
| @@ -757,7 +757,7 @@ char *kv_keymatch(const char *kv, const char *key)
 | ||||
|  static size_t read_file(const char * fname, char *buffer, size_t *bufsz) | ||||
|  { | ||||
|  	char   *p; | ||||
| -	_cleanup_file_ FILE *file;
 | ||||
| +	_cleanup_file_ FILE *file = NULL;
 | ||||
|  	size_t len; | ||||
|   | ||||
|  	file = fopen(fname, "re"); | ||||
| @@ -806,7 +806,7 @@ size_t get_entity_name(char *buffer, size_t bufsz)
 | ||||
|   | ||||
|  size_t get_entity_version(char *buffer, size_t bufsz) | ||||
|  { | ||||
| -	_cleanup_file_ FILE *file;
 | ||||
| +	_cleanup_file_ FILE *file = NULL;
 | ||||
|  	size_t  num_bytes = 0; | ||||
|   | ||||
|  	/* /proc/sys/kernel/ostype typically contains the string "Linux" */ | ||||
| @@ -928,7 +928,7 @@ int nvme_uuid_from_string(const char *str, unsigned char uuid[NVME_UUID_LEN])
 | ||||
|   | ||||
|  int nvme_uuid_random(unsigned char uuid[NVME_UUID_LEN]) | ||||
|  { | ||||
| -	_cleanup_fd_ int f;
 | ||||
| +	_cleanup_fd_ int f = -1;
 | ||||
|  	ssize_t n; | ||||
|   | ||||
|  	f = open("/dev/urandom", O_RDONLY); | ||||
							
								
								
									
										279
									
								
								libnvme-1.8.0-nbft-parser-fixes-766.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										279
									
								
								libnvme-1.8.0-nbft-parser-fixes-766.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,279 @@ | ||||
| From 6761c7d71a3fa7c6d5c718fafb3423f9e51ab261 Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 5 Jan 2024 14:42:11 +0100 | ||||
| Subject: [PATCH 1/5] nbft: Fix (struct nbft_info_subsystem_ns).num_hfis | ||||
|  off-by-one | ||||
| 
 | ||||
| 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> | ||||
| ---
 | ||||
|  src/nvme/nbft.c | 1 + | ||||
|  1 file changed, 1 insertion(+) | ||||
| 
 | ||||
| diff --git a/src/nvme/nbft.c b/src/nvme/nbft.c
 | ||||
| index 2c870880..06632323 100644
 | ||||
| --- a/src/nvme/nbft.c
 | ||||
| +++ b/src/nvme/nbft.c
 | ||||
| @@ -274,6 +274,7 @@ static int read_ssns(struct nbft_info *nbft,
 | ||||
|  		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]) | ||||
| 
 | ||||
| From fc919080448a3b9cdb1eaa0e65f17d5b45f9e58d Mon Sep 17 00:00:00 2001 | ||||
| From: Martin Wilck <mwilck@suse.com> | ||||
| Date: Thu, 11 Jan 2024 11:02:11 +0100 | ||||
| Subject: [PATCH 2/5] nbft: avoid duplicate entries in ssns->hfis | ||||
| 
 | ||||
| The NVMe boot specification does not disallow listing the primary | ||||
| HFI index again in the secondary HFI list, or listing the same | ||||
| index multiple times in the secondary HFI list. But such duplicate
 | ||||
| entries aren't helpful for consumers of this data. In the worst | ||||
| case, they might lead to confusion and misconfiguration. | ||||
| Suppress them. | ||||
| 
 | ||||
| Signed-off-by: Martin Wilck <mwilck@suse.com> | ||||
| ---
 | ||||
|  src/nvme/nbft.c | 21 +++++++++++++++++++++ | ||||
|  1 file changed, 21 insertions(+) | ||||
| 
 | ||||
| diff --git a/src/nvme/nbft.c b/src/nvme/nbft.c
 | ||||
| index 06632323..f2ffc21e 100644
 | ||||
| --- a/src/nvme/nbft.c
 | ||||
| +++ b/src/nvme/nbft.c
 | ||||
| @@ -276,6 +276,27 @@ static int read_ssns(struct nbft_info *nbft,
 | ||||
|  	} | ||||
|  	ssns->num_hfis = 1; | ||||
|  	for (i = 0; i < le16_to_cpu(raw_ssns->secondary_hfi_assoc_obj.length); i++) { | ||||
| +		bool duplicate = false;
 | ||||
| +		int j;
 | ||||
| +
 | ||||
| +		for (j = 0; j < i; j++) {
 | ||||
| +			if (ss_hfi_indexes[i] == ss_hfi_indexes[j]) {
 | ||||
| +				duplicate = true;
 | ||||
| +				break;
 | ||||
| +			}
 | ||||
| +		}
 | ||||
| +
 | ||||
| +		if (!duplicate &&
 | ||||
| +		    ss_hfi_indexes[i] == raw_ssns->primary_hfi_desc_index)
 | ||||
| +			duplicate = true;
 | ||||
| +
 | ||||
| +		if (duplicate) {
 | ||||
| +			nvme_msg(NULL, LOG_DEBUG,
 | ||||
| +				 "file %s: SSNS %d skipping duplicate HFI index %d\n",
 | ||||
| +				 nbft->filename, ssns->index, ss_hfi_indexes[i]);
 | ||||
| +			continue;
 | ||||
| +		}
 | ||||
| +
 | ||||
|  		ssns->hfis[i + 1] = hfi_from_index(nbft, ss_hfi_indexes[i]); | ||||
|  		if (ss_hfi_indexes[i] && !ssns->hfis[i + 1]) | ||||
|  			nvme_msg(NULL, LOG_DEBUG, | ||||
| 
 | ||||
| From 68afe6d9055025aa54c351bb131c30e0d66e6976 Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 5 Jan 2024 14:49:15 +0100 | ||||
| Subject: [PATCH 3/5] tests: Fix diffs output for duplicate HFI entries | ||||
| 
 | ||||
| With commit "nbft: avoid duplicate entries in ssns->hfis" applied, | ||||
| nbft-dump will not see any duplicate HFI indices any more. | ||||
| Fix the reference output for generating the diffs. | ||||
| 
 | ||||
| Signed-off-by: Martin Wilck <mwilck@suse.com> | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  test/nbft/diffs/NBFT-auto-ipv6             | 1 - | ||||
|  test/nbft/diffs/NBFT-dhcp-ipv4             | 1 - | ||||
|  test/nbft/diffs/NBFT-dhcp-ipv6             | 1 - | ||||
|  test/nbft/diffs/NBFT-rhpoc                 | 1 - | ||||
|  test/nbft/diffs/NBFT-static-ipv4           | 1 - | ||||
|  test/nbft/diffs/NBFT-static-ipv4-discovery | 1 - | ||||
|  test/nbft/diffs/NBFT-static-ipv6           | 1 - | ||||
|  7 files changed, 7 deletions(-) | ||||
| 
 | ||||
| diff --git a/test/nbft/diffs/NBFT-auto-ipv6 b/test/nbft/diffs/NBFT-auto-ipv6
 | ||||
| index 32a8b607..83ee6430 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-auto-ipv6
 | ||||
| +++ b/test/nbft/diffs/NBFT-auto-ipv6
 | ||||
| @@ -23,7 +23,6 @@ hfi_list[0]->tcp_info.dhcp_override=0
 | ||||
|  subsystem_ns_list[0]->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=fd09:9a46:b5c1:1ff:5054:ff:fefd:9e66 | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| diff --git a/test/nbft/diffs/NBFT-dhcp-ipv4 b/test/nbft/diffs/NBFT-dhcp-ipv4
 | ||||
| index cb280d9a..067079d9 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-dhcp-ipv4
 | ||||
| +++ b/test/nbft/diffs/NBFT-dhcp-ipv4
 | ||||
| @@ -28,7 +28,6 @@ subsystem_ns_list[0]->index=1
 | ||||
|  subsystem_ns_list[0]->discovery->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=192.168.49.10 | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| diff --git a/test/nbft/diffs/NBFT-dhcp-ipv6 b/test/nbft/diffs/NBFT-dhcp-ipv6
 | ||||
| index b94cc394..11c974f6 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-dhcp-ipv6
 | ||||
| +++ b/test/nbft/diffs/NBFT-dhcp-ipv6
 | ||||
| @@ -23,7 +23,6 @@ hfi_list[0]->tcp_info.dhcp_override=1
 | ||||
|  subsystem_ns_list[0]->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=fddf:d:f:49::10 | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| diff --git a/test/nbft/diffs/NBFT-rhpoc b/test/nbft/diffs/NBFT-rhpoc
 | ||||
| index d4b4ad84..d849b6e1 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-rhpoc
 | ||||
| +++ b/test/nbft/diffs/NBFT-rhpoc
 | ||||
| @@ -23,7 +23,6 @@ hfi_list[0]->tcp_info.dhcp_override=0
 | ||||
|  subsystem_ns_list[0]->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=192.168.101.20 | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| diff --git a/test/nbft/diffs/NBFT-static-ipv4 b/test/nbft/diffs/NBFT-static-ipv4
 | ||||
| index 715b30d2..a6f38597 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-static-ipv4
 | ||||
| +++ b/test/nbft/diffs/NBFT-static-ipv4
 | ||||
| @@ -23,7 +23,6 @@ hfi_list[0]->tcp_info.dhcp_override=0
 | ||||
|  subsystem_ns_list[0]->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=192.168.49.10 | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| diff --git a/test/nbft/diffs/NBFT-static-ipv4-discovery b/test/nbft/diffs/NBFT-static-ipv4-discovery
 | ||||
| index 67881b6c..5bf0e46f 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-static-ipv4-discovery
 | ||||
| +++ b/test/nbft/diffs/NBFT-static-ipv4-discovery
 | ||||
| @@ -28,7 +28,6 @@ subsystem_ns_list[0]->index=1
 | ||||
|  subsystem_ns_list[0]->discovery->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=192.168.49.10 | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| diff --git a/test/nbft/diffs/NBFT-static-ipv6 b/test/nbft/diffs/NBFT-static-ipv6
 | ||||
| index a5b02c1d..c6ad844d 100644
 | ||||
| --- a/test/nbft/diffs/NBFT-static-ipv6
 | ||||
| +++ b/test/nbft/diffs/NBFT-static-ipv6
 | ||||
| @@ -23,7 +23,6 @@ hfi_list[0]->tcp_info.dhcp_override=0
 | ||||
|  subsystem_ns_list[0]->index=1 | ||||
|  subsystem_ns_list[0]->num_hfis=1 | ||||
|  subsystem_ns_list[0]->hfis[0]->index=1 | ||||
| -subsystem_ns_list[0]->hfis[1]->index=1
 | ||||
|  subsystem_ns_list[0]->transport=tcp | ||||
|  subsystem_ns_list[0]->traddr=fd09:9a46:b5c1:1fe::13f | ||||
|  subsystem_ns_list[0]->trsvcid=4420 | ||||
| 
 | ||||
| From 0bc1985b3e78383cd842968e2adc16d019e784f1 Mon Sep 17 00:00:00 2001 | ||||
| From: Tomas Bzatek <tbzatek@redhat.com> | ||||
| Date: Fri, 5 Jan 2024 14:53:28 +0100 | ||||
| Subject: [PATCH 4/5] tests: Add sample NBFT table from Dell PowerEdge R760 | ||||
| 
 | ||||
| Covered by the Python tests already, let's include this | ||||
| table in the other NBFT parser tests (which are all | ||||
| QEMU dumps). | ||||
| 
 | ||||
| Signed-off-by: Tomas Bzatek <tbzatek@redhat.com> | ||||
| ---
 | ||||
|  test/nbft/diffs/NBFT-Dell.PowerEdge.R760  | 60 +++++++++++++++++++++++ | ||||
|  test/nbft/meson.build                     |  1 + | ||||
|  test/nbft/tables/NBFT-Dell.PowerEdge.R760 |  1 + | ||||
|  3 files changed, 62 insertions(+) | ||||
|  create mode 100644 test/nbft/diffs/NBFT-Dell.PowerEdge.R760 | ||||
|  create mode 120000 test/nbft/tables/NBFT-Dell.PowerEdge.R760 | ||||
| 
 | ||||
| diff --git a/test/nbft/diffs/NBFT-Dell.PowerEdge.R760 b/test/nbft/diffs/NBFT-Dell.PowerEdge.R760
 | ||||
| new file mode 100644 | ||||
| index 00000000..d7fab3f2
 | ||||
| --- /dev/null
 | ||||
| +++ b/test/nbft/diffs/NBFT-Dell.PowerEdge.R760
 | ||||
| @@ -0,0 +1,60 @@
 | ||||
| +raw_nbft_size=1017
 | ||||
| +host.id=44454c4c34010368038b2c04f313233
 | ||||
| +host.nqn=nqn.1988-11.com.dell:PowerEdge.R760.1234567
 | ||||
| +host.host_id_configured=1
 | ||||
| +host.host_nqn_configured=1
 | ||||
| +host.primary=0
 | ||||
| +hfi_list[0]->index=1
 | ||||
| +hfi_list[0]->transport=tcp
 | ||||
| +hfi_list[0]->tcp_info.pci_sbdf=16384
 | ||||
| +hfi_list[0]->tcp_info.mac_addr=b02628e87ce
 | ||||
| +hfi_list[0]->tcp_info.vlan=0
 | ||||
| +hfi_list[0]->tcp_info.ip_origin=82
 | ||||
| +hfi_list[0]->tcp_info.ipaddr=100.71.245.232
 | ||||
| +hfi_list[0]->tcp_info.subnet_mask_prefix=24
 | ||||
| +hfi_list[0]->tcp_info.gateway_ipaddr=100.71.245.254
 | ||||
| +hfi_list[0]->tcp_info.route_metric=500
 | ||||
| +hfi_list[0]->tcp_info.primary_dns_ipaddr=100.64.0.5
 | ||||
| +hfi_list[0]->tcp_info.secondary_dns_ipaddr=100.64.0.6
 | ||||
| +hfi_list[0]->tcp_info.dhcp_server_ipaddr=100.71.245.254
 | ||||
| +hfi_list[0]->tcp_info.host_name=(null)
 | ||||
| +hfi_list[0]->tcp_info.this_hfi_is_default_route=1
 | ||||
| +hfi_list[0]->tcp_info.dhcp_override=1
 | ||||
| +discovery_list[0]->index=1
 | ||||
| +discovery_list[0]->hfi->index=1
 | ||||
| +discovery_list[0]->uri=nvme+tcp://100.71.103.50:8009/
 | ||||
| +discovery_list[0]->nqn=nqn.2014-08.org.nvmexpress.discovery
 | ||||
| +subsystem_ns_list[0]->index=1
 | ||||
| +subsystem_ns_list[0]->discovery->index=1
 | ||||
| +subsystem_ns_list[0]->num_hfis=1
 | ||||
| +subsystem_ns_list[0]->hfis[0]->index=1
 | ||||
| +subsystem_ns_list[0]->transport=tcp
 | ||||
| +subsystem_ns_list[0]->traddr=100.71.103.48
 | ||||
| +subsystem_ns_list[0]->trsvcid=4420
 | ||||
| +subsystem_ns_list[0]->subsys_port_id=0
 | ||||
| +subsystem_ns_list[0]->nsid=148
 | ||||
| +subsystem_ns_list[0]->nid_type=2
 | ||||
| +subsystem_ns_list[0]->nid=c8244ed9c15f53b8ccf96802efca
 | ||||
| +subsystem_ns_list[0]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:2a64abf1c5b81F6C4549
 | ||||
| +subsystem_ns_list[0]->pdu_header_digest_required=0
 | ||||
| +subsystem_ns_list[0]->data_digest_required=0
 | ||||
| +subsystem_ns_list[0]->controller_id=5
 | ||||
| +subsystem_ns_list[0]->asqsz=0
 | ||||
| +subsystem_ns_list[0]->dhcp_root_path_string=(null)
 | ||||
| +subsystem_ns_list[1]->index=2
 | ||||
| +subsystem_ns_list[1]->discovery->index=1
 | ||||
| +subsystem_ns_list[1]->num_hfis=1
 | ||||
| +subsystem_ns_list[1]->hfis[0]->index=1
 | ||||
| +subsystem_ns_list[1]->transport=tcp
 | ||||
| +subsystem_ns_list[1]->traddr=100.71.103.49
 | ||||
| +subsystem_ns_list[1]->trsvcid=4420
 | ||||
| +subsystem_ns_list[1]->subsys_port_id=0
 | ||||
| +subsystem_ns_list[1]->nsid=148
 | ||||
| +subsystem_ns_list[1]->nid_type=2
 | ||||
| +subsystem_ns_list[1]->nid=c8244ed9c15f53b8ccf96802efca
 | ||||
| +subsystem_ns_list[1]->subsys_nqn=nqn.1988-11.com.dell:powerstore:00:2a64abf1c5b81F6C4549
 | ||||
| +subsystem_ns_list[1]->pdu_header_digest_required=0
 | ||||
| +subsystem_ns_list[1]->data_digest_required=0
 | ||||
| +subsystem_ns_list[1]->controller_id=4166
 | ||||
| +subsystem_ns_list[1]->asqsz=0
 | ||||
| +subsystem_ns_list[1]->dhcp_root_path_string=(null)
 | ||||
							
								
								
									
										13
									
								
								libnvme.spec
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								libnvme.spec
									
									
									
									
									
								
							| @ -4,11 +4,18 @@ | ||||
| Name:    libnvme | ||||
| Summary: Linux-native nvme device management library | ||||
| Version: 1.7.1 | ||||
| Release: 3%{?dist} | ||||
| Release: 4%{?dist} | ||||
| License: LGPL-2.1-or-later | ||||
| URL:     https://github.com/linux-nvme/libnvme | ||||
| Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz | ||||
| 
 | ||||
| # https://github.com/linux-nvme/libnvme/pull/765 | ||||
| Patch0:  libnvme-1.8.0-initialize_autoclean_vars.patch | ||||
| # https://github.com/linux-nvme/libnvme/pull/780 | ||||
| Patch1:  libnvme-1.8.0-initialize_autoclean_vars-2.patch | ||||
| # https://github.com/linux-nvme/libnvme/pull/766 | ||||
| Patch2:  libnvme-1.8.0-nbft-parser-fixes-766.patch | ||||
| 
 | ||||
| BuildRequires: gcc gcc-c++ | ||||
| BuildRequires: swig | ||||
| BuildRequires: python3-devel | ||||
| @ -97,6 +104,10 @@ mv %{buildroot}/usr/*.rst %{buildroot}%{_pkgdocdir}/ | ||||
| %{python3_sitearch}/libnvme/* | ||||
| 
 | ||||
| %changelog | ||||
| * Fri Feb 09 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.7.1-4 | ||||
| - nbft: Fix SSNS HFI indexes parsing | ||||
| - cleanup: Explicitly initialize auto-cleanup variables | ||||
| 
 | ||||
| * Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-3 | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user