From: Long Li <longli@microsoft.com> To: KY Srinivasan <kys@microsoft.com>, "helgaas@kernel.org" <helgaas@kernel.org>, "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "devel@linuxdriverproject.org" <devel@linuxdriverproject.org>, "olaf@aepfle.de" <olaf@aepfle.de>, "apw@canonical.com" <apw@canonical.com>, "vkuznets@redhat.com" <vkuznets@redhat.com>, "jasowang@redhat.com" <jasowang@redhat.com>, "leann.ogasawara@canonical.com" <leann.ogasawara@canonical.com>, "marcelo.cerri@canonical.com" <marcelo.cerri@canonical.com>, "Stephen Hemminger" <sthemmin@microsoft.com> Cc: "stable@vger.kernel.org" <stable@vger.kernel.org> Subject: RE: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity Date: Mon, 27 Mar 2017 18:13:30 +0000 [thread overview] Message-ID: <BN3PR03MB2227C9E21CC131FDCB6B2CABCE330@BN3PR03MB2227.namprd03.prod.outlook.com> (raw) In-Reply-To: <1490378842-26950-2-git-send-email-kys@exchange.microsoft.com> > -----Original Message----- > From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On > Behalf Of kys@exchange.microsoft.com > Sent: Friday, March 24, 2017 11:07 AM > To: helgaas@kernel.org; linux-pci@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com; > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > Hemminger <sthemmin@microsoft.com> > Cc: stable@vger.kernel.org > Subject: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity > > From: K. Y. Srinivasan <kys@microsoft.com> > > When we have 32 or more CPUs in the affinity mask, we should use a special > constant to specify that to the host. Fix this issue. > > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> > Cc: <stable@vger.kernel.org> Reviewed-by: Long Li <longli@microsoft.com> > --- > drivers/pci/host/pci-hyperv.c | 11 ++++++++--- > 1 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c > index ada9856..32a16fb 100644 > --- a/drivers/pci/host/pci-hyperv.c > +++ b/drivers/pci/host/pci-hyperv.c > @@ -72,6 +72,7 @@ enum { > PCI_PROTOCOL_VERSION_CURRENT = PCI_PROTOCOL_VERSION_1_1 }; > > +#define CPU_AFFINITY_ALL -1ULL > #define PCI_CONFIG_MMIO_LENGTH 0x2000 > #define CFG_PAGE_OFFSET 0x1000 > #define CFG_PAGE_SIZE (PCI_CONFIG_MMIO_LENGTH - > CFG_PAGE_OFFSET) @@ -897,9 +898,13 @@ static void > hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > * processors because Hyper-V only supports 64 in a guest. > */ > affinity = irq_data_get_affinity_mask(data); > - for_each_cpu_and(cpu, affinity, cpu_online_mask) { > - int_pkt->int_desc.cpu_mask |= > - (1ULL << vmbus_cpu_number_to_vp_number(cpu)); > + if (cpumask_weight(affinity) >= 32) { > + int_pkt->int_desc.cpu_mask = CPU_AFFINITY_ALL; > + } else { > + for_each_cpu_and(cpu, affinity, cpu_online_mask) { > + int_pkt->int_desc.cpu_mask |= > + (1ULL << vmbus_cpu_number_to_vp_number(cpu)); > + } > } > > ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt, > -- > 1.7.1 > > _______________________________________________ > devel mailing list > devel@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
WARNING: multiple messages have this Message-ID (diff)
From: Long Li <longli@microsoft.com> To: KY Srinivasan <kys@microsoft.com>, "helgaas@kernel.org" <helgaas@kernel.org>, "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "devel@linuxdriverproject.org" <devel@linuxdriverproject.org>, "olaf@aepfle.de" <olaf@aepfle.de>, "apw@canonical.com" <apw@canonical.com>, "vkuznets@redhat.com" <vkuznets@redhat.com>, "jasowang@redhat.com" <jasowang@redhat.com>, "leann.ogasawara@canonical.com" <leann.ogasawara@canonical.com>, "marcelo.cerri@canonical.com" <marcelo.cerri@canonical.com>, "Stephen Hemminger" <sthemmin@microsoft.com> Cc: "stable@vger.kernel.org" <stable@vger.kernel.org> Subject: RE: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity Date: Mon, 27 Mar 2017 18:13:30 +0000 [thread overview] Message-ID: <BN3PR03MB2227C9E21CC131FDCB6B2CABCE330@BN3PR03MB2227.namprd03.prod.outlook.com> (raw) In-Reply-To: <1490378842-26950-2-git-send-email-kys@exchange.microsoft.com> > -----Original Message----- > From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On > Behalf Of kys@exchange.microsoft.com > Sent: Friday, March 24, 2017 11:07 AM > To: helgaas@kernel.org; linux-pci@vger.kernel.org; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com; > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen > Hemminger <sthemmin@microsoft.com> > Cc: stable@vger.kernel.org > Subject: [PATCH 1/2] pci-hyperv: Fix a bug in specifying CPU affinity >=20 > From: K. Y. Srinivasan <kys@microsoft.com> >=20 > When we have 32 or more CPUs in the affinity mask, we should use a specia= l > constant to specify that to the host. Fix this issue. >=20 > Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> > Cc: <stable@vger.kernel.org> Reviewed-by: Long Li <longli@microsoft.com> > --- > drivers/pci/host/pci-hyperv.c | 11 ++++++++--- > 1 files changed, 8 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.= c > index ada9856..32a16fb 100644 > --- a/drivers/pci/host/pci-hyperv.c > +++ b/drivers/pci/host/pci-hyperv.c > @@ -72,6 +72,7 @@ enum { > PCI_PROTOCOL_VERSION_CURRENT =3D PCI_PROTOCOL_VERSION_1_1 }; >=20 > +#define CPU_AFFINITY_ALL -1ULL > #define PCI_CONFIG_MMIO_LENGTH 0x2000 > #define CFG_PAGE_OFFSET 0x1000 > #define CFG_PAGE_SIZE (PCI_CONFIG_MMIO_LENGTH - > CFG_PAGE_OFFSET) @@ -897,9 +898,13 @@ static void > hv_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > * processors because Hyper-V only supports 64 in a guest. > */ > affinity =3D irq_data_get_affinity_mask(data); > - for_each_cpu_and(cpu, affinity, cpu_online_mask) { > - int_pkt->int_desc.cpu_mask |=3D > - (1ULL << vmbus_cpu_number_to_vp_number(cpu)); > + if (cpumask_weight(affinity) >=3D 32) { > + int_pkt->int_desc.cpu_mask =3D CPU_AFFINITY_ALL; > + } else { > + for_each_cpu_and(cpu, affinity, cpu_online_mask) { > + int_pkt->int_desc.cpu_mask |=3D > + (1ULL << vmbus_cpu_number_to_vp_number(cp= u)); > + } > } >=20 > ret =3D vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt, > -- > 1.7.1 >=20 > _______________________________________________ > devel mailing list > devel@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2017-03-27 18:13 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-03-24 18:06 [PATCH 0/2] pci-hyperv: Some miscellaneous fixes kys 2017-03-24 18:07 ` [PATCH 1/2] PCI: hv: Fix a bug in specifying CPU affinity kys 2017-03-24 18:07 ` [PATCH 1/2] pci-hyperv: " kys 2017-03-27 18:13 ` Long Li [this message] 2017-03-27 18:13 ` Long Li 2017-03-24 18:07 ` [PATCH 2/2] pci-hyperv: Fix an atomic bug kys 2017-03-27 18:14 ` Long Li 2017-03-27 18:14 ` Long Li 2017-04-04 19:03 ` [PATCH 0/2] pci-hyperv: Some miscellaneous fixes Bjorn Helgaas 2017-04-04 19:54 ` KY Srinivasan 2017-04-04 19:54 ` KY Srinivasan 2017-04-04 20:39 ` Bjorn Helgaas 2017-04-04 21:47 ` KY Srinivasan 2017-04-04 21:47 ` KY Srinivasan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=BN3PR03MB2227C9E21CC131FDCB6B2CABCE330@BN3PR03MB2227.namprd03.prod.outlook.com \ --to=longli@microsoft.com \ --cc=apw@canonical.com \ --cc=devel@linuxdriverproject.org \ --cc=helgaas@kernel.org \ --cc=jasowang@redhat.com \ --cc=kys@microsoft.com \ --cc=leann.ogasawara@canonical.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=marcelo.cerri@canonical.com \ --cc=olaf@aepfle.de \ --cc=stable@vger.kernel.org \ --cc=sthemmin@microsoft.com \ --cc=vkuznets@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.