[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 15/15] hw/nvme: Update the initalization place for the AER que
From: |
Lukasz Maniak |
Subject: |
[PATCH v3 15/15] hw/nvme: Update the initalization place for the AER queue |
Date: |
Tue, 21 Dec 2021 15:32:46 +0100 |
From: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
This patch updates the initialization place for the AER queue, so it’s
initialized once, at controller initialization, and not every time
controller is enabled.
While the original version works for a non-SR-IOV device, as it’s hard
to interact with the controller if it’s not enabled, the multiple
reinitialization is not necessarily correct.
With the SR/IOV feature enabled a segfault can happen: a VF can have its
controller disabled, while a namespace can still be attached to the
controller through the parent PF. An event generated in such case ends
up on an uninitialized queue.
While it’s an interesting question whether a VF should support AER in
the first place, I don’t think it must be answered today.
Signed-off-by: Łukasz Gieryk <lukasz.gieryk@linux.intel.com>
---
hw/nvme/ctrl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index e21c60fee8..23280f501f 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -6023,8 +6023,6 @@ static int nvme_start_ctrl(NvmeCtrl *n)
nvme_set_timestamp(n, 0ULL);
- QTAILQ_INIT(&n->aer_queue);
-
nvme_select_iocs(n);
return 0;
@@ -7001,6 +6999,8 @@ static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice
*pci_dev)
id->cmic |= NVME_CMIC_MULTI_CTRL;
}
+ QTAILQ_INIT(&n->aer_queue);
+
NVME_CAP_SET_MQES(cap, 0x7ff);
NVME_CAP_SET_CQR(cap, 1);
NVME_CAP_SET_TO(cap, 0xf);
--
2.25.1
- [PATCH v3 05/15] hw/nvme: Add support for SR-IOV, (continued)
- [PATCH v3 05/15] hw/nvme: Add support for SR-IOV, Lukasz Maniak, 2021/12/21
- [PATCH v3 06/15] hw/nvme: Add support for Primary Controller Capabilities, Lukasz Maniak, 2021/12/21
- [PATCH v3 07/15] hw/nvme: Add support for Secondary Controller List, Lukasz Maniak, 2021/12/21
- [PATCH v3 08/15] hw/nvme: Implement the Function Level Reset, Lukasz Maniak, 2021/12/21
- [PATCH v3 09/15] hw/nvme: Make max_ioqpairs and msix_qsize configurable in runtime, Lukasz Maniak, 2021/12/21
- [PATCH v3 11/15] hw/nvme: Calculate BAR attributes in a function, Lukasz Maniak, 2021/12/21
- [PATCH v3 12/15] hw/nvme: Initialize capability structures for primary/secondary controllers, Lukasz Maniak, 2021/12/21
- [PATCH v3 13/15] hw/nvme: Add support for the Virtualization Management command, Lukasz Maniak, 2021/12/21
- [PATCH v3 14/15] docs: Add documentation for SR-IOV and Virtualization Enhancements, Lukasz Maniak, 2021/12/21
- [PATCH v3 10/15] hw/nvme: Remove reg_size variable and update BAR0 size calculation, Lukasz Maniak, 2021/12/21
- [PATCH v3 15/15] hw/nvme: Update the initalization place for the AER queue,
Lukasz Maniak <=