Skip to content

Commit b6ba1d2

Browse files
dcuiallenpais
authored andcommitted
PCI: hv: Only reuse existing IRTE allocation for Multi-MSI
Jeffrey's 4 recent patches added Multi-MSI support to the pci-hyperv driver. Unluckily, one of the patches, i.e., b4b7777, causes a regression to a fio test for the Azure VM SKU Standard L64s v2 (64 AMD vCPUs, 8 NVMe drives): when fio runs against all the 8 NVMe drives, it runs fine with a low io-depth (e.g., 2 or 4); when fio runs with a high io-depth (e.g., 256), somehow queue-29 of each NVMe drive suddenly no longer receives any interrupts, and the NVMe core code has to abort the queue after a timeout of 30 seconds, and then queue-29 starts to receive interrupts again for several seconds, and later queue-29 no longer receives interrupts again, and this pattern repeats: [ 223.891249] nvme nvme2: I/O 320 QID 29 timeout, aborting [ 223.896231] nvme nvme0: I/O 320 QID 29 timeout, aborting [ 223.898340] nvme nvme4: I/O 832 QID 29 timeout, aborting [ 259.471309] nvme nvme2: I/O 320 QID 29 timeout, aborting [ 259.476493] nvme nvme0: I/O 321 QID 29 timeout, aborting [ 259.482967] nvme nvme0: I/O 322 QID 29 timeout, aborting Some other symptoms are: the throughput of the NVMe drives drops due to commit b4b7777. When the fio test is running, the kernel prints some soft lock-up messages from time to time. Commit b4b7777 itself looks good, and at the moment it's unclear where the issue is. While the issue is being investigated, restore the old behavior in hv_compose_msi_msg(), i.e., don't reuse the existing IRTE allocation for single-MSI and MSI-X. This is a stopgap for the above NVMe issue. *** Note *** As of 11:30 8/9/2022 PDT, the patch has not been accepted into the upstream. Fixes: b4b7777 ("PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()") Link: https://lwn.net/ml/linux-kernel/[email protected]/ Signed-off-by: Dexuan Cui <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Cc: Carl Vanderlip <[email protected]>
1 parent bb1ac2c commit b6ba1d2

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

drivers/pci/controller/pci-hyperv.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,6 +1683,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
16831683
struct compose_comp_ctxt comp;
16841684
struct tran_int_desc *int_desc;
16851685
struct msi_desc *msi_desc;
1686+
bool multi_msi;
16861687
u8 vector, vector_count;
16871688
struct {
16881689
struct pci_packet pci_pkt;
@@ -1696,16 +1697,23 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
16961697
u32 size;
16971698
int ret;
16981699

1699-
/* Reuse the previous allocation */
1700-
if (data->chip_data) {
1700+
msi_desc = irq_data_get_msi_desc(data);
1701+
multi_msi = !msi_desc->msi_attrib.is_msix &&
1702+
msi_desc->nvec_used > 1;
1703+
/*
1704+
* Reuse the previous allocation for Multi-MSI. This is required for
1705+
* Multi-MSI and is optional for single-MSI and MSI-X. Note: for now,
1706+
* don't reuse the previous allocation for MSI-X because this causes
1707+
* unreliable interrupt delivery for some NVMe devices.
1708+
*/
1709+
if (data->chip_data && multi_msi) {
17011710
int_desc = data->chip_data;
17021711
msg->address_hi = int_desc->address >> 32;
17031712
msg->address_lo = int_desc->address & 0xffffffff;
17041713
msg->data = int_desc->data;
17051714
return;
17061715
}
17071716

1708-
msi_desc = irq_data_get_msi_desc(data);
17091717
pdev = msi_desc_to_pci_dev(msi_desc);
17101718
dest = irq_data_get_effective_affinity_mask(data);
17111719
pbus = pdev->bus;
@@ -1715,11 +1723,18 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
17151723
if (!hpdev)
17161724
goto return_null_message;
17171725

1726+
/* Free any previous message that might have already been composed. */
1727+
if (data->chip_data && !multi_msi) {
1728+
int_desc = data->chip_data;
1729+
data->chip_data = NULL;
1730+
hv_int_desc_free(hpdev, int_desc);
1731+
}
1732+
17181733
int_desc = kzalloc(sizeof(*int_desc), GFP_ATOMIC);
17191734
if (!int_desc)
17201735
goto drop_reference;
17211736

1722-
if (!msi_desc->msi_attrib.is_msix && msi_desc->nvec_used > 1) {
1737+
if (multi_msi) {
17231738
/*
17241739
* If this is not the first MSI of Multi MSI, we already have
17251740
* a mapping. Can exit early.

0 commit comments

Comments
 (0)