Commit b668e6d8 authored by Curt Bruns's avatar Curt Bruns Committed by Tomasz Zawadzki
Browse files

test: update multi-process Async Event Report test



Updated the existing nvme aer test to only print information
about AEN one time per controller. If the SSD is slow to
reset the temperature setting, it could continually generate
AENs and spam the output logs.

Fixes: #2660.
Fixes: #2662.
Fixes: #2664.

Signed-off-by: default avatarCurt Bruns <curt.e.bruns@gmail.com>
Change-Id: Ibbaa9c54bd5f27a018d85ad53390933628975883
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14239


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
parent ffa82355
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ struct dev {
	bool						ns_test_active;
	struct spdk_nvme_health_information_page	*health_page;
	uint32_t					orig_temp_threshold;
	bool						reset_temp_active;
	char						name[SPDK_NVMF_TRADDR_MAX_LEN + 1];
};

@@ -211,6 +212,11 @@ aer_cb(void *arg, const struct spdk_nvme_cpl *cpl)
		return;
	}

	/* If we are already resetting the temp, no need to print more AENs */
	if (dev->reset_temp_active) {
		return;
	}

	AER_PRINTF("%s: aer_cb for log page %d, aen_event_type: 0x%02x, aen_event_info: 0x%02x\n",
		   dev->name, log_page_id, aen_event_type, aen_event_info);
	/* Temp Test: Verify proper EventType, Event Info and Log Page.
@@ -225,7 +231,10 @@ aer_cb(void *arg, const struct spdk_nvme_cpl *cpl)
		/* Set the temperature threshold back to the original value to stop triggering  */
		if (g_parent_process) {
			AER_PRINTF("aer_cb - Resetting Temp Threshold for device: %s\n", dev->name);
			set_temp_threshold(dev, dev->orig_temp_threshold);
			if (set_temp_threshold(dev, dev->orig_temp_threshold)) {
				g_failed = 1;
			}
			dev->reset_temp_active = true;
		}
		get_health_log_page(dev);
	} else if (log_page_id == SPDK_NVME_LOG_CHANGED_NS_LIST) {
@@ -413,6 +422,7 @@ spdk_aer_temperature_test(void)
	foreach_dev(dev) {
		/* Get the original temperature threshold */
		get_temp_threshold(dev);
		dev->reset_temp_active = false;
	}

	while (!g_failed && g_temperature_done < g_num_devs) {
@@ -468,7 +478,9 @@ spdk_aer_temperature_test(void)
	/* Waiting for AEN to be occur here. Each device will increment g_aer_done on an AEN */
	while (!g_failed && (g_aer_done < g_num_devs)) {
		foreach_dev(dev) {
			spdk_nvme_ctrlr_process_admin_completions(dev->ctrlr);
			if (spdk_nvme_ctrlr_process_admin_completions(dev->ctrlr) < 0) {
				g_failed = 1;
			}
		}
	}