Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2018-11-06 10:52:08 +0100
committerOlaf Hering <ohering@suse.de>2018-11-06 10:52:08 +0100
commitdfcddc618aad686c60d2398962d22a9f4a81e1e4 (patch)
treed5d69f982113c767b13bedc6dad090da49e7e3d2
parentd27ac2e77eefda7e4c7bdabf6a0fc9f80026bebb (diff)
- PCI: hv: Use effective affinity mask (bsc#1109772).
-rw-r--r--patches.suse/msft-hv-1545-PCI-hv-Use-effective-affinity-mask.patch76
-rw-r--r--patches.suse/msft-hv-1728-PCI-hv-Disable-enable-IRQs-rather-than-BH-in-hv_comp.patch2
-rw-r--r--series.conf1
3 files changed, 78 insertions, 1 deletions
diff --git a/patches.suse/msft-hv-1545-PCI-hv-Use-effective-affinity-mask.patch b/patches.suse/msft-hv-1545-PCI-hv-Use-effective-affinity-mask.patch
new file mode 100644
index 0000000000..06f5edf2bf
--- /dev/null
+++ b/patches.suse/msft-hv-1545-PCI-hv-Use-effective-affinity-mask.patch
@@ -0,0 +1,76 @@
+From: Dexuan Cui <decui@microsoft.com>
+Date: Wed, 1 Nov 2017 20:30:53 +0000
+Patch-mainline: v4.15-rc1
+Subject: PCI: hv: Use effective affinity mask
+Git-commit: 79aa801e899417a56863d6713f76c4e108856000
+References: bsc#1109772
+
+The effective_affinity_mask is always set when an interrupt is assigned in
+__assign_irq_vector() -> apic->cpu_mask_to_apicid(), e.g. for struct apic
+apic_physflat: -> default_cpu_mask_to_apicid() ->
+irq_data_update_effective_affinity(), but it looks d->common->affinity
+remains all-1's before the user space or the kernel changes it later.
+
+In the early allocation/initialization phase of an IRQ, we should use the
+effective_affinity_mask, otherwise Hyper-V may not deliver the interrupt to
+the expected CPU. Without the patch, if we assign 7 Mellanox ConnectX-3
+VFs to a 32-vCPU VM, one of the VFs may fail to receive interrupts.
+
+Tested-by: Adrian Suhov <v-adsuho@microsoft.com>
+Signed-off-by: Dexuan Cui <decui@microsoft.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Jake Oshins <jakeo@microsoft.com>
+Cc: stable@vger.kernel.org
+Cc: Jork Loeser <jloeser@microsoft.com>
+Cc: Stephen Hemminger <sthemmin@microsoft.com>
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/pci/host/pci-hyperv.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
+--- a/drivers/pci/host/pci-hyperv.c
++++ b/drivers/pci/host/pci-hyperv.c
+@@ -879,7 +879,7 @@ static void hv_irq_unmask(struct irq_data *data)
+ int cpu;
+ u64 res;
+
+- dest = irq_data_get_affinity_mask(data);
++ dest = irq_data_get_effective_affinity_mask(data);
+ pdev = msi_desc_to_pci_dev(msi_desc);
+ pbus = pdev->bus;
+ hbus = container_of(pbus->sysdata, struct hv_pcibus_device, sysdata);
+@@ -1042,6 +1042,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
+ struct hv_pci_dev *hpdev;
+ struct pci_bus *pbus;
+ struct pci_dev *pdev;
++ struct cpumask *dest;
+ struct compose_comp_ctxt comp;
+ struct tran_int_desc *int_desc;
+ struct {
+@@ -1056,6 +1057,7 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
+ int ret;
+
+ pdev = msi_desc_to_pci_dev(irq_data_get_msi_desc(data));
++ dest = irq_data_get_effective_affinity_mask(data);
+ pbus = pdev->bus;
+ hbus = container_of(pbus->sysdata, struct hv_pcibus_device, sysdata);
+ hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn));
+@@ -1081,14 +1083,14 @@ static void hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg)
+ switch (pci_protocol_version) {
+ case PCI_PROTOCOL_VERSION_1_1:
+ size = hv_compose_msi_req_v1(&ctxt.int_pkts.v1,
+- irq_data_get_affinity_mask(data),
++ dest,
+ hpdev->desc.win_slot.slot,
+ cfg->vector);
+ break;
+
+ case PCI_PROTOCOL_VERSION_1_2:
+ size = hv_compose_msi_req_v2(&ctxt.int_pkts.v2,
+- irq_data_get_affinity_mask(data),
++ dest,
+ hpdev->desc.win_slot.slot,
+ cfg->vector);
+ break;
diff --git a/patches.suse/msft-hv-1728-PCI-hv-Disable-enable-IRQs-rather-than-BH-in-hv_comp.patch b/patches.suse/msft-hv-1728-PCI-hv-Disable-enable-IRQs-rather-than-BH-in-hv_comp.patch
index b883ac7da4..4f73565edc 100644
--- a/patches.suse/msft-hv-1728-PCI-hv-Disable-enable-IRQs-rather-than-BH-in-hv_comp.patch
+++ b/patches.suse/msft-hv-1728-PCI-hv-Disable-enable-IRQs-rather-than-BH-in-hv_comp.patch
@@ -42,9 +42,9 @@ Acked-by: Olaf Hering <ohering@suse.de>
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1090,6 +1090,7 @@ static void hv_compose_msi_msg(struct ir
- struct hv_pci_dev *hpdev;
struct pci_bus *pbus;
struct pci_dev *pdev;
+ struct cpumask *dest;
+ unsigned long flags;
struct compose_comp_ctxt comp;
struct tran_int_desc *int_desc;
diff --git a/series.conf b/series.conf
index dc629c472b..fc546295ee 100644
--- a/series.conf
+++ b/series.conf
@@ -9242,6 +9242,7 @@
patches.drivers/0005-PCI-Set-Cavium-ACS-capability-quirk-flags-to-assert-.patch
patches.drivers/0006-PCI-Apply-Cavium-ThunderX-ACS-quirk-to-more-Root-Por.patch
patches.drivers/PCI-Detach-driver-before-procfs-sysfs-teardown-on-de
+ patches.suse/msft-hv-1545-PCI-hv-Use-effective-affinity-mask.patch
patches.drivers/0007-PCI-Mark-Cavium-CN8xxx-to-avoid-bus-reset.patch
patches.drivers/0001-PCI-Avoid-bus-reset-if-bridge-itself-is-broken.patch
patches.drivers/0002-PCI-Avoid-slot-reset-if-bridge-itself-is-broken.patch