Commit 39393f5
nvmet: pci-epf: Do not add an IRQ vector if not needed
The function nvmet_pci_epf_create_cq() always unconditionally calls
nvmet_pci_epf_add_irq_vector() to add an IRQ vector for a completion
queue. But this is not correct if the host requested the creation of a
completion queue for polling, without an IRQ vector specified (i.e. the
flag NVME_CQ_IRQ_ENABLED is not set).
Fix this by calling nvmet_pci_epf_add_irq_vector() and setting the queue
flag NVMET_PCI_EPF_Q_IRQ_ENABLED for the cq only if NVME_CQ_IRQ_ENABLED
is set. While at it, also fix the error path to add the missing removal
of the added IRQ vector if nvmet_cq_create() fails.
Fixes: 0faa0fe ("nvmet: New NVMe PCI endpoint function target driver")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>1 parent bf9b802 commit 39393f5
1 file changed
Lines changed: 7 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1271 | 1271 | | |
1272 | 1272 | | |
1273 | 1273 | | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | 1274 | | |
1278 | 1275 | | |
1279 | 1276 | | |
| |||
1290 | 1287 | | |
1291 | 1288 | | |
1292 | 1289 | | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
1297 | 1295 | | |
1298 | 1296 | | |
1299 | 1297 | | |
| |||
1308 | 1306 | | |
1309 | 1307 | | |
1310 | 1308 | | |
1311 | | - | |
| 1309 | + | |
| 1310 | + | |
1312 | 1311 | | |
1313 | 1312 | | |
1314 | 1313 | | |
| |||
0 commit comments