> -----Original Message-----
> From: Bjorn Helgaas [mailto:helg...@kernel.org]
> Sent: Tuesday, November 7, 2017 4:15 PM
> To: Jake Oshins <ja...@microsoft.com>
> Cc: Dexuan Cui <de...@microsoft.com>; Bjorn Helgaas
> <bhelg...@google.com>; linux-...@vger.kernel.org; KY Srinivasan
> <k...@microsoft.com>; Stephen Hemminger <sthem...@microsoft.com>;
> de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; Haiyang Zhang
> <haiya...@microsoft.com>; Jork Loeser <jork.loe...@microsoft.com>;
> Chris Valean (Cloudbase Solutions SRL) <v-chv...@microsoft.com>; Adrian
> Suhov (Cloudbase Solutions SRL) <v-ads...@microsoft.com>; Simon Xiao
> <six...@microsoft.com>; 'Eyal Mizrachi' <eya...@mellanox.com>; Jack
> Morgenstein <ja...@mellanox.com>; Armen Guezalian
> <arm...@mellanox.com>; Firas Mahameed <fi...@mellanox.com>;
> Tziporet Koren <tzipo...@mellanox.com>; Daniel Jurgens
> <dani...@mellanox.com>
> Subject: Re: [PATCH] PCI: hv: use effective affinity mask
> 
> On Wed, Nov 01, 2017 at 08:52:56PM +0000, Jake Oshins wrote:
> > > -----Original Message-----
> > > From: Dexuan Cui
> > > Sent: Wednesday, November 1, 2017 1:31 PM
> > > To: Bjorn Helgaas <bhelg...@google.com>; linux-...@vger.kernel.org;
> > > Jake Oshins <ja...@microsoft.com>; KY Srinivasan
> > > <k...@microsoft.com>; Stephen Hemminger
> <sthem...@microsoft.com>
> > > Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org;
> > > Haiyang Zhang <haiya...@microsoft.com>; Jork Loeser
> > > <jork.loe...@microsoft.com>; Chris Valean (Cloudbase Solutions SRL)
> > > <v- chv...@microsoft.com>; Adrian Suhov (Cloudbase Solutions SRL)
> > > <v- ads...@microsoft.com>; Simon Xiao <six...@microsoft.com>; 'Eyal
> > > Mizrachi' <eya...@mellanox.com>; Jack Morgenstein
> > > <ja...@mellanox.com>; Armen Guezalian <arm...@mellanox.com>;
> Firas
> > > Mahameed <fi...@mellanox.com>; Tziporet Koren
> > > <tzipo...@mellanox.com>; Daniel Jurgens <dani...@mellanox.com>
> > > Subject: [PATCH] PCI: hv: use effective affinity mask
> > >
> > >
> > > 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.
> > >
> > > Signed-off-by: Dexuan Cui <de...@microsoft.com>
> > > Cc: Jake Oshins <ja...@microsoft.com>
> > > Cc: Jork Loeser <jloe...@microsoft.com>
> > > Cc: Stephen Hemminger <sthem...@microsoft.com>
> > > Cc: K. Y. Srinivasan <k...@microsoft.com>
> > > ---
> > >
> > > Please consider this for v4.14, if it's not too late.
> > >
> > >  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 index 5ccb47d..8b5f66d 100644
> > > --- 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;
> > > --
> > > 2.7.4
> >
> > Signed-off-by: Jake Oshins <ja...@microsoft.com>
> 
> I'm not sure what this means.
> 
> Per Documentation/process/submitting-patches.rst, "Signed-off-by"
> means you were "involved in the development of the patch, or that he/she
> was in the patch's delivery path."  You weren't in the delivery path (I got it
> from Dexuan), and if you were involved in development, your Signed-off-by
> would normally appear in the original posting.
> 
> Should this be a Reviewed-by tag?

Sorry.  I forgot the protocol.  I'll fix that.

Reviewed-by: Jake Oshins <ja...@microsoft.com>
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to