[PATCH 1/1] nvme-fabrics: Generate uevent on namespace AENs

Martin Belanger nitram_67 at hotmail.com
Wed Apr 28 21:18:25 BST 2021


From: Martin Belanger <martin.belanger at dell.com>

Generate uevent on NVMe Async Event Notifications for NS_CHANGED and ANA. Today
the uevent handler is not capturing on NVME_AER_NOTICE_NS_CHANGED
(Namespace Changed) and NVME_AER_NOTICE_ANA (Asymmetric Namespace Access).

Signed-off-by: Martin Belanger <Martin_Belanger at dell.com>


---
 drivers/nvme/host/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 2f45e8fcdd7c..bd37ddb172de 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1115,7 +1115,7 @@ EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);

 /*
  * Recommended frequency for KATO commands per NVMe 1.4 section 7.12.1:
- *
+ *
  *   The host should send Keep Alive commands at half of the Keep Alive Timeout
  *   accounting for transport roundtrip times [..].
  */
@@ -4133,6 +4133,7 @@ static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
 	case NVME_AER_NOTICE_NS_CHANGED:
 		set_bit(NVME_AER_NOTICE_NS_CHANGED, &ctrl->events);
 		nvme_queue_scan(ctrl);
+		ctrl->aen_result = result;
 		break;
 	case NVME_AER_NOTICE_FW_ACT_STARTING:
 		/*
@@ -4148,6 +4149,7 @@ static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
 		if (!ctrl->ana_log_buf)
 			break;
 		queue_work(nvme_wq, &ctrl->ana_work);
+		ctrl->aen_result = result;
 		break;
 #endif
 	case NVME_AER_NOTICE_DISC_CHANGED:
--
2.25.1




More information about the Linux-nvme mailing list